/* ═══════════════════════════════════════════════════════════════════════════
   AbaPatch — Design System
   Paleta: #bd2629 · #942124 · #231f20 · #4b4844 · #ffffff
   Tipografia: Montserrat (títulos) + System-UI (corpo/tabelas)
═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&display=swap');

/* ─── CSS Custom Properties — Light Theme ──────────────────────────────── */
:root,
.theme-light {
  --primary:       #bd2629;
  --primary-dark:  #942124;
  --primary-light: #d44144;
  --primary-xlight:#fce8e8;
  --neutral-dark:  #231f20;
  --neutral-mid:   #4b4844;
  --neutral-light: #7a7674;
  --bg-app:        #f0f2f5;
  --bg-sidebar:    #231f20;
  --bg-card:       #ffffff;
  --bg-header:     #ffffff;
  --bg-hover:      #f8f9fa;
  --bg-input:      #f5f6fa;
  --border:        #e2e5ea;
  --border-light:  #eef0f4;
  --text-primary:  #1a1a2e;
  --text-secondary:#4b4844;
  --text-muted:    #7a7674;
  --text-sidebar:  rgba(255,255,255,0.75);
  --text-sidebar-active: #ffffff;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.12);
  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --sidebar-w:     250px;
  --sidebar-collapsed: 68px;
  --topbar-h:      62px;
  --transition:    0.22s cubic-bezier(.4,0,.2,1);
  --font-head:     'Montserrat', 'Segoe UI', sans-serif;
  --font-body:     'Gotham', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --success:       #1a7f4e;
  --success-light: #e6f7ef;
  --warning:       #d97706;
  --warning-light: #fef3cd;
  --danger:        #bd2629;
  --danger-light:  #fce8e8;
  --info:          #1565c0;
  --info-light:    #e3f0fd;
}

/* ─── Dark Theme ────────────────────────────────────────────────────────── */
.theme-dark {
  --primary:       #d44144;
  --primary-dark:  #bd2629;
  --primary-light: #e66567;
  --primary-xlight:#3a1415;
  --neutral-dark:  #e8e6e5;
  --neutral-mid:   #b0ada9;
  --bg-app:        #0f1117;
  --bg-sidebar:    #161820;
  --bg-card:       #1c1f2a;
  --bg-header:     #1c1f2a;
  --bg-hover:      #252834;
  --bg-input:      #252834;
  --border:        #2e3244;
  --border-light:  #252834;
  --text-primary:  #e8e6f0;
  --text-secondary:#b0ada9;
  --text-muted:    #6b6875;
  --text-sidebar:  rgba(255,255,255,0.65);
  --text-sidebar-active: #ffffff;
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.4);
  --success:       #34c27e;
  --success-light: #0d2a1c;
  --warning:       #f59e0b;
  --warning-light: #2a1e05;
  --danger:        #d44144;
  --danger-light:  #3a1415;
  --info:          #4d9cf5;
  --info-light:    #0d1f3c;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-app);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ─── Typography ────────────────────────────────────────────────────────── */
h1, h2, h3, .metric-value, .section-title, .brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

/* ═══ SIDEBAR ═══════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--transition);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span:not(.nav-badge),
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-details { display: none; }
.sidebar.collapsed .sidebar-toggle-btn i { transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0 10px; }
.sidebar.collapsed .nav-item i { margin-right: 0; font-size: 1.1rem; }
.sidebar.collapsed .brand-icon { margin-right: 0; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0 10px; }
.sidebar.collapsed .sidebar-toggle-btn { margin-left: 0; }
.sidebar.collapsed .user-info { justify-content: center; }
.sidebar.collapsed .user-avatar { margin-right: 0; }

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 0 18px;
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  gap: 10px;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(189,38,41,0.4);
}
.brand-text { flex: 1; min-width: 0; }
.brand-name {
  display: block;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.brand-sub {
  display: block;
  color: rgba(255,255,255,0.45);
  font-size: 0.65rem;
  white-space: nowrap;
  margin-top: 2px;
}
.sidebar-toggle-btn {
  margin-left: auto;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.sidebar-toggle-btn:hover { background: rgba(255,255,255,0.14); color: white; }
.sidebar-toggle-btn i { transition: transform var(--transition); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nav-section-label {
  font-family: var(--font-head);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.3);
  padding: 12px 20px 4px;
  white-space: nowrap;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 40px;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition);
  position: relative;
}
.nav-item i { width: 20px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(189,38,41,0.85), rgba(148,33,36,0.6));
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(189,38,41,0.3);
}
.nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: rgba(255,255,255,0.15);
  color: white;
  border-radius: 9px;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
}
.nav-badge.danger { background: var(--primary); }
.nav-badge.warning { background: var(--warning); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.user-info:hover { background: rgba(255,255,255,0.05); }
.user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-family: var(--font-head);
  font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}
.user-name { display: block; color: white; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.user-role { display: block; color: rgba(255,255,255,0.4); font-size: 0.65rem; white-space: nowrap; }

/* ═══ MAIN WRAPPER & TOPBAR ═════════════════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
  transition: margin-left var(--transition);
}
.main-wrapper.expanded { margin-left: var(--sidebar-collapsed); }

.topbar {
  position: sticky; top: 0;
  height: var(--topbar-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.mobile-menu-btn {
  display: none; width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-secondary);
  align-items: center; justify-content: center; font-size: 0.95rem;
}
.breadcrumb { font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.breadcrumb .current { color: var(--text-primary); }

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 12px; height: 36px;
  transition: all var(--transition);
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(189,38,41,0.1); }
.search-bar i { color: var(--text-muted); font-size: 0.8rem; }
.search-bar input { border: none; background: none; outline: none; color: var(--text-primary); font-size: 0.82rem; width: 220px; }
.search-bar input::placeholder { color: var(--text-muted); }

.topbar-btn {
  position: relative; width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; transition: all var(--transition);
}
.topbar-btn:hover { background: var(--primary-xlight); color: var(--primary); border-color: var(--primary); }
.notification-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--primary); color: white; border-radius: 50%;
  font-size: 0.58rem; font-weight: 700; font-family: var(--font-head);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-header);
}

/* ═══ PAGE CONTENT ══════════════════════════════════════════════════════════ */
.page-content { flex: 1; padding: 24px; overflow-y: auto; }

.loading-spinner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 300px; gap: 16px; color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 16px; height: 36px; border-radius: var(--radius-sm);
  font-family: var(--font-head); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.02em; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(189,38,41,0.3); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(189,38,41,0.4); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(189,38,41,0.2); }
.btn-danger:hover { background: var(--primary); color: white; }
.btn-success { background: var(--success-light); color: var(--success); border: 1px solid rgba(26,127,78,0.2); }
.btn-success:hover { background: var(--success); color: white; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 0.72rem; }
.btn-icon { width: 36px; padding: 0; justify-content: center; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: all var(--transition); }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--border-light); }
.card-title { font-family: var(--font-head); font-size: 0.9rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary); font-size: 0.85rem; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }

/* ─── KPI / Metric Cards ─────────────────────────────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden; transition: all var(--transition); cursor: pointer;
}
.metric-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--m-color, var(--primary)); }
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--m-color, var(--primary)); }
.metric-card .card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--m-bg, var(--primary-xlight)); color: var(--m-color, var(--primary)); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; align-self: flex-start; }
.metric-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-family: var(--font-head); }
.metric-value { font-size: 2rem; font-weight: 800; color: var(--text-primary); line-height: 1; font-family: var(--font-head); }
.metric-delta { font-size: 0.72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.metric-delta.up { color: var(--success); }
.metric-delta.down { color: var(--danger); }
.metric-delta.neutral { color: var(--text-muted); }

/* ─── Charts Grid ────────────────────────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.charts-grid .col-2 { grid-column: span 2; }
.chart-container { position: relative; height: 220px; }

/* ─── Risk Gauge ─────────────────────────────────────────────────────────── */
.risk-gauge { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; height: 220px; }
.risk-score { font-family: var(--font-head); font-size: 3.5rem; font-weight: 900; line-height: 1; }
.risk-score.high { color: var(--danger); }
.risk-label { font-size: 0.8rem; font-weight: 600; font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.risk-bar-wrap { width: 100%; max-width: 200px; }
.risk-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.risk-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--success) 0%, var(--warning) 50%, var(--danger) 100%); }
.risk-breakdown { display: flex; gap: 8px; margin-top: 4px; }
.rb-item { display: flex; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-head); font-weight: 600; }
.rb-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
thead th {
  background: var(--bg-input); padding: 10px 14px; text-align: left;
  font-family: var(--font-head); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted);
  white-space: nowrap; border-bottom: 2px solid var(--border); position: sticky; top: 0;
}
tbody tr { border-bottom: 1px solid var(--border-light); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 10px 14px; color: var(--text-secondary); vertical-align: middle; }
.td-name { font-weight: 600; color: var(--text-primary); font-family: var(--font-head); font-size: 0.8rem; }
.td-mono { font-family: 'Courier New', monospace; font-size: 0.75rem; background: var(--bg-input); padding: 2px 6px; border-radius: 4px; color: var(--text-secondary); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-family: var(--font-head); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-danger  { background: var(--danger-light);  color: var(--danger);  }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-info    { background: var(--info-light);    color: var(--info);    }
.badge-neutral { background: var(--bg-input);      color: var(--text-muted); }

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(.4,0,.2,1); }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger  { background: var(--danger);  }
.progress-fill.primary { background: var(--primary); }

/* ─── Filters / Toolbar ──────────────────────────────────────────────────── */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-input { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); font-size: 0.78rem; outline: none; transition: all var(--transition); min-width: 0; }
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(189,38,41,0.08); }
.filter-input::placeholder { color: var(--text-muted); }

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-item { padding: 8px 16px; font-family: var(--font-head); font-size: 0.78rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-count { background: var(--primary-xlight); color: var(--primary); border-radius: 10px; padding: 1px 6px; font-size: 0.62rem; font-weight: 700; }

/* ─── Type Icon ──────────────────────────────────────────────────────────── */
.type-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; }
.type-icon.servidor { background: #e3f0fd; color: #1565c0; }
.type-icon.switch    { background: #f3e8ff; color: #7c3aed; }
.type-icon.desktop   { background: #e6f7ef; color: #1a7f4e; }
.type-icon.notebook  { background: #fff8e6; color: #d97706; }
.type-icon.vm        { background: var(--danger-light); color: var(--danger); }

/* ─── Criticality ────────────────────────────────────────────────────────── */
.crit-indicator { display: inline-flex; align-items: center; gap: 5px; font-size: 0.72rem; font-weight: 600; font-family: var(--font-head); }
.crit-indicator::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.crit-critical::before { background: var(--danger); }
.crit-high::before     { background: var(--warning); }
.crit-medium::before   { background: var(--info); }
.crit-low::before      { background: var(--success); }
.crit-critical { color: var(--danger); }
.crit-high     { color: var(--warning); }
.crit-medium   { color: var(--info); }
.crit-low      { color: var(--success); }

/* ─── Image Cards ────────────────────────────────────────────────────────── */
.image-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.image-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all var(--transition); cursor: pointer; }
.image-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-2px); }
.image-card-header { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border-light); }
.image-os-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.image-card-body { padding: 14px 16px; }
.image-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.image-meta-label { font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 2px; }
.image-meta-value { font-size: 0.78rem; color: var(--text-primary); font-weight: 500; }
.image-software-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.software-tag { background: var(--bg-input); color: var(--text-secondary); padding: 2px 8px; border-radius: 4px; font-size: 0.65rem; font-weight: 500; border: 1px solid var(--border); }
.image-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--bg-input); border-top: 1px solid var(--border-light); }

/* ─── Settings ───────────────────────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 600; color: var(--text-primary); font-size: 0.82rem; margin-bottom: 2px; }
.setting-desc { font-size: 0.72rem; color: var(--text-muted); }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 11px; transition: background var(--transition); }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform var(--transition); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 600px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; animation: modalIn 0.22s cubic-bezier(.4,0,.2,1); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 700; }
.modal-close { width: 30px; height: 30px; border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; transition: all var(--transition); }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); }

/* ─── Detail Grid ────────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-label { font-family: var(--font-head); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 3px; }
.detail-value { font-size: 0.82rem; color: var(--text-primary); font-weight: 500; }

/* ─── Alert Banner ───────────────────────────────────────────────────────── */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 0.8rem; margin-bottom: 16px; }
.alert i { font-size: 0.9rem; margin-top: 1px; flex-shrink: 0; }
.alert-danger  { background: var(--danger-light);  border-color: rgba(189,38,41,0.2); color: var(--danger);  }
.alert-warning { background: var(--warning-light); border-color: rgba(217,119,6,0.2);  color: var(--warning); }
.alert-success { background: var(--success-light); border-color: rgba(26,127,78,0.2);  color: var(--success); }
.alert-info    { background: var(--info-light);    border-color: rgba(21,101,192,0.2); color: var(--info);    }

/* ─── Compliance Ring ────────────────────────────────────────────────────── */
.compliance-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.compliance-ring svg { transform: rotate(-90deg); }
.compliance-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.compliance-pct { font-family: var(--font-head); font-size: 1.4rem; font-weight: 900; color: var(--text-primary); line-height: 1; }
.compliance-sub { font-size: 0.6rem; color: var(--text-muted); font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; text-align: center; color: var(--text-muted); gap: 12px; }
.empty-state i { font-size: 2.5rem; opacity: 0.3; }
.empty-state h3 { font-family: var(--font-head); font-size: 0.95rem; color: var(--text-secondary); }

/* ─── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-mid); }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.stock-bar-wrap { min-width: 80px; }
.stock-labels { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); margin-bottom: 3px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid .col-2 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper, .main-wrapper.expanded { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .charts-grid { grid-template-columns: 1fr; }
  .charts-grid .col-2 { grid-column: span 1; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .search-bar input { width: 140px; }
}
@media (max-width: 600px) {
  .page-content { padding: 16px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
}
