/* ═══════════════════════════════════════
   LAYOUT — Prenoty Vetrina
   Sidebar, Header, Navbar, Grid, Responsive
   ═══════════════════════════════════════ */

/* ═══ ADMIN LAYOUT ═══ */
.app { display: flex; min-height: 100vh; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 100;
  transition: transform .3s var(--ease);
  overflow-y: auto; overflow-x: hidden;
}
/* Sidebar stays dark even in light mode */
[data-theme="light"] .sidebar {
  background: #1C2434;
  border-right-color: rgba(255,255,255,.08);
}
[data-theme="light"] .sidebar .nav-item { color: #8A99AF; }
[data-theme="light"] .sidebar .nav-item:hover { color: #DEE4EE; background: rgba(255,255,255,.04); }
[data-theme="light"] .sidebar .nav-item.active { color: #fff; background: rgba(70,95,255,.15); }
[data-theme="light"] .sidebar .nav-section-label { color: #5B6B82; }
[data-theme="light"] .sidebar .sidebar-brand-name { color: #fff; }
[data-theme="light"] .sidebar .sidebar-brand-sub { color: #8A99AF; }
[data-theme="light"] .sidebar .sidebar-user-name { color: #DEE4EE; }
[data-theme="light"] .sidebar .sidebar-user-role { color: #8A99AF; }
[data-theme="light"] .sidebar .sidebar-footer { border-top-color: rgba(255,255,255,.08); }
[data-theme="light"] .sidebar .sidebar-header { border-bottom-color: rgba(255,255,255,.08); }

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--grad-brand);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}
.sidebar-brand { display: flex; flex-direction: column; }
.sidebar-brand-name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.sidebar-brand-sub { font-size: .75rem; color: var(--text-tertiary); font-weight: 400; }

/* Navigation */
.sidebar-nav { padding: 12px; flex: 1; }
.nav-section { margin-bottom: 24px; }
.nav-section-label {
  padding: 0 12px; margin-bottom: 8px;
  font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted);
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r-md);
  font-size: .9rem; font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
  cursor: pointer; position: relative; margin-bottom: 2px;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-4); }
.nav-item.active { color: var(--text-primary); background: var(--accent-muted); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.nav-label { flex: 1; white-space: nowrap; }
.nav-badge {
  font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--r-full);
  background: var(--accent); color: #fff;
  min-width: 20px; text-align: center;
}
.nav-tag {
  font-size: .6rem; font-weight: 700;
  padding: 2px 6px; border-radius: var(--r-sm);
  background: var(--grad-brand); color: #fff;
  text-transform: uppercase; letter-spacing: .05em;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: var(--r-full);
  background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0; color: #fff;
}
.sidebar-user-name { font-weight: 600; font-size: .85rem; }
.sidebar-user-role { font-size: .7rem; color: var(--text-tertiary); }
.sidebar-logout {
  margin-left: auto;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); transition: all .2s; font-size: .9rem;
}
.sidebar-logout:hover { background: var(--error-muted); color: var(--error); }

/* ═══ MAIN CONTENT ═══ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

/* Topbar */
.topbar {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 32px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(12,12,15,.8);
}
[data-theme="light"] .topbar { background: rgba(255,255,255,.9); border-bottom-color: #E2E8F0; }
.topbar-left { display: flex; align-items: center; gap: 16px; flex: 1; }
.topbar-title { font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-tertiary); }
.topbar-breadcrumb span { color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all .2s;
  font-size: 1rem; position: relative;
  border: 1px solid var(--border); background: var(--bg-3);
}
.topbar-btn:hover { background: var(--bg-4); color: var(--text-primary); border-color: var(--border-hover); }
.topbar-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--error); border: 2px solid var(--bg-1);
}
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-lg); font-size: .85rem; color: var(--text-tertiary);
  transition: all .2s; cursor: pointer; min-width: 260px;
}
.topbar-search:hover { border-color: var(--border-hover); }
.topbar-search kbd {
  font-family: var(--font); font-size: .7rem;
  padding: 2px 6px; border-radius: var(--r-xs);
  background: var(--bg-5); color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Content area */
.content { padding: 32px; flex: 1; }
.content-section { display: none; }
.content-section.active { display: block; animation: fadeUp .4s var(--ease) both; }

/* ═══ LANDING NAVBAR ═══ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: all .3s var(--ease);
}
.navbar.scrolled {
  background: rgba(12,12,15,.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .navbar.scrolled {
  background: rgba(255,255,255,.88);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 100%; padding: 12px 32px;
}
.navbar-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.1rem;
}
.navbar-logo-icon {
  width: 32px; height: 32px;
  background: var(--grad-brand);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.navbar-links {
  display: flex; align-items: center; gap: 24px;
}
.navbar-links a {
  font-size: .82rem; font-weight: 500; color: var(--text-secondary);
  transition: color .2s;
}
.navbar-links a:hover { color: var(--text-primary); }
.navbar-actions { display: flex; align-items: center; gap: 10px; }
.navbar-mobile-btn {
  display: none; width: 36px; height: 36px;
  border-radius: var(--r-md); border: 1px solid var(--border);
  align-items: center; justify-content: center; font-size: 1.2rem;
}

/* Mobile nav overlay */
.mobile-nav {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.8); backdrop-filter: blur(8px);
}
.mobile-nav.open { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.mobile-nav a {
  font-size: 1.2rem; font-weight: 600; color: var(--text-primary);
  padding: 12px 40px; border-radius: var(--r-md);
  transition: background .2s;
}
.mobile-nav a:hover { background: var(--bg-3); }

/* ═══ CHART LAYOUTS ═══ */
.chart-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-bar-container { height: 220px; display: flex; align-items: flex-end; gap: 8px; padding: 8px 0; }
.chart-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart-bar {
  width: 100%; max-width: 32px; border-radius: 6px 6px 2px 2px;
  background: var(--accent); min-height: 3px;
  transition: all .3s var(--ease); position: relative;
  animation: barGrow .8s var(--ease) both;
}
.chart-bar:hover { opacity: .8; }
.chart-bar-val { font-size: .68rem; font-weight: 600; font-family: var(--font-mono); color: var(--text-secondary); }
.chart-bar-label { font-size: .68rem; color: var(--text-muted); }

/* Donut */
.donut-container { display: flex; align-items: center; gap: 28px; justify-content: center; flex-wrap: wrap; }
.donut-svg { width: 160px; height: 160px; transform: rotate(-90deg); }
.donut-svg circle { transition: stroke-dasharray 1s var(--ease), stroke-dashoffset 1s var(--ease); }
.donut-center { font-size: 1.3rem; font-weight: 800; font-family: var(--font-mono); }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-val { font-weight: 700; font-family: var(--font-mono); margin-left: auto; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar-search { display: none; }
  .content { padding: 20px 16px; }
  #menu-btn { display: flex !important; }
  .navbar-links { display: none; }
  .navbar-mobile-btn { display: flex; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
}
