/* ============================================================
   Asset Manager — Sleek Dark Theme v2
   Animations, glow effects, smooth transitions
   ============================================================ */

:root {
  --bg:          #080810;
  --surface:     #0f0f1a;
  --card:        #161622;
  --card-hover:  #1c1c2e;
  --border:      #232338;
  --border-bright: #2e2e50;
  --accent:      #6366f1;
  --accent-h:    #818cf8;
  --accent-glow: rgba(99,102,241,0.25);
  --text:        #e8e8f4;
  --text-sec:    #7878a0;
  --text-muted:  #45455f;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --error:       #ef4444;
  --info:        #38bdf8;
  --sidebar-w:   230px;
  --header-h:    64px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --transition:  0.18s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ══════════════════════════════════════════════════════════
   LOGIN SCREEN
══════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  top: -150px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: #8b5cf6;
  bottom: -100px; right: -80px;
  animation-delay: -3s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: #06b6d4;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -5s;
  opacity: 0.08;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-15px, 25px) scale(0.97); }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(22, 22, 34, 0.85);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
  animation: loginCardIn 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.login-logo-icon {
  font-size: 36px;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.login-logo-text {
  display: flex;
  flex-direction: column;
}

.login-logo-text span:first-child {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.login-tagline {
  font-size: 12px !important;
  color: var(--text-sec) !important;
  font-weight: 400 !important;
}

.login-form { display: flex; flex-direction: column; gap: 16px; }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; color: var(--text-sec);
  font-size: 14px; padding: 4px;
  transition: color var(--transition);
}
.pw-toggle:hover { color: var(--text); }

.btn-login {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.btn-login:hover { box-shadow: 0 6px 28px rgba(99,102,241,0.45); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.login-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--error);
  font-size: 13px;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  animation: appFadeIn 0.4s ease forwards;
}

@keyframes appFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-logo .logo-icon {
  font-size: 20px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-sec);
  transition: background var(--transition), color var(--transition), transform var(--transition);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-glow);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius);
}

.nav-item:hover { color: var(--text); transform: translateX(2px); }
.nav-item:hover::before { opacity: 0.5; }

.nav-item.active {
  background: rgba(99,102,241,0.12);
  color: var(--accent-h);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

.nav-item.active::before { opacity: 0; }

.nav-icon { font-size: 15px; flex-shrink: 0; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-sec);
}

/* ── Main Area ─────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.header-subtitle { font-size: 12px; color: var(--text-sec); margin-top: 1px; }

.header-right { display: flex; align-items: center; gap: 12px; }

/* ── Content ───────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

/* ── Views ─────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: viewIn 0.25s ease forwards; }

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

/* ══════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-bright);
}

/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.3;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.stat-card:hover::after { transform: scaleX(1); }

.stat-card.total         { color: var(--accent-h); }
.stat-card.active        { color: var(--success); }
.stat-card.maintenance   { color: var(--warning); }
.stat-card.decommissioned{ color: var(--text-sec); }
.stat-card:not([class*=" "]):last-child { color: var(--info); }

.stat-card .stat-label { font-size: 11px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.6px; }
.stat-card .stat-value { font-size: 34px; font-weight: 800; line-height: 1; color: var(--text); }
.stat-card .stat-icon  { font-size: 22px; }

/* ── Dashboard grid ────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Charts ────────────────────────────────────────────────── */
.chart-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }

.chart-row { display: flex; align-items: center; gap: 14px; }
.chart-label { width: 110px; font-size: 12.5px; color: var(--text-sec); display: flex; align-items: center; gap: 6px; }
.chart-bar-wrap {
  flex: 1; height: 22px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  overflow: hidden;
}
.chart-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-h));
  border-radius: 6px;
  width: 0%;
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 10px var(--accent-glow);
}
.chart-count { width: 28px; text-align: right; font-size: 13px; font-weight: 700; color: var(--text); }

/* Status rings */
.status-rings { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.status-ring-row { display: flex; align-items: center; justify-content: space-between; }
.status-ring-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-ring-count { font-weight: 700; font-size: 15px; }

/* ── Section header ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title { font-size: 15px; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; }

thead th {
  background: rgba(255,255,255,0.02);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition), transform var(--transition);
  animation: rowIn 0.3s ease both;
}

/* Stagger animation for table rows */
tbody tr:nth-child(1) { animation-delay: 0.03s; }
tbody tr:nth-child(2) { animation-delay: 0.06s; }
tbody tr:nth-child(3) { animation-delay: 0.09s; }
tbody tr:nth-child(4) { animation-delay: 0.12s; }
tbody tr:nth-child(5) { animation-delay: 0.15s; }
tbody tr:nth-child(n+6) { animation-delay: 0.18s; }

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

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(99,102,241,0.04); }

tbody td { padding: 13px 16px; vertical-align: middle; }

.asset-name { font-weight: 600; cursor: pointer; transition: color var(--transition); }
.asset-name:hover { color: var(--accent-h) !important; }
.asset-hostname { font-size: 11.5px; color: var(--text-sec); margin-top: 2px; }

/* ── Skeleton loading ──────────────────────────────────────── */
.skeleton-row { padding: 16px !important; }
.skeleton {
  height: 14px;
  background: linear-gradient(90deg, var(--border) 25%, var(--border-bright) 50%, var(--border) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s infinite;
}

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

/* ══════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-active        { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-inactive      { background: rgba(120,120,160,0.1); color: var(--text-sec); border: 1px solid rgba(120,120,160,0.2); }
.badge-maintenance   { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-decommissioned{ background: rgba(239,68,68,0.10);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

.badge-cpu        { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }
.badge-ram        { background: rgba(34,197,94,0.12);  color: #86efac; border: 1px solid rgba(34,197,94,0.2); }
.badge-gpu        { background: rgba(245,158,11,0.12); color: #fde68a; border: 1px solid rgba(245,158,11,0.2); }
.badge-storage    { background: rgba(239,68,68,0.10);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }
.badge-motherboard{ background: rgba(120,120,160,0.12); color: #c4c4e0; border: 1px solid rgba(120,120,160,0.2); }
.badge-psu        { background: rgba(34,197,94,0.08);  color: #6ee7b7; border: 1px solid rgba(34,197,94,0.15); }
.badge-case       { background: rgba(99,102,241,0.08); color: #c7d2fe; border: 1px solid rgba(99,102,241,0.15); }
.badge-cooling    { background: rgba(56,189,248,0.10); color: #7dd3fc; border: 1px solid rgba(56,189,248,0.2); }
.badge-network    { background: rgba(245,158,11,0.08); color: #fcd34d; border: 1px solid rgba(245,158,11,0.15); }
.badge-other      { background: rgba(120,120,160,0.10); color: var(--text-sec); border: 1px solid rgba(120,120,160,0.15); }

/* ══════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Ripple effect */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.2), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn:active::after { opacity: 1; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border-bright);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.09);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.4);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sec);
  border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
}

.btn-sm { padding: 5px 12px; font-size: 12px; }

.action-group { display: flex; gap: 6px; align-items: center; }

/* ══════════════════════════════════════════════════════════
   INPUTS
══════════════════════════════════════════════════════════ */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-sec);
  pointer-events: none;
  font-size: 13px;
}

input[type="text"],
input[type="date"],
input[type="search"],
input[type="password"],
select,
textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  width: 100%;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus,
input[type="date"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
  background: rgba(255,255,255,0.06);
}

.search-field { padding-left: 38px; }

select option { background: #1a1a28; }
textarea { resize: vertical; min-height: 80px; }
.filter-group { display: flex; gap: 8px; }
.filter-group select { width: auto; }

/* ══════════════════════════════════════════════════════════
   ASSET DETAIL
══════════════════════════════════════════════════════════ */
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.detail-actions { display: flex; gap: 10px; }

.detail-header-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 4px;
}

.detail-type-icon {
  font-size: 44px;
  filter: drop-shadow(0 0 16px var(--accent-glow));
  animation: iconPop 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes iconPop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.detail-field label {
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  display: block;
  margin-bottom: 5px;
}

.detail-field .field-value { font-size: 14px; }
.detail-field .field-empty { color: var(--text-muted); font-style: italic; }

/* ── Hardware section ──────────────────────────────────────── */
.hw-category { margin-bottom: 20px; }
.hw-category-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-sec);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  animation: hwCardIn 0.3s ease both;
}

.hw-card:hover {
  border-color: var(--border-bright);
  background: rgba(255,255,255,0.035);
  transform: translateX(3px);
}

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

.hw-card-info { flex: 1; }
.hw-card-name { font-weight: 600; margin-bottom: 4px; }
.hw-card-meta { font-size: 12px; color: var(--text-sec); line-height: 1.6; }
.hw-card-actions { display: flex; gap: 6px; flex-shrink: 0; margin-top: 2px; }

/* ══════════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(6px);
  animation: overlayIn 0.2s ease forwards;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.25s cubic-bezier(0.34,1.2,0.64,1) forwards;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(-12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 26px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title { font-size: 16px; font-weight: 700; }

.modal-close {
  background: none; border: none;
  color: var(--text-sec); cursor: pointer;
  font-size: 18px; padding: 5px 8px;
  border-radius: 8px;
  transition: all var(--transition);
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.07); }

.modal-body { padding: 20px 26px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Form ──────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11.5px; font-weight: 500; color: var(--text-sec); letter-spacing: 0.2px; }
.form-group.full { grid-column: 1 / -1; }

.form-error { color: var(--error); font-size: 12px; margin-top: 8px; display: none; }
.form-error.show { display: block; animation: shake 0.4s ease; }

/* ══════════════════════════════════════════════════════════
   SETTINGS
══════════════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.settings-card { transition: transform var(--transition), box-shadow var(--transition); }
.settings-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.settings-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.settings-card-title { font-size: 15px; font-weight: 600; }
.settings-card-sub   { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

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

.color-presets { display: flex; gap: 7px; flex-wrap: wrap; }
.color-preset {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}
.color-preset:hover { transform: scale(1.2); }
.color-preset.selected { border-color: var(--text); }

.settings-info-row {
  display: flex;
  gap: 20px;
}

.info-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  flex: 1;
}

.info-value { font-size: 28px; font-weight: 800; }
.info-label { font-size: 11px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.sys-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.sys-info-item {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sys-label { font-size: 12px; color: var(--text-sec); }
.sys-val   { font-size: 12.5px; font-weight: 500; }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-sec);
}
.empty-state .empty-icon { font-size: 52px; margin-bottom: 14px; opacity: 0.7; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state .empty-sub   { font-size: 13px; margin-bottom: 22px; }

/* ══════════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 13px 18px;
  font-size: 13px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: toastIn 0.3s cubic-bezier(0.34,1.2,0.64,1) forwards;
  backdrop-filter: blur(10px);
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--accent); }

.toast-icon { font-size: 16px; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(30px) scale(0.9); }
}

/* ══════════════════════════════════════════════════════════
   SPINNER
══════════════════════════════════════════════════════════ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   UTILS
══════════════════════════════════════════════════════════ */
.hidden { display: none !important; }

/* ── Counter animation ──── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .form-grid     { grid-template-columns: 1fr; }
  .detail-grid   { grid-template-columns: 1fr; }
  .stats-grid    { grid-template-columns: 1fr 1fr; }
  .content       { padding: 16px; }
  .top-header    { padding: 0 16px; }
  :root { --sidebar-w: 200px; }
}
