/* === DESIGN TOKENS === */
:root {
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #242424;
  --bg-card: #1e1e1e;
  --bg-card-hover: #262626;
  --bg-input: #2a2a2a;
  --border: #333;
  --border-light: #444;
  --text-primary: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --fire-50: #fff7ed;
  --fire-100: #ffedd5;
  --fire-200: #fed7aa;
  --fire-300: #fdba74;
  --fire-400: #fb923c;
  --fire-500: #f97316;
  --fire-600: #ea580c;
  --fire-700: #c2410c;
  --fire-800: #9a3412;
  --fire-900: #7c2d12;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --red-400: #f87171;
  --red-500: #ef4444;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(249,115,22,.15);
  --transition: 200ms ease;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--fire-400); text-decoration: none; }
a:hover { color: var(--fire-300); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--fire-500);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
textarea { resize: vertical; min-height: 80px; }

/* === LAYOUT === */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar.hidden { transform: translateX(-100%); }
.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-close { display: none; background: none; border: none; color: var(--text-secondary); font-size: 1.2rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand-icon { font-size: 1.5rem; }
.brand-text { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.brand-accent { color: var(--fire-500); }
.brand-icon-sm { font-size: 1.2rem; }
.brand-text-sm { font-size: 1rem; font-weight: 700; }

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem 1.5rem 0.4rem;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-item.active {
  color: var(--fire-400);
  background: rgba(249,115,22,.08);
  border-left-color: var(--fire-500);
}
.nav-item .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--fire-600);
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.user-info {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.user-info .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fire-600), var(--amber-500));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: white; flex-shrink: 0;
}
.user-info .user-name { font-size: 0.85rem; font-weight: 600; }
.user-info .user-role { font-size: 0.7rem; color: var(--text-muted); }
.btn-logout {
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: all var(--transition);
}
.btn-logout:hover { border-color: var(--red-500); color: var(--red-400); }

.main-content {
  flex: 1;
  margin-left: 0;
  transition: margin-left 0.3s ease;
}
.main-content.with-sidebar { margin-left: 260px; }

.top-bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,15,15,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.top-bar.hidden { display: none; }
.hamburger {
  display: none;
  background: none; border: none;
  color: var(--text-primary); font-size: 1.4rem;
}
.top-bar-brand { display: none; }
.top-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.notif-btn {
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  position: relative;
  padding: 0.3rem;
  transition: color var(--transition);
}
.notif-btn:hover { color: var(--text-primary); }
.notif-badge {
  position: absolute; top: -4px; right: -6px;
  background: var(--red-500);
  color: white;
  font-size: 0.6rem;
  padding: 0.05rem 0.35rem;
  border-radius: 10px;
  font-weight: 700;
}
.notif-badge.hidden { display: none; }
.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fire-600), var(--amber-500));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: white;
}

.page-wrapper { padding: 2rem; max-width: 1400px; margin: 0 auto; }

/* === TOAST === */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 0.5rem;
  animation: slideInRight 0.3s ease;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--green-500); }
.toast.error { border-left: 3px solid var(--red-500); }
.toast.info { border-left: 3px solid var(--blue-500); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-secondary); font-size: 1.3rem; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }
