:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #d9e2ef;
    --primary: #2454d6;
    --primary-dark: #173fa7;
    --success: #137333;
    --danger: #b42318;
    --warning: #b54708;
    --shadow: 0 14px 35px rgba(20, 35, 65, .08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background: #101828;
    color: #fff;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform .2s ease;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,.12);
    margin-bottom: 14px;
}
.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--primary);
    font-weight: 700;
    font-size: 22px;
}
.brand small { display:block; color:#cbd5e1; margin-top:4px; }
.nav-menu { display: grid; gap: 6px; }
.nav-menu a {
    padding: 12px 14px;
    border-radius: 12px;
    color: #e5e7eb;
}
.nav-menu a:hover,
.nav-menu a.active { background: rgba(255,255,255,.12); color: #fff; }
.main-area { flex: 1; padding: 22px; min-width: 0; }
.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}
.topbar h1 { margin: 0 0 4px; font-size: 26px; }
.topbar p { margin: 0; color: var(--muted); }
.menu-toggle { display:none; }
.user-chip {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    min-width: 150px;
    box-shadow: var(--shadow);
}
.user-chip span { display:block; font-weight:700; }
.user-chip small { color:var(--muted); text-transform:capitalize; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.grid { display:grid; gap:18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat-card span { color: var(--muted); display:block; }
.stat-card strong { font-size: 30px; display:block; margin-top: 8px; }
.form-grid { display:grid; gap:14px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-row { display:grid; gap:6px; }
label { font-weight: 700; font-size: 14px; }
input, select, textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    font-size: 15px;
}
textarea { min-height: 92px; resize: vertical; }
.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0;
    border-radius:12px;
    padding:11px 15px;
    font-weight:700;
    cursor:pointer;
    background: #e7ecf7;
    color: var(--text);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: #fee4e2; color: var(--danger); }
.btn-success { background: #dcfce7; color: var(--success); }
.btn-warning { background: #fffaeb; color: var(--warning); }
.actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.table-wrap { overflow-x:auto; border:1px solid var(--line); border-radius:16px; }
table { width:100%; border-collapse: collapse; background:#fff; }
th, td { padding:12px; text-align:left; border-bottom:1px solid var(--line); white-space: nowrap; }
th { background:#eef4ff; font-size:13px; text-transform:uppercase; color:#344054; }
tr:last-child td { border-bottom:0; }
.badge { display:inline-block; padding:5px 9px; border-radius:999px; font-size:12px; font-weight:700; }
.badge-active, .badge-paid, .badge-present { background:#dcfce7; color:var(--success); }
.badge-inactive, .badge-unpaid, .badge-absent { background:#fee4e2; color:var(--danger); }
.badge-partial, .badge-late { background:#fffaeb; color:var(--warning); }
.alert { padding:12px 14px; border-radius:14px; margin-bottom:16px; font-weight:700; }
.alert-success { background:#dcfce7; color:var(--success); }
.alert-danger { background:#fee4e2; color:var(--danger); }
.alert-warning { background:#fffaeb; color:var(--warning); }
.login-page {
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:20px;
    background: linear-gradient(135deg, #eef4ff, #f7fbff);
}
.login-card { width:100%; max-width:430px; }
.login-card h1 { margin-top:0; }
.help-text { color:var(--muted); font-size:14px; }
.section-title { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.section-title h2 { margin:0; font-size:20px; }
@media (max-width: 900px) {
    .sidebar { position: fixed; z-index: 20; transform: translateX(-105%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { padding: 16px; }
    .menu-toggle { display:inline-flex; width:42px; height:42px; border:0; border-radius:12px; background:#fff; box-shadow:var(--shadow); font-size:22px; }
    .topbar { align-items:flex-start; }
    .user-chip { display:none; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
}
