/* ==========================================================================
   Molino Attendance — admin design system
   Corporate, dense, table-first. Type scale and spacing live here so pages
   stay free of one-off padding overrides.
   ========================================================================== */

[x-cloak] { display: none !important; }

:root {
    /* Brand */
    --brand: #0e7490;
    --brand-dark: #0b5566;
    --brand-600: #0891b2;
    --brand-soft: #ecfeff;

    /* Neutrals — cool slate, corporate rather than warm */
    --ink: #0f172a;
    --ink-2: #1e293b;
    --muted: #64748b;
    --faint: #94a3b8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --bg: #f1f5f9;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;

    /* Dark navigation rail */
    --rail: #0f172a;
    --rail-2: #1e293b;
    --rail-ink: #cbd5e1;
    --rail-muted: #7c8ba1;

    /* Geometry — restrained radii read more corporate than pill shapes */
    --r-sm: 4px;
    --r: 6px;
    --r-lg: 8px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .07);
    --shadow: 0 8px 24px -12px rgba(15, 23, 42, .25);

    /* Density */
    --rail-w: 228px;
    --gap: 14px;
    --pad: 18px;
}

/* ---------- Base ---------- */
html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv05" 1, "cv11" 1;
}

h1, h2, h3, h4, h5, h6 { color: var(--ink); letter-spacing: -.011em; }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }
h6 { font-size: .875rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }

.small, small { font-size: .78rem; }
.text-muted { color: var(--muted) !important; }
code { font-size: .8em; color: var(--brand-dark); background: var(--surface-2); padding: .1em .35em; border-radius: var(--r-sm); }

/* Every figure in the app is money or minutes: keep digits column-aligned. */
.table, .stat-card .value, .num { font-variant-numeric: tabular-nums; }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; }

.sidebar {
    width: var(--rail-w);
    background: var(--rail);
    border-right: 1px solid #0b1220;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow-y: auto;
}
.sidebar .brand {
    padding: 14px 16px;
    font-size: .95rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -.01em;
    border-bottom: 1px solid var(--rail-2);
    display: flex;
    align-items: center;
    gap: 9px;
}
.sidebar .brand img { border-radius: var(--r-sm) !important; }
.sidebar .nav { padding: 10px 10px; gap: 1px; }
.sidebar .nav-link {
    color: var(--rail-ink);
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8125rem;
    font-weight: 500;
    border-radius: var(--r);
    border-left: 2px solid transparent;
    transition: background .12s, color .12s;
}
.sidebar .nav-link:hover { background: var(--rail-2); color: #fff; text-decoration: none; }
.sidebar .nav-link.active {
    background: var(--rail-2);
    color: #fff;
    font-weight: 600;
    border-left-color: var(--brand-600);
}
.sidebar .nav-link i { font-size: .95rem; width: 18px; text-align: center; color: var(--rail-muted); }
.sidebar .nav-link:hover i, .sidebar .nav-link.active i { color: var(--brand-600); }
.sidebar .sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--rail-2); }
.sidebar .sidebar-foot .btn { border-color: var(--rail-2); color: var(--rail-ink); font-size: .78rem; }
.sidebar .sidebar-foot .btn:hover { background: var(--rail-2); color: #fff; }

.content { margin-left: var(--rail-w); min-width: 0; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 9px 20px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    position: sticky; top: 0; z-index: 1020;
    min-height: 48px;
}
.topbar h1 { font-size: 1.02rem; margin: 0; font-weight: 650; letter-spacing: -.015em; }
.topbar .btn { font-size: .78rem; padding: .3rem .6rem; }
.topbar .dropdown-toggle { background: transparent; border: 1px solid var(--line); }

.page { padding: 18px 20px 28px; }
.page > *:last-child { margin-bottom: 0 !important; }

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; }
    .page { padding: 14px 14px 24px; }
}

/* ---------- Page heading strip ---------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.page-head .title { font-size: 1.05rem; font-weight: 650; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .8rem; }

/* ---------- Cards ---------- */
.card {
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xs);
    background: var(--surface);
}
.card-body { padding: 16px 18px; }
.card-body.p-4 { padding: 16px 18px; }   /* neutralise legacy one-off padding */
.card + .card { margin-top: var(--gap); }
.card .card-body > h5,
.card .card-body > h6 { font-weight: 650; letter-spacing: -.01em; }

/* A card whose body is a table: let the table meet the edges. */
.card > .table-responsive:only-child > .table { margin-bottom: 0; }
.card > .table-responsive { border-radius: var(--r-lg); overflow: auto; }

/* Cards sitting side by side in a row stay the same height. */
.row > [class*="col-"] > .card.h-100 { height: 100%; }

/* ---------- Stat cards ---------- */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 12px 14px;
    height: 100%;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 11px;
    transition: border-color .15s, box-shadow .15s;
}
.stat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.stat-card .stat-icon {
    width: 34px; height: 34px; border-radius: var(--r);
    display: grid; place-items: center; font-size: 1rem;
    flex: 0 0 34px;
}
.stat-card .stat-text { min-width: 0; }
.stat-card .label {
    color: var(--muted); font-size: .69rem; text-transform: uppercase;
    letter-spacing: .04em; font-weight: 600; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.stat-card .value { font-size: 1.35rem; font-weight: 680; line-height: 1.15; color: var(--ink); }
.stat-card .value.sm { font-size: 1.05rem; }

.ic-teal   { background:#ecfeff; color:#0e7490; }
.ic-green  { background:#ecfdf5; color:#047857; }
.ic-amber  { background:#fffbeb; color:#b45309; }
.ic-red    { background:#fef2f2; color:#b91c1c; }
.ic-blue   { background:#eff6ff; color:#1d4ed8; }
.ic-violet { background:#f5f3ff; color:#6d28d9; }
.ic-slate  { background:#f1f5f9; color:#475569; }

/* ---------- Tables ---------- */
.table {
    --bs-table-bg: transparent;
    font-size: .8125rem;
    margin-bottom: 0;
    color: var(--ink-2);
}
.table > :not(caption) > * > * { padding: .44rem .6rem; }
.table thead th {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .045em;
    color: var(--muted);
    font-weight: 650;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;          /* headers never wrap — keeps columns proportional */
    vertical-align: middle;
}
.table td { vertical-align: middle; border-color: #eef2f6; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background: var(--surface-2); }
.table tfoot td, .table tfoot th {
    background: var(--surface-2);
    border-top: 1px solid var(--line-strong);
    font-weight: 650;
}
/* First column carries the name: give it room, let the rest size to content. */
.table th:first-child, .table td:first-child { padding-left: 14px; }
.table th:last-child, .table td:last-child { padding-right: 14px; }
.table td.text-end, .table th.text-end { white-space: nowrap; }

.table-responsive { scrollbar-width: thin; }

/* ---------- Status badges ---------- */
.badge-status {
    font-weight: 600; padding: .2em .55em; border-radius: var(--r-sm);
    font-size: .7rem; letter-spacing: .01em; white-space: nowrap;
    display: inline-block; border: 1px solid transparent;
}
.st-present   { background:#ecfdf5; color:#047857; border-color:#a7f3d0; }
.st-late      { background:#fffbeb; color:#b45309; border-color:#fde68a; }
.st-absent    { background:#fef2f2; color:#b91c1c; border-color:#fecaca; }
.st-incomplete{ background:#f1f5f9; color:#475569; border-color:#e2e8f0; }
.st-clockedin { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.st-completed { background:#f1f5f9; color:#334155; border-color:#e2e8f0; }
.st-rest_day  { background:#f5f3ff; color:#6d28d9; border-color:#ddd6fe; }
.st-leave     { background:#ecfeff; color:#0e7490; border-color:#a5f3fc; }
.st-holiday   { background:#fdf2f8; color:#be185d; border-color:#fbcfe8; }

.badge { font-weight: 600; border-radius: var(--r-sm); font-size: .7rem; padding: .3em .55em; }

/* ---------- Buttons ---------- */
.btn {
    font-size: .8125rem;
    font-weight: 550;
    border-radius: var(--r);
    padding: .38rem .7rem;
    line-height: 1.4;
}
.btn-sm { font-size: .75rem; padding: .25rem .55rem; }
.btn-lg { font-size: .9rem; padding: .55rem 1rem; }
.btn i { font-size: .95em; }

.brand-btn { background: var(--brand); border-color: var(--brand); color: #fff; }
.brand-btn:hover, .brand-btn:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.text-brand { color: var(--brand) !important; }

.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
}
.btn-outline-secondary {
    --bs-btn-color: #475569; --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line-strong);
    --bs-btn-hover-color: var(--ink);
}
.btn-light { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-border-color: var(--ink-2); }

.text-primary, .link-primary { color: var(--brand) !important; }
.bg-primary, .badge.bg-primary { background-color: var(--brand) !important; }

/* ---------- Forms ---------- */
.form-label { font-size: .76rem; font-weight: 600; color: var(--ink-2); margin-bottom: .22rem; }
.form-control, .form-select {
    font-size: .8125rem;
    padding: .34rem .6rem;
    border-radius: var(--r);
    border-color: var(--line-strong);
    color: var(--ink);
}
.form-control-sm, .form-select-sm { font-size: .76rem; padding: .24rem .5rem; }
.form-control-lg, .form-select-lg { font-size: .9rem; padding: .5rem .8rem; }
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .12);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.input-group-text { font-size: .78rem; background: var(--surface-2); border-color: var(--line-strong); }
.btn-check:checked + .btn-outline-primary { background-color: var(--brand); border-color: var(--brand); color: #fff; }

/* Filter bars sit tight above their table. */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--r-lg);
    font-size: .8125rem;
    padding: .6rem .85rem;
    border-width: 1px;
    margin-bottom: var(--gap);
}
.alert-info { background:#eff6ff; border-color:#bfdbfe; color:#1e40af; }
.alert-success { background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }
.alert-warning { background:#fffbeb; border-color:#fde68a; color:#92400e; }
.alert-danger { background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.alert-dark { background:#f1f5f9; border-color:var(--line-strong); color:var(--ink-2); }
.alert p:last-child { margin-bottom: 0; }

/* ---------- Pagination / misc ---------- */
.pagination { --bs-pagination-font-size: .78rem; --bs-pagination-padding-y: .25rem; --bs-pagination-padding-x: .55rem; }
.page-link { color: var(--brand); border-color: var(--line); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }
.dropdown-menu { font-size: .8125rem; border-color: var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.dropdown-item { padding: .35rem .8rem; }
details > summary { cursor: pointer; }

/* ---------- Sign-in / standalone panels (login screen) ---------- */
.kiosk-body {
    background:
        radial-gradient(1200px 600px at 15% -10%, #1e3a4a 0%, transparent 55%),
        linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    min-height: 100vh;
    color: #e2e8f0;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.kiosk-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    backdrop-filter: blur(8px);
}
.kiosk-card .form-control { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #f8fafc; }
.kiosk-card .form-control::placeholder { color: #64748b; }
.kiosk-card .form-control:focus { background: rgba(255,255,255,.1); color: #fff; }
.kiosk-card .form-label { color: #cbd5e1; }

/* ---------- Print ---------- */
@media print {
    .sidebar, .topbar, .no-print { display: none !important; }
    .content { margin-left: 0 !important; }
    .page { padding: 0 !important; }
    body { background: #fff; font-size: 11px; }
    .card { border: 1px solid #cbd5e1; box-shadow: none; }
    .table { font-size: 10.5px; }
    .report-head { border-bottom: 2px solid #0f172a; margin-bottom: 12px; padding-bottom: 8px; }
}

.report-head { border-bottom: 2px solid var(--ink); margin-bottom: 14px; padding-bottom: 10px; }
