body.app-body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(212, 166, 96, 0.18), transparent 28%),
        linear-gradient(135deg, var(--background-color, #f8f1e6) 0%, color-mix(in srgb, var(--background-color, #f8f1e6) 82%, white 18%) 45%, #fbf8f3 100%);
    color: #2c1a0f;
}

.sidebar-wrap {
    background: var(--primary-color);
    padding: 1rem 0.85rem;
    transition: width 0.25s ease, padding 0.25s ease;
    width: 16rem;
}

.sidebar-panel {
    position: sticky;
    top: 1rem;
    min-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.brand-tag,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: #d7782a;
}

.sidebar-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.sidebar-logo,
.topbar-logo,
.login-brand-logo {
    object-fit: cover;
    border-radius: 1rem;
    border: 1px solid rgba(133, 93, 58, 0.18);
    background: #fffaf5;
}

.sidebar-logo {
    width: 2.4rem;
    height: 2.4rem;
}

.sidebar-title,
.display-title,
.section-title {
    font-family: 'DM Serif Display', serif;
}

.sidebar-title {
    font-size: 1.9rem;
    line-height: 1;
    color: #fffaf4;
    margin: 0;
}

.nav-pill {
    border-radius: 1.1rem;
    padding: 0.8rem 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: #fff3e7;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 0.2s ease, padding 0.2s ease;
}

.nav-pill:hover,
.nav-pill.active {
    background: var(--secondary-color);
    color: #ffffff;
}

.nav-icon {
    font-size: 1.05rem;
    min-width: 1.2rem;
}

.sidebar-footer {
    margin-top: auto;
    border-radius: 1.25rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-color) 42%, transparent), color-mix(in srgb, var(--primary-color) 88%, black 12%));
    color: #fff8f1;
}

.content-wrap {
    padding: 2rem;
}

.topbar-card {
    border-radius: 1.4rem;
    background: color-mix(in srgb, var(--card-background-color, #fffaf5) 92%, white 8%);
    border: 1px solid rgba(133, 93, 58, 0.12);
    box-shadow: 0 0.8rem 2rem rgba(91, 61, 33, 0.06);
    padding: 1rem 1.25rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.topbar-logo {
    width: 2.8rem;
    height: 2.8rem;
}

.hero-card,
.soft-card {
    border-radius: 2rem;
    background: color-mix(in srgb, var(--card-background-color, #fffaf5) 92%, white 8%);
    border: 1px solid rgba(133, 93, 58, 0.12);
    box-shadow: 0 1.25rem 2.75rem rgba(91, 61, 33, 0.08);
}

.hero-card {
    padding: 2.25rem;
}

.soft-card {
    padding: 1.75rem;
}

.display-title {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.95;
    margin: 0.5rem 0 1rem;
}

.lead-copy {
    max-width: 60rem;
    font-size: 1.1rem;
    line-height: 1.85;
    color: #6d5240;
}

.metric-stack {
    min-width: 16rem;
    display: grid;
    gap: 0.9rem;
}

.metric-stack-horizontal {
    flex: 1 1 28rem;
    min-width: min(100%, 28rem);
    grid-template-columns: repeat(4, minmax(10rem, 1fr));
    align-items: stretch;
}

.metric-box {
    border-radius: 1.25rem;
    padding: 1rem 1.15rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--card-background-color, #fffaf5) 88%, white 12%),
        color-mix(in srgb, var(--card-background-color, #fffaf5) 72%, #ecdac6 28%)
    );
}

.metric-box span {
    display: block;
    color: #7f634f;
    font-size: 0.9rem;
}

.metric-box strong {
    font-size: 1.75rem;
}

.report-filter-form {
    row-gap: 0.75rem;
}

.section-title {
    font-size: 2.1rem;
    margin-bottom: 1rem;
}

.list-clean {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.9;
    color: #654c3b;
}

.data-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(109, 82, 64, 0.12);
}

.data-row:last-child {
    border-bottom: 0;
}

.list-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(133, 93, 58, 0.16);
    background: color-mix(in srgb, var(--card-background-color, #fffaf5) 90%, white 10%);
    padding: 1rem 1.15rem;
}

.btn-accent {
    background: var(--button-color, var(--accent-color));
    color: var(--button-text-color, #fff);
    border: 1px solid color-mix(in srgb, var(--button-color, var(--accent-color)) 78%, black 22%);
    box-shadow: 0 0.4rem 0.85rem color-mix(in srgb, var(--button-color, var(--accent-color)) 24%, transparent);
}

.btn-accent:hover {
    filter: brightness(0.92);
    color: var(--button-text-color, #fff);
}

.table thead th {
    color: #7b5f4d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table tbody td {
    vertical-align: middle;
}

.badge.text-bg-light {
    color: #6a4a32 !important;
    background: #fffaf5 !important;
}

.login-shell {
    width: min(100%, 72rem);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
    gap: 1.25rem;
}

.login-brand-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.login-hero-image {
    width: 100%;
    border-radius: 1.5rem;
    object-fit: cover;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(133, 93, 58, 0.12);
    box-shadow: 0 1rem 2rem rgba(91, 61, 33, 0.08);
}

.login-brand-logo {
    width: 5rem;
    height: 5rem;
    margin-bottom: 1rem;
}

.employee-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.95rem;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #fffaf5, #f4eadf);
    color: var(--primary-color);
    font-weight: 700;
    flex-shrink: 0;
}

.employee-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.report-thumb {
    width: 3.4rem;
    height: 3.4rem;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid rgba(133, 93, 58, 0.14);
}

.smtp-logo-panel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    border-radius: 1.25rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--card-background-color, #fffaf5) 88%, white 12%),
        color-mix(in srgb, var(--card-background-color, #fffaf5) 72%, #ecdac6 28%)
    );
    border: 1px solid rgba(133, 93, 58, 0.12);
}

.audit-note {
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    background: color-mix(in srgb, var(--card-background-color, #fffaf5) 90%, white 10%);
    border: 1px solid rgba(133, 93, 58, 0.12);
    color: #6d5240;
    font-size: 0.92rem;
}

.app-footer {
    padding: 1.25rem 0 0.5rem;
    color: #7f634f;
    font-size: 0.9rem;
}

.sidebar-toggle {
    border-radius: 0.85rem;
}

body.sidebar-collapsed .sidebar-wrap {
    width: 6rem;
    padding: 0.9rem 0.6rem;
}

body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer .small,
body.sidebar-collapsed .sidebar-footer .fw-semibold,
body.sidebar-collapsed .sidebar-logo {
    display: none;
}

body.sidebar-collapsed .nav-pill {
    justify-content: center;
    padding: 0.85rem;
}

body.sidebar-collapsed .sidebar-logo-wrap {
    justify-content: center;
}

.mobile-punch-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.mobile-punch-card {
    width: min(100%, 38rem);
    border-radius: 2rem;
    background: color-mix(in srgb, var(--card-background-color, #fffaf5) 96%, white 4%);
    border: 1px solid rgba(133, 93, 58, 0.12);
    box-shadow: 0 1.25rem 2.75rem rgba(91, 61, 33, 0.12);
    padding: 1.5rem;
}

.mobile-time-pill,
.mobile-next-punch {
    border-radius: 1.25rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--card-background-color, #fffaf5) 88%, white 12%),
        color-mix(in srgb, var(--card-background-color, #fffaf5) 72%, #ecdac6 28%)
    );
    border: 1px solid rgba(133, 93, 58, 0.14);
    padding: 1rem 1.1rem;
}

.mobile-time-pill {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0;
}

.mobile-next-punch span {
    display: block;
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    color: #8a6d58;
    margin-bottom: 0.2rem;
}

.mobile-next-punch strong {
    font-size: 1.1rem;
    color: #2c1a0f;
}

.camera-stage {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    background: #24170f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 18rem;
}

.camera-video {
    width: 100%;
    min-height: 18rem;
    display: block;
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-fallback {
    display: grid;
    place-items: center;
    min-height: 18rem;
    color: #fff3e7;
    text-align: center;
    padding: 1rem;
}

.mobile-punch-result {
    border-radius: 1.25rem;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--card-background-color, #fffaf5) 88%, white 12%),
        color-mix(in srgb, var(--card-background-color, #fffaf5) 72%, #ecdac6 28%)
    );
    border: 1px solid rgba(133, 93, 58, 0.14);
    padding: 1rem 1.1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.attendance-calendar {
    display: grid;
    gap: 0.75rem;
}

.calendar-weekdays,
.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a6d58;
}

.calendar-day {
    min-height: 5.7rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(133, 93, 58, 0.12);
    padding: 0.55rem;
    background: #fffaf5;
}

.calendar-day-outside {
    opacity: 0.42;
}

.calendar-day-number {
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
}

.calendar-day-status {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
}

.calendar-day-subtitle {
    font-size: 0.68rem;
    line-height: 1.3;
    color: #6d5240;
    margin-top: 0.2rem;
}

.calendar-status-present {
    background: linear-gradient(180deg, #effaf0, #dff2e2);
}

.calendar-status-holiday {
    background: linear-gradient(180deg, #fff4e7, #ffe7c6);
}

.calendar-status-holiday-worked {
    background: linear-gradient(180deg, #edf4ff, #dbe8ff);
}

.calendar-status-weeklyoff {
    background: linear-gradient(180deg, #f3f5f8, #e2e8ef);
}

.calendar-status-weeklyoff-worked {
    background: linear-gradient(180deg, #eef7ff, #d5ebff);
}

.calendar-status-other {
    background: linear-gradient(180deg, #f7f2fb, #ece0f7);
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.2rem;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #6d5240;
    font-size: 0.92rem;
}

.calendar-dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(133, 93, 58, 0.18);
}

.calendar-dot-present { background: #dff2e2; }
.calendar-dot-holiday { background: #ffe7c6; }
.calendar-dot-holiday-worked { background: #dbe8ff; }
.calendar-dot-weeklyoff { background: #e2e8ef; }
.calendar-dot-weeklyoff-worked { background: #d5ebff; }

@media print {
    .sidebar-wrap,
    .topbar-card,
    .app-footer,
    .btn,
    form,
    .alert {
        display: none !important;
    }

    .content-wrap {
        padding: 0 !important;
    }

    .soft-card {
        box-shadow: none !important;
        border: 1px solid #d8c9b8 !important;
        background: #fff !important;
    }

    .calendar-weekdays,
    .calendar-week {
        gap: 0.35rem;
    }

    .calendar-day {
        min-height: 6.4rem;
        break-inside: avoid;
    }
}

@media (max-width: 991.98px) {
    .sidebar-wrap {
        width: 100%;
        padding: 0.8rem;
    }

    .sidebar-panel {
        min-height: auto;
        position: static;
        gap: 0.9rem;
    }

    .sidebar-title {
        font-size: 1.65rem;
    }

    .nav.flex-column {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem !important;
    }

    .nav-pill {
        text-align: center;
        padding: 0.8rem 0.9rem;
        justify-content: center;
    }

    .content-wrap {
        padding: 1rem;
    }

    .hero-card,
    .soft-card {
        border-radius: 1.5rem;
        padding: 1.2rem;
    }

    .metric-stack {
        min-width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .metric-box strong {
        font-size: 1.45rem;
    }

    .mobile-punch-shell {
        padding: 0.8rem;
    }

    .mobile-punch-card {
        border-radius: 1.5rem;
        padding: 1.1rem;
    }

    .mobile-time-pill {
        flex-direction: column;
    }

    .camera-stage,
    .camera-video,
    .camera-fallback {
        min-height: 15rem;
    }

    .topbar-card {
        padding: 0.9rem 1rem;
    }

    .mobile-punch-result {
        flex-direction: column;
    }

    .calendar-legend {
        gap: 0.6rem 0.9rem;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .nav.flex-column {
        grid-template-columns: 1fr;
    }

    .display-title,
    .section-title {
        line-height: 1.02;
    }

    .metric-stack {
        grid-template-columns: 1fr;
    }

    .metric-stack-horizontal {
        grid-template-columns: 1fr;
    }

    .lead-copy {
        font-size: 1rem;
        line-height: 1.65;
    }

    .report-filter-form .col-6,
    .report-filter-form .col-12 {
        width: 100%;
    }

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

    .topbar-user {
        align-items: flex-start;
        flex-wrap: wrap;
    }

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

    .calendar-day {
        min-height: 4.8rem;
    }
}
