/* ── Variables ─────────────────────────────────────────── */
:root {
  --primary: #2c3e50;
  --primary-light: #34495e;
  --accent: #3498db;
  --accent-hover: #2980b9;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #17a2b8;
  --text: #2d3436;
  --text-muted: #636e72;
  --border: #dee2e6;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --sidebar-w: 240px;
  --header-h: 60px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,.14);
  --transition: .2s ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button { cursor: pointer; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 12px; font-weight: 600; color: var(--primary); }
p { margin: 0 0 8px; }
ul, ol { margin: 0; padding-left: 20px; }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo h2 {
  color: #fff;
  font-size: 16px;
  margin: 0 0 4px;
  line-height: 1.2;
}
.sidebar-logo span {
  color: rgba(255,255,255,.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: rgba(255,255,255,.75);
  font-size: 13.5px;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav a.active { color: #fff; background: rgba(255,255,255,.12); border-left-color: var(--accent); }
.sidebar-nav a .nav-icon { width: 18px; text-align: center; font-size: 16px; flex-shrink: 0; }
.sidebar-nav .nav-section {
  padding: 14px 18px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(255,255,255,.35);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.6); font-size: 13px; padding: 6px 0;
}
.sidebar-footer a:hover { color: #fff; }

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

/* Top header */
.top-header {
  height: var(--header-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-header .page-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin: 0;
}
.top-header .header-actions { display: flex; align-items: center; gap: 10px; }

/* Page container */
.page { padding: 24px; flex: 1; display: none; }
.page.active { display: block; }

/* Auth screen */
#auth-screen {
  position: fixed; inset: 0;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card p { color: var(--text-muted); margin-bottom: 24px; font-size: 13px; }
