* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(212, 163, 115, 0.22), transparent 24%),
        linear-gradient(180deg, #f7f1e8 0%, #eef4f7 52%, #f8fafc 100%);
    color: #1f2937;
}

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

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #12343b;
    color: #fff;
    padding: 28px 20px;
}

.brand-kicker {
    display: inline-block;
    background: #d4a373;
    color: #1f2937;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    margin-bottom: 10px;
}

.brand h1 {
    margin: 0 0 24px;
    font-size: 24px;
    line-height: 1.4;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav a {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.nav a.is-active,
.nav a:hover {
    background: #d4a373;
    color: #1f2937;
}

.content {
    padding: 24px;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 26px 28px;
    margin-bottom: 20px;
    border-radius: 24px;
    background: linear-gradient(135deg, #12343b, #285f67 58%, #d4a373 140%);
    color: #fff;
    box-shadow: 0 18px 40px rgba(18, 52, 59, 0.22);
}

.hero h2 {
    margin: 8px 0;
    font-size: 30px;
}

.hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

.hero-kicker {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 12px;
}

.hero-clock {
    min-width: 160px;
    text-align: center;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
}

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

.hero-clock span {
    color: rgba(255, 255, 255, 0.78);
}

.topbar {
    margin-bottom: 20px;
}

.topbar h2 {
    margin: 0 0 6px;
}

.topbar p {
    margin: 0;
    color: #64748b;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card,
.panel {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.card h3,
.panel h3 {
    margin-top: 0;
}

.metric {
    font-size: 30px;
    font-weight: 700;
    margin-top: 12px;
}

.cards-highlight .metric-card {
    border: 1px solid rgba(18, 52, 59, 0.07);
    position: relative;
    overflow: hidden;
}

.cards-highlight .metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #12343b, #d4a373);
}

.panel-accent {
    background: linear-gradient(180deg, #ffffff, #f7fbfc);
    border: 1px solid rgba(18, 52, 59, 0.08);
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    vertical-align: top;
}

th {
    background: #f8fafc;
}

form.inline,
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

input,
select,
textarea,
button {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
}

textarea {
    resize: vertical;
}

button,
.btn {
    background: #12343b;
    color: #fff;
    cursor: pointer;
}

.btn-secondary {
    background: #d4a373;
    color: #1f2937;
}

.flash {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

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

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.status-active,
.status-present {
    background: #dcfce7;
    color: #166534;
}

.status-late {
    background: #fef3c7;
    color: #92400e;
}

.status-absent,
.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.status-leave {
    background: #dbeafe;
    color: #1d4ed8;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.auth-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.muted {
    color: #64748b;
}

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

.attendance-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.action-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid #e2e8f0;
}

.action-card p {
    margin: 0;
    color: #64748b;
}

.check-row {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #334155;
}

.check-row input {
    width: auto;
}

.sidebar-employee {
    background: linear-gradient(180deg, #0f2d33, #12343b 40%, #173f48 100%);
}

.employee-shell .content {
    background: linear-gradient(180deg, rgba(255,255,255,0.25), rgba(255,255,255,0));
}

@media (max-width: 900px) {
    .layout,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding-bottom: 10px;
    }

    .hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .content {
        padding: 16px;
    }

    .card,
    .panel {
        padding: 14px;
        border-radius: 16px;
    }

    .metric {
        font-size: 24px;
    }

    .toolbar,
    form.inline,
    .attendance-actions,
    .actions {
        gap: 10px;
    }

    .field {
        min-width: 100%;
    }

    .nav a,
    button,
    .btn {
        min-height: 46px;
    }

    th,
    td {
        padding: 10px;
        font-size: 13px;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .layout {
        display: block;
    }

    .sidebar {
        padding: 18px 14px;
    }

    .brand h1 {
        font-size: 20px;
        margin-bottom: 14px;
    }

    .content {
        padding: 12px;
    }

    .hero {
        padding: 18px;
        border-radius: 18px;
    }

    .hero h2 {
        font-size: 22px;
    }

    .hero-clock {
        min-width: 100%;
    }

    .hero-clock strong {
        font-size: 32px;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .panel-grid {
        grid-template-columns: 1fr;
    }

    .action-card {
        padding: 14px;
    }

    .topbar h2,
    .panel h3,
    .card h3 {
        font-size: 18px;
    }

    input,
    select,
    textarea,
    button {
        padding: 12px 11px;
        font-size: 16px;
    }
}
