/* =====================================================================
   SIMKA — "Monday.com inspired" design tokens & layout
   ===================================================================== */

:root {
    --simka-purple: #7c5cff;
    --simka-purple-dark: #6a48f2;
    --simka-teal: #00b8a9;
    --simka-teal-dark: #009688;
    --simka-bg: #f5f4fc;
    --simka-card: #ffffff;
    --simka-border: #ece9f8;
    --simka-text: #1c1730;
    --simka-text-muted: #746f8c;
    --simka-text-faint: #a29dbd;
    --simka-danger: #ef4444;
    --simka-warning: #ee9c2c;
    --simka-success: #17b26a;
    --simka-info: #2f7ff0;
    --simka-pink: #ef5fa7;
    --simka-purple-soft: color-mix(in srgb, var(--simka-purple) 12%, #fff);
    --simka-success-soft: color-mix(in srgb, var(--simka-success) 14%, #fff);
    --simka-warning-soft: color-mix(in srgb, var(--simka-warning) 16%, #fff);
    --simka-danger-soft: color-mix(in srgb, var(--simka-danger) 12%, #fff);
    --simka-info-soft: color-mix(in srgb, var(--simka-info) 12%, #fff);
    --simka-pink-soft: color-mix(in srgb, var(--simka-pink) 12%, #fff);
    --simka-radius: 14px;
    --simka-shadow: 0 1px 2px rgba(30, 20, 80, 0.04), 0 8px 24px -8px rgba(60, 40, 150, 0.12);
    --simka-shadow-hover: 0 4px 10px rgba(30, 20, 80, 0.05), 0 14px 32px -8px rgba(60, 40, 150, 0.18);
    --sidebar-width: 258px;
    --bottom-nav-height: 62px;
    --sidebar-from: #322671;
    --sidebar-to: #221a53;
    --sidebar-text: #c9c2ea;
    --sidebar-text-dim: #8f87b8;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 74px;
}

body {
    background-color: var(--simka-bg);
    color: var(--simka-text);
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ---------------------------------------------------------------------
   Layout shell: sidebar + topbar + content
   --------------------------------------------------------------------- */
.simka-shell {
    display: flex;
    min-height: 100vh;
}

.simka-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-from), var(--sidebar-to));
    border-right: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 24px rgba(20, 14, 50, 0.10);
}

.simka-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: none;
    background: none;
}

.simka-sidebar-brand .logo-badge {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--simka-purple-dark);
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.simka-sidebar-brand .brand-text {
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -0.01em;
    color: #ffffff;
    line-height: 1.25;
}

.simka-sidebar-brand .brand-sub {
    font-size: 10.5px;
    color: var(--sidebar-text-dim);
    margin-top: 1px;
}

.simka-nav {
    padding: 16px 14px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--simka-border) transparent;
}

.simka-nav::-webkit-scrollbar {
    width: 6px;
}

.simka-nav::-webkit-scrollbar-thumb {
    background: var(--simka-border);
    border-radius: 6px;
}

.simka-nav .nav-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text-dim);
    padding: 14px 10px 8px;
}

.simka-nav .nav-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--sidebar-text);
    padding: 10px 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.simka-nav .nav-section-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.simka-nav .nav-section-toggle .chevron {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.simka-nav .nav-section-toggle.collapsed .chevron {
    transform: rotate(-90deg);
}

.simka-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px 9px 16px;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 3px;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.simka-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    transform: translateX(2px);
}

.simka-nav .nav-link.active {
    background: var(--simka-purple);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px -4px rgba(124, 92, 255, 0.7);
}

.simka-nav .nav-link.active::before {
    content: none;
}

.simka-nav .nav-link i {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 7px;
    flex-shrink: 0;
    transition: background-color 0.15s ease;
}

.simka-nav .nav-link.active i {
    background: rgba(255, 255, 255, 0.16);
}

.simka-sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 11.5px;
    color: var(--sidebar-text-dim);
}

.simka-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.simka-topbar {
    background: var(--simka-card);
    border-bottom: 1px solid var(--simka-border);
    box-shadow: 0 1px 2px rgba(30, 20, 80, 0.03);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.simka-topbar .page-title {
    font-size: 18px;
    font-weight: 700;
}

.simka-topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.simka-topbar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--simka-purple), var(--simka-teal));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-toggle-btn {
    display: none;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--simka-text);
}

.simka-content {
    padding: 24px;
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.simka-card {
    background: var(--simka-card);
    border: none;
    border-radius: var(--simka-radius);
    box-shadow: var(--simka-shadow);
}

.simka-stat-card {
    background: var(--simka-card);
    border: none;
    border-radius: var(--simka-radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--simka-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.simka-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.simka-stat-icon.purple { background: var(--simka-purple-soft); color: var(--simka-purple-dark); }
.simka-stat-icon.teal { background: var(--simka-info-soft); color: var(--simka-info); }
.simka-stat-icon.warning { background: var(--simka-warning-soft); color: var(--simka-warning); }
.simka-stat-icon.danger { background: var(--simka-danger-soft); color: var(--simka-danger); }

.simka-level-row + .simka-level-row {
    margin-top: 10px;
}
a.simka-level-row {
    padding: 4px 6px;
    margin-left: -6px;
    margin-right: -6px;
    border-radius: 8px;
    transition: background .15s ease;
}
a.simka-level-row:hover {
    background: var(--simka-bg, #f4f5fa);
}
.simka-level-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--simka-bg, #f4f5fa);
    overflow: hidden;
}
.simka-level-bar-fill {
    height: 100%;
    background: var(--simka-purple);
    border-radius: 3px;
}

.simka-stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
}

.simka-stat-label {
    font-size: 13px;
    color: var(--simka-text-muted);
}

.simka-welcome-banner {
    background: linear-gradient(120deg, var(--simka-purple), var(--simka-teal));
    border-radius: var(--simka-radius);
    color: #fff;
    padding: 28px;
    margin-bottom: 24px;
}

.simka-welcome-banner .wb-name {
    font-size: 22px;
    font-weight: 700;
}

.simka-welcome-banner .wb-meta {
    font-size: 13px;
    opacity: 0.92;
}

.app-switcher-card {
    border: none;
    border-radius: var(--simka-radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--simka-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.app-switcher-card:hover {
    box-shadow: var(--simka-shadow-hover);
    transform: translateY(-2px);
}

.app-switcher-card .app-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.app-switcher-card.disabled {
    opacity: 0.55;
    filter: grayscale(30%);
}

/* ---------------------------------------------------------------------
   Form controls — Bootstrap's own defaults (blue focus ring, square
   file-input button, unstyled native date/month picker) never picked up
   the app's purple brand token, so every text field, select, date/month
   input and file upload looked like a generic Bootstrap admin panel
   regardless of how the rest of the shell was reskinned. One shared rule
   set here instead of touching every form page individually.
   --------------------------------------------------------------------- */
.form-control,
.form-select {
    border-color: var(--simka-border);
    border-radius: 9px;
    font-size: 13.5px;
    color: var(--simka-text);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--simka-purple);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--simka-purple) 20%, transparent);
}

.form-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--simka-text);
    margin-bottom: 5px;
}

/* Native file input: the OS-drawn "Choose File" button is a real
   pseudo-element in every modern browser (standard ::file-selector-button,
   plus the older WebKit-only alias), so it can be restyled directly
   instead of hiding the input behind a custom widget. */
.form-control[type="file"]::file-selector-button,
.form-control[type="file"]::-webkit-file-upload-button {
    background: var(--simka-purple-soft);
    color: var(--simka-purple-dark);
    border: none;
    border-radius: 7px;
    padding: 6px 12px;
    margin-right: 10px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.form-control[type="file"]:hover::file-selector-button,
.form-control[type="file"]:hover::-webkit-file-upload-button {
    background: color-mix(in srgb, var(--simka-purple) 22%, #fff);
}

/* Native date/month/time picker: the calendar/clock glyph itself is an
   OS-drawn icon Chromium exposes as ::-webkit-calendar-picker-indicator —
   nudged toward the brand purple instead of its default flat grey/black
   (Firefox has no equivalent hook and falls back to its own default,
   which is an acceptable, no-worse-than-before outcome there). */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(48%) sepia(60%) saturate(3000%) hue-rotate(230deg) brightness(97%) contrast(101%);
    cursor: pointer;
}

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.simka-table thead th {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--simka-text-faint);
    border-bottom: 1px solid var(--simka-border);
    background: var(--simka-bg);
    white-space: nowrap;
    padding: 10px 14px;
}

.simka-table td {
    vertical-align: middle;
    font-size: 12px;
    padding: 9px 14px;
    white-space: nowrap;
    border-bottom: 1px solid var(--simka-border);
}

.simka-table tbody tr:hover {
    background: color-mix(in srgb, var(--simka-purple) 4%, transparent);
}

.badge-role {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.badge-status-active { background: rgba(0, 184, 169, 0.12); color: var(--simka-teal-dark); }
.badge-status-inactive { background: rgba(107, 111, 128, 0.12); color: var(--simka-text-muted); }
.badge-status-suspended { background: rgba(231, 76, 92, 0.12); color: var(--simka-danger); }

/* ---------------------------------------------------------------------
   Buttons — purple/teal accent
   --------------------------------------------------------------------- */
.btn-simka-primary {
    background: var(--simka-purple);
    border-color: var(--simka-purple);
    color: #fff;
}
.btn-simka-primary:hover {
    background: var(--simka-purple-dark);
    border-color: var(--simka-purple-dark);
    color: #fff;
}

.btn-simka-teal {
    background: var(--simka-teal);
    border-color: var(--simka-teal);
    color: #fff;
}
.btn-simka-teal:hover {
    background: var(--simka-teal-dark);
    border-color: var(--simka-teal-dark);
    color: #fff;
}

.simka-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

/* The filter form (search input + dropdown filters + search button) must
   always render as a single row — never wrap mid-form. If the toolbar as a
   whole is too narrow for [filter form] + [action buttons] side by side,
   the action-buttons group (a sibling flex item) wraps to its own line
   instead; the search input shrinks first (flex-basis) so the dropdowns
   and button keep a legible, consistent width. */
.simka-toolbar > form.d-flex {
    flex-wrap: nowrap !important;
    min-width: 0;
}

.simka-toolbar select.form-select {
    flex-shrink: 0;
    max-width: 170px !important;
}

.simka-toolbar > form.d-flex > button[type="submit"] {
    flex-shrink: 0;
}

.simka-search-input {
    flex: 1 1 150px;
    min-width: 110px;
    max-width: 260px;
}

/* The action-buttons group next to the filter form: same treatment so its
   own buttons never wrap onto separate lines either. */
.simka-toolbar > div.d-flex {
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* On a phone there's no room left for "never wrap" — that's exactly what
   was clipping the search input and dropdowns off-screen. Below 767px the
   toolbar stacks instead: filter form full-width on its own row (search
   input on its own line, the two dropdowns sharing a row), then the
   action-buttons group full-width below it, wrapping into a tidy 2-up
   grid. Same selectors as above, so this is purely an override, not a
   second toolbar system — and it applies everywhere .simka-toolbar is
   used (users.php, departments.php, positions.php, sigarmen_master.php,
   kdwms_*.php, magang_master.php, etc. all share this one component). */
@media (max-width: 767px) {
    .simka-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .simka-toolbar > form.d-flex {
        flex-wrap: wrap !important;
        width: 100%;
    }

    .simka-search-input {
        flex: 1 1 100% !important;
        max-width: none !important;
        min-width: 0;
    }

    .simka-toolbar select.form-select {
        flex: 1 1 calc(50% - 5px) !important;
        max-width: none !important;
        min-width: 0;
        width: auto !important;
    }

    .simka-toolbar > form.d-flex > button[type="submit"] {
        flex: 1 1 100%;
    }

    .simka-toolbar > div.d-flex {
        flex-wrap: wrap !important;
        width: 100%;
    }

    .simka-toolbar > div.d-flex > .btn {
        flex: 1 1 calc(50% - 5px);
    }

    /* Some pages (sigarmen_master.php, departments.php, etc.) place their
       action button(s) directly under .simka-toolbar instead of inside a
       wrapping div — same full-width/paired treatment either way. */
    .simka-toolbar > a.btn,
    .simka-toolbar > button.btn {
        flex: 1 1 calc(50% - 5px);
    }
}

/* ---------------------------------------------------------------------
   Auth / login page
   --------------------------------------------------------------------- */
.simka-auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--simka-purple) 0%, var(--simka-teal) 100%);
    padding: 20px;
}

.simka-auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* ---------------------------------------------------------------------
   Responsive sidebar
   --------------------------------------------------------------------- */
@media (max-width: 991px) {
    .simka-sidebar {
        transform: translateX(-100%);
    }
    .simka-sidebar.show {
        transform: translateX(0);
    }
    .simka-main {
        margin-left: 0;
    }
    .sidebar-toggle-btn {
        display: inline-block;
    }
    .simka-sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1025;
    }
}

.simka-sidebar-backdrop {
    display: none;
}

/* ---------------------------------------------------------------------
   Mobile comfort pass: tighter chrome, bigger tap targets, room for the
   fixed bottom nav below — applies at the same breakpoint the sidebar
   already collapses at, so "hamburger + bottom nav" is one consistent
   mobile/tablet mode rather than a second, slightly different breakpoint.
   --------------------------------------------------------------------- */
@media (max-width: 991px) {
    .simka-content {
        padding: 16px 14px calc(var(--bottom-nav-height) + 22px + env(safe-area-inset-bottom));
    }

    .simka-topbar {
        height: 58px;
        padding: 0 12px;
    }

    .simka-topbar .page-title {
        font-size: 16px;
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Full name + role text next to the avatar is redundant with the
       bottom nav's own "Menu"/account access on a narrow screen — the
       dropdown menu itself still shows name/email/role once opened. */
    .simka-topbar-user .avatar {
        width: 32px;
        height: 32px;
        font-size: 12.5px;
    }

    .simka-card {
        border-radius: 14px;
    }

    /* Bootstrap's own modal margin is already responsive; this just
       keeps action buttons (Simpan/Batal etc.) full tap-height on a touch
       screen without resizing every icon-only button in dense tables. */
    .modal-footer .btn,
    .modal-body .btn {
        min-height: 40px;
    }
}

@media (max-width: 576px) {
    .simka-table td,
    .simka-table th {
        font-size: 12.5px;
        padding: 8px 10px;
    }
}

/* ---------------------------------------------------------------------
   Bottom nav — mobile/tablet only, mirrors a banking-app tab bar: Beranda,
   Riwayat, a raised "Ajukan" shortcut in the middle (opens the leave
   modal directly when already on account.php, else navigates there),
   Notifikasi (proxies a click to the existing topbar bell) and Menu
   (proxies a click to the existing sidebar hamburger) — reuses those two
   components instead of duplicating their state.
   --------------------------------------------------------------------- */
.simka-bottom-nav {
    display: none;
}

@media (max-width: 991px) {
    .simka-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: start;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        padding: 6px 4px calc(4px + env(safe-area-inset-bottom));
        background: var(--simka-card);
        border-top: 1px solid var(--simka-border);
        box-shadow: 0 -4px 18px rgba(30, 32, 61, 0.08);
        z-index: 1040;
    }
}

.bn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    border: none;
    background: none;
    color: var(--simka-text-muted);
    font-size: 10.5px;
    font-weight: 600;
    padding: 6px 2px;
    border-radius: 10px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.bn-item i {
    font-size: 18px;
    line-height: 1;
}

.bn-item:hover,
.bn-item:active {
    color: var(--simka-purple-dark);
}

.bn-item.active {
    color: var(--simka-purple-dark);
    background: color-mix(in srgb, var(--simka-purple) 9%, transparent);
}

.bn-fab {
    position: relative;
    color: var(--simka-purple-dark);
    font-weight: 700;
}

.bn-fab-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--simka-purple), var(--simka-teal));
    color: #fff;
    font-size: 17px;
    margin-top: -22px;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--simka-purple) 45%, transparent);
    transition: transform 0.15s ease;
}

.bn-fab:active .bn-fab-circle {
    transform: scale(0.94);
}

@media (prefers-reduced-motion: reduce) {
    .bn-fab-circle,
    .bn-item {
        transition: none;
    }
}

/* Notification read/unread state: unread items are bright (full opacity,
   tinted background, purple dot); once clicked they fade to the same muted
   gray as any other read row. */
#notifList .dropdown-item {
    opacity: 0.55;
    transition: opacity .15s ease, background-color .15s ease;
}
#notifList .dropdown-item:hover {
    opacity: 0.85;
}
#notifList .notif-item-unread {
    opacity: 1;
    background: rgba(108, 92, 231, 0.07);
}
#notifList .notif-item-unread:hover {
    background: rgba(108, 92, 231, 0.13);
}
/* Same read/unread look for the self-service portals' bells (portal_notifications.js). */
.portal-notif-list .dropdown-item { opacity: 0.55; transition: opacity .15s ease, background-color .15s ease; }
.portal-notif-list .dropdown-item:hover { opacity: 0.85; }
.portal-notif-list .notif-item-unread { opacity: 1; background: rgba(108, 92, 231, 0.07); }
.portal-notif-list .notif-item-unread:hover { background: rgba(108, 92, 231, 0.13); }
.notif-read-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(108, 92, 231, 0.45);
    color: var(--simka-purple, #6c5ce7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    align-self: center;
    cursor: pointer;
}
.notif-read-btn:hover,
.notif-read-btn:focus-visible {
    background: var(--simka-purple, #6c5ce7);
    color: #fff;
    outline: none;
}

/* Notification bell dropdown: fixed 340px width works fine on desktop, but
   on a narrow phone viewport Popper's default anchor-relative positioning
   can push most of that width off-screen (the bell sits near the right
   edge, so a right-aligned dropdown has nowhere to expand but left, past
   x=0). Below 480px we bypass Popper's calculated position/transform
   entirely and pin it as a fixed, viewport-margined panel instead. */
@media (max-width: 480px) {
    #notifList {
        position: fixed !important;
        top: 64px !important;
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        transform: none !important;
    }
}

/* ---------------------------------------------------------------------
   Global save/submit toast — fixed top-right stack with an auto-dismiss
   countdown bar (see simkaToast() in app.js). Fired by ajaxSubmitForm()
   on every "Simpan" action app-wide, so every CRUD form gets consistent
   sukses/gagal/kurang-lengkap feedback without each page wiring its own.
   --------------------------------------------------------------------- */
#simkaToastStack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 340px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.simka-toast {
    position: relative;
    background: var(--simka-card);
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(30, 32, 61, 0.16), 0 2px 6px rgba(30, 32, 61, 0.06);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 30px 15px 14px;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.simka-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.simka-toast-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    color: #fff;
}

.simka-toast-body {
    flex: 1;
    min-width: 0;
}

.simka-toast-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--simka-text);
    margin-bottom: 2px;
}

.simka-toast-message {
    font-size: 12.5px;
    color: var(--simka-text-muted);
    line-height: 1.4;
    word-wrap: break-word;
}

.simka-toast-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: var(--simka-text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.simka-toast-close:hover {
    opacity: 1;
}

.simka-toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform: scaleX(1);
    transform-origin: left;
    animation: simka-toast-countdown linear forwards;
}

@keyframes simka-toast-countdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.simka-toast--success .simka-toast-icon { background: var(--simka-success); }
.simka-toast--success .simka-toast-bar { background: var(--simka-success); }
.simka-toast--error .simka-toast-icon { background: var(--simka-danger); }
.simka-toast--error .simka-toast-bar { background: var(--simka-danger); }
.simka-toast--warning .simka-toast-icon { background: var(--simka-warning); }
.simka-toast--warning .simka-toast-bar { background: var(--simka-warning); }

@media (prefers-reduced-motion: reduce) {
    .simka-toast {
        transition: none;
    }
    .simka-toast-bar {
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ---------------------------------------------------------------------
   Date-range picker (assets/js/range_picker.js) — presensi pages
   --------------------------------------------------------------------- */
.simka-rp { position: relative; display: block; min-width: 260px; }
.simka-rp-toggle { display: flex; align-items: center; text-align: left; cursor: pointer; background: #fff; }
.simka-rp-pop {
    position: absolute; z-index: 1060; top: calc(100% + 4px); left: 0; width: 300px; padding: 12px;
    background: #fff; border: 1px solid var(--simka-border); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(40, 30, 90, .18); user-select: none; -webkit-user-select: none;
}
.simka-rp-pop[hidden] { display: none; }
.simka-rp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.simka-rp-nav { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 8px; color: #555; }
.simka-rp-nav:hover { background: rgba(124, 92, 255, .12); }
.simka-rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.simka-rp-wd { text-align: center; font-size: 11px; font-weight: 600; color: #8a8fa0; padding-bottom: 4px; }
.simka-rp-wd.sun { color: #d9534f; }
.simka-rp-day { border: 0; background: transparent; height: 34px; font-size: 13px; border-radius: 0; color: inherit; cursor: pointer; }
.simka-rp-day.out { color: #b6bac6; }
.simka-rp-day:hover { background: rgba(124, 92, 255, .12); }
.simka-rp-day.in { background: rgba(124, 92, 255, .16); }
.simka-rp-day.start, .simka-rp-day.end { background: var(--simka-purple); color: #fff; font-weight: 600; }
.simka-rp-day.start { border-radius: 8px 0 0 8px; }
.simka-rp-day.end { border-radius: 0 8px 8px 0; }
.simka-rp-day.start.end { border-radius: 8px; }
.simka-rp-hint { margin-top: 8px; font-size: 11px; color: #8a8fa0; min-height: 15px; }
.simka-rp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--simka-border); }
.simka-rp-preset { border: 1px solid var(--simka-border); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.simka-rp-preset:hover { border-color: var(--simka-purple); color: var(--simka-purple); }
@media (max-width: 575.98px) { .simka-rp { min-width: 0; width: 100%; } .simka-rp-pop { width: min(300px, calc(100vw - 32px)); } }
