* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f7fb; color: #333; }
.hidden { display: none !important; }
a { color: #2563eb; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.btn { padding: 8px 14px; border: none; border-radius: 8px; cursor: pointer; background: #2563eb; color: #fff; }
.btn.secondary { background: #64748b; }
.btn.danger { background: #dc2626; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.card { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
th { background: #f8fafc; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#dbeafe,#fef3c7); }
.login-box { width: 360px; max-width: calc(100vw - 32px); background: #fff; padding: 32px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.login-box h1 { margin: 0 0 8px; font-size: 24px; }
#loginForm { display: flex; flex-direction: column; gap: 12px; margin: 0; }
#loginForm input { width: 100%; padding: 12px 14px; border: 1px solid #ddd; border-radius: 10px; }
#loginForm .login-submit { width: 100%; padding: 12px 14px; font-size: 16px; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1e293b; color: #fff; padding: 16px 0; flex-shrink: 0; }
.sidebar h2 { padding: 0 16px; font-size: 18px; margin: 0 0 16px; }
.sidebar a { display: block; padding: 10px 16px; color: #cbd5e1; cursor: pointer; }
.sidebar a.active, .sidebar a:hover { background: #334155; color: #fff; }
.main { flex: 1; padding: 20px; overflow: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; }
.stat { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .num { font-size: 28px; font-weight: 700; color: #2563eb; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.form-row label { min-width: 80px; font-size: 14px; }
.form-row input, .form-row select, .form-row textarea { padding: 8px; border: 1px solid #ddd; border-radius: 8px; min-width: 180px; }
.msg { padding: 10px; border-radius: 8px; margin-bottom: 12px; }
.msg.ok { background: #dcfce7; color: #166534; }
.msg.err { background: #fee2e2; color: #991b1b; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; background: #eee; }
.progress { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: #2563eb; width: 0; transition: width .2s; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #e2e8f0; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.red { background: #fee2e2; color: #991b1b; }
