@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ==========================================================================
   ROOT VARIABLES — Enhanced contrast & depth system
   ========================================================================== */
:root {
    /* Base palette */
    --bg-base: #0e0e10;
    --bg-elevated: #1a1a1e;
    --bg-surface: #222226;
    --bg-dark: #0e0e10;
    --bg-panel: rgba(22, 22, 26, 0.75);
    --bg-panel-solid: #1a1a1e;

    --text-main: #f0f0f5;
    --text-sec: #c8c8d0;
    --text-dim: #8a8a95;

    --accent-red: #ff453a;
    --accent-dim: #cf2e26;
    --accent-glow: rgba(255, 69, 58, 0.35);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --border-active: rgba(255, 69, 58, 0.4);

    --glass-bg: var(--bg-panel);
    --glass-border: var(--border-color);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);

    /* Status */
    --status-ok: #32d74b;
    --status-warn: #ff9f0a;
    --status-err: #ff453a;

    /* Phases */
    --phase-l1: #ff453a;
    --phase-l2: #ff9f0a;
    --phase-l3: #0a84ff;

    /* Shadow system */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(255, 69, 58, 0.25);

    /* Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 69, 58, 0.25); }
    50%      { box-shadow: 0 0 18px rgba(255, 69, 58, 0.5); }
}

@keyframes pulse-red {
    0%   { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(255, 69, 58, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

@keyframes borderGlow {
    0%, 100% { border-color: var(--accent-red); box-shadow: 0 0 6px rgba(255, 69, 58, 0.15); }
    50%      { border-color: #ff6b63; box-shadow: 0 0 12px rgba(255, 69, 58, 0.35); }
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes rowSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes accentLine {
    from { width: 0; }
    to   { width: 24px; }
}

.animate-pulse {
    animation: pulse-red 2s infinite;
}

/* ==========================================================================
   BASE / BODY
   ========================================================================== */
body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(255, 69, 58, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 30%, rgba(80, 20, 20, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 15% 80%, rgba(40, 40, 60, 0.06) 0%, transparent 50%);
    background-size: 200% 200%;
    background-attachment: fixed;
    animation: gradientShift 30s ease infinite;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Typography — clear, readable at any resolution */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.88rem; }

p, li, td, th, span, label, small, div {
    text-rendering: optimizeLegibility;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

code {
    background: rgba(255, 69, 58, 0.1);
    color: #ff8a80;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
}

strong {
    font-weight: 700;
    color: #fff;
}

/* ==========================================================================
   SCROLLBAR — Subtle, functional
   ========================================================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-red); }

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.app-header {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(28px) saturate(1.4);
    -webkit-backdrop-filter: blur(28px) saturate(1.4);
    border-bottom: 2px solid var(--accent-red);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 69, 58, 0.1);
    padding: 0.5rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: #9e9ea8 !important;
    font-weight: 600;
    transition: color var(--duration-normal) var(--ease-out-expo),
                text-shadow var(--duration-normal),
                background var(--duration-normal);
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    position: relative;
    font-size: 0.82rem;
}

/* Animated underline */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-red);
    transition: width var(--duration-normal) var(--ease-out-expo),
                left var(--duration-normal) var(--ease-out-expo);
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
    left: 20%;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-red) !important;
    text-shadow: 0 0 12px rgba(255, 69, 58, 0.4);
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ==========================================================================
   CARDS & PANELS — Unified Glass Style
   ========================================================================== */
.glass-card, .eng-panel, .tech-matrix, .card-control, .test-card {
    background: var(--bg-panel);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    color: var(--text-main);
    transition: border-color var(--duration-normal),
                box-shadow var(--duration-normal),
                transform var(--duration-normal) var(--ease-out-expo);
}

.glass-card:hover, .eng-panel:hover, .tech-matrix:hover, .test-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.glass-card, .tech-matrix, .test-card {
    padding: 1.5rem;
}

.eng-panel {
    padding: 0;
}

.card-control {
    padding: 25px;
    transition: transform var(--duration-normal) var(--ease-spring),
                border-color var(--duration-normal),
                box-shadow var(--duration-normal),
                background var(--duration-normal);
}

.card-control:hover {
    border-color: var(--accent-red);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 44px rgba(255, 69, 58, 0.15);
    background: rgba(40, 40, 44, 0.7);
}

.icon-box {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: var(--text-dim);
    transition: color var(--duration-normal), transform var(--duration-normal) var(--ease-spring);
}

.card-control:hover .icon-box {
    color: var(--accent-red);
    transform: scale(1.06);
}

/* Stagger entrance — page load */
.glass-card, .eng-panel, .tech-matrix, .card-control, .test-card,
.stat-card, .project-card, .quick-action, .data-cell, .recap-item {
    animation: slideUp var(--duration-slow) var(--ease-out-expo) both;
}

/* Stagger delays by nth-child */
.stats-grid > :nth-child(1), .recap-grid > :nth-child(1), .data-grid > :nth-child(1) { animation-delay: 0.05s; }
.stats-grid > :nth-child(2), .recap-grid > :nth-child(2), .data-grid > :nth-child(2) { animation-delay: 0.1s; }
.stats-grid > :nth-child(3), .recap-grid > :nth-child(3), .data-grid > :nth-child(3) { animation-delay: 0.15s; }
.stats-grid > :nth-child(4), .recap-grid > :nth-child(4), .data-grid > :nth-child(4) { animation-delay: 0.2s; }
.stats-grid > :nth-child(5), .recap-grid > :nth-child(5), .data-grid > :nth-child(5) { animation-delay: 0.25s; }
.stats-grid > :nth-child(6), .recap-grid > :nth-child(6), .data-grid > :nth-child(6) { animation-delay: 0.3s; }
.stats-grid > :nth-child(7), .recap-grid > :nth-child(7), .data-grid > :nth-child(7) { animation-delay: 0.35s; }
.stats-grid > :nth-child(8), .recap-grid > :nth-child(8), .data-grid > :nth-child(8) { animation-delay: 0.4s; }

.container-main { animation: slideUp 0.4s var(--ease-out-expo) both; animation-delay: 0.05s; }
.top-controls { animation: slideUp 0.4s var(--ease-out-expo) both; animation-delay: 0.1s; }

/* Panel Headers */
.eng-panel-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eng-panel-title, .section-title, .control-title {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    color: var(--accent-red);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    font-weight: 700;
    position: relative;
}

.section-title, .control-title {
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    padding-left: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--accent-red);
    width: 100%;
}

.eng-panel-body {
    padding: 1.2rem;
}

/* ==========================================================================
   TAB CONTENT — Fade-in when switching tabs
   ========================================================================== */
.tab-pane.show.active {
    animation: tabFadeIn 0.35s var(--ease-out-expo) both;
}

/* ==========================================================================
   INPUTS & FORMS — 3 states: default > hover > focus
   ========================================================================== */
.form-select,
.form-control,
textarea {
    background-color: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main) !important;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    transition: border-color var(--duration-normal),
                box-shadow var(--duration-normal),
                background var(--duration-normal);
}

.form-select:hover,
.form-control:hover,
textarea:hover {
    border-color: var(--border-hover) !important;
    background-color: rgba(0, 0, 0, 0.38) !important;
}

.form-select:focus,
.form-control:focus,
textarea:focus {
    background: rgba(0, 0, 0, 0.45) !important;
    border-color: var(--accent-red) !important;
    color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 69, 58, 0.15) !important;
    animation: borderGlow 2.5s ease-in-out infinite;
}

/* Placeholder — visible but clearly secondary */
.form-control::placeholder,
.form-select::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
    font-style: italic;
    font-weight: 400;
}

/* Input group text (separators like "-") */
.input-group-text {
    background: rgba(255, 69, 58, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--accent-red) !important;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.form-label {
    color: var(--text-sec);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
    transition: color var(--duration-fast);
}

.form-label.label-focused {
    color: var(--accent-red);
}

/* ==========================================================================
   INFO DISPLAYS
   ========================================================================== */
.info-display {
    background: rgba(255, 69, 58, 0.06);
    border-left: 3px solid var(--accent-red);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.info-label {
    color: var(--text-sec);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.info-value {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
}

/* ==========================================================================
   BUTTONS — with ripple support & active feedback
   ========================================================================== */
.btn {
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--duration-fast) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    font-size: 0.82rem;
}

.btn:active {
    transform: scale(0.96);
}

.btn .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent-red);
    border: 1px solid var(--accent-red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
    box-shadow: var(--shadow-glow);
}

/* btn-info — separate from primary (blue tint) */
.btn-info {
    background: rgba(10, 132, 255, 0.15);
    border: 1px solid rgba(10, 132, 255, 0.3);
    color: #5ac8fa;
}

.btn-info:hover {
    background: rgba(10, 132, 255, 0.25);
    border-color: #0a84ff;
    color: #fff;
    box-shadow: 0 0 16px rgba(10, 132, 255, 0.3);
}

.btn-secondary, .btn-dark, .btn-light {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover, .btn-dark:hover, .btn-light:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--border-hover);
    color: #fff;
}

.btn-success {
    background: var(--status-ok);
    border: none;
    color: #fff;
}
.btn-success:hover {
    background: #28a745;
    box-shadow: 0 0 18px rgba(50, 215, 75, 0.35);
}

.btn-warning {
    background: var(--status-warn);
    border: none;
    color: #1c1c1e;
}

.btn-outline-secondary, .btn-outline-light, .btn-outline-info, .btn-outline-success {
    border-color: var(--border-color);
    color: var(--text-sec);
    background: transparent;
}

.btn-outline-secondary:hover, .btn-outline-light:hover, .btn-outline-info:hover, .btn-outline-success:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline-danger {
    border-color: rgba(255, 69, 58, 0.3);
    color: var(--accent-red);
    background: transparent;
}

.btn-outline-danger:hover {
    background: rgba(255, 69, 58, 0.1);
    border-color: var(--accent-red);
    color: #fff;
}

.btn-upload { width: 100%; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-danger { background: var(--status-err); border: none; color: #fff; }
.btn-danger:hover { background: #d63a30; box-shadow: 0 0 12px rgba(255, 69, 58, 0.4); }

/* Small buttons — more readable */
.btn-sm {
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
}

/* ==========================================================================
   BADGES
   ========================================================================== */
.eng-badge, .badge, .status-badge, .project-badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid transparent;
}

.badge-ok, .text-success { color: var(--status-ok) !important; }
.badge-warn, .text-warning { color: var(--status-warn) !important; }
.badge-err, .text-danger { color: var(--status-err) !important; }

.badge-ok { background: rgba(50, 215, 75, 0.1); border-color: rgba(50, 215, 75, 0.3); }
.badge-warn, .badge-warning { background: rgba(255, 159, 10, 0.1); border-color: rgba(255, 159, 10, 0.3); color: var(--status-warn); }
.badge-err, .badge-error { background: rgba(255, 69, 58, 0.1); border-color: rgba(255, 69, 58, 0.3); color: var(--accent-red); }
.bg-secondary { background-color: rgba(255, 255, 255, 0.08) !important; color: var(--text-sec); }
.badge-success { background: rgba(50, 215, 75, 0.1); border-color: rgba(50, 215, 75, 0.3); color: var(--status-ok); }

.status-incomplete { background-color: rgba(255, 159, 10, 0.15); color: var(--status-warn); border: 1px solid var(--status-warn); }
.status-complete { background-color: rgba(50, 215, 75, 0.15); color: var(--status-ok); border: 1px solid var(--status-ok); }

/* ==========================================================================
   TEXT UTILS
   ========================================================================== */
.text-muted { color: var(--text-dim) !important; }
.text-info { color: #64d2ff !important; }
.text-l1 { color: var(--phase-l1); }
.text-l2 { color: var(--phase-l2); }
.text-l3 { color: var(--phase-l3); }
.small { font-size: 0.82rem; }

/* ==========================================================================
   TABLES — Enhanced contrast & row animation
   ========================================================================== */
.table {
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    font-size: 0.88rem;
}

.table thead th {
    background-color: rgba(0, 0, 0, 0.35);
    color: #fff;
    border-bottom: 2px solid var(--accent-red);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    padding: 0.65rem 0.75rem;
    position: sticky;
    top: 0;
    z-index: 2;
}

.table-hover tbody tr {
    transition: background var(--duration-fast),
                transform var(--duration-fast);
}

.table-hover tbody tr:hover {
    color: var(--text-main);
    background-color: rgba(255, 69, 58, 0.05);
    transform: translateX(2px);
}

.table td, .table th {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.04) !important;
    vertical-align: middle;
    padding: 0.55rem 0.75rem;
}

.table .text-muted,
.table small,
.table span,
.table div {
    color: rgba(255, 255, 255, 0.9) !important;
}

.table td {
    color: var(--text-main) !important;
}

/* Row entrance stagger for tables in tab panes */
.tab-pane.show.active .table tbody tr {
    animation: rowSlideIn 0.25s var(--ease-out-expo) both;
}
.tab-pane.show.active .table tbody tr:nth-child(1) { animation-delay: 0.02s; }
.tab-pane.show.active .table tbody tr:nth-child(2) { animation-delay: 0.04s; }
.tab-pane.show.active .table tbody tr:nth-child(3) { animation-delay: 0.06s; }
.tab-pane.show.active .table tbody tr:nth-child(4) { animation-delay: 0.08s; }
.tab-pane.show.active .table tbody tr:nth-child(5) { animation-delay: 0.1s; }
.tab-pane.show.active .table tbody tr:nth-child(n+6) { animation-delay: 0.12s; }

/* ==========================================================================
   DASHBOARD LAYOUT
   ========================================================================== */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 70px);
}

/* Sidebar General — Glass */
.sidebar, .sidebar-container {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}
.sidebar-container { min-height: calc(100vh - 75px); padding: 16px; }
.content-container { padding: 20px; }

/* Sidebar Nav Pills (Management) */
.sidebar-nav .nav-link {
    color: var(--text-sec) !important;
    padding: 11px 16px;
    margin-bottom: 4px;
    border-radius: 10px;
    transition: all var(--duration-normal) var(--ease-out-expo);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.3px;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #fff !important;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav .nav-link::after {
    display: none;
}

.sidebar-nav .nav-link i {
    width: 22px;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity var(--duration-fast);
}

.sidebar-nav .nav-link:hover i {
    opacity: 1;
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-dim));
    color: white !important;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 69, 58, 0.3);
    animation: glowPulse 3s ease-in-out infinite;
    text-shadow: none;
}

.sidebar-nav .nav-link.active i {
    opacity: 1;
}

/* Device List Item (Monitor) */
.device-list-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.device-list-item:hover {
    border-color: var(--accent-red);
    background: rgba(255, 69, 58, 0.05);
    transform: translateX(3px);
}

.device-list-item.active {
    border-color: var(--accent-red);
    background: rgba(255, 69, 58, 0.08);
    box-shadow: inset 3px 0 0 var(--accent-red);
}

.device-list-item.status-online::before {
    content: '';
    position: absolute;
    top: 10px; right: 10px;
    width: 8px; height: 8px;
    background: var(--status-ok);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--status-ok);
}

.device-list-item.status-offline::before {
    content: '';
    position: absolute;
    top: 10px; right: 10px;
    width: 8px; height: 8px;
    background: var(--status-err);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--status-err);
}

/* Main Panel */
.main-panel {
    padding: 1.5rem;
    position: relative;
    overflow-y: auto;
    height: calc(100vh - 70px);
}

/* Metric Display */
.metric-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    transition: border-color var(--duration-normal);
}

.metric-box:hover { border-color: var(--border-hover); }

.metric-box label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

/* ==========================================================================
   MIMIC DIAGRAM
   ========================================================================== */
.mimic-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 40px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
}

.mimic-line {
    position: absolute;
    top: 50%; left: 20px; right: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 0;
}

.mimic-node {
    position: relative;
    z-index: 1;
    background: var(--bg-base);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    width: 180px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.mimic-node:hover {
    transform: translateY(-4px);
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 69, 58, 0.15);
}

.mimic-node h4 {
    font-size: 0.8rem;
    color: var(--accent-red);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.mimic-value-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 2px;
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   SCROLLING FOOTER
   ========================================================================== */
.scrolling-footer {
    position: fixed;
    bottom: 0; left: 260px; right: 0;
    background: rgba(0, 0, 0, 0.92);
    border-top: 1px solid var(--border-color);
    color: var(--accent-red);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    padding: 4px 0;
    z-index: 1000;
}

.scrolling-content {
    display: inline-block;
    animation: scroll-left 30s linear infinite;
}

@keyframes scroll-left {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.placeholder-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
}

/* ==========================================================================
   CALCULATOR SPECIFIC
   ========================================================================== */
.top-controls {
    display: flex;
    width: 100%;
    gap: 15px;
    padding: 20px;
    overflow-x: auto;
}

.recap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.recap-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 14px;
    border-left: 3px solid var(--accent-red);
    transition: background var(--duration-normal), transform var(--duration-normal);
}

.recap-item:hover {
    background: rgba(255, 69, 58, 0.04);
    transform: translateY(-2px);
}

.recap-label {
    font-size: 0.72rem;
    color: var(--text-sec);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 600;
}

.recap-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.data-grid.redesigned {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.data-cell {
    background: rgba(40, 40, 44, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
    transition: all var(--duration-normal) var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.data-cell::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
}

.data-cell.active {
    background: rgba(255, 59, 48, 0.04);
    border-color: rgba(255, 59, 48, 0.2);
}

.data-cell:hover {
    background: rgba(255, 69, 58, 0.06);
    border-color: var(--accent-red);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 69, 58, 0.15);
    z-index: 10;
}

.cell-label {
    font-size: 0.75rem;
    color: var(--text-sec);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.cell-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.cell-unit {
    font-size: 0.9rem;
    color: var(--text-sec);
    margin-left: 6px;
    font-weight: 400;
}

.cell-value-edit {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid var(--accent-red) !important;
    color: #fff !important;
    border-radius: 8px;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 5px 10px;
    width: 100%;
}

.cell-value-edit:focus {
    box-shadow: 0 0 12px rgba(255, 69, 58, 0.4) !important;
    outline: none;
}
.cell-value-edit:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02) !important;
}

.cell-value-edit.huge {
    font-size: 2.5rem;
    font-weight: 900;
}

.specs-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   DASHBOARD SPECIFIC
   ========================================================================== */
.container-main {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.1) 0%, rgba(255, 69, 58, 0.03) 100%);
    border: 1px solid rgba(255, 69, 58, 0.15);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform var(--duration-normal) var(--ease-out-expo),
                box-shadow var(--duration-normal),
                border-color var(--duration-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-red);
}

.stat-icon {
    width: 56px; height: 56px;
    background: var(--accent-red);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.stat-card:hover .stat-icon { transform: scale(1.08); }

.stat-content h3 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
}

.stat-content p {
    font-size: 0.82rem;
    color: var(--text-sec);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    transition: all var(--duration-normal) var(--ease-out-expo);
    cursor: pointer;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-red);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.project-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.project-meta {
    font-size: 0.82rem;
    color: var(--text-sec);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quick-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all var(--duration-normal) var(--ease-out-expo);
    cursor: pointer;
}

.quick-action:hover {
    background: rgba(255, 69, 58, 0.08);
    border-color: var(--accent-red);
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--shadow-glow);
}

.quick-action i {
    font-size: 2rem;
    color: var(--accent-red);
    margin-bottom: 10px;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.quick-action:hover i { transform: scale(1.12); }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state i {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

#map {
    height: 400px;
    border-radius: 14px;
    overflow: hidden;
}

/* ==========================================================================
   SNMP TEST SPECIFIC
   ========================================================================== */
.result-box {
    background: rgba(14, 14, 16, 0.7);
    border-left: 3px solid var(--accent-red);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
}

.success-box { border-left-color: #2ecc71; }
.error-box { border-left-color: #e74c3c; }

.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.metric-label { color: var(--text-dim); font-weight: 600; }
.metric-value { color: #fff; font-weight: 700; }

.spinner-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ==========================================================================
   SEGMENTED NAVIGATION
   ========================================================================== */
:root {
    --red-servicio: #ff453a;
    --red-monitoreo: #e03030;
    --red-admin: #c41840;
}

.nav-segmented {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.nav-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 10px 6px;
    border-radius: 8px;
    position: relative;
}

.nav-segment-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 2px;
    opacity: 0.6;
}

.nav-segment .nav-link {
    padding: 4px 10px;
    font-size: 0.76rem;
}

.nav-segment-divider {
    width: 1px; height: 36px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.nav-segment-servicio { background: rgba(255, 69, 58, 0.05); border: 1px solid rgba(255, 69, 58, 0.1); }
.nav-segment-servicio .nav-segment-label { color: var(--red-servicio); }
.nav-segment-servicio .nav-link:hover, .nav-segment-servicio .nav-link.active { color: var(--red-servicio) !important; }

.nav-segment-monitoreo { background: rgba(224, 48, 48, 0.05); border: 1px solid rgba(224, 48, 48, 0.1); }
.nav-segment-monitoreo .nav-segment-label { color: var(--red-monitoreo); }
.nav-segment-monitoreo .nav-link:hover, .nav-segment-monitoreo .nav-link.active { color: var(--red-monitoreo) !important; }

.nav-segment-admin { background: rgba(196, 24, 64, 0.05); border: 1px solid rgba(196, 24, 64, 0.1); }
.nav-segment-admin .nav-segment-label { color: var(--red-admin); }
.nav-segment-admin .nav-link:hover, .nav-segment-admin .nav-link.active { color: var(--red-admin) !important; }

/* ==========================================================================
   TOAST SYSTEM
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 80px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 20px;
    min-width: 280px;
    max-width: 400px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: slideInRight 0.35s var(--ease-out-expo) both;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-item.toast-exit { animation: slideOutRight 0.3s var(--ease-out-expo) both; }
.toast-item.toast-success { border-left: 3px solid var(--status-ok); }
.toast-item.toast-error { border-left: 3px solid var(--status-err); }
.toast-item.toast-warning { border-left: 3px solid var(--status-warn); }
.toast-item.toast-info { border-left: 3px solid #0a84ff; }

/* ==========================================================================
   SKELETON LOADING
   ========================================================================== */
.skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.06) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ==========================================================================
   MODALS — Dark glass theme
   ========================================================================== */
.modal-content {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-lg) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.modal-header { border-bottom-color: var(--border-color) !important; }
.modal-footer { border-top-color: var(--border-color) !important; }
.modal-title { color: var(--text-main) !important; }
.btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ==========================================================================
   DROPDOWNS — Dark with blur
   ========================================================================== */
.dropdown-menu {
    background: var(--bg-elevated) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 10px !important;
    box-shadow: var(--shadow-lg) !important;
    animation: slideUp 0.2s var(--ease-out-expo) both;
}

.dropdown-item {
    color: var(--text-sec) !important;
    transition: all var(--duration-fast);
    font-size: 0.88rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: rgba(255, 69, 58, 0.08) !important;
    color: var(--text-main) !important;
}

.dropdown-divider { border-top-color: var(--border-color) !important; }

/* ==========================================================================
   ALERTS — Dark theme by type
   ========================================================================== */
.alert {
    border-radius: 10px;
    border: 1px solid;
    font-size: 0.88rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.alert-success { background: rgba(50, 215, 75, 0.08) !important; border-color: rgba(50, 215, 75, 0.25) !important; color: var(--status-ok) !important; }
.alert-danger { background: rgba(255, 69, 58, 0.08) !important; border-color: rgba(255, 69, 58, 0.25) !important; color: var(--accent-red) !important; }
.alert-warning { background: rgba(255, 159, 10, 0.08) !important; border-color: rgba(255, 159, 10, 0.25) !important; color: var(--status-warn) !important; }
.alert-info { background: rgba(10, 132, 255, 0.08) !important; border-color: rgba(10, 132, 255, 0.25) !important; color: #64d2ff !important; }

/* ==========================================================================
   SCROLL REVEAL (JS adds .is-visible)
   ========================================================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-slow) var(--ease-out-expo),
                transform var(--duration-slow) var(--ease-out-expo);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   PRINT — strip animations
   ========================================================================== */
@media print {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    body { background: #fff !important; color: #000 !important; }
    .toast-container, .app-header { display: none !important; }
}

/* ==========================================================================
   ACCESSIBILITY — prefers-reduced-motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    body { animation: none; }
    .reveal-on-scroll { opacity: 1; transform: none; }
}

/* ==========================================================================
   MOBILE RESPONSIVE — reduce transforms
   ========================================================================== */
@media (max-width: 768px) {
    .card-control:hover,
    .data-cell:hover,
    .stat-card:hover,
    .quick-action:hover {
        transform: none;
    }

    .table-hover tbody tr:hover { transform: none; }
    .dashboard-container { grid-template-columns: 1fr; }
    .scrolling-footer { left: 0; }

    .toast-container { right: 10px; left: 10px; }
    .toast-item { min-width: unset; max-width: unset; }

    .sidebar-container { min-height: auto; }

    body { font-size: 13px; }
}
