* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; background: #f8f9fb; color: #1f2330; }
a { text-decoration: none; color: inherit; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a0533 0%, #2d1457 50%, #1a0533 100%); }
.login-box { width: 100%; max-width: 420px; padding: 0 16px; }
.brand { text-align: center; margin-bottom: 32px; }
.brand-pill { display: inline-flex; align-items: center; gap: 12px; background: rgba(255,255,255,.1); border-radius: 16px; padding: 14px 22px; margin-bottom: 14px; }
.logo-box { width: 40px; height: 40px; background: #f97316; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 900; font-size: 17px; }
.brand-name { color: white; font-weight: 700; font-size: 17px; line-height: 1; }
.brand-sub { color: #c4b5fd; font-size: 12px; }
.tagline { color: #c4b5fd; font-size: 14px; }
.login-card { background: white; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); padding: 32px; }
.login-card h2 { font-size: 20px; margin-bottom: 4px; }
.login-card p.sub { color: #6b7280; font-size: 13px; margin-bottom: 22px; }
label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
input[type=email], input[type=password], input[type=text], input[type=date], select, textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 2px rgba(139,92,246,.25); }
.btn { display: inline-block; width: 100%; text-align: center; border: none; border-radius: 12px; padding: 12px; font-weight: 700; font-size: 14px; color: white; cursor: pointer;
  background: linear-gradient(90deg,#7c3aed,#a855f7); }
.btn:hover { opacity: .92; }
.btn-dark { background: #1f2937; }
.btn-green { background: #22c55e; }
.btn-red { background: #ef4444; }
.btn-small { width: auto; padding: 7px 14px; font-size: 12px; border-radius: 9px; }
.error-msg { color: #dc2626; font-size: 13px; margin-bottom: 12px; }
.success-msg { background: #dcfce7; color: #15803d; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.warn-msg { background: #fef2f2; color: #b91c1c; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.demo-box { margin-top: 18px; background: #f5f3ff; border-radius: 12px; padding: 12px 14px; }
.demo-box p { font-size: 12px; color: #6d28d9; }
.demo-box p.label { font-weight: 700; margin-bottom: 4px; }
.footer-credit { text-align: center; color: #a78bfa; font-size: 12px; margin-top: 16px; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex-shrink: 0; background: linear-gradient(180deg,#1a0533,#2d1457); display: flex; flex-direction: column; }
.sidebar-header { padding: 16px; border-bottom: 1px solid #3a1d5c; display: flex; align-items: center; gap: 8px; }
.sidebar-header .logo-box { width: 32px; height: 32px; font-size: 13px; }
.sidebar-header .brand-name { font-size: 12px; }
.sidebar-user { padding: 12px 16px; border-bottom: 1px solid #3a1d5c; display: flex; align-items: center; gap: 10px; }
.sidebar-nav { flex: 1; padding: 8px; }
.sidebar-nav a { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 10px; font-size: 14px; color: #c4b5fd; margin-bottom: 3px; }
.sidebar-nav a.active { background: #7c3aed; color: white; }
.sidebar-nav a:hover { background: #3a1d5c; }
.sidebar-footer { padding: 12px; }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; font-size: 13px; color: #c4b5fd; }
.sidebar-footer a:hover { background: #3a1d5c; color: white; }

.main { flex: 1; overflow-x: hidden; }
.topbar { background: white; border-bottom: 1px solid #e5e7eb; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; }
.topbar h1 { font-size: 18px; }
.topbar .sub { color: #6b7280; font-size: 12px; }
.content { padding: 24px; max-width: 1100px; }

.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; flex-shrink: 0; }
.av-sm { width: 32px; height: 32px; font-size: 11px; }
.av-md { width: 40px; height: 40px; font-size: 14px; }
.av-lg { width: 56px; height: 56px; font-size: 20px; }

.card { background: white; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 22px; margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f1f1f4; font-weight: 600; font-size: 14px; color: #374151; }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 800px) { .grid-stats { grid-template-columns: repeat(2,1fr); } .app-shell { flex-direction: column; } .sidebar { width: 100%; } }
.stat-box { border-radius: 14px; padding: 16px; }
.stat-box .icon { font-size: 22px; margin-bottom: 4px; }
.stat-box .num { font-size: 26px; font-weight: 800; }
.stat-box .lbl { font-size: 11px; color: #6b7280; margin-top: 2px; }
.bg-purple { background: #f5f3ff; } .text-purple { color: #6d28d9; }
.bg-green { background: #f0fdf4; } .text-green { color: #16a34a; }
.bg-yellow { background: #fefce8; } .text-yellow { color: #ca8a04; }
.bg-red { background: #fef2f2; } .text-red { color: #dc2626; }
.bg-amber { background: #fffbeb; } .text-amber { color: #b45309; }
.bg-blue { background: #eff6ff; } .text-blue { color: #2563eb; }
.bg-gray { background: #f3f4f6; } .text-gray { color: #4b5563; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }

table { width: 100%; font-size: 13px; border-collapse: collapse; }
th { text-align: left; padding: 10px 14px; font-size: 11px; color: #6b7280; background: #fafafa; }
td { padding: 9px 14px; border-top: 1px solid #f1f1f4; }
.divide-row { border-top: 1px solid #f1f1f4; padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.flex { display: flex; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .items-center { align-items: center; }
.flex-1 { flex: 1; } .text-center { text-align: center; } .mb-1{margin-bottom:4px;} .mb-2{margin-bottom:8px;} .mb-3{margin-bottom:12px;}
.muted { color: #9ca3af; font-size: 12px; }
.row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }