:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-2: #eef3f8;
    --text: #1e293b;
    --muted: #64748b;
    --line: #dbe3ee;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --accent: #2563eb;
    --danger: #dc2626;
    --success: #15803d;
    --warning: #b45309;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.public-content {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .13), rgba(37, 99, 235, .12)),
        radial-gradient(circle at top left, rgba(15, 118, 110, .20), transparent 34%),
        var(--bg);
}

.clock-card,
.login-card {
    width: min(100%, 460px);
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(219, 227, 238, .85);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 34px;
    backdrop-filter: blur(16px);
}

.clock-card h1,
.login-card h1,
.page-title h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 0;
}

.clock-card p,
.login-card p,
.page-title p {
    margin: 8px 0 0;
    color: var(--muted);
}

.live-clock {
    margin: 28px 0;
    padding: 22px;
    border-radius: 8px;
    background: #0f172a;
    color: white;
    text-align: center;
}

.live-clock strong {
    display: block;
    font-size: 42px;
    line-height: 1;
}

.live-clock span {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

.field input,
.field select {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--text);
    background: white;
    font: inherit;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
    outline: none;
}

.pin-input {
    text-align: center;
    font-size: 28px;
    letter-spacing: 8px;
    font-weight: 800;
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #b91c1c;
}

.top-link {
    display: flex;
    justify-content: center;
    margin-top: 18px;
    color: var(--primary);
    font-weight: 800;
}

.alert {
    width: min(100%, 980px);
    margin: 0 auto 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 14px 16px;
    font-weight: 700;
}

.alert-success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: var(--success);
}

.alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

.alert-warning {
    border-color: #fed7aa;
    background: #fff7ed;
    color: var(--warning);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: #101827;
    color: white;
    padding: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: #94a3b8;
}

.nav {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.nav a,
.sidebar-footer a {
    border-radius: 8px;
    padding: 12px 14px;
    color: #dbeafe;
    font-weight: 700;
}

.nav a:hover,
.sidebar-footer a:hover {
    background: rgba(255, 255, 255, .08);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    margin-top: auto;
    color: #cbd5e1;
}

.sidebar-footer span {
    padding: 0 14px;
    font-weight: 800;
}

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

.page-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.stat {
    padding: 18px;
}

.stat span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.panel {
    padding: 20px;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.panel-header h2 {
    margin: 0;
    font-size: 20px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 780px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 12px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    color: #1f2937;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 10px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 900;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-muted {
    background: #e2e8f0;
    color: #475569;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions .btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.report-head {
    display: none;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--panel-2);
}

.summary-box span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-box strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
}

@media (max-width: 980px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 22px 16px;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats,
    .filters,
    .report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .clock-card,
    .login-card {
        padding: 24px;
    }

    .page-title,
    .panel-header {
        align-items: stretch;
        flex-direction: column;
    }

    .stats,
    .filters,
    .report-summary,
    .nav {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: white;
    }

    .sidebar,
    .page-title,
    .filters,
    .no-print,
    .alert {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    .panel {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .report-head {
        display: block;
        border-bottom: 2px solid #111827;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .report-head h1 {
        margin: 0;
        font-size: 24px;
    }

    .report-head p {
        margin: 4px 0 0;
        color: #475569;
    }

    table {
        min-width: 0;
        font-size: 11px;
    }

    th,
    td {
        padding: 7px 6px;
    }

    @page {
        size: A4;
        margin: 14mm;
    }
}

