*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; color: #334155; background: #f1f5f9; }

/* Sidebar */
.sidebar { width: 220px; min-height: 100vh; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 20px 20px 16px; font-size: 1.2rem; font-weight: 700; color: #fff; border-bottom: 1px solid #334155; }
.sidebar-brand span { color: #38bdf8; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-footer { padding: 12px 0; border-top: 1px solid #334155; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; color: #94a3b8; text-decoration: none; font-size: 0.875rem; border-radius: 0; transition: background .15s, color .15s; cursor: pointer; background: none; border: none; width: 100%; }
.nav-item:hover { background: #334155; color: #f1f5f9; }
.nav-item.active { background: #0ea5e9; color: #fff; }
.nav-item i { width: 16px; text-align: center; }

/* Topbar */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.topbar-title { font-weight: 600; font-size: 1rem; }
.topbar-user { font-size: .85rem; color: #64748b; display: flex; align-items: center; gap: 6px; }

/* Layout */
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.h-screen { height: 100vh; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Cards */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-body { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-weight: 600; font-size: .95rem; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-label { font-size: .75rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 700; color: #1e293b; }
.stat-icon { font-size: 1.4rem; color: #0ea5e9; margin-bottom: 8px; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.tab-btn { padding: 10px 20px; font-size: .875rem; font-weight: 500; border: none; background: none; cursor: pointer; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s; }
.tab-btn.active { color: #0ea5e9; border-bottom-color: #0ea5e9; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; font-size: .875rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .15s; text-decoration: none; }
.btn-primary { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
.btn-primary:hover { background: #0284c7; }
.btn-outline { background: #fff; color: #334155; border-color: #cbd5e1; }
.btn-outline:hover { background: #f8fafc; }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 5px 10px; font-size: .8rem; }

/* Search bar */
.search-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.search-bar .form-control { max-width: 320px; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .8rem; font-weight: 500; color: #475569; margin-bottom: 4px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .875rem; background: #fff; color: #1e293b; outline: none; transition: border-color .15s; }
.form-control:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.1); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th { text-align: left; padding: 10px 12px; font-size: .75rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #e2e8f0; }
.data-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td { background: #f8fafc; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: .75rem; font-weight: 500; }
.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-gray   { background: #f1f5f9; color: #64748b; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: #fef9c3; color: #ca8a04; }
.badge-blue   { background: #dbeafe; color: #2563eb; }
.badge-purple { background: #ede9fe; color: #7c3aed; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-backdrop.hidden { display: none; }
.modal { background: #fff; border-radius: 12px; width: 580px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #94a3b8; line-height: 1; }
.modal-body { padding: 20px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid #f1f5f9; }

/* Detail header */
.detail-header { background: #fff; border-radius: 10px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-title { font-size: 1.3rem; font-weight: 700; color: #1e293b; }
.detail-meta { font-size: .85rem; color: #64748b; margin-top: 4px; display: flex; gap: 16px; flex-wrap: wrap; }
.detail-meta span { display: flex; align-items: center; gap: 4px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 8px; font-size: .875rem; font-weight: 500; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); transform: translateY(20px); opacity: 0; transition: all .3s; z-index: 100; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { display: block; height: 56px; width: auto; margin: 0 auto 16px; }
.login-brand { text-align: center; font-size: 1.6rem; font-weight: 800; color: #1e293b; margin-bottom: 4px; }
.login-brand span { color: #0ea5e9; }
.login-sub { text-align: center; color: #64748b; font-size: .875rem; margin-bottom: 28px; }
.p-6 { padding: 24px; }
.p-4 { padding: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.justify-center { justify-content: center; }
.text-sm { font-size: .875rem; }
.text-slate-400 { color: #94a3b8; }
.text-xs { font-size: .75rem; }
.font-mono { font-family: monospace; }
.font-medium { font-weight: 500; }
.py-10 { padding-top: 40px; padding-bottom: 40px; }
