/**
 * shell-mobile (Wave D5a)
 */

/* === Mobile "Lainnya" overflow sheet (Phase B) === */
dialog.mobile-more-sheet {
    border: none;
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100%;
    max-height: none;
    height: 100%;
    background: transparent;
    color: var(--text-primary);
}

dialog.mobile-more-sheet::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.mobile-more-sheet-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface-2, var(--bg-card));
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
    padding: 8px 12px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    z-index: var(--z-modal, 1100);
}

.mobile-more-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-color);
    margin: 4px auto 8px;
}

.mobile-more-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 4px 12px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-more-sheet-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.mobile-more-sheet-close {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
}

.mobile-more-sheet-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-more-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0 4px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-more-item {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.mobile-more-item i {
    font-size: 1.35rem;
    color: var(--brand-fg, var(--brand-color));
    min-width: 28px;
    text-align: center;
}

.mobile-more-item:hover,
.mobile-more-item:focus-visible {
    background: var(--brand-tint-10, rgba(var(--brand-color-rgb), 0.1));
    outline: none;
}

.mobile-more-empty {
    margin: 12px 8px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.9rem;
}

body.device-desktop dialog.mobile-more-sheet {
    display: none !important;
}


/* --- styles.css L5647-L5841 --- */
/* === Mobile Header Optimization === */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Simplify Header: Hide User Profile Dropdown */
    .header-user {
        display: none !important;
    }

    /* Sub-nav hidden on mobile — navigation via sidebar */

    /* Clean header: brand left, hamburger flush right */
    .app-header {
        padding: 0 0 0 12px;
        justify-content: space-between;
        gap: 0;
    }

    /* header-left must stretch full width so hamburger can go to right edge */
    .header-left {
        flex: 1;
        justify-content: space-between;
    }

    /* Layout only — hamburger visual owned by apk-redesign (body.device-mobile). */
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        font-size: 24px;
        margin-left: auto;
        margin-right: 0;
        padding-right: 0;
        flex-shrink: 0;
        order: 99;
    }

    /* Note: Level welcome styling for mobile is handled by user-dashboard.css */

    /* Make user summary text look like a card */
    #user-summary-line,
    #user-assessor-hint {
        background: var(--bg-card);
        padding: 12px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        margin-top: 12px !important;
        font-size: 0.9rem;
        line-height: 1.5;
        color: var(--text-primary);
    }
}


/* === MOBILE HEADER FIXES === */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Hide User Profile Dropdown in Header to save space */
    .app-header .header-user {
        display: none !important;
    }

    /* Brand left, hamburger flush right */
    .app-header {
        justify-content: space-between;
        padding: 0 0 0 12px;
    }

    /* Ensure header-left stretches so hamburger reaches right edge */
    .header-left {
        flex: 1 !important;
        justify-content: space-between !important;
    }

    /* Hamburger: order 99 pushes it to end, margin-left:auto fills gap */
    .mobile-menu-btn {
        order: 99 !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Adjust main content padding because header is smaller/cleaner */
    .main-content {
        padding-top: 70px; /* Ensure content doesn't go under header */
    }
}


/* === MOBILE DRAWER MENU FIX === */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Main container for the drawer */
    .tab-nav {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px; /* Wider drawer (was 250px) for better proportions */
        height: 100vh;
        background-color: var(--bg-card) !important;
        z-index: 2000; /* Higher than header */
        box-shadow: 4px 0 12px rgba(0,0,0,0.3) !important;
        flex-direction: column;
        padding-top: 0; /* Header handled by ::after */
        padding-bottom: 20px; /* Space at bottom */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(-100%);
        display: flex !important; /* Enable Flexbox layout */
    }

    /* When active, slide in */
    .tab-nav.active {
        transform: translateX(0);
    }

    /* Backdrop overlay (Click outside area) */
    .tab-nav.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 280px; /* Starts after menu width */
        right: -100vw;
        bottom: 0;
        width: 200vw;
        height: 100vh;
        background: rgba(0,0,0,0.6); /* Slightly lighter backdrop */
        z-index: -1;
        backdrop-filter: blur(4px);
        opacity: 0;
        animation: fadeInBackdrop 0.3s forwards;
    }

    @keyframes fadeInBackdrop {
        to { opacity: 1; }
    }

    /* Drawer Header (using ::after with order -1) */
    .tab-nav::after {
        content: 'Menu Utama';
        display: block;
        order: -1; /* Move to top of flex container */
        padding: 32px 20px 16px 20px; /* Top padding simulates status bar */
        font-size: 1.2rem;
        font-weight: 800;
        color: var(--brand-fg, var(--brand-color));
        letter-spacing: -0.5px;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 16px;
        background: var(--bg-surface-1); /* Subtle header bg */
    }

    /* Styling the buttons inside the drawer */
    .tab-btn {
        width: calc(100% - 24px); /* Full width minus margins */
        margin: 4px 12px; /* Add side margins and vertical gap */
        text-align: left;
        padding: 14px 16px; /* Comfortable touch target */
        border: none; /* Removed border-bottom */
        border-radius: 12px; /* Modern rounded shape */
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-primary);
        background: transparent;
        display: flex;
        align-items: center;
        gap: 16px; /* More space between icon and text */
        transition: all 0.2s ease;
    }

    .tab-btn i {
        min-width: 24px;
        text-align: center;
        color: var(--text-secondary); /* Neutral icon color by default */
        font-size: 1.3rem;
    }

    /* Active & Hover States */
    .tab-btn:hover, .tab-btn.active {
        background: rgba(var(--brand-color-rgb), 0.1);
        color: var(--brand-fg, var(--brand-color));
        border-left: none; /* Removed blocky border */
        padding-left: 16px; /* Maintain padding */
    }

    .tab-btn.active {
        font-weight: 600;
    }

    .tab-btn:hover i, .tab-btn.active i {
        color: var(--brand-fg, var(--brand-color));
    }
}

.sidebar-akun-overflow:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

body.device-mobile .app-footer {
    display: none !important;
}

body.mobile-drawer-account-only #user-section-switcher,
body.mobile-drawer-account-only #profile-completion-card,
body.mobile-drawer-account-only #wc-project-summary-card,
body.mobile-drawer-account-only #wc-team-attendance-card,
body.mobile-drawer-account-only #wc-team-competency-card,
body.mobile-drawer-account-only #wc-mobile-dashboard .wc-quick-actions,
body.mobile-drawer-account-only #bc-running-wage-card {
    display: none !important;
}

body.device-mobile.window-medium #bottom-nav,
body.device-mobile.window-expanded #bottom-nav {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: var(--nav-rail-width, 72px);
    height: auto;
    border-top: none;
    border-right: 1px solid var(--border-color);
    padding-top: var(--safe-top, env(safe-area-inset-top, 0px));
    padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom, 0px));
    padding-left: var(--safe-left, env(safe-area-inset-left, 0px));
    box-shadow: 1px 0 12px rgba(0, 0, 0, 0.06);
}

body.device-mobile.window-medium .bottom-nav-container,
body.device-mobile.window-expanded .bottom-nav-container {
    flex-direction: column;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 4px;
    justify-content: flex-start;
    gap: 4px;
}

body.device-mobile.window-medium .bottom-nav-item,
body.device-mobile.window-expanded .bottom-nav-item {
    max-width: none;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    min-height: 56px;
}

body.device-mobile.window-medium #main-app,
body.device-mobile.window-expanded #main-app {
    padding-left: calc(var(--nav-rail-width, 72px) + var(--safe-left, 0px));
}

body.device-mobile.window-medium,
body.device-mobile.window-expanded {
    --page-pad-bottom-mobile: 16px;
}

.hari-ini {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 12px 12px calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    background: #F4F7F8;
    color: #172033;
    font-size: 16px;
    line-height: 1.4;
}

body.device-mobile #hari-ini:not([hidden]) {
    display: flex;
}

.hari-ini h2,
.hari-ini h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #172033;
}

.hari-ini-chip,
.hari-ini-status,
.hari-ini-progress {
    color: #65748B;
    font-size: 16px;
}

.hari-ini-clock,
.mobile-home-clock {
    width: 100%;
    min-height: 80px;
    border: 0;
    border-radius: 14px;
    background: #E85D04;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
}

#mobile-home-clock[hidden] {
    display: none !important;
}

#mobile-home-clock:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    margin: 0 12px 12px;
}

@media (max-width: 320px) {
    .hari-ini-clock,
    .mobile-home-clock {
        min-height: 70px;
    }
}

.hari-ini-wage {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.hari-ini-wage strong {
    font-size: 1.25rem;
    color: #0D3B66;
}

.hari-ini-stat-grid {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (min-width: 360px) {
    .hari-ini-stat-grid {
        display: grid;
    }
}

.hari-ini-stat-grid div {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
}

.hari-ini-stat-grid span {
    display: block;
    color: #65748B;
    font-size: 0.9rem;
}

.hari-ini-block,
.hari-ini-checks,
.hari-ini-agenda,
.hari-ini-exceptions,
.hari-ini-alerts {
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0;
    list-style: none;
}

.hari-ini-checks li.is-complete {
    color: #16865D;
}

.hari-ini-clock:focus-visible,
.hari-ini-action:focus-visible,
.hari-ini-exception:focus-visible {
    outline: 3px solid #0D3B66;
    outline-offset: 2px;
}

.hari-ini-exception,
.hari-ini-action {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: #0D3B66;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.hari-ini-exception {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    color: #172033;
    border: 1px solid #E6EBF0;
    padding: 0 12px;
}

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

.hari-ini-actions-stack {
    flex-direction: column;
}

.hari-ini-action-primary {
    background: #E85D04;
}

.hari-ini-empty {
    margin: 0;
    color: #65748B;
}

.hari-ini-alerts li {
    color: #A96F12;
}

body.device-mobile.window-medium .hari-ini,
body.device-mobile.window-expanded .hari-ini {
    padding-left: 16px;
}

.kotak-page {
    padding: 12px;
    min-height: 40vh;
}

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

.kotak-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.kotak-panes {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.kotak-pane-btn {
    flex: 1;
    min-height: 44px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-1, var(--bg-card));
    color: var(--text-secondary);
    border-radius: 10px;
    font-weight: 600;
}

.kotak-pane-btn.is-active {
    color: var(--brand-fg, var(--brand-color));
    background: rgba(var(--brand-color-rgb, 13, 59, 102), 0.12);
    border-color: transparent;
}

.kotak-approval-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

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

.kotak-bulk-actions .btn,
.approval-card-select {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

#kotak-pending-list .approval-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.kotak-notif-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.kotak-notif-item.is-read {
    opacity: 0.7;
}

#kotak-month-filter {
    min-height: 44px;
    max-width: 100%;
}

.hc-ops-queue {
    margin: 0 0 16px;
    padding: 12px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.hc-ops-queue-title {
    margin: 0 0 8px;
    font-size: 1rem;
}

.hc-ops-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hc-ops-queue-item {
    min-height: 48px;
    text-align: left;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-1, #fff);
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
}

body.device-desktop #hc-ops-queue {
    display: none !important;
}

body.device-mobile #hc-dashboard-section #hc-stats-grid,
body.device-mobile #hc-dashboard-section .hc-dashboard-cockpit,
body.device-mobile #hc-dashboard-section .quick-actions-grid {
    display: none;
}

.bc-pay-proof-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}


