@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&display=swap');

:root {
  --bg-base:      #080d14;
  --bg-surface:   #0d1520;
  --bg-elevated:  #111c2a;
  --bg-card:      #132030;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --gold:         #d4a843;
  --gold-light:   #f0c060;
  --gold-dim:     rgba(212,168,67,0.15);
  --gold-glow:    rgba(212,168,67,0.25);
  --text-primary:   #f0f4f8;
  --text-secondary: #8a9ab0;
  --text-muted:     #4a5a6a;
  --blue-accent:  #004B89;
  --green:        #22c55e;
  --red:          #ef4444;
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 24px rgba(212,168,67,0.2);
  --sidebar-w: 220px;
  --tabbar-h:  64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { font-family: 'Sora', system-ui, sans-serif; background: var(--bg-base); color: var(--text-primary); min-height: 100vh; -webkit-font-smoothing: antialiased; }

/* SIDEBAR */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--bg-surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 100; padding-bottom: 24px; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sidebar-logo img { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.sidebar-logo-text { font-size: 18px; font-weight: 700; background: linear-gradient(135deg, var(--gold-light), var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-nav { flex: 1; padding: 4px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 13.5px; font-weight: 500; transition: all 0.15s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; }
.nav-item:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-item.active { color: var(--gold-light); background: var(--gold-dim); }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }
.sidebar-user { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-dim); border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--gold-light); flex-shrink: 0; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10.5px; color: var(--text-muted); }

/* MAIN CONTENT */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; padding: 32px; }

/* TAB BAR */
.tab-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--bg-surface); border-top: 1px solid var(--border); z-index: 200; flex-direction: row; align-items: stretch; padding-left: 4px; padding-right: 4px; -webkit-transform: translateZ(0); transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-muted); text-decoration: none; font-size: 10px; font-weight: 500; transition: color 0.15s; cursor: pointer; background: none; border: none; padding: 8px 0; }
.tab-item.active { color: var(--gold); }
.tab-item svg { width: 20px; height: 20px; }

/* CARDS */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.card-sm { padding: 14px 16px; }
.card-lg { padding: 28px; }
.glass { background: rgba(13,21,32,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--border); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--radius-md); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; border: none; text-decoration: none; white-space: nowrap; }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: #0a0f1a; }
.btn-gold:hover { filter: brightness(1.1); box-shadow: var(--shadow-gold); }
.btn-ghost { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--text-primary); }
.btn-danger { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* FORMS */
.input, .textarea, .select { width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-primary); font-family: inherit; font-size: 13.5px; padding: 10px 14px; transition: border-color 0.15s; outline: none; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
.label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; display: block; }
.form-group { margin-bottom: 16px; }

/* TYPOGRAPHY */
.page-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 12px; }
.gold-text { background: linear-gradient(135deg, var(--gold-light), var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-gold  { background: var(--gold-dim); color: var(--gold-light); border: 1px solid rgba(212,168,67,0.3); }
.badge-green { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-blue  { background: rgba(59,130,246,0.1); color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-red   { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-gray  { background: rgba(255,255,255,0.06); color: var(--text-secondary); border: 1px solid var(--border); }

/* SKELETON */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skeleton { background: linear-gradient(90deg, var(--bg-elevated) 25%, #1a2535 50%, var(--bg-elevated) 75%); background-size: 800px 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }

/* TOAST */
#toast-container { position: fixed; bottom: 88px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; min-width: 240px; max-width: 320px; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 10px; animation: toastIn 0.25s ease; font-size: 13.5px; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--gold); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* OVERLAY / MODAL */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 500; display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.overlay.open { display: flex; }
.modal { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; width: 90%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease; }
@keyframes modalIn { from { transform: translateY(20px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.07); border: none; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all 0.15s; }
.modal-close:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

/* ANIMATIONS */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeInUp 0.3s ease both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }

/* MISC */
.progress-track { width: 100%; height: 8px; background: var(--bg-elevated); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 1.2s cubic-bezier(0.4,0,0.2,1); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-card); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-elevated); }

/* Mobile Menu Overlay */
.mobile-menu-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 300; }
.mobile-menu-overlay.open { display: flex; align-items: center; justify-content: center; }
.mobile-menu { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 90%; max-width: 340px; padding: 24px; }
.mobile-menu-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; float: right; padding: 0 4px; }
.mobile-menu-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.mobile-menu-nav { display: flex; flex-direction: column; gap: 4px; clear: both; }
.mobile-menu-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; transition: 0.15s; }
.mobile-menu-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.mobile-menu-nav a.active { background: var(--gold-dim); color: var(--gold-light); }
.mobile-menu-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .tab-bar { display: flex; }
  .main-content { margin-left: 0; padding: 16px 16px calc(var(--tabbar-h) + 16px); }
  #toast-container { bottom: calc(var(--tabbar-h) + 12px); right: 12px; }
}
