/* LBB CMS — Design System */
:root {
  --sidebar-w: 272px;
  --header-h: 64px;
  --footer-h: 44px;
  --bg: #f4f6f9;
  --bg-accent: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --accent: #0f172a;
  --accent-soft: #f1f5f9;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 40px rgba(15,23,42,.10);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22,1,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; line-height: 1; user-select: none;
}
.material-symbols-outlined.icon-sm { font-size: 18px; }
.material-symbols-outlined.icon-md { font-size: 22px; }
.material-symbols-outlined.icon-lg { font-size: 28px; }
.material-symbols-outlined.icon-filled { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 50;
}
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.content { flex: 1; padding: 28px 32px 24px; max-width: 1360px; width: 100%; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.35);
  z-index: 45; opacity: 0; transition: opacity .2s var(--ease);
}
.sidebar-backdrop.visible { display: block; opacity: 1; }

/* Sidebar */
.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  border-radius: 12px;
  display: grid; place-items: center;
  box-shadow: 0 6px 16px rgba(37,99,235,.25);
}
.sidebar-brand-icon .material-symbols-outlined { font-size: 22px; color: #fff; }
.sidebar-brand-text h1 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.sidebar-brand-text p { margin: 0; font-size: 11px; color: var(--text-muted); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.nav-section { margin-top: 18px; margin-bottom: 8px; padding: 0 10px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-light);
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  transition: background .15s, color .15s, transform .15s;
}
.nav-link:hover { background: var(--accent-soft); color: var(--text); transform: translateX(2px); }
.nav-link.active {
  background: linear-gradient(135deg, var(--blue-soft) 0%, #f8fafc 100%);
  color: var(--blue); box-shadow: inset 0 0 0 1px rgba(37,99,235,.12);
}
.nav-link .icon { width: 20px; display: inline-flex; justify-content: center; }

.sidebar-user {
  padding: 16px; border-top: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(248,250,252,.8));
}
.sidebar-user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center;
  border: 1px solid rgba(37,99,235,.15);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; color: var(--text-light); text-transform: capitalize; }

/* Topbar */
.topbar {
  height: var(--header-h);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.topbar-eyebrow { display: block; font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-light); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.app-footer {
  height: var(--footer-h);
  border-top: 1px solid var(--border-light);
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-light);
  background: rgba(255,255,255,.7);
}
.app-footer-links { display: flex; align-items: center; gap: 16px; }
.app-footer-links a:hover { color: var(--blue); }

/* Page */
.page-header {
  margin-bottom: 28px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 15px; max-width: 560px; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-light); margin-bottom: 10px;
}
.breadcrumb .material-symbols-outlined { font-size: 14px; }

/* Grid */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-header h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 22px; }

.stat-card {
  padding: 22px; position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.08) 0%, transparent 70%);
  transform: translate(30%, -30%);
}
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
}
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat-meta { margin-top: 10px; font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 4px; }

/* Badges & Buttons */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: var(--accent-soft); color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: all .15s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.18); }
.btn-primary:hover { background: #1e293b; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }

.input, .select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.input-group { position: relative; }
.input-group .material-symbols-outlined {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); pointer-events: none;
}
.input-group .input { padding-left: 40px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 12px 18px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-light);
  border-bottom: 1px solid var(--border); background: #f8fafc;
}
table.data td { padding: 14px 18px; border-bottom: 1px solid var(--border-light); }
table.data tr:hover td { background: #fcfdff; }
table.data tr:last-child td { border-bottom: none; }

/* Lists & Alerts */
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.list-row:last-child { border-bottom: none; }
.list-row-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.list-row-sub { font-size: 12px; color: var(--text-light); }

.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px;
}
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid #a7f3d0; }
.alert-error { background: var(--red-soft); color: var(--red); border: 1px solid #fecaca; }

.quick-actions { display: grid; gap: 10px; }
.quick-action {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  transition: all .15s var(--ease);
}
.quick-action:hover { border-color: rgba(37,99,235,.25); background: var(--blue-soft); transform: translateX(2px); }
.quick-action-left { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 14px; }
.quick-action-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center;
}

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 8px; }
.bar-chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-chart .bar {
  width: 100%; max-width: 42px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 8px 8px 4px 4px; min-height: 6px;
  transition: transform .15s var(--ease);
}
.bar-chart .bar:hover { transform: scaleY(1.03); transform-origin: bottom; }
.bar-chart .bar-label { font-size: 11px; color: var(--text-light); font-weight: 600; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state-icon { color: var(--text-light); margin-bottom: 12px; }
.empty-state h3 { margin: 0 0 8px; font-size: 16px; color: var(--text); }

.stagger-item { opacity: 0; transform: translateY(14px); transition: all .45s var(--ease); }
.stagger-item.visible { opacity: 1; transform: translateY(0); }

/* Auth & Public */
.auth-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--bg-accent);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.8); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 40px 36px;
}
.auth-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  border-radius: 16px; display: grid; place-items: center;
  margin: 0 auto 22px; box-shadow: 0 10px 24px rgba(37,99,235,.28);
}
.auth-logo .material-symbols-outlined { font-size: 28px; color: #fff; }
.auth-title { text-align: center; margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.auth-subtitle { text-align: center; margin: 0 0 28px; color: var(--text-muted); font-size: 14px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-light); }
.auth-footer a { color: var(--blue); font-weight: 600; }

.public-page {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: var(--bg-accent);
}
.public-card {
  width: 100%; max-width: 520px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); padding: 36px;
}
.public-brand-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  border-radius: 16px; display: grid; place-items: center;
  margin: 0 auto 16px; box-shadow: 0 10px 24px rgba(37,99,235,.28);
}
.public-brand-icon .material-symbols-outlined { font-size: 28px; color: #fff; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.up { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-dot.down { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.check-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 12px;
  background: #f8fafc; border: 1px solid var(--border-light); margin-bottom: 8px;
}

.mobile-only { display: none; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-105%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; }
  .mobile-only { display: inline-grid; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
