/* ============================================================
   WORKPAY — DESIGN SYSTEM
   "Time, kept well." — petrol teal + warm amber, Manrope/Inter
   Light / Dark Mode
   ============================================================ */

/* ============================================================
   ROOT VARIABLES
   ============================================================ */

:root {
    /* Core palette */
    --ink: #12181a;
    --petrol: #0e6b62;
    --petrol-dark: #0a4f49;
    --petrol-light: #14877b;
    --amber: #e2a53a;
    --amber-dark: #c98c22;

    /* Aliases used across the app */
    --primary: var(--petrol);
    --primary-hover: var(--petrol-dark);
    --primary-soft: #e5f2f0;

    --body-bg: #f5f6f3;
    --surface: #ffffff;
    --surface-2: #f0f3f1;
    --border: #e3e8e4;

    --text: #172220;
    --text-secondary: #5c6b66;
    --text-muted: #8b9a95;

    --success: #1c8a5c;
    --success-soft: #e6f5ec;

    --warning: var(--amber-dark);
    --warning-soft: #fbf1dc;

    --danger: #cf4a5e;
    --danger-soft: #fceaee;

    --info: #1d7fa6;
    --info-soft: #e7f3f8;

    --wp-surface: var(--surface);
    --wp-soft: var(--surface-2);
    --wp-border: var(--border);

    --shadow-sm: 0 2px 8px rgba(18, 24, 26, .04);
    --shadow: 0 10px 30px rgba(18, 24, 26, .07);
    --shadow-lg: 0 24px 60px rgba(18, 24, 26, .14);

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;

    --font-display: 'Manrope', Inter, system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", sans-serif;

    --transition: .2s ease;
}


/* ============================================================
   DARK MODE
   Aktif jika <html data-theme="dark">
   ============================================================ */

html[data-theme="dark"] {

    --ink: #eaf3ef;

    --body-bg: #0b1412;
    --surface: #101c19;
    --surface-2: #152522;

    --border: #23413a;

    --text: #eaf3ef;
    --text-secondary: #a3b8b1;
    --text-muted: #708881;

    --primary-soft: rgba(20, 135, 123, .18);

    --success-soft: rgba(28, 138, 92, .16);
    --warning-soft: rgba(226, 165, 58, .16);
    --danger-soft: rgba(207, 74, 94, .16);
    --info-soft: rgba(29, 127, 166, .16);

    --wp-surface: var(--surface);
    --wp-soft: var(--surface-2);
    --wp-border: var(--border);

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .22);
    --shadow: 0 12px 35px rgba(0, 0, 0, .30);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, .45);
}


/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--body-bg);
    color: var(--text);

    font-family: var(--font-body);

    font-size: 14px;
    line-height: 1.55;

    transition:
        background-color .25s ease,
        color .25s ease;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -.02em;
}


/* ============================================================
   APP LAYOUT
   ============================================================ */

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


/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    width: 255px;

    background: var(--surface);

    border-right: 1px solid var(--border);

    position: fixed;
    inset: 0 auto 0 0;

    z-index: 1000;

    padding: 18px 13px;

    display: flex;
    flex-direction: column;

    overflow-y: auto;

    box-shadow: 4px 0 25px rgba(18, 24, 26, .03);

    transition:
        transform .25s ease,
        background-color .25s ease,
        border-color .25s ease;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--petrol), var(--amber));
    opacity: .8;
}


/* Scrollbar */

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5cf;
    border-radius: 20px;
}


/* ============================================================
   BRAND
   ============================================================ */

.sidebar-brand {
    display: flex;
    gap: 11px;
    align-items: center;

    padding: 7px 9px 20px;

    margin-bottom: 8px;
}

.sidebar-brand strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.2px;
}

.sidebar-brand small {
    display: block;
    margin-top: 1px;

    color: var(--text-muted);

    font-size: 11px;
}


.brand-mark {
    width: 42px;
    height: 42px;

    flex: none;

    border-radius: 13px;

    background: linear-gradient(145deg, var(--petrol-light), var(--petrol-dark));

    color: #fff;

    display: grid;
    place-items: center;

    font-size: 18px;

    box-shadow: 0 8px 18px rgba(14, 107, 98, .28);
}


.brand-logo {
    width: 42px;
    height: 42px;

    object-fit: contain;

    border-radius: 11px;

    background: var(--surface-2);
}


/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */

.sidebar .nav {
    gap: 3px;
}

.nav-link {
    position: relative;

    color: var(--text-secondary);

    border-radius: 11px;

    margin: 1px 0;

    padding: 10px 12px;

    font-weight: 550;

    display: flex;
    align-items: center;
    gap: 10px;

    transition:
        background-color var(--transition),
        color var(--transition),
        transform var(--transition);
}

.nav-link i {
    width: 22px;

    font-size: 15px;

    text-align: center;

    opacity: .9;
}

.nav-link:hover {
    background: var(--surface-2);
    color: var(--primary);

    transform: translateX(2px);
}

.nav-link.active {
    background: var(--primary-soft);
    color: var(--primary);

    font-weight: 650;
}

.nav-link.active::before {
    content: "";

    position: absolute;

    left: -13px;

    width: 3px;
    height: 22px;

    border-radius: 0 5px 5px 0;

    background: var(--amber);
}


/* ============================================================
   SIDEBAR BOTTOM
   ============================================================ */

.sidebar-bottom {
    margin-top: auto;

    padding-top: 12px;

    border-top: 1px solid var(--border);
}


/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main-content {
    margin-left: 255px;

    width: calc(100% - 255px);

    min-width: 0;
}


/* ============================================================
   TOPBAR
   ============================================================ */

.topbar {
    height: 68px;

    background: color-mix(in srgb, var(--surface) 94%, transparent);

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;

    padding: 0 24px;

    position: sticky;
    top: 0;

    z-index: 900;

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    transition:
        background-color .25s ease,
        border-color .25s ease;
}


/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: var(--primary-soft);
    color: var(--primary);

    display: grid;
    place-items: center;

    font-weight: 700;

    border: 1px solid rgba(14, 107, 98, .14);
}


/* ============================================================
   THEME TOGGLE
   ============================================================ */

.theme-toggle {
    width: 38px;
    height: 38px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: var(--surface);

    color: var(--text-secondary);

    display: inline-grid;
    place-items: center;

    cursor: pointer;

    transition:
        background-color var(--transition),
        color var(--transition),
        border-color var(--transition),
        transform var(--transition);
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: rgba(14, 107, 98, .3);

    transform: translateY(-1px);
}


/* ============================================================
   CARDS
   ============================================================ */

.card,
.stat-card {
    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

    background: var(--surface);

    box-shadow: var(--shadow-sm);

    transition:
        background-color .25s ease,
        border-color .25s ease,
        box-shadow var(--transition),
        transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.stat-card {
    padding: 19px;

    height: 100%;

    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);

    box-shadow: var(--shadow);
}


/* ============================================================
   STAT ICON
   ============================================================ */

.stat-icon {
    width: 46px;
    height: 46px;

    border-radius: 13px;

    background: var(--primary-soft);
    color: var(--primary);

    display: grid;
    place-items: center;

    font-size: 17px;
}


/* ============================================================
   PAGE TITLE
   ============================================================ */

.page-title {
    font-family: var(--font-display);

    font-size: 1.5rem;

    font-weight: 800;

    letter-spacing: -.02em;

    color: var(--text);
}

.section-title {
    font-family: var(--font-display);

    font-size: .98rem;

    font-weight: 750;

    color: var(--text);
}

.small-muted {
    font-size: .82rem;

    color: var(--text-muted);
}


/* ============================================================
   FORMS
   ============================================================ */

.form-label {
    color: var(--text);

    font-weight: 600;

    font-size: .86rem;

    margin-bottom: 6px;
}

.form-control,
.form-select {
    min-height: 42px;

    border-radius: 11px;

    padding: .62rem .8rem;

    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text);

    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background-color var(--transition);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    background: var(--surface);

    color: var(--text);

    border-color: rgba(14, 107, 98, .55);

    box-shadow: 0 0 0 3px rgba(14, 107, 98, .12);
}

textarea.form-control {
    min-height: 100px;
}

.input-group-text {
    border-color: var(--border);

    border-radius: 11px 0 0 11px;

    background: var(--surface-2);

    color: var(--text-secondary);
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    border-radius: 10px;

    font-weight: 600;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background-color var(--transition),
        border-color var(--transition),
        color var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--petrol);
    border-color: var(--petrol);

    box-shadow: 0 5px 14px rgba(14, 107, 98, .2);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--petrol-dark);
    border-color: var(--petrol-dark);

    box-shadow: 0 7px 18px rgba(14, 107, 98, .26);
}

.btn-outline-primary {
    color: var(--petrol);
    border-color: var(--petrol);
}

.btn-outline-primary:hover {
    background: var(--petrol);
    border-color: var(--petrol);
}

.text-primary {
    color: var(--petrol) !important;
}

.btn-check:checked + .btn-outline-primary,
.btn-outline-primary:active {
    background: var(--petrol);
    border-color: var(--petrol);
}


/* ============================================================
   TABLE
   ============================================================ */

.table {
    color: var(--text);

    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 12px 10px;

    vertical-align: middle;

    border-color: var(--border);
}

.table thead th {
    background: var(--surface-2);

    color: var(--text-secondary);

    font-size: .74rem;

    font-weight: 750;

    text-transform: uppercase;

    letter-spacing: .06em;

    white-space: nowrap;
}

.table tbody tr {
    transition: background-color var(--transition);
}

.table tbody tr:hover {
    background: var(--surface-2);
}

/* Row identity chip — used for employee names in tables */
.row-avatar {
    width: 36px;
    height: 36px;
    flex: none;

    border-radius: 10px;

    display: grid;
    place-items: center;

    font-weight: 700;
    font-size: .8rem;

    color: var(--petrol);
    background: var(--primary-soft);
}


/* ============================================================
   BADGES
   ============================================================ */

.badge-soft {
    background: var(--primary-soft);

    color: var(--primary);

    border-radius: 99px;

    padding: 5px 9px;

    font-size: .75rem;

    font-weight: 650;
}

.warning-chip,
.success-chip,
.danger-chip {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    padding: 5px 9px;

    border-radius: 99px;

    font-size: .75rem;

    font-weight: 600;
}

.warning-chip {
    background: var(--warning-soft);
    color: var(--warning);
}

.success-chip {
    background: var(--success-soft);
    color: var(--success);
}

.danger-chip {
    background: var(--danger-soft);
    color: var(--danger);
}

.text-bg-success {
    background-color: var(--success) !important;
}

.text-bg-warning {
    background-color: var(--amber) !important;
    color: #4a3306 !important;
}

.text-bg-secondary {
    background-color: var(--text-muted) !important;
}


/* ============================================================
   ALERT
   ============================================================ */

.alert {
    border-radius: 12px;

    border-width: 1px;
}

.alert-primary {
    background: var(--primary-soft);

    color: var(--petrol-dark);

    border-color: rgba(14, 107, 98, .14);
}

.alert-info {
    background: var(--info-soft);

    color: var(--info);

    border-color: rgba(29, 127, 166, .16);
}

.alert-warning {
    background: var(--warning-soft);

    color: #7a5410;

    border-color: rgba(226, 165, 58, .16);
}


/* ============================================================
   ATTENDANCE
   ============================================================ */

.time-box {
    font-family: var(--font-display);

    font-size: 1.35rem;

    font-weight: 800;

    letter-spacing: -.02em;
}

.attendance-card {
    border-left: 4px solid var(--primary);

    border-radius: 0 var(--radius) var(--radius) 0;
}


/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-page {
    min-height: 100vh;

    display: grid;

    place-items: center;

    padding: 20px;

    background:
        radial-gradient(circle at top left, rgba(14, 107, 98, .14), transparent 35%),
        radial-gradient(circle at bottom right, rgba(226, 165, 58, .12), transparent 35%),
        var(--body-bg);
}

.login-card {
    width: min(430px, 100%);

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-xl);

    padding: 32px;

    box-shadow: var(--shadow-lg);
}

.login-logo {
    width: 72px;
    height: 72px;

    object-fit: contain;

    border-radius: 16px;
}


/* ============================================================
   LOGO PREVIEW
   ============================================================ */

.logo-preview {
    max-width: 140px;
    max-height: 90px;

    object-fit: contain;

    border: 1px solid var(--border);

    border-radius: 12px;

    padding: 7px;

    background: #fff;
}


/* ============================================================
   STICKY ACTION
   ============================================================ */

.sticky-action {
    position: sticky;

    bottom: 12px;

    z-index: 20;
}


/* ============================================================
   DROPDOWN
   ============================================================ */

.dropdown-menu {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 13px;

    box-shadow: var(--shadow);

    padding: 6px;
}

.dropdown-item {
    color: var(--text-secondary);

    border-radius: 9px;

    padding: 8px 10px;

    font-size: .88rem;
}

.dropdown-item:hover {
    background: var(--surface-2);

    color: var(--primary);
}


/* ============================================================
   MODAL
   ============================================================ */

.modal-content {
    background: var(--surface);

    color: var(--text);

    border: 1px solid var(--border);

    border-radius: 18px;

    box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}


/* ============================================================
   PAGINATION
   ============================================================ */

.page-link {
    background: var(--surface);

    color: var(--text-secondary);

    border-color: var(--border);
}

.page-link:hover {
    background: var(--primary-soft);

    color: var(--primary);

    border-color: var(--border);
}

.page-item.active .page-link {
    background: var(--primary);

    border-color: var(--primary);
}


/* ============================================================
   HR
   ============================================================ */

hr {
    border-color: var(--border);

    opacity: 1;
}


/* ============================================================
   DARK MODE — BOOTSTRAP OVERRIDES
   (ditulis FLAT, tanpa CSS nesting, supaya kompatibel di semua
   browser — versi nested sebelumnya bisa gagal di-parse di
   browser/WebView yang belum mendukung native CSS nesting,
   sehingga terlihat seolah "dark mode tidak berubah")
   ============================================================ */

html[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .text-dark {
    color: var(--text) !important;
}

html[data-theme="dark"] .bg-white {
    background-color: var(--surface) !important;
}

html[data-theme="dark"] .border {
    border-color: var(--border) !important;
}

html[data-theme="dark"] .table-light {
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--text);
}

html[data-theme="dark"] .btn-outline-primary {
    color: #63c6b8;
    border-color: #1f7a70;
}

html[data-theme="dark"] .btn-outline-primary:hover {
    color: #fff;
    background: var(--primary);
}

html[data-theme="dark"] .btn-close {
    filter: invert(1);
}


/* ============================================================
   MOBILE SIDEBAR
   ============================================================ */

@media (max-width: 991px) {

    .sidebar {
        transform: translateX(-100%);

        box-shadow: 15px 0 45px rgba(18, 24, 26, .14);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;

        width: 100%;
    }

    .topbar {
        padding: 0 14px;

        height: 62px;
    }

    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .page-title {
        font-size: 1.25rem;
    }
}


/* ============================================================
   SMALL MOBILE
   ============================================================ */

@media (max-width: 575px) {

    .card {
        border-radius: 14px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;

        border-radius: 11px;
    }

    .login-card {
        padding: 24px;

        border-radius: 18px;
    }

    .topbar {
        padding: 0 10px;
    }
}


/* ============================================================
   REDUCE MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition: none !important;

        animation: none !important;
    }
}



/* ============================================================
   WORKPAY DASHBOARD
   ============================================================ */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.dashboard-date {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wp-surface);
    border: 1px solid var(--wp-border);
    border-radius: 14px;
    padding: 10px 14px;
}

.dashboard-date-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--petrol);
}

.dashboard-stat {
    min-height: 135px;
}

.stat-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    height: 100%;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

.stat-description {
    font-size: .76rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.stat-description .warning-chip {
    margin: 0;
}

.stat-icon {
    flex: 0 0 auto;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--wp-border);
    background: var(--wp-soft);
    color: var(--text-secondary);
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    transition: .2s ease;
}

.icon-btn:hover {
    background: var(--primary-soft);
    color: var(--petrol);
    border-color: rgba(14, 107, 98, .25);
}


/* ------------------------------------------------------------
   Stat card accent bar — a quiet identity mark per card
   ------------------------------------------------------------ */

.stat-card::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--petrol), var(--amber));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s ease;
}

.stat-card:hover::after {
    transform: scaleX(1);
}


/* ------------------------------------------------------------
   Load-in sequence for dashboard stat cards (single orchestrated
   reveal, respects prefers-reduced-motion via the rule above)
   ------------------------------------------------------------ */

.dashboard-stat {
    opacity: 0;
    animation: wp-rise .5s ease forwards;
}

.row.g-3.mb-4 > *:nth-child(1) .dashboard-stat { animation-delay: .02s; }
.row.g-3.mb-4 > *:nth-child(2) .dashboard-stat { animation-delay: .10s; }
.row.g-3.mb-4 > *:nth-child(3) .dashboard-stat { animation-delay: .18s; }
.row.g-3.mb-4 > *:nth-child(4) .dashboard-stat { animation-delay: .26s; }

@keyframes wp-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ------------------------------------------------------------
   Attendance progress ring (SVG, drawn via stroke-dashoffset)
   ------------------------------------------------------------ */

.progress-ring {
    position: relative;
    width: 64px;
    height: 64px;
    flex: none;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring circle {
    fill: none;
    stroke-width: 6;
}

.progress-ring .ring-track {
    stroke: var(--surface-2);
}

.progress-ring .ring-value {
    stroke: var(--petrol);
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 163.36;
    animation: wp-ring-draw 1.1s .3s cubic-bezier(.4, 0, .2, 1) forwards;
}

.progress-ring .ring-label {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: .82rem;
    color: var(--petrol);
}

@keyframes wp-ring-draw {
    to {
        stroke-dashoffset: var(--ring-offset, 0);
    }
}


/* ============================================================
   ATTENDANCE TIMELINE
   ============================================================ */

.attendance-timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.attendance-step {
    position: relative;
    padding: 8px 12px;
    text-align: center;
}

.attendance-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 27px;
    left: 62%;
    width: 76%;
    height: 1px;
    background: var(--wp-border);
    z-index: 0;
}

.attendance-step-icon {
    position: relative;
    z-index: 1;
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--petrol);
    font-size: 18px;
    border: 4px solid var(--wp-surface);
    box-shadow: 0 0 0 1px rgba(14, 107, 98, .16);
    transition: transform .2s ease, box-shadow .2s ease;
}

.attendance-step.is-current .attendance-step-icon {
    background: var(--amber);
    color: #4a3306;
    box-shadow: 0 0 0 1px var(--amber), 0 0 0 6px rgba(226, 165, 58, .18);
    animation: wp-pulse 2.2s ease-in-out infinite;
}

@keyframes wp-pulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--amber), 0 0 0 6px rgba(226, 165, 58, .18); }
    50%      { box-shadow: 0 0 0 1px var(--amber), 0 0 0 10px rgba(226, 165, 58, .06); }
}

.attendance-time {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
}

.attendance-label {
    font-size: .82rem;
    font-weight: 600;
    margin-top: 3px;
}


/* ============================================================
   SCHEDULE
   ============================================================ */

.schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--wp-border);
}

.schedule-row:last-of-type {
    border-bottom: 0;
}

.schedule-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--petrol);
}

.schedule-duration {
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.schedule-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 16px;
    border-radius: 13px;
    background: var(--wp-soft);
    border: 1px solid var(--wp-border);
}

.schedule-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: 13px;
    background: var(--primary-soft);
    color: var(--petrol);
}

.schedule-total > i {
    font-size: 20px;
}


/* ============================================================
   RULE CARDS
   ============================================================ */

.rule-card {
    height: 100%;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--wp-border);
    border-radius: 14px;
    background: var(--wp-soft);
    transition: transform var(--transition), box-shadow var(--transition);
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.rule-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--wp-surface);
    color: var(--petrol);
    border: 1px solid var(--wp-border);
}


/* ============================================================
   DARK MODE — WORKPAY-SPECIFIC ELEMENTS
   ============================================================ */

html[data-theme="dark"] .dashboard-date-icon,
html[data-theme="dark"] .attendance-step-icon,
html[data-theme="dark"] .schedule-icon {
    background: rgba(20, 135, 123, .18);
    border-color: rgba(20, 135, 123, .3);
}

html[data-theme="dark"] .dashboard-date {
    background: var(--wp-surface);
    border-color: var(--wp-border);
}

html[data-theme="dark"] .schedule-summary,
html[data-theme="dark"] .rule-card {
    background: var(--wp-soft);
    border-color: var(--wp-border);
}

html[data-theme="dark"] .schedule-total {
    background: rgba(20, 135, 123, .18);
}

html[data-theme="dark"] .icon-btn {
    background: var(--wp-soft);
    border-color: var(--wp-border);
}

html[data-theme="dark"] .progress-ring .ring-track {
    stroke: var(--surface-2);
}

html[data-theme="dark"] .attendance-step.is-current .attendance-step-icon {
    color: #1a1200;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {

    .attendance-timeline {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 25px;
    }

    .attendance-step::after {
        display: none;
    }

}


@media (max-width: 575px) {

    .dashboard-header {
        align-items: flex-start;
    }

    .stat-number {
        font-size: 1.65rem;
    }

    .dashboard-stat {
        min-height: 120px;
    }

    .attendance-timeline {
        grid-template-columns: repeat(2, 1fr);
    }

    .attendance-step {
        padding: 5px;
    }

    .attendance-step-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

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

}


/* ============================================================
   LIVE CAMERA CAPTURE — SELFIE ABSENSI
   Kartu kamera dengan overlay tanggal/jam/lokasi real-time,
   dipakai di portal karyawan saat mengambil selfie absensi.
   ============================================================ */

.camera-modal .modal-body {
    padding-top: 18px;
}

.camera-stage {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 62vh;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #060c0b;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.camera-stage.camera-error {
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-stage video,
.camera-stage img#capturedPreview {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    display: block;
}

.camera-stage video {
    transform: scaleX(-1); /* pratinjau dicerminkan agar terasa alami seperti kaca */
}

.camera-live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(207, 74, 94, .92);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.camera-live-badge i {
    font-size: 7px;
    animation: wp-live-blink 1.4s ease-in-out infinite;
}

@keyframes wp-live-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.camera-overlay-info {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2;

    background: rgba(6, 12, 11, .55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    border: 1px solid rgba(255, 255, 255, .08);
    border-left: 3px solid var(--amber);
    border-radius: 12px;

    padding: 10px 12px;

    color: #fff;
    font-size: .76rem;

    display: flex;
    flex-direction: column;
    gap: 4px;

    pointer-events: none;
}

.camera-overlay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.camera-overlay-row i {
    width: 14px;
    flex: none;
    color: var(--amber);
    font-size: .72rem;
}

.camera-status {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;

    max-width: 90%;
    text-align: center;

    color: #fff;
    font-size: .72rem;
    font-weight: 600;

    background: rgba(0, 0, 0, .45);
    border-radius: 99px;
    padding: 5px 12px;
}

.camera-status:empty {
    display: none;
}

.camera-actions {
    display: flex;
    gap: 10px;
}

#captureBtn {
    box-shadow: 0 6px 18px rgba(14, 107, 98, .28);
}

#captureBtn:not(:disabled) {
    animation: wp-capture-ready .5s ease;
}

@keyframes wp-capture-ready {
    from { transform: translateY(4px); opacity: .6; }
    to   { transform: translateY(0); opacity: 1; }
}


/* ============================================================
   EVIDENCE VIEWER (ADMIN) — FOTO & LOKASI PER SLOT ABSENSI
   ============================================================ */

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

.evidence-card {
    border: 1px solid var(--wp-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--wp-soft);
    transition: transform var(--transition), box-shadow var(--transition);
}

.evidence-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.evidence-photo-wrap {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #060c0b;
}

.evidence-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    display: block;
    transition: transform .3s ease;
}

.evidence-photo-wrap img:hover {
    transform: scale(1.03);
}

.evidence-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: .78rem;
}

.evidence-body {
    padding: 12px 14px 14px;
}

.evidence-coords {
    font-size: .72rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.evidence-map {
    height: 130px;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
    border: 1px solid var(--wp-border);
}


/* ============================================================
   LIGHTBOX — PRATINJAU FOTO PENUH
   ============================================================ */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 32px;

    background: rgba(4, 8, 7, .92);
}

.lightbox-overlay.show {
    display: flex;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 26px;

    color: #fff;
    font-size: 30px;
    line-height: 1;

    cursor: pointer;
    opacity: .85;
    transition: opacity var(--transition), transform var(--transition);
}

.lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}


/* ============================================================
   DARK MODE — CAMERA & EVIDENCE
   ============================================================ */

html[data-theme="dark"] .evidence-card {
    background: var(--wp-soft);
    border-color: var(--wp-border);
}

html[data-theme="dark"] .camera-stage {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}


/* ============================================================
   RESPONSIVE — CAMERA & EVIDENCE
   ============================================================ */

@media (max-width: 575px) {

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

}


/* ============================================================
   CAMERA MODAL — MOBILE FULLSCREEN & FLEX CONTAINMENT FIX
   ------------------------------------------------------------
   SATU-SATUNYA sumber aturan responsif untuk modal kamera.
   Breakpoint disatukan jadi 576px, dan semua elemen anak
   dipaksa max-width:100% sebagai pengaman tambahan.

   Catatan teknis:
   1) `vh` di browser mobile tidak akurat karena menghitung area
      yang tertutup address bar, jadi tinggi kotak kamera bisa
      salah hitung. Solusinya pakai `dvh` (dynamic viewport
      height) dengan fallback `vh`.
   2) `.modal-content` Bootstrap adalah flex container
      (display:flex; flex-direction:column). Tanpa `min-height:0`
      pada anak-anaknya, video di dalam `.camera-stage` (yang
      secara intrinsik sangat tinggi di mode potret HP) akan
      mendorong keluar batas kotaknya, bukan di-crop oleh
      `overflow:hidden` — inilah yang membuat video, tombol, dan
      teks halaman di belakang modal jadi kelihatan numpuk/melebar.
   3) `video`/`img` di dalam `.camera-stage` dipaksa
      `width/height: 100% !important` supaya resolusi asli kamera
      (diminta 1080x1440) tidak pernah mendikte ukuran container.
   ============================================================ */

#selfieModal .modal-content,
#selfieModal .modal-body {
    min-height: 0;
}

#selfieModal .modal-dialog {
    overflow-x: hidden;
}

.camera-stage,
.camera-stage * {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 576px) {

    #selfieModal.modal {
        padding: 0 !important;
    }

    #selfieModal .modal-dialog,
    #selfieModal .modal-dialog.modal-dialog-centered {
        margin: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        display: flex;
        align-items: stretch;
        min-height: 0;
    }

    #selfieModal .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    #selfieModal .modal-header,
    #selfieModal .modal-footer {
        flex: 0 0 auto;
    }

    #selfieModal .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .camera-stage {
        width: 100%;
        max-height: 44vh;
        max-height: 44dvh;
    }

    .camera-stage video,
    .camera-stage img#capturedPreview {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        object-fit: cover;
    }

    .camera-overlay-info {
        font-size: .7rem;
        padding: 8px 10px;
    }

    .camera-actions,
    #reviewActions {
        flex-direction: column;
    }

    .camera-actions .btn,
    #reviewActions .btn {
        width: 100%;
    }

    /* Kartu slot absensi jadi 1 kolom penuh di HP supaya tombol
       besar & mudah disentuh (pindahan dari inline style lama
       employee_attendance.php) */
    #slotGrid .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

}


/* ============================================================
   RIWAYAT ABSENSI — TABEL RESPONSIF
   ============================================================ */

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 575px) {

    .table-responsive table {
        min-width: 640px;
    }

    .table thead th,
    .table tbody td {
        font-size: .8rem;
        padding: 10px 8px;
    }

}