:root {
    --navy: #0b1f4d;
    --blue: #1e6fe8;
    --cyan: #00b4ff;
    --bg: #f3f6fc;
    --line: #e3e9f5;
    --sidebar-w: 224px;
    --topbar-h: 50px;
}
* { box-sizing: border-box; }

/* ---------- Base (chhota font) ---------- */
html { font-size: 13px; }                       /* pura app 13px base par (rem scale) */
body { background: var(--bg); font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; color: #1d2433; line-height: 1.45; }
h4 { font-size: 1.25rem; } h5 { font-size: 1.1rem; } h6 { font-size: .98rem; }
.small, small { font-size: .85em; }
.text-navy { color: var(--navy); }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--navy); }

/* ---------- Forms & Buttons ---------- */
.form-label { font-size: .85rem; font-weight: 600; color: #4a5568; margin-bottom: .25rem; }
.form-control, .form-select { font-size: .92rem; padding: .38rem .65rem; border-radius: 8px; border-color: #d5dcea; }
.form-control-sm, .form-select-sm { font-size: .85rem; }
.input-group-text { font-size: .92rem; background: #f3f6fc; border-color: #d5dcea; }
.btn { font-size: .88rem; padding: .38rem .85rem; border-radius: 8px; font-weight: 500; }
.btn-sm { font-size: .8rem; padding: .25rem .55rem; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); border: 0; }
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(135deg, var(--navy), var(--blue)); }
.btn-outline-primary { color: var(--blue); border-color: var(--blue); }
.btn-outline-primary:hover { background: var(--blue); border-color: var(--blue); }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .18rem rgba(30,111,232,.15); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-switch.fs-5 { font-size: 1rem !important; }   /* purane fs-5 switch chhote */

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
    background: #fff; border-right: 1px solid var(--line); overflow-y: auto; z-index: 1040;
    transition: transform .25s ease;
}
.sidebar .brand { padding: 14px 16px 10px; text-align: center; border-bottom: 1px solid #eef2fa; }
.sidebar .brand img { max-width: 120px; width: 100%; height: auto; }
.brand-sub { font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; color: #7a8599; margin-top: 5px; }
.side-nav { padding: 8px 10px 16px; }
.side-nav a {
    display: flex; align-items: center; gap: 9px; padding: 7px 11px; margin-bottom: 2px;
    border-radius: 8px; color: #3a455c; font-weight: 500; font-size: .92rem;
}
.side-nav a i { font-size: 1rem; width: 18px; text-align: center; }
.side-nav a:hover { background: #eef4ff; color: var(--blue); }
.side-nav a.active { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; box-shadow: 0 3px 10px rgba(30,111,232,.28); }
.nav-title { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; color: #97a1b5; padding: 12px 11px 4px; }

/* ---------- Main ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
    padding: 0 20px; position: sticky; top: 0; z-index: 1030;
}
.user-chip { background: #eef4ff; color: var(--navy); padding: 4px 12px; border-radius: 20px; font-weight: 500; font-size: .85rem; }
.content { padding: 18px 20px; flex: 1; }
.footer { text-align: center; padding: 10px; color: #8a94a8; font-size: .78rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.page-head h4 { margin: 0; color: var(--navy); font-weight: 700; }
.page-head h4 i { color: var(--blue); margin-right: 6px; }

/* ---------- Cards & Tables ---------- */
.card { border: 0; border-radius: 12px; box-shadow: 0 2px 12px rgba(11,31,77,.06); }
.card-header { background: transparent; font-weight: 600; font-size: .95rem; color: var(--navy); border-bottom: 1px solid #eef2fa; padding: 10px 14px; }
.card-body { padding: 14px; }
.table { font-size: .9rem; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .5rem .6rem; }
.table-sm > :not(caption) > * > * { padding: .35rem .5rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #6b768c; background: #f8faff; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background-color: #f5f9ff; }
.detail-table th { width: 38%; color: #6b768c; font-weight: 500; }
.alert { font-size: .9rem; padding: .55rem .9rem; border-radius: 10px; }

.stat-card { background: #fff; border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 2px 12px rgba(11,31,77,.06); height: 100%; }
.stat-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.2rem; flex-shrink: 0; }
.bg-blue { background: linear-gradient(135deg, #1e6fe8, #4d9bff); }
.bg-cyan { background: linear-gradient(135deg, #00a2e8, #00d4ff); }
.bg-navy { background: linear-gradient(135deg, #0b1f4d, #274a9c); }
.bg-green { background: linear-gradient(135deg, #12a46b, #3fd596); }
.bg-red { background: linear-gradient(135deg, #e5484d, #ff7a7e); }
.bg-orange { background: linear-gradient(135deg, #f08c00, #ffb347); }
.stat-num { font-size: 1.2rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-label { color: #7a8599; font-size: .78rem; }
.mini-stat { background: #fff; border-radius: 12px; padding: 10px; text-align: center; box-shadow: 0 2px 12px rgba(11,31,77,.06); }
.fs-4 { font-size: 1.15rem !important; }
.fs-5 { font-size: 1rem !important; }

.badge-soft-success { background: #dff6ec; color: #0e8a5a; }
.badge-soft-secondary { background: #e8ebf1; color: #5b657a; }
.badge-soft-danger { background: #fde3e4; color: #c8323a; }
.badge-soft-primary { background: #e3eeff; color: var(--blue); }
.badge-soft-warning { background: #fff1d6; color: #b36b00; }
.badge { font-weight: 600; font-size: .75rem; padding: .35em .6em; }

/* ---------- Attendance (radio rang) ---------- */
.att-radio { width: 1.15em; height: 1.15em; cursor: pointer; }
.att-present:checked { background-color: #12a46b; border-color: #12a46b; }
.att-absent:checked  { background-color: #e5484d; border-color: #e5484d; }
.att-leave:checked   { background-color: #f08c00; border-color: #f08c00; }
.att-half:checked    { background-color: #00a2e8; border-color: #00a2e8; }
.att-note { min-width: 160px; }

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(circle at 20% 20%, #1e6fe8 0, transparent 40%), radial-gradient(circle at 80% 80%, #00b4ff 0, transparent 40%), var(--navy); }
.login-card { background: #fff; border-radius: 18px; padding: 28px 28px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-logo { max-width: 160px; width: 60%; height: auto; }

/* ---------- Receipt ---------- */
.receipt-body { background: #e9eef8; padding: 24px 10px; }
.receipt { background: #fff; max-width: 780px; margin: auto; padding: 30px; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.1); }
@media print {
    .no-print { display: none !important; }
    .receipt-body { background: #fff; padding: 0; }
    .receipt { box-shadow: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.25); }
    .main { margin-left: 0; }
    .content { padding: 12px; }
    .topbar { padding: 0 12px; }
}

/* ---------- Reports ---------- */
.report-card { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 12px; padding: 14px;
    box-shadow: 0 2px 12px rgba(11,31,77,.06); color: inherit; height: 100%; transition: transform .15s, box-shadow .15s; }
.report-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,111,232,.18); color: inherit; }
.report-card h6 { margin: 0 0 3px; color: var(--navy); font-weight: 700; }
.report-card p { margin: 0; color: #7a8599; font-size: .8rem; }
.print-only { display: none; }
@media print {
    html { font-size: 12px; }
    .sidebar, .topbar, .footer, .no-print { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0 !important; }
    .print-only { display: block !important; }
    body { background: #fff; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
}

/* ---------- Report card ---------- */
.rc-page { max-width: 760px; margin-left: auto; margin-right: auto; }
@media print {
    .rc-page { page-break-after: always; break-after: page; border: 0 !important; max-width: 100%; }
    .rc-page:last-child { page-break-after: auto; break-after: auto; }
}
