:root {
    --primary: #4361ee;
    --primary-dark: #3247c7;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --success: #2ec4b6;
    --danger: #e63946;
    --warning: #ff9f1c;
    --dark: #1e2138;
    --sidebar-bg: #1a1c2e;
    --sidebar-hover: #262a45;
    --bg-light: #f4f6fb;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-light);
    margin: 0;
    color: #333;
}

/* ---------- LOGIN PAGE ---------- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 50%, #1a1c2e 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    max-width: 850px;
    width: 100%;
}

.login-left {
    background: linear-gradient(160deg, var(--primary), var(--secondary));
    color: #fff;
    padding: 50px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-left h2 { font-weight: 700; margin-bottom: 10px; }
.login-left p { opacity: 0.9; font-size: 14px; line-height: 1.7; }
.login-left .icon-circle {
    width: 70px; height: 70px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    margin-bottom: 20px;
}

.login-right {
    flex: 1;
    padding: 50px 40px;
}

.login-right h3 { font-weight: 700; margin-bottom: 5px; }
.login-right p.subtitle { color: #888; margin-bottom: 30px; font-size: 14px; }

.form-control {
    border-radius: 10px;
    padding: 12px 15px;
    border: 1.5px solid #e5e7f0;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67,97,238,0.15);
}

.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    transition: 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.demo-hint {
    background: #f0f3ff;
    border-left: 4px solid var(--primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #444;
    margin-top: 20px;
}

/* ---------- LAYOUT ---------- */
.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    padding-top: 20px;
    z-index: 100;
}

.sidebar-brand {
    color: #fff;
    text-align: center;
    padding: 15px 20px 25px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 15px;
}
.sidebar-brand .icon-circle {
    width: 55px; height: 55px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    margin: 0 auto 10px;
}
.sidebar-brand h5 { font-weight: 700; margin: 0; font-size: 17px; }
.sidebar-brand span { font-size: 11px; color: #9aa0c3; }

.sidebar .nav-link {
    color: #c4c8e0;
    padding: 12px 25px;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    transition: 0.2s;
}
.sidebar .nav-link i { width: 18px; text-align: center; }
.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar .nav-link.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left: 3px solid var(--primary);
}
.sidebar .nav-link.logout { color: #ff8a8a; margin-top: 20px;}

.main-content {
    margin-left: 250px;
    padding: 25px 30px;
    min-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar h4 { font-weight: 700; margin: 0; color: var(--dark); }
.topbar p { margin: 0; color: #888; font-size: 13px; }

.admin-chip {
    background: #fff;
    border-radius: 30px;
    padding: 6px 18px 6px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--card-shadow);
    font-size: 14px;
    font-weight: 500;
}
.admin-chip .avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ---------- CARDS ---------- */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}
.stat-card .stat-icon {
    width: 55px; height: 55px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}
.stat-card h3 { margin: 0; font-weight: 700; font-size: 26px; }
.stat-card p { margin: 0; color: #888; font-size: 13px; }

.bg-blue { background: linear-gradient(135deg, #4361ee, #3f37c9); }
.bg-green { background: linear-gradient(135deg, #2ec4b6, #0ea394); }
.bg-orange { background: linear-gradient(135deg, #ff9f1c, #ee7d00); }
.bg-purple { background: linear-gradient(135deg, #8338ec, #5f27b8); }

.card-panel {
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
}
.card-panel h5 { font-weight: 700; margin-bottom: 18px; color: var(--dark); }

/* ---------- TABLE ---------- */
.table-custom { margin-bottom: 0; }
.table-custom thead th {
    background: #f4f6fb;
    border: none;
    color: #666;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 12px 15px;
}
.table-custom tbody td {
    padding: 13px 15px;
    vertical-align: middle;
    font-size: 14px;
    border-bottom: 1px solid #f0f1f7;
}
.table-custom tbody tr:hover { background: #f9fafe; }

.badge-soft {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-present { background: #e3faf7; color: #0ea394; }
.badge-absent { background: #fdeaea; color: #e63946; }

.avatar-sm {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.btn-icon {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.btn-edit { background: #eef1ff; color: var(--primary); }
.btn-delete { background: #fdeaea; color: var(--danger); }

.btn-add-new {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 22px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-add-new:hover { background: var(--primary-dark); color: #fff; }

.search-box {
    border-radius: 10px;
    border: 1.5px solid #e5e7f0;
    padding: 10px 15px 10px 40px;
    font-size: 14px;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%23999" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/></svg>') no-repeat 12px center;
    background-size: 15px;
}

.modal-content { border-radius: 16px; border: none; }
.modal-header { border-bottom: 1px solid #f0f1f7; }
.modal-title { font-weight: 700; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); transition: 0.3s; }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .login-card { flex-direction: column; }
}
