:root {
    --bg: #f3f6fb;
    --ink: #122033;
    --muted: #66758a;
    --card: #ffffff;
    --line: #e6ebf2;
    --accent: #1f6feb;
    --sidebar: #0f1728;
    --ok: #0f9f6e;
    --bad: #d14343;
    --warn: #b7791f;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}
a { color: inherit; text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 248px;
    background: linear-gradient(180deg, #111b2e, #0c1422);
    color: #f8fafc;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: grid; place-items: center; font-weight: 700;
}
.brand span, .side-user a { color: #94a3b8; font-size: 13px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar nav a { padding: 11px 12px; border-radius: 10px; color: #e2e8f0; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.08); }
.side-user { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
main { flex: 1; padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
h1 { margin: 0; font-size: 28px; letter-spacing: -0.03em; }
.topbar p, .muted { margin: 4px 0 0; color: var(--muted); }
.today { background: white; border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card, .panel {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 40, .04);
}
.card { position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.card.ok::before { background: var(--ok); }
.card.bad::before { background: var(--bad); }
.card.warn::before { background: var(--warn); }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; font-size: 32px; margin-top: 8px; letter-spacing: -0.04em; }
.panel { margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
    border: 1px solid var(--line); background: white; border-radius: 10px;
    padding: 10px 12px; font: inherit; color: var(--ink); min-width: 160px;
}
textarea { min-width: 280px; }
button, .btn {
    background: var(--accent); color: white; border: 0; border-radius: 10px;
    padding: 10px 14px; cursor: pointer; font: inherit; display: inline-block;
}
button.secondary, .btn.secondary { background: #eef3fb; color: var(--ink); }
button.danger { background: var(--bad); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; background: #eef3fb; }
.badge.Present, .badge.active { background: #e7f8f1; color: var(--ok); }
.badge.Absent, .badge.inactive { background: #fdecec; color: var(--bad); }
.badge.Half, .badge.Leave { background: #fff6e5; color: var(--warn); }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; }
.flash.ok { background: #e7f8f1; color: var(--ok); }
.flash.bad { background: #fdecec; color: var(--bad); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top, #dbeafe, #f3f6fb 45%); }
.login-card { width: min(440px, 100%); background: white; border-radius: 20px; padding: 28px; border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(15,23,40,.08); }
.actions { display: flex; gap: 8px; }
.avatar { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; margin-bottom: 12px; }
.avatar.sm { width: 36px; height: 36px; border-radius: 10px; margin: 0; }
.split { display: grid; grid-template-columns: 1.4fr .8fr; gap: 14px; }
.quick { display: flex; flex-direction: column; gap: 10px; }
.quick a { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fbff; }
.quick a strong { display: block; }
.quick a span { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
    .app { display: block; }
    .sidebar { width: auto; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .cards, .split { grid-template-columns: 1fr 1fr; }
    main { padding: 16px; }
    table { display: block; overflow-x: auto; }
}
