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

:root {
    --bg-dark: #070913;
    --bg-surface: rgba(15, 22, 42, 0.7);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-highlight: rgba(245, 158, 11, 0.2);
    
    --primary: #f59e0b; /* Amber Gold */
    --primary-glow: rgba(245, 158, 11, 0.35);
    --secondary: #3b82f6; /* Electric Blue */
    --secondary-glow: rgba(59, 130, 246, 0.3);
    --accent: #10b981; /* Emerald Green */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

html {
    background-color: var(--bg-dark);
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    background-image: 
        radial-gradient(at 0% 0%, rgba(245, 158, 11, 0.07) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(59, 130, 246, 0.07) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.04) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(15, 22, 42, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-top: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}
a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Glassmorphic layout structure */
.krie-header {
    background: rgba(7, 9, 19, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.krie-footer {
    background: rgba(7, 9, 19, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
}

.krie-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Cards & Glassmorphism */
.krie-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.krie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.krie-card:hover {
    border-color: var(--border-highlight);
    box-shadow: 
        0 15px 35px -5px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(245, 158, 11, 0.05);
    transform: translateY(-2px);
}

.krie-card-glow {
    border-color: var(--border-highlight);
    box-shadow: 
        0 15px 35px -5px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(245, 158, 11, 0.12);
}

/* Inputs & Form Controls */
.krie-input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.krie-label {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.krie-input, .krie-select, .krie-textarea {
    background: rgba(15, 22, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.krie-input:focus, .krie-select:focus, .krie-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(20, 30, 55, 0.9);
}

/* Buttons */
.btn-krie-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #d97706 100%);
    border: none;
    border-radius: 8px;
    color: #070913;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.8rem 1.75rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-krie-primary:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(245, 158, 11, 0.45),
        0 0 10px rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

.btn-krie-primary:active {
    transform: translateY(1px);
}

.btn-krie-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.8rem 1.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-krie-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

/* Badges & Scores */
.badge-krie {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.badge-krie-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.badge-krie-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.badge-krie-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.badge-krie-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* Grid Layout Helper */
.krie-grid {
    display: grid;
    gap: 1.5rem;
}

.krie-grid-1 { grid-template-columns: 1fr; }
.krie-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.krie-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.krie-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Custom components */
.tco-badge {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--border-highlight);
    border-radius: 30px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-heading);
    font-weight: 500;
}

.tco-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #070913;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Recalculate Panel */
.engine-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-display {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.saving-hero {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.saving-amount {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    line-height: 1;
    margin: 0.5rem 0;
    text-shadow: 0 0 20px var(--primary-glow);
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    height: 12px;
    width: 100%;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    height: 100%;
    border-radius: 30px;
    transition: width 0.5s ease-out;
}

/* Diagnostic results details grid */
.metric-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 0;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

.metric-value-highlight {
    color: var(--primary);
    text-shadow: 0 0 5px rgba(245, 158, 11, 0.2);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator-green { background-color: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status-indicator-blue { background-color: var(--secondary); box-shadow: 0 0 8px var(--secondary); }
.status-indicator-orange { background-color: var(--primary); box-shadow: 0 0 8px var(--primary); }

.krie-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.krie-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.krie-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.krie-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #7f1d1d;
    color: #fca5a5;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    display: none;
    left: 0;
    line-height: 24px;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
    border-top: 1px solid #b91c1c;
    font-family: var(--font-body);
}

#blazor-error-ui .reload {
    color: #fff;
    text-decoration: underline;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: #fca5a5;
}

/* Background Canvas — [PERF-05] GPU compositing hints for 3D readiness */
.krie-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    /* GPU layer promotion — eliminates repaint on scroll/resize */
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Isolate compositing layer from page stacking context */
    isolation: isolate;
}

/* Sidebar canvas GPU hints */
#sidebar-canvas {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    display: block;
    width: 100%;
    height: 100%;
}

/* ─── SIDEBAR & MAIN DASHBOARD LAYOUT ─── */
:root {
  --bg-dark: #03060c;
  --bg-panel: #050a14;
  --bg-card: #050810;
  --border: rgba(255,255,255,0.07);
  --gold: #f5a623;
  --gold-dim: #c47f10;
  --green: #00e676;
  --green-dim: #00b35a;
  --blue: #29b6f6;
  --sidebar-w: 260px;
}

/* Sidebar styling */
.sidebar { width: var(--sidebar-w); min-height: 100vh; background: linear-gradient(180deg, #050a14 0%, #03060c 100%); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 30px 0 32px; flex-shrink: 0; position: relative; z-index: 10; overflow: hidden; }
#sidebar-network-container { position: absolute; bottom: 120px; left: 0; width: 100%; height: 350px; z-index: 1; pointer-events: none; mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%); }
#sidebar-canvas { width: 100%; height: 100%; display: block; }
.sidebar-logo, .nav, .sidebar-bottom { position: relative; z-index: 2; }
.sidebar-logo { display: flex; align-items: center; gap: 12px; padding: 0 24px; margin-bottom: 40px; }
.logo-icon { width: 42px; height: 42px; flex-shrink: 0; object-fit: contain; }
.logo-text-group { display: flex; flex-direction: column; }
.logo-title { color: #fff; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 14px; line-height: 1.1; letter-spacing: 0.05em; }
.logo-sub { color: var(--gold); font-size: 9px; letter-spacing: 0.02em; margin-top: 4px; font-weight: 500; }
.nav { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 16px; padding: 14px 24px 14px 20px; border-left: 4px solid transparent; cursor: pointer; transition: all 0.3s ease; color: var(--text-secondary); text-decoration: none; }
.nav-text { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; line-height: 1.4; text-align: left; }
.nav-icon-svg { width: 22px; height: 22px; flex-shrink: 0; }
.nav-item.active { background: linear-gradient(90deg, rgba(245,166,35,0.12) 0%, transparent 100%); border-left: 4px solid var(--gold); color: var(--gold); }
.nav-item:not(.active):hover { background: rgba(255,255,255,0.02); color: var(--text-primary); }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 24px; }
.kryphos-icon { width: 48px; height: 48px; object-fit: contain; }
.kryphos-text { color: var(--gold); font-family: 'Outfit', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.15em; }
.kryphos-sub { color: var(--text-muted); font-size: 8px; letter-spacing: 0.06em; }

/* Main wrapper layout */
.main-layout-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--bg-dark);
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 70% -20%, rgba(13, 35, 75, 0.4) 0%, var(--bg-dark) 50%);
}

/* Topbar styling */
.topbar { 
  display: flex; align-items: flex-start; justify-content: space-between; 
  padding: 24px 36px 0; 
  flex-shrink: 0; 
}
.topbar-title h1 { 
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 600; 
  color: var(--text-primary); 
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
.topbar-title p { 
  color: var(--gold); 
  font-size: 14px; 
  font-weight: 400; 
}

.topbar-user { 
  display: flex; align-items: center; gap: 14px; cursor: pointer; 
  margin-top: 4px;
}
.user-avatar { 
  width: 38px; height: 38px; border-radius: 50%; 
  background: transparent;
  border: 1px solid rgba(245,166,35,0.6);
  display: flex; align-items: center; justify-content: center; 
  font-weight: 600; font-size: 13px; color: var(--gold); 
}
.user-info { text-align: right; }
.user-info .name { font-weight: 500; font-size: 13px; color: #fff;}
.user-info .role { color: var(--text-secondary); font-size: 11px; margin-top: 2px;}
.chevron { 
  color: var(--text-secondary); 
  font-size: 12px; 
  margin-left: -4px;
}

/* Content area scrollable wrapper */
.content { flex: 1; overflow-y: auto; padding: 24px 36px 28px; display: flex; flex-direction: column; gap: 24px; }

/* KPI Row actuals */
.kpi-row { 
  display: grid; 
  grid-template-columns: 1fr 1.6fr 2fr;
  gap: 16px; 
}

.kpi-card { 
  background: var(--bg-card); 
  border-radius: 8px;
  padding: 24px 20px; 
  display: flex; align-items: center; gap: 20px; 
  position: relative;
}

.kpi-card.gold-border { border: 1px solid rgba(245,166,35,0.15); }
.kpi-card.blue-border { border: 1px solid rgba(41,182,246,0.15); }
.kpi-card.green-border { border: 1px solid rgba(0,230,118,0.15); }

.kpi-icon-container {
  position: relative;
  width: 70px; height: 70px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.kpi-glow {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1.5px solid transparent;
  z-index: 1;
}

.kpi-glow::before {
  content: ''; position: absolute; inset: 2px;
  background: #020408;
  border-radius: 50%;
  z-index: -1;
}

.kpi-icon-container.gold .kpi-glow {
  background: linear-gradient(135deg, rgba(245,166,35,0.8), rgba(245,166,35,0.1)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}
.kpi-icon-container.gold { box-shadow: inset 0 0 20px rgba(245,166,35,0.05), 0 0 30px rgba(245,166,35,0.15); border-radius: 50%;}

.kpi-icon-container.blue .kpi-glow {
  background: linear-gradient(135deg, rgba(41,182,246,0.8), rgba(41,182,246,0.1)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}
.kpi-icon-container.blue { box-shadow: inset 0 0 20px rgba(41,182,246,0.05), 0 0 30px rgba(41,182,246,0.15); border-radius: 50%;}

.kpi-icon-container.green .kpi-glow {
  background: linear-gradient(135deg, rgba(0,230,118,0.8), rgba(0,230,118,0.1)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
}
.kpi-icon-container.green { box-shadow: inset 0 0 20px rgba(0,230,118,0.05), 0 0 30px rgba(0,230,118,0.15); border-radius: 50%;}

.kpi-svg {
  width: 32px; height: 32px;
  position: relative; z-index: 2;
}

.kpi-info { display: flex; flex-direction: column; justify-content: center; }
.kpi-label { color: var(--text-primary); font-size: 11px; font-weight: 500; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.05em;}
.kpi-value { font-size: 38px; font-weight: 600; color: var(--gold); line-height: 1; font-family: var(--font-body);}
.kpi-sub { color: var(--text-secondary); font-size: 11px; margin-top: 8px; }

.kpi-layout-split { display: flex; width: 100%; }
.kpi-left-col { flex: 1.2; display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,0.05); padding-right: 15px;}
.kpi-right-col { flex: 1; padding-left: 20px; display: flex; flex-direction: column; justify-content: center;}

.kpi-vm-numbers { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.kpi-vm-numbers .val { font-size: 28px; font-weight: 600; color: #fff; }
.kpi-vm-numbers .slash { font-size: 24px; font-weight: 300; color: var(--text-secondary); }

.kpi-vm-labels { display: flex; align-items: center; gap: 12px; }
.kpi-vm-labels .lbl-block { display: flex; flex-direction: column; align-items: flex-start; }
.kpi-vm-labels .lbl-num { font-size: 14px; color: #fff; font-weight: 500; margin-bottom: 2px;}
.kpi-vm-labels .lbl-text { color: var(--text-secondary); font-size: 10px; }

.kpi-right-col .kpi-label { margin-bottom: 6px; }
.kpi-right-col .kpi-big-val { font-size: 32px; font-weight: 600; color: var(--blue); line-height: 1; margin-bottom: 6px;}

.kpi-cap-layout { display: flex; flex: 1; align-items: center; }
.cap-data-area { flex: 1; display: flex; flex-direction: column; padding-right: 20px; border-right: 1px solid rgba(255,255,255,0.05);}
.cap-stats-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px;}
.cap-col { display: flex; flex-direction: column; align-items: center; }
.cap-val-num { font-size: 24px; font-weight: 600; margin-bottom: 4px;}
.cap-val-num.green { color: var(--green); }
.cap-val-num.blue { color: var(--blue); }
.cap-val-num.white { color: #fff; }
.cap-lbl-text { color: var(--text-secondary); font-size: 10px; text-align: center;}

.kpi-chart-area { padding-left: 20px; display: flex; align-items: center; justify-content: center;}
.gauge-wrap { position: relative; width: 85px; height: 85px; }
.gauge-wrap svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 6; }
.gauge-prog { fill: none; stroke: var(--green); stroke-width: 6; stroke-linecap: round; }
.gauge-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge-text .pct { font-size: 22px; font-weight: 600; color: #fff; line-height: 1.1; margin-bottom: 2px;}
.gauge-text .lbl { font-size: 9px; color: var(--green); letter-spacing: 0.05em; font-weight: 500;}

/* Section headers */
.section-header { text-align: center; margin: 10px 0; }
.section-header h2 { 
  font-family: var(--font-heading); font-size: 14px; font-weight: 600; 
  color: #fff; text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; justify-content: center; gap: 20px; 
}
.section-header h2::before, .section-header h2::after { 
  content: ''; flex: 1; max-width: 250px; height: 1px; 
  background: linear-gradient(90deg, transparent, rgba(245,166,35,0.5)); 
}
.section-header h2::after { background: linear-gradient(90deg, rgba(245,166,35,0.5), transparent); }
.section-header p { color: var(--text-secondary); font-size: 11px; margin-top: 6px; }

/* Servers grid visual layout */
.servers-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.server-card { background: rgba(13, 24, 41, 0.8); backdrop-filter: blur(5px); border-radius: 14px; padding: 20px; position: relative; overflow: hidden; }
.server-card.high { border: 1.5px solid rgba(245,166,35,0.5); }
.server-card.ok { border: 1.5px solid rgba(0,230,118,0.3); }
.server-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.server-card.high::before { background: linear-gradient(90deg, var(--gold), transparent); }
.server-card.ok::before { background: linear-gradient(90deg, var(--green), transparent); }

.server-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.server-name { font-family: var(--font-heading); font-size: 15px; font-weight: 700; letter-spacing: 0.06em; }
.server-card.high .server-name { color: var(--gold); }
.server-card.ok .server-name { color: var(--green); }

.server-badge { display: flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 20px; }
.badge-high { background: rgba(245,166,35,0.15); color: var(--gold); }
.badge-ok { background: rgba(0,230,118,0.12); color: var(--green); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; }
.badge-high .badge-dot { background: var(--gold); }
.badge-ok .badge-dot { background: var(--green); }

.server-body { display: flex; gap: 14px; align-items: flex-start; }
.server-img { width: 70px; flex-shrink: 0; }
.server-visual { width: 70px; height: 90px; background: linear-gradient(180deg, #0a1628 0%, #050d1a 100%); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px; position: relative; overflow: hidden; }

.rack-unit { width: 100%; height: 10px; border-radius: 2px; background: #0f1f38; border: 1px solid rgba(255,255,255,0.06); position: relative; overflow: hidden; }
.rack-unit::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 40%, rgba(255,200,0,0.08) 100%); }
.rack-unit.lit { border-color: rgba(245,166,35,0.3); }
.rack-unit.lit::before { content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.rack-unit.green-lit { border-color: rgba(0,230,118,0.3); }
.rack-unit.green-lit::before { content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }

.server-stats { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.stat-icon { color: var(--text-muted); font-size: 13px; width: 18px; text-align: center; }
.stat-val { font-weight: 700; color: var(--text-primary); min-width: 22px; }
.stat-lbl { color: var(--text-secondary); font-size: 11px; }

.occ-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.occ-circle { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 8px; font-weight: 700; position: relative; }
.occ-circle.high { border: 2px solid var(--gold); color: var(--gold); background: rgba(245,166,35,0.08); }
.occ-circle.med { border: 2px solid #f5c842; color: #f5c842; background: rgba(245,200,66,0.08); }
.occ-circle.low { border: 2px solid var(--green); color: var(--green-dim); background: rgba(0,230,118,0.08); }
.occ-pct { font-size: 18px; font-weight: 800; }
.occ-pct.high { color: var(--gold); }
.occ-pct.med { color: #f5c842; }
.occ-pct.low { color: var(--green); }

.vm-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 2px; padding-top: 6px; border-top: 1px solid var(--border); }
.vm-icon { color: var(--text-muted); }
.vm-val { font-size: 15px; font-weight: 800; color: var(--text-primary); }
.vm-lbl { color: var(--text-secondary); font-size: 11px; }

/* Network hexagon visual separator */
.network-section { display: flex; justify-content: center; padding: 0 0 4px; position: relative; height: 60px; pointer-events: none; }
.network-center { width: 60px; height: 60px; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(245,166,35,0.3) 0%, transparent 70%); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.network-hex { width: 36px; height: 36px; background: linear-gradient(135deg, var(--gold) 0%, #c47f10 100%); clip-path: polygon(50% 0%,93% 25%,93% 75%,50% 100%,7% 75%,7% 25%); display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* Bottom actions */
.bottom-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.action-card { border-radius: 14px; padding: 20px 24px; display: flex; align-items: center; gap: 18px; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; }
.action-card.gold-card { background: linear-gradient(135deg, rgba(26,18,0,0.8) 0%, rgba(13,8,0,0.8) 100%); backdrop-filter: blur(5px); border: 1.5px solid rgba(245,166,35,0.4); }
.action-card.gold-card:hover { border-color: var(--gold); }
.action-card.blue-card { background: linear-gradient(135deg, rgba(0,21,41,0.8) 0%, rgba(0,13,26,0.8) 100%); backdrop-filter: blur(5px); border: 1.5px solid rgba(41,182,246,0.3); }
.action-card.blue-card:hover { border-color: var(--blue); }

.action-icon-wrap { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.gold-card .action-icon-wrap { background: rgba(245,166,35,0.12); }
.blue-card .action-icon-wrap { background: rgba(41,182,246,0.1); }

.action-text { flex: 1; }
.action-text h3 { font-family: var(--font-heading); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 5px; text-align: left; }
.gold-card .action-text h3 { color: var(--gold); }
.blue-card .action-text h3 { color: var(--blue); }
.action-text p { color: var(--text-secondary); font-size: 11px; line-height: 1.4; text-align: left; }

.action-chevron { font-size: 20px; color: var(--text-muted); }
.gold-card .action-chevron { color: var(--gold); }
.blue-card .action-chevron { color: var(--blue); }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── RESPONSIVE LAYOUT & MEDIA QUERIES ─── */

/* Desktop & high-res screens */
@media (min-width: 1400px) {
  .servers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Medium desktops / tablets landscape */
@media (max-width: 1300px) {
  .kpi-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .kpi-card.green-border {
    grid-column: span 2;
  }
  .servers-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* Tablets and small laptops */
@media (max-width: 992px) {
  .main-layout-wrapper {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-height: auto;
    padding: 16px 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
  }
  #sidebar-network-container {
    display: none;
  }
  .sidebar-logo {
    margin-bottom: 0;
    padding: 0;
  }
  .nav {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
  }
  .nav-item {
    padding: 10px 14px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }
  .nav-item.active {
    background: linear-gradient(180deg, rgba(245,166,35,0.06) 0%, rgba(245,166,35,0.01) 100%);
    border-left: none;
    border-bottom: 3px solid var(--gold);
  }
  .sidebar-bottom {
    display: none;
  }
  .topbar {
    padding: 20px 24px 0;
  }
  .content {
    padding: 20px 24px 24px;
  }
}

/* Tablets portrait / large mobiles */
@media (max-width: 768px) {
  .sidebar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .nav {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
  }
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .kpi-card.green-border {
    grid-column: span 1;
  }
  .servers-grid {
    grid-template-columns: 1fr;
  }
  .bottom-cards {
    grid-template-columns: 1fr;
  }
}

/* Small mobiles */
@media (max-width: 576px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .topbar-user {
    width: 100%;
    justify-content: flex-end;
  }
  .kpi-layout-split {
    flex-direction: column;
    gap: 15px;
  }
  .kpi-left-col {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-right: 0;
    padding-bottom: 15px;
  }
  .kpi-right-col {
    padding-left: 0;
  }
  .kpi-cap-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  .cap-data-area {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-right: 0;
    padding-bottom: 15px;
  }
  .kpi-chart-area {
    padding-left: 0;
  }
}

/* ─── PREMIUM DISCOVERY/NUEVA IMPLEMENTACIÓN DESIGN ─── */
.three-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (min-width: 992px) {
  .three-cols {
    grid-template-columns: 1.1fr 1.6fr 1fr;
  }
}

.panel {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.panel-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.num-blue {
  background: rgba(41,182,246,0.15);
  border: 1.5px solid rgba(41,182,246,0.4);
  color: var(--blue);
}

.num-green {
  background: rgba(0,230,118,0.12);
  border: 1.5px solid rgba(0,230,118,0.35);
  color: var(--green);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-title.blue { color: var(--blue); }
.panel-title.green { color: var(--green); }

.field {
  margin-bottom: 14px;
}

.field-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, background-color 0.2s;
}

.field-input:focus-within {
  border-color: var(--gold);
  background: rgba(255,255,255,0.06);
}

.field-input .fi-icon {
  color: var(--text-muted);
  font-size: 14px;
}

.field-input .fi-text {
  color: var(--text-primary);
}

.field-input .fi-phone {
  color: var(--green);
}

.field-input.multiline {
  align-items: flex-start;
  min-height: 60px;
}

.field-input.multiline .fi-icon {
  margin-top: 2px;
}

.field-input-inner {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  outline: none;
}

/* ─── DISCOVERY SECTION ─── */
.disc-metrics {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}

.disc-col {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.disc-col + .disc-col {
  border-left: 1px solid var(--border);
}

.disc-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.disc-icon {
  font-size: 18px;
  color: var(--text-muted);
}

.disc-val {
  font-size: 30px;
  font-weight: 900;
  color: var(--text-primary);
}

.disc-val.blue { color: var(--blue); }
.disc-val.gold { color: var(--gold); }

.disc-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

.disc-op {
  font-size: 22px;
  color: var(--text-muted);
  align-self: center;
}

.disc-eq {
  font-size: 22px;
  color: var(--text-muted);
  align-self: center;
}

.disc-val-input {
  background: transparent;
  border: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-align: center;
  width: 80px;
  outline: none;
}

.disc-auto-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.disc-auto-label::before {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(41,182,246,0.2);
}

.disc-auto-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(41,182,246,0.2);
}

@media (max-width: 768px) {
  .disc-metrics {
    flex-direction: column;
  }
  .disc-col {
    width: 100%;
  }
  .disc-col + .disc-col {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .disc-op, .disc-eq {
    display: none;
  }
}

/* ─── TRANSLATION TABLE ─── */
.trans-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.trans-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
}

.trans-table th:first-child {
  text-align: left;
}

.trans-table td {
  text-align: center;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.trans-table td:first-child {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.trans-table td.highlight {
  background: rgba(41,182,246,0.12);
  border: 1.5px solid rgba(41,182,246,0.4);
  border-radius: 6px;
  color: var(--blue);
  font-weight: 800;
}

/* ─── NUCLEOS CARD ─── */
.nucleos-card {
  background: rgba(41,182,246,0.06);
  border: 1px solid rgba(41,182,246,0.2);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nucleos-icon {
  font-size: 32px;
  color: var(--blue);
}

.nucleos-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.nucleos-val {
  font-size: 28px;
  font-weight: 900;
  color: var(--blue);
}

.nucleos-sub {
  color: var(--text-secondary);
  font-size: 10px;
}

/* ─── VALIDATION PANEL ─── */
.val-row {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.val-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.val-sublabel {
  font-size: 9px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.val-formula {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.val-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
}

.val-op {
  font-size: 14px;
  color: var(--text-muted);
}

.val-price {
  font-size: 30px;
  font-weight: 900;
  color: var(--green);
  margin-top: 4px;
}

.val-price-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

.val-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

.val-neg-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.val-neg-price {
  font-size: 26px;
  font-weight: 900;
  color: var(--text-primary);
}

.val-status {
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.val-check {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.val-status-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.val-status-body {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── BOTTOM ROW ─── */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}

@media (min-width: 992px) {
  .bottom-row {
    grid-template-columns: 1.3fr 1fr;
  }
}

/* ─── INFO CARD ─── */
.info-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 100% 50%, rgba(41,70,180,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.info-icon {
  font-size: 14px;
  color: var(--blue);
}

.info-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

.info-bullet {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ─── ANALIZAR CARD ─── */
.analizar-card {
  background: linear-gradient(135deg, #1a1200 0%, #100b00 100%);
  border: 1.5px solid rgba(245,166,35,0.5);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.analizar-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 0% 50%, rgba(245,166,35,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.analizar-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(245,166,35,0.12);
}

.analizar-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(245,166,35,0.25) 0%, rgba(245,166,35,0.05) 100%);
  border: 1.5px solid rgba(245,166,35,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.analizar-text {
  flex: 1;
}

.analizar-text h3 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  text-align: left;
}

.analizar-text p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

.analizar-chevron {
  font-size: 24px;
  color: var(--gold);
}

/* ─── TOPBAR BREADCRUMB & DESIGN OVERRIDES ─── */
.topbar-premium {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 0 20px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.breadcrumb-premium {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-premium span {
  color: var(--text-secondary);
}

.breadcrumb-premium .sep {
  color: var(--text-muted);
}

.topbar-left-premium h1 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.06em;
  margin: 0;
  text-align: left;
}

.topbar-left-premium p {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 3px;
  text-align: left;
}

.topbar-right-premium {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back-premium {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid rgba(245,166,35,0.5);
  background: rgba(245,166,35,0.06);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.btn-back-premium:hover {
  background: rgba(245,166,35,0.14);
}

.footer-bar-premium {
  border-top: 1px solid var(--border);
  padding: 16px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  margin-top: 20px;
}

.footer-left-premium {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.footer-shield-premium {
  color: var(--blue);
}

.footer-right-premium {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.status-dot-premium {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* ═══════════════════════════════════════════════════════════
   COUNTRY SELECT — searchable dropdown with flag
   ═══════════════════════════════════════════════════════════ */
.cs-wrapper {
  position: relative;
  width: 100%;
}

.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}
.cs-trigger:hover,
.cs-wrapper.cs-open .cs-trigger {
  border-color: var(--gold, #f5a623);
  background: rgba(255,255,255,0.06);
}

.cs-flag { font-size: 18px; line-height: 1; }
.cs-selected-name { flex: 1; font-weight: 500; }
.cs-placeholder { flex: 1; color: var(--text-muted); }
.cs-chevron { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; }
.cs-chevron-up { transform: rotate(180deg); }

.cs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #0d1829;
  border: 1px solid rgba(41,182,246,0.25);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 9999;
  overflow: hidden;
  animation: cs-appear 0.15s ease-out;
}
@keyframes cs-appear {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cs-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cs-search-icon { font-size: 13px; color: var(--text-muted); }
.cs-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.cs-search-input::placeholder { color: var(--text-muted); }
.cs-search-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}
.cs-search-clear:hover { color: var(--text-primary); }

.cs-list {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.cs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text-secondary);
}
.cs-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.cs-item-selected { background: rgba(41,182,246,0.08); color: #29b6f6 !important; }

.cs-item-flag { font-size: 16px; }
.cs-item-name { flex: 1; }
.cs-item-check { color: #29b6f6; font-size: 12px; font-weight: 700; }

.cs-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* ═══════════════════════════════════════════════════════════
   PHONE INPUT — dial code selector + number field
   ═══════════════════════════════════════════════════════════ */
.pi-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: visible;
  transition: border-color 0.2s, background 0.2s;
}
.pi-wrapper:focus-within,
.pi-wrapper.pi-dial-open {
  border-color: var(--gold, #f5a623);
  background: rgba(255,255,255,0.06);
}

.pi-dial-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 10px 0 0 10px;
  transition: background 0.15s;
}
.pi-dial-trigger:hover { background: rgba(255,255,255,0.05); }

.pi-flag { font-size: 18px; line-height: 1; }
.pi-code { font-weight: 600; color: var(--gold, #f5a623); font-size: 12px; min-width: 34px; }
.pi-caret { font-size: 10px; color: var(--text-muted); transition: transform 0.2s; }
.pi-caret-up { transform: rotate(180deg); }

.pi-number-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  min-width: 0;
  border-radius: 0 10px 10px 0;
}
.pi-number-input::placeholder { color: var(--text-muted); }

.pi-dial-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: #0d1829;
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  z-index: 9999;
  overflow: hidden;
  animation: cs-appear 0.15s ease-out;
}

.pi-dial-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pi-dial-search-icon { font-size: 12px; color: var(--text-muted); }
.pi-dial-search {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}
.pi-dial-search::placeholder { color: var(--text-muted); }

.pi-dial-list {
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.pi-dial-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.pi-dial-item:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.pi-dial-selected { background: rgba(245,166,35,0.08); color: var(--gold, #f5a623) !important; }

.pi-dial-flag { font-size: 16px; }
.pi-dial-name { flex: 1; }
.pi-dial-num { font-weight: 700; color: var(--gold, #f5a623); font-size: 11px; }
.pi-dial-empty { padding: 14px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* ── Shared backdrop: transparent fullscreen layer that closes any open dropdown ── */
.cs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: transparent;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE SYSTEM — KRYPHOS WEB  (Mobile-First Rewrite)
   Breakpoints:
     xs  < 480px  — small phones
     sm  < 768px  — phones / large phones
     md  < 1024px — tablets
     lg  ≥ 1024px — desktops (default sidebar layout)
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   HAMBURGER BUTTON  (hidden on desktop, shown on mobile)
───────────────────────────────────────────────────────────────── */
.sidebar-hamburger {
  display: none;              /* desktop: hidden */
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1300;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(7, 9, 19, 0.95);
  border: 1px solid rgba(245, 166, 35, 0.5);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.sidebar-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #f5a623;
  border-radius: 2px;
  transition: all 0.28s ease;
}
.sidebar-hamburger:hover {
  background: rgba(245,166,35,0.12);
  border-color: rgba(245,166,35,0.8);
}
.sidebar-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.sidebar-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sidebar-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─────────────────────────────────────────────────────────────────
   SIDEBAR OVERLAY  (darkens background when sidebar is open)
───────────────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;              /* shown only on mobile via JS class */
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(3px);
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─────────────────────────────────────────────────────────────────
   DESKTOP BASELINE  (≥ 1024px — unchanged, sidebar always visible)
───────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .sidebar-hamburger { display: none !important; }
  .sidebar-overlay   { display: none !important; }
  .main-layout-wrapper {
    display: flex;
    flex-direction: row;
  }
  .sidebar {
    position: relative !important;
    transform: none !important;
    left: auto !important;
    width: var(--sidebar-w, 260px) !important;
    flex-shrink: 0;
  }
  .main {
    flex: 1;
    min-width: 0;
  }
  .topbar {
    padding: 24px 36px 0 !important;
  }
  .content {
    padding: 24px 36px 28px !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   MOBILE / TABLET  (< 1024px)
   KEY FIX: wrapper → display:block  so sidebar is OUT of flow.
            sidebar → position:fixed + transform off-screen.
───────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {

  /* ① Wrapper becomes block — sidebar is no longer a flex child */
  .main-layout-wrapper {
    display: block !important;
    position: relative;
  }

  /* ② Hamburger is visible */
  .sidebar-hamburger { display: flex; }

  /* ③ Overlay available */
  .sidebar-overlay { display: block; }

  /* ④ Sidebar: fixed, fully off-screen to the left via transform */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100dvh !important;
    width: 260px !important;
    transform: translateX(-110%) !important;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1250 !important;
    box-shadow: none;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* ⑤ Sidebar open state */
  .sidebar.sidebar-open {
    transform: translateX(0) !important;
    box-shadow: 6px 0 40px rgba(0,0,0,0.85) !important;
  }

  /* ⑥ Main area: full width block */
  .main {
    display: block !important;
    width: 100% !important;
    min-height: 100dvh;
    margin-left: 0 !important;
  }

  /* ⑦ Topbar: shifted right to not overlap hamburger */
  .topbar {
    padding: 14px 12px 0 66px !important;   /* 66px = hamburger 44px + gap */
    flex-wrap: wrap;
    gap: 8px;
    align-items: center !important;
  }

  /* ⑧ Content area */
  .content {
    padding: 12px 12px 20px !important;
    gap: 14px !important;
  }

  /* ⑨ KPI row: collapse to 1 col */
  .kpi-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* ⑩ Engine grids: 350px/420px fixed → responsive */
  div[style*="grid-template-columns: 350px"],
  div[style*="grid-template-columns: 420px"] {
    grid-template-columns: 1fr !important;
  }
  .engine-sidebar  { order: 2; }
  .report-display  { order: 1; }

  /* ⑪ 3/4-col grids → 2-col minimum */
  .krie-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
  .krie-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   PHONES  (< 768px)
───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* All grids → single column */
  .krie-grid-2,
  .krie-grid-3,
  .krie-grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Cards */
  .krie-card {
    padding: 1rem 0.9rem !important;
    border-radius: 12px;
  }

  /* Typography */
  h1 { font-size: 1.5rem !important; line-height: 1.2 !important; }
  h2 { font-size: 1.25rem !important; }
  h3 { font-size: 1.05rem !important; }

  /* Hero saving number */
  .saving-amount { font-size: 2rem !important; }

  /* Inputs — touch-friendly */
  .krie-input,
  .krie-select,
  .krie-textarea {
    font-size: 16px !important;     /* prevents iOS zoom-on-focus */
    padding: 0.75rem 0.85rem !important;
    min-height: 44px;
  }

  /* Buttons — full width & touch-friendly */
  .btn-krie-primary,
  .btn-krie-secondary {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.85rem 1rem !important;
    font-size: 0.95rem !important;
    min-height: 48px;
    box-sizing: border-box;
  }
  /* Exception: small utility buttons (badges, icon buttons) */
  button[style*="padding: 0.2"],
  button[style*="padding: 0.4"],
  a[style*="padding: 0.2"],
  a[style*="padding: 0.4"] {
    width: auto !important;
    min-height: unset !important;
  }

  /* Page header rows */
  div[style*="justify-content: space-between"][style*="align-items: flex-end"],
  div[style*="justify-content: space-between"][style*="align-items: center"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
  }

  /* Tables: horizontal scroll */
  .krie-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .krie-table th,
  .krie-table td {
    padding: 0.6rem 0.7rem !important;
    font-size: 0.8rem !important;
  }

  /* Inline tables in Finance Recharges */
  table[style*="width: 100%"] {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Topbar user info compact */
  .topbar-title h1 {
    font-size: 18px !important;
  }
  .topbar {
    padding: 14px 12px 0 66px !important;
    gap: 6px !important;
  }

  /* Modal → bottom sheet */
  div[style*="position: fixed"][style*="backdrop-filter"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  div[style*="position: fixed"][style*="backdrop-filter"] > div.krie-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 90dvh !important;
    overflow-y: auto;
  }

  /* Exchange rate widget: wrap */
  div[style*="display: flex"][style*="gap: 0.75rem"][style*="align-items: center"] {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  /* Tab bars: horizontal scroll (Command Center) */
  div[style*="border-bottom"][style*="display: flex"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }
  div[style*="border-bottom"][style*="display: flex"]::-webkit-scrollbar { display: none; }
}

/* ─────────────────────────────────────────────────────────────────
   SMALL PHONES  (< 480px)
───────────────────────────────────────────────────────────────── */
@media (max-width: 479px) {
  .user-info  { display: none !important; }
  .chevron    { display: none !important; }

  .krie-card {
    padding: 0.85rem 0.75rem !important;
  }

  .metric-label { font-size: 0.75rem; }
  .metric-value { font-size: 0.82rem; }

  .badge-krie {
    font-size: 0.68rem !important;
    padding: 0.2rem 0.45rem !important;
  }

  h1 { font-size: 1.3rem !important; }
}

/* ─────────────────────────────────────────────────────────────────
   iOS SAFE AREA (notch / home indicator)
───────────────────────────────────────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 1023px) {
    .content {
      padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important;
    }
    .sidebar {
      padding-top: max(30px, env(safe-area-inset-top));
    }
  }
}

/* ─────────────────────────────────────────────────────────────────
   PRINT
───────────────────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .sidebar-hamburger,
  .sidebar-overlay { display: none !important; }
  .main { width: 100% !important; }
  .content { padding: 0 !important; }
}

/* end of app.css */