/* === User Dashboard Cards === */
.user-dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0;
    padding: 8px;
    margin-bottom: 0;
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Mobile: maximize content width */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .user-dashboard-card {
        padding: 8px;
        margin-bottom: 0;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

@media (max-width: 320px) and (hover: none) and (pointer: coarse) {
    .user-dashboard-card {
        padding: 8px;
        margin-bottom: 0;
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
}

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

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.user-card-header h4 {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile optimization for card headers */
@media (max-width: 768px) {
    .user-card-header h4 {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .user-card-header {
        margin-bottom: 8px;
    }
    
    .user-card-header h4 {
        font-size: 0.9rem;
    }
}

.user-card-header h4 i {
    color: var(--brand-fg, var(--brand-color));
}

.user-profile-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.user-profile-details p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.user-profile-details strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.user-history-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.user-alert-box {
    background: rgba(var(--brand-color-rgb), 0.1);
    border: 1px solid var(--brand-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: var(--section-gap, 12px);
}

.user-alert-header {
    margin: 0 0 10px 0;
    color: var(--brand-fg, var(--brand-color));
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Standardized breakpoint: 480px for large phones */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .user-card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-card-header button {
        width: 100%;
        min-height: 48px; /* Enforce tap target */
    }
}

/* === Sticky Sub Navigation === */
.sub-nav {
    position: sticky;
    top: 64px; /* Adjust based on main header height */
    z-index: 90;
    background: var(--bg-secondary);
    padding: 10px 0;
    margin-bottom: var(--section-gap, 12px);
    display: flex;
    gap: var(--stack-gap, 8px);
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(8px); /* Nice effect */
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .sub-nav {
        top: 56px; /* Shorter header on mobile */
        padding: 8px 0;
    }
}

/* === User Dashboard Navigation === */
/* Mobile: pill/rounded button style */
#user-tab .sub-nav-btn {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
#user-tab 
#user-tab .sub-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
#user-tab 
#user-tab .sub-nav-btn.active {
    background: var(--brand-color);
    color: var(--text-on-brand);
}

/* Desktop: normalize to standard header sub-nav style */
@media (min-width: 1025px) {
    #user-tab .sub-nav-btn {
        padding: 0 14px;
        border-radius: 0;
        height: 100%;
        border-bottom: 2px solid transparent;
        color: var(--text-muted);
        font-size: 0.8125rem;
        font-weight: 500;
        background: transparent;
    }
    #user-tab .sub-nav-btn:hover {
        background: transparent;
        color: var(--text-primary);
    }
    #user-tab .sub-nav-btn.active {
        background: transparent;
        color: var(--brand-fg, var(--brand-color));
        border-bottom-color: var(--brand-color);
        font-weight: 600;
    }
}

.sub-nav-btn i {
    font-size: 1.1em;
}

/* === User Sections === */
.user-section {
    display: none; /* Hidden by default */
    animation: fadeIn 0.3s ease;
    min-height: 60vh; /* Ensure minimum height so content is visible */
    overflow-y: auto; /* Allow scrolling if content is long */
}

.user-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Minimal No-Company State === */
.no-company-dashboard {
    display: none;
    width: 100%;
    max-width: min(100%, var(--form-max-width, 960px));
    margin: 0;
    padding: var(--section-gap, 12px) 0;
}

#user-overview-section.no-company-mode > :not(#no-company-dashboard) {
    display: none !important;
}

#user-overview-section.no-company-mode #no-company-dashboard {
    display: block;
}

.no-company-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--space-4, 16px);
    box-shadow: none;
}

.no-company-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.no-company-panel h2 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1.45rem;
    line-height: 1.25;
}

.no-company-panel p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

.no-company-checklist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: var(--section-gap, 12px) 0;
}

.no-company-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-size: 0.9rem;
}

.no-company-check-item.is-complete {
    color: var(--text-primary);
    border-color: rgba(34, 197, 94, 0.35);
}

.no-company-check-item i {
    flex: 0 0 auto;
}

.no-company-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.no-company-actions .btn-primary,
.no-company-actions .btn-secondary {
    min-height: 44px;
}

.no-company-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.no-company-meta strong {
    color: var(--text-primary);
}

.no-company-membership {
    display: grid;
    gap: 12px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.membership-section-head,
.membership-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.membership-section-head h3,
.membership-card-head h3,
.membership-pending-copy h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.3;
}

.membership-section-head p,
.membership-card-head p,
.membership-pending-copy p,
.membership-message,
.membership-helper,
.membership-rejected-note p {
    margin: 3px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

.membership-section-icon,
.membership-pending-icon,
.membership-company-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 13px;
    background: rgba(var(--brand-color-rgb), 0.1);
    color: var(--brand-fg, var(--brand-color));
    object-fit: cover;
    font-size: 1.1rem;
    font-weight: 800;
}

.membership-company-logo img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.membership-company-logo i {
    font-size: 1.15rem;
}

.membership-invite-card,
.membership-pending-card {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}

.membership-pending-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
}

.membership-pending-card .membership-card-actions {
    grid-column: 1 / -1;
}

.membership-state-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    margin-bottom: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 750;
}

.membership-state-pill--invite {
    background: rgba(var(--safety-color-rgb), 0.1);
    color: var(--safety-color);
}

.membership-state-pill--pending {
    background: rgba(var(--brand-color-rgb), 0.1);
    color: var(--brand-fg, var(--brand-color));
}

.membership-message {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-secondary);
}

.membership-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.membership-card-actions .btn-primary,
.membership-card-actions .btn-secondary {
    min-height: 42px;
}

.membership-text-btn {
    min-height: 40px;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.membership-text-btn--danger {
    color: var(--error-text, #b91c1c);
}

.membership-join-form {
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
}

.membership-join-form > label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 750;
}

.membership-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.membership-code-input-wrap {
    position: relative;
}

.membership-code-input-wrap i {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.membership-code-input-wrap input {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px 9px 40px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.membership-code-input-wrap input:focus {
    border-color: var(--safety-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--safety-color-rgb), 0.1);
}

.membership-code-row .btn-primary {
    min-width: 88px;
    min-height: 44px;
}

.membership-rejected-note,
.membership-inline-error {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid rgba(185, 28, 28, 0.18);
    border-radius: 10px;
    background: rgba(185, 28, 28, 0.06);
    color: var(--error-text, #b91c1c);
}

.membership-rejected-note strong {
    color: inherit;
    font-size: 0.82rem;
}

.membership-inline-error {
    margin: 0;
    font-size: 0.78rem;
}

.membership-loading {
    display: grid;
    gap: 7px;
}

.membership-loading span {
    height: 12px;
    border-radius: 999px;
    background: var(--border-color);
    animation: membershipPulse 1.4s ease-in-out infinite;
}

.membership-loading span:last-child {
    width: 68%;
}

@keyframes membershipPulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.9; }
}

@media (max-width: 640px) {
    .no-company-dashboard {
        padding: 8px 0 16px;
    }

    .no-company-panel {
        padding: 18px;
    }

    .no-company-checklist {
        grid-template-columns: 1fr;
    }

    .no-company-actions {
        flex-direction: column;
    }

    .no-company-actions .btn-primary,
    .no-company-actions .btn-secondary {
        width: 100%;
    }

    .membership-code-row {
        grid-template-columns: 1fr;
    }

    .membership-code-row .btn-primary,
    .membership-card-actions .btn-primary,
    .membership-card-actions .btn-secondary {
        width: 100%;
    }
}

/* === Form Grid System === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
}

/* Light mode: Ensure select dropdown is readable */
[data-theme="light"] .form-group select {
    background-color: #ffffff;
    color: #1a1a1a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--brand-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--brand-color-rgb), 0.1);
}

.form-group select option {
    background-color: var(--bg-surface-1);
    color: var(--text-primary);
    padding: 4px 8px;
}

/* Light mode dropdown option visibility */
[data-theme="light"] .form-group select option {
    background-color: #ffffff;
    color: #1a1a1a;
}

[data-theme="light"] .form-group select option:checked {
    background: linear-gradient(var(--brand-color), var(--brand-color));
    background-color: var(--brand-color) !important;
    color: #ffffff !important;
}

/* === Manager Sticky Header === */
.manager-sticky-header {
    position: sticky;
    top: 64px;
    z-index: 89;
    background: var(--bg-secondary);
    padding: 10px 15px;
    margin: 0 -15px 20px -15px; /* Negative margin to stretch full width if inside padded container */
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.manager-project-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.manager-project-selector-wrapper i {
    font-size: 1.2em;
    color: var(--brand-fg, var(--brand-color));
}

.manager-project-selector-wrapper select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-1); /* Explicitly use surface-1 for contrast against surface-2 header */
    color: var(--text-primary);
    cursor: pointer;
}

/* Light mode project selector */
[data-theme="light"] .manager-project-selector-wrapper select {
    background-color: #ffffff;
    color: #1a1a1a;
}

.manager-project-selector-wrapper select:hover {
    border-color: var(--brand-color);
}

.manager-project-selector-wrapper select:focus {
    border-color: var(--brand-color);
    outline: none;
}

.manager-sub-nav {
    display: flex;
    gap: 5px;
}

.sub-nav-link {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.sub-nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sub-nav-link.active {
    background: var(--brand-color);
    color: var(--text-on-brand);
}

/* Standardized breakpoint: 480px for large phones */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .manager-sticky-header {
        flex-direction: column;
        align-items: stretch;
    }
    .manager-sub-nav {
        justify-content: space-between;
        overflow-x: auto;
    }
    .sub-nav-link {
        min-height: 44px; /* Touch-friendly */
        padding: 10px 14px;
    }
}

/* ============= MOBILE UI/UX OPTIMIZATION (Blue Collar Focus) ============= */

/* Mobile Device Class Targeting */
.device-mobile #user-tab {
    padding: 12px; /* Consistent padding for mobile */
}

.device-mobile #user-tab h3 {
    font-size: 1.5rem; /* Slightly smaller on mobile */
    margin-bottom: 12px;
}

/* Ensure tab content is visible on mobile */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #user-tab {
        padding: 12px;
        min-height: 50vh; /* Minimum height to ensure visibility */
        display: none; /* Hidden by default */
    }
    
    #user-tab.tab-content.active {
        display: block !important; /* Force display when active */
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Ensure all user sections within user-tab are visible when active */
    #user-tab .user-section.active {
        display: block !important;
        opacity: 1;
        min-height: 40vh;
    }
    
    /* Ensure stats grid is visible */
    #user-tab .stats-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-bottom: var(--section-gap, 12px);
    }
    
    /* Ensure welcome message is visible */
    #user-tab .level-welcome {
        display: block !important;
        margin-bottom: var(--section-gap, 12px);
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/* Mobile Stats Grid - Single Column Layout */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .stats-grid {
        grid-template-columns: 1fr !important; /* Single column on mobile */
        gap: 14px;
        margin-bottom: var(--section-gap, 12px);
    }
    
    .stat-card {
        padding: var(--card-pad, 12px);
        min-height: 80px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.4rem;
        flex-shrink: 0;
    }
    
    .stat-info {
        flex: 1;
        min-width: 0; /* Allow text truncation */
    }
    
    .stat-label {
        font-size: 0.8rem;
        margin-bottom: 6px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .stat-value {
        font-size: 1.65rem;
        font-weight: 700;
        line-height: 1.1;
    }
    
    .insight-text {
        font-size: 0.875rem;
        line-height: 1.5;
        color: var(--text-secondary);
    }
}

/* Mobile Sub-Navigation - Horizontal Scroll with Large Touch Targets */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .sub-nav {
        padding: 10px 0;
        gap: 6px;
        margin-bottom: 18px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    
    .sub-nav::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }
    
    #user-tab .sub-nav-btn {
        padding: 12px 18px;
        min-height: 48px;
        font-size: 0.9rem;
        border-radius: 8px;
        white-space: nowrap;
    }
    
    #user-tab .sub-nav-btn i {
        font-size: 1.25em;
    }
}

/* Mobile User Dashboard Cards - More Compact */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .user-dashboard-card {
        padding: 18px;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .user-card-header {
        margin-bottom: 12px;
    }
    
    .user-card-header h4 {
        font-size: 1.1rem;
    }
    
    .user-card-header .btn-sm {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Mobile Attendance History - prevent card overflow */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #user-attendance-history-table {
        min-width: 0;
        width: 100%;
    }

    #user-attendance-history-table th,
    #user-attendance-history-table td {
        white-space: normal;
    }
}

/* Mobile Top Skills Grid - 2 Columns Max */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .top-skills-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .top-skill-item {
        padding: 12px;
        font-size: 0.85rem;
    }
}

/* Mobile Job Postings Table - Convert to Cards */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #user-job-postings-table {
        display: block;
        border: none;
    }
    
    #user-job-postings-table thead {
        display: none; /* Hide table header on mobile */
    }
    
    #user-job-postings-table tbody {
        display: block;
    }
    
    #user-job-postings-table tr {
        display: block;
        margin-bottom: 12px;
        padding: 12px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
    }
    
    #user-job-postings-table td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
    }
    
    #user-job-postings-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        margin-bottom: 4px;
    }
    
    #user-job-postings-table td button {
        width: 100%;
        margin-top: 8px;
    }
}

/* Mobile Career Timeline - Simplified */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .career-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .career-stat-card {
        padding: 12px;
        font-size: 0.85rem;
    }
    
    .timeline-item {
        padding-left: 24px; /* Smaller indent */
    }
    
    .timeline-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        left: -16px;
    }
    
    .timeline-header h5 {
        font-size: 1rem;
    }
    
    .timeline-meta {
        font-size: 0.8rem;
    }
}

/* Mobile Form Groups - Full Width */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 1rem; /* 16px to prevent iOS zoom */
        min-height: var(--touch-target-size);
    }
}

/* Mobile Profile Details - Single Column */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .user-profile-details {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
}

/* Hide less important elements on mobile to reduce clutter */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .helper-text.muted {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    /* Hide complex charts/visuals if they exist */
    .chart-container.mobile-hide {
        display: none;
    }
}

/* Touch Device Specific - Larger Tap Targets */
.touch-device button,
.touch-device .btn,
.touch-device .btn-primary,
.touch-device .btn-secondary {
    min-height: var(--touch-target-size);
    padding: 12px 20px;
}

.touch-device .stat-card {
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
}

.touch-device .stat-card:active {
    transform: scale(0.98);
    background: var(--bg-hover);
}

/* Mobile Logout Section */
.mobile-logout-section {
    display: none;
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .mobile-logout-section {
        display: block;
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}


/* Welcome Message Polish */
#user-summary-line {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: var(--section-gap, 12px) !important;
    position: relative;
    padding-left: 14px;
}

#user-summary-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    background: var(--brand-color);
    border-radius: 4px;
}

/* Mobile optimization for summary */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #user-summary-line {
        font-size: 1.05rem;
        padding-left: 12px;
        margin-bottom: var(--section-gap-sm, 10px) !important;
    }
    
    #user-summary-line::before {
        width: 3px;
    }
}


/* === RESPONSIVE TABLE (CARD VIEW) === */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Force table to not be like tables anymore */
    .user-dashboard-view table, 
    .user-dashboard-view thead, 
    .user-dashboard-view tbody, 
    .user-dashboard-view th, 
    .user-dashboard-view td, 
    .user-dashboard-view tr { 
        display: block; 
    }
    
    /* Hide table headers (but not display: none;, for accessibility) */
    .user-dashboard-view thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .user-dashboard-view tr { 
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: var(--bg-surface);
        padding: 12px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .user-dashboard-view td { 
        /* Behave  like a row */
        border: none;
        border-bottom: 1px solid var(--border-color); 
        position: relative;
        padding-left: 40% !important; 
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        text-align: right;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    
    .user-dashboard-view td:last-child {
        border-bottom: none;
        justify-content: center; /* Center action buttons */
        padding-left: 0 !important;
        margin-top: 10px;
    }
    
    .user-dashboard-view td::before { 
        /* Now like a table header */
        position: absolute;
        /* Top/Left values mimic padding */
        top: 0;
        left: 12px;
        width: 35%; 
        padding-right: 10px; 
        white-space: nowrap;
        height: 100%;
        display: flex;
        align-items: center;
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
        text-align: left;
        content: attr(data-label);
    }

    /* Specific adjustment for action buttons in card footer */
    .user-dashboard-view td:last-child button {
        width: 100%;
        margin: 0;
    }
}

/* In-page dashboard switcher: visible when header #user-sub-nav is hidden (incl. DevTools 390px). */
.user-section-switcher {
    display: none;
    gap: 8px;
    padding: 8px;
    margin: 0 0 16px;
    background: var(--bg-surface-1, var(--bg-card));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.user-section-switcher-btn {
    flex: 1 0 auto;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.user-section-switcher-btn.active {
    color: var(--brand-fg, var(--brand-color));
    background: var(--brand-tint-12, rgba(var(--brand-color-rgb), 0.12));
    border-color: var(--brand-tint-28, rgba(var(--brand-color-rgb), 0.28));
}

@media (max-width: 768px) {
    .user-section-switcher {
        display: flex;
    }
}

/* Sub-nav hidden via persona rules (.persona-blue-collar / .persona-white-collar #user-sub-nav) */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Adjust main content padding for bottom nav */
    .user-section {
        padding-bottom: 72px !important; /* 56px bottom nav + 16px breathing room */
        position: relative;
        width: 100%;
    }
    
    #user-overview-section {
        min-height: 50vh !important;
        padding: 0;
    }

    /* Style the sub-nav buttons for the bottom bar context */
    .sub-nav-btn {
        flex: 0 0 auto; /* Don't shrink */
        padding: 12px 16px;
        margin: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        color: var(--text-secondary);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 0.75rem; /* Smaller text for bottom bar */
        border-bottom: 2px solid transparent; /* Highlight indicator */
    }
    
    .sub-nav-btn i {
        font-size: 1.2rem;
        margin-right: 0; /* Stack icon above text */
    }

    .sub-nav-btn.active {
        color: var(--brand-fg, var(--brand-color));
        background: transparent;
        border-bottom: 2px solid var(--brand-color);
        box-shadow: none;
    }

    /* Hide the scrollbar */
    .sub-nav::-webkit-scrollbar {
        display: none;
    }
}

/* === Profile Sharing Card === */
.bc-sharing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.bc-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.bc-toggle-info {
    flex: 1;
}

.bc-toggle-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.bc-toggle-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.bc-toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.bc-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.bc-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-surface-2, #ffffff);
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.bc-toggle-switch input:checked + .bc-toggle-slider {
    background-color: var(--brand-color, #0D3B66);
}

.bc-toggle-switch input:checked + .bc-toggle-slider:before {
    transform: translateX(24px);
}

/* Share Button */
.bc-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: var(--brand-color, #0D3B66);
    color: var(--text-on-brand);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.bc-share-btn:hover {
    background: var(--brand-color-dark, #082F49);
    color: var(--text-on-brand);
}

.bc-share-btn:active {
    transform: scale(0.98);
}

.bc-share-icon {
    font-size: 1.2rem;
}

/* Active Share Info */
.bc-active-share {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-secondary, #f7f7f7);
    border-radius: 8px;
}

.bc-share-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.bc-share-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bg-card);
}

.bc-copy-btn {
    padding: 8px 12px;
    background: var(--brand-color, #0D3B66);
    color: var(--text-on-brand);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
}

.bc-copy-btn:hover {
    background: var(--brand-color-dark, #082F49);
    color: var(--text-on-brand);
}

.bc-share-expiry,
.bc-share-views {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

/* Views Link */
.bc-views-link {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.bc-views-link:hover {
    background: var(--bg-secondary);
    color: var(--brand-fg, var(--brand-color));
}

/* Profile Views List */
.bc-views-list {
    max-height: 400px;
    overflow-y: auto;
}

.bc-view-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.bc-view-item:last-child {
    border-bottom: none;
}

.bc-view-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.bc-view-info {
    flex: 1;
    min-width: 0;
}

.bc-view-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-view-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bc-view-source {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    color: var(--text-secondary);
}

/* Quick Action - Share variant */
.bc-action-share {
    background: linear-gradient(135deg, var(--brand-color, #0D3B66) 0%, var(--brand-hover, #082F49) 100%);
}

.bc-action-share:hover {
    background: linear-gradient(135deg, var(--brand-hover, #082F49) 0%, var(--brand-color, #0D3B66) 100%);
    color: var(--text-on-brand);
}

/* QR Code Container */
.qr-code-container {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

#share-qr-code canvas,
#share-qr-code img {
    max-width: 180px;
    height: auto;
}

/* Share link display */
.input-group {
    display: flex;
    gap: 8px;
}

.share-expiry-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ==========================================================================
   DESKTOP COMPACT MODE FOR USER DASHBOARD (100% Zoom Optimization)
   ========================================================================== */
@media (min-width: 1024px) {
    /* Compact User Dashboard Cards */
    .user-dashboard-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .user-card-header h4 {
        font-size: 1.1rem;
    }

    /* Compact Profile Details */
    .user-profile-details {
        gap: 12px;
    }

    .user-profile-details p {
        font-size: 0.9rem;
    }
    
    .user-profile-details strong {
        font-size: 0.8rem;
    }

    /* Compact Forms */
    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    /* Compact Task/Agenda Cards */
    .task-card {
        padding: 12px;
    }
}

/* ============================================================
   MOBILE DASHBOARD — REDESIGNED (Feb 2026)
   Reference design adoption: Hero card, 2-col stats, list cards,
    modern bottom nav. Brand color preserved (navy #0D3B66).
   ============================================================ */

/* ---- Hero Welcome Card (Mobile) ---- */
.hero-welcome-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-welcome-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .level-welcome {
        background: linear-gradient(135deg, var(--brand-color, #0D3B66) 0%, var(--brand-hover, #082F49) 100%) !important;
        border-radius: 16px !important;
        padding: 14px 14px 12px !important;
        margin: 0 4px 4px !important;
        border: none !important;
        box-shadow: 0 4px 20px rgba(var(--brand-color-rgb, 13,59,102), 0.3) !important;
        position: relative;
        overflow: hidden;
    }

    .level-welcome::before {
        content: '';
        position: absolute;
        top: -40%;
        right: -20%;
        width: 140px;
        height: 140px;
        border-radius: 50%;
        background: rgba(255,255,255,0.08);
        pointer-events: none;
    }

    .level-welcome::after {
        content: '';
        position: absolute;
        bottom: -30%;
        left: -10%;
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background: rgba(255,255,255,0.05);
        pointer-events: none;
    }

    .hero-welcome-inner {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        position: relative;
        z-index: 1;
    }

    .hero-welcome-content {
        flex: 1;
        min-width: 0;
    }

    .level-welcome-title {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        margin: 0 0 2px 0;
        line-height: 1.25;
    }

    .level-welcome-text {
        font-size: 0.8rem !important;
        color: rgba(255,255,255,0.85) !important;
        margin: 0;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .persona-blue-collar #user-overview-section > .desktop-profile-dashboard,
    .persona-white-collar #user-overview-section > .desktop-profile-dashboard {
        display: none !important;
    }

    .hero-welcome-avatar {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 50%;
        background: rgba(255,255,255,0.2);
        border: 2px solid rgba(255,255,255,0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        flex-shrink: 0;
    }

    .hero-welcome-avatar i {
        font-size: 1.3rem;
        color: #fff;
    }

    .hero-welcome-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .hero-welcome-stat {
        position: relative;
        z-index: 1;
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .hero-stat-value {
        font-size: 1.3rem;
        font-weight: 800;
        color: #fff;
        letter-spacing: -0.5px;
    }

    .hero-stat-label {
        font-size: 0.75rem;
        color: rgba(255,255,255,0.75);
        line-height: 1.25;
    }

    .hero-stat-trend {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 2px 8px;
        border-radius: 12px;
        margin-left: auto;
    }

    .hero-stat-trend.up {
        background: rgba(34,197,94,0.25);
        color: #bbf7d0;
    }

    .hero-stat-trend.down {
        background: rgba(239,68,68,0.25);
        color: #fecaca;
    }
}

/* Light Mode Overrides for Hero Card (Mobile) */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    [data-theme="light"] .level-welcome {
        background: linear-gradient(135deg, rgba(var(--brand-color-rgb), 0.12) 0%, rgba(var(--safety-color-rgb), 0.10) 100%) !important;
        box-shadow: 0 2px 12px rgba(var(--brand-color-rgb), 0.12) !important;
    }

    [data-theme="light"] .level-welcome::before {
        background: rgba(var(--brand-color-rgb), 0.08);
    }

    [data-theme="light"] .level-welcome::after {
        background: rgba(var(--safety-color-rgb), 0.08);
    }

    [data-theme="light"] .level-welcome-title {
        color: var(--text-primary) !important;
    }

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

    [data-theme="light"] .hero-welcome-avatar {
        background: rgba(var(--brand-color-rgb), 0.14);
        border-color: rgba(var(--brand-color-rgb), 0.24);
    }

    [data-theme="light"] .hero-welcome-avatar i {
        color: var(--brand-fg, var(--brand-color));
    }

    [data-theme="light"] .hero-welcome-stat {
        border-top-color: rgba(var(--brand-color-rgb), 0.20);
    }

    [data-theme="light"] .hero-stat-value {
        color: var(--brand-fg, var(--brand-color));
    }

    [data-theme="light"] .hero-stat-label {
        color: var(--text-secondary);
    }

    [data-theme="light"] .hero-stat-trend.up {
        background: rgba(34, 197, 94, 0.15);
        color: #166534;
    }

    [data-theme="light"] .hero-stat-trend.down {
        background: rgba(239, 68, 68, 0.15);
        color: #991b1b;
    }
}

/* Desktop: keep hero simple */
@media (min-width: 769px) {
    .hero-welcome-avatar { display: none; }
    .hero-welcome-stat { display: none !important; }
    .hero-welcome-inner {
        display: block;
    }
}

/* ---- 2-Column Stat Grid (Mobile) ---- */
.mobile-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 4px;
}

.mobile-stat-card {
    background: var(--bg-surface-2, #fff);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color, #e8eaed);
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: default;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.mobile-stat-card.is-clickable {
    cursor: pointer;
}

.mobile-stat-card.is-static:active {
    transform: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
}

.mobile-stat-card:active {
    transform: scale(0.97);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.mobile-stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.mobile-stat-icon i {
    font-size: 1.05rem;
    line-height: 1;
}

.mobile-stat-menu {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.mobile-stat-menu:hover {
    background: var(--bg-hover, rgba(0,0,0,0.05));
}

.mobile-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 500;
    line-height: 1.2;
}

.mobile-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary, #1a1a1a);
    letter-spacing: 0;
    line-height: 1.2;
}

.mobile-stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

.mobile-stat-trend.up { color: var(--success-text, #166534); }
.mobile-stat-trend.down { color: var(--error-text, #991b1b); }
.mobile-stat-trend.neutral { color: var(--text-muted, #9ca3af); }

@media (max-width: 374px) and (hover: none) and (pointer: coarse) {
    .mobile-stat-grid {
        gap: 6px;
        padding: 0 2px;
    }
    .mobile-stat-card {
        padding: 10px;
    }
    .mobile-stat-value {
        font-size: 1.1rem;
    }
}

@media (min-width: 1025px) {
    .mobile-stat-grid {
        display: none !important;
    }
}

/* ---- Mobile Dashboard Container (Redesigned) ---- */
.mobile-dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 4px;
}

/* ---- Generic Mobile Card (Redesigned) ---- */
.mobile-card {
    background: var(--bg-surface-2, #fff);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color, #e8eaed);
}

.mobile-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.mobile-card-icon {
    font-size: 1.3rem;
}

.mobile-card-title {
    font-weight: 700;
    font-size: 1rem;
    flex: 1;
    color: var(--text-primary, #1a1a1a);
}

.mobile-card-meta {
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}

.mobile-card-see-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--brand-fg, var(--brand-color, #0D3B66));
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* ---- Attendance Live Card (Redesigned) ---- */
.mobile-card-attendance {
    border-left: none;
}

.attendance-live-empty,
.attendance-live-not-checked {
    text-align: center;
    padding: 8px 0;
}

.attendance-live-hint {
    color: var(--text-muted, #6b7280);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.attendance-status-text {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary, #4b5563);
}

.bc-absen-btn-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 52px;
    width: 100%;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bc-absen-btn-mobile:active {
    transform: scale(0.97);
}

.bc-absen-checkin-mobile {
    background: linear-gradient(135deg, var(--success-solid, #15803d) 0%, #166534 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.3);
}

.bc-absen-checkout-mobile {
    background: linear-gradient(135deg, #d32f2f 0%, var(--error-solid, #b91c1c) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.3);
    margin-top: 10px;
}

.attendance-record-live,
.attendance-record-done {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color, #f0f1f3);
}

.attendance-record-live:last-child,
.attendance-record-done:last-child {
    border-bottom: none;
}

.attendance-times {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-in {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success-text, #166534);
}

.time-separator {
    color: var(--text-muted, #6b7280);
    font-size: 1rem;
}

.time-out {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--brand-fg, var(--brand-color, #0D3B66));
}

.time-running {
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    color: var(--brand-fg, var(--brand-color, #0D3B66));
}

.time-duration {
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}

.attendance-project-name {
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin-top: 2px;
}

/* Overtime badges */
.overtime-badge {
    display: inline-block;
    background: linear-gradient(135deg, #c2410c, #9a3412);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 6px;
}

.overtime-badge.pulse {
    animation: overtimePulse 2s ease-in-out infinite;
}

@keyframes overtimePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    50% { opacity: 0.9; box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); }
}

.overtime-badge-summary {
    display: block;
    text-align: center;
    margin-top: 10px;
    background: var(--warn-bg, #fff7ed);
    color: var(--warn-text, #c2410c);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- Weekly Wage Card (Redesigned) ---- */
.mobile-card-wage {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
}

[data-theme="dark"] .mobile-card-wage {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    border-color: rgba(34, 197, 94, 0.2);
}

.wage-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success-text, #166534);
    letter-spacing: -0.5px;
}

[data-theme="dark"] .wage-amount {
    color: #4ade80;
}

.wage-detail {
    font-size: 0.82rem;
    color: var(--text-secondary, #4b5563);
    margin: 4px 0 12px;
}

.wage-days-row {
    display: flex;
    gap: 6px;
    justify-content: space-between;
}

.wage-day-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.wage-day-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
}

.wage-day-indicator {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-surface-2, #f3f4f6);
    color: var(--text-muted, #9ca3af);
}

.wage-day-worked .wage-day-indicator {
    background: var(--success-solid, #15803d);
    color: #fff;
}

.wage-day-today .wage-day-indicator {
    background: var(--brand-color, #0D3B66);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(var(--brand-color-rgb, 13,59,102), 0.2);
}

.wage-day-missed .wage-day-indicator {
    background: #fee2e2;
    color: var(--error-text, #991b1b);
}

.wage-day-future .wage-day-indicator {
    background: var(--bg-surface-2, #f9fafb);
    color: var(--text-muted, #6b7280);
    border: 1px dashed var(--border-color, #e5e7eb);
}

.wage-overtime-info {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--warn-text, #c2410c);
    font-weight: 600;
}

/* ---- Payment History Card (Daily Wage) ---- */
.mobile-card-payment {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
}

[data-theme="dark"] .mobile-card-payment {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e40af30 100%);
    border-color: #3b82f633;
}

.bc-pay-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bc-pay-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-surface, #fff);
    border-radius: 10px;
    gap: 10px;
    border: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .bc-pay-row {
    background: var(--bg-surface-2, #1e293b);
    border-color: #334155;
}

.bc-pay-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.bc-pay-period {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-pay-days {
    font-size: 0.72rem;
    color: var(--text-secondary, #6b7280);
}

.bc-pay-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.bc-pay-amount {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
    white-space: nowrap;
}

.bc-pay-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.bc-pay-status-paid {
    background: var(--success-bg, #dcfce7);
    color: var(--success-text, #166534);
}

[data-theme="dark"] .bc-pay-status-paid {
    background: var(--success-bg, #16a34a33);
    color: var(--success-text, #86efac);
}

.bc-pay-status-pending {
    background: var(--warning-bg, #fef3c7);
    color: var(--warning-text, #854d0e);
}

[data-theme="dark"] .bc-pay-status-pending {
    background: var(--warning-bg, #d9770633);
    color: var(--warning-text, #fbbf24);
}

.bc-pay-proof-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px;
    color: var(--brand-fg, var(--brand-color, #3b82f6));
    opacity: 0.7;
    transition: opacity 0.15s;
}

.bc-pay-proof-btn:hover {
    opacity: 1;
}

.bc-pay-pending-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--warning-bg, #fef3c7);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--warning-text, #854d0e);
    font-weight: 500;
    margin-top: 4px;
}

[data-theme="dark"] .bc-pay-pending-banner {
    background: var(--warning-bg, #78350f33);
    color: var(--warning-text, #fbbf24);
}

/* ---- Proof Dropzone (HC Daily Wage) ---- */
.dw-proof-dropzone {
    border: 2px dashed var(--border-color, #d1d5db);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-secondary, #6b7280);
    font-size: 0.85rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
}

.dw-proof-dropzone:hover,
.dw-proof-dropzone.dragover {
    border-color: var(--brand-color, #3b82f6);
    background: rgba(59, 130, 246, 0.04);
}

.dw-proof-dropzone img {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    object-fit: contain;
}

.dw-proof-dropzone .dw-proof-hint {
    font-size: 0.78rem;
    color: var(--text-muted, #9ca3af);
}

/* ---- Today's Agenda / Transaction-style List (Redesigned) ---- */
.mobile-card-agenda {
    border-left: none;
}

.agenda-empty {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted, #6b7280);
}

.agenda-empty-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border-color, #f0f1f3);
    min-height: 52px;
}

.agenda-item:last-of-type {
    border-bottom: none;
}

.agenda-item-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.agenda-item-icon.priority-critical { background: var(--error-bg, rgba(239,68,68,0.12)); color: var(--error-text, #991b1b); }
.agenda-item-icon.priority-high { background: rgba(var(--safety-color-rgb),0.12); color: var(--safety-fg, #c2410c); }
.agenda-item-icon.priority-medium { background: var(--warning-bg, rgba(234,179,8,0.12)); color: var(--warning-text, #854d0e); }
.agenda-item-icon.priority-low { background: var(--success-bg, rgba(34,197,94,0.12)); color: var(--success-text, #166534); }

.agenda-checkbox {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agenda-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agenda-title {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-title-done {
    text-decoration: line-through;
    opacity: 0.5;
}

.agenda-item-done {
    opacity: 0.55;
}

.agenda-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted, #9ca3af);
}

.agenda-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.agenda-status-badge.done { background: var(--success-bg, rgba(34,197,94,0.12)); color: var(--success-text, #166534); }
.agenda-status-badge.pending { background: var(--warning-bg, rgba(234,179,8,0.12)); color: var(--warning-text, #854d0e); }
.agenda-status-badge.in-progress { background: var(--info-bg, rgba(59,130,246,0.12)); color: var(--info-text, #1d4ed8); }

.agenda-priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agenda-priority-critical { background: var(--error-solid, #b91c1c); }
.agenda-priority-high { background: var(--safety-bg, #e85d04); }
.agenda-priority-medium { background: var(--warning-solid, #a16207); }
.agenda-priority-low { background: var(--success-solid, #15803d); }

.agenda-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--brand-fg, var(--brand-color, #0D3B66));
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s;
}

.agenda-show-more:hover {
    background: rgba(var(--brand-color-rgb, 13,59,102), 0.08);
}

.agenda-show-more:active {
    opacity: 0.7;
}

/* ---- Mobile Dashboard Responsive ---- */
@media (min-width: 1025px) {
    .mobile-dashboard-container {
        display: none !important;
    }
}

/* ---- Tablet: Apply mobile dashboard styles for 769-1024px range ---- */
@media (min-width: 769px) and (max-width: 1024px) {
    .mobile-dashboard-container {
        max-width: 560px;
        margin: 0 auto;
        padding: 0 16px;
    }
    
    .mobile-card {
        padding: 20px;
    }
    
    .mobile-stat-grid {
        max-width: 560px;
        margin: 0 auto 4px;
        padding: 0 16px;
    }
}

/* ---- Bottom Nav Persona Styles ---- */
@media (max-width: 1024px) {
    .persona-blue-collar .bottom-nav-container {
        justify-content: space-around;
    }
    
    .persona-blue-collar .bottom-nav-item {
        min-width: 80px;
    }

    .persona-white-collar .bottom-nav-container {
        justify-content: space-around;
    }
    
    .persona-white-collar .bottom-nav-item {
        min-width: 60px;
    }
}

/* ---- Mobile: Hide desktop sections when persona dashboard active ---- */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .persona-blue-collar #user-overview-section > .desktop-profile-dashboard,
    .persona-white-collar #user-overview-section > .desktop-profile-dashboard {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Dummy / DevTools 390: paint the field host without requiring hover:none. */
    .persona-blue-collar #user-overview-section > .desktop-profile-dashboard,
    .persona-white-collar #user-overview-section > .desktop-profile-dashboard {
        display: none !important;
    }

    .persona-blue-collar #user-overview-section #bc-mobile-dashboard,
    .persona-blue-collar #bc-mobile-dashboard {
        display: flex !important;
        flex-direction: column;
    }

    .persona-blue-collar #bc-mobile-dashboard #mobile-stat-grid,
    .persona-blue-collar #user-overview-section #mobile-stat-grid {
        display: grid !important;
    }

    .persona-white-collar #user-overview-section #bc-mobile-dashboard,
    .persona-white-collar #bc-mobile-dashboard {
        display: none !important;
    }

    .persona-white-collar #user-overview-section #wc-mobile-dashboard,
    .persona-white-collar #wc-mobile-dashboard {
        display: flex !important;
        flex-direction: column;
    }

    /* Struktur is desktop HC only — no door/chrome on the 390 reduced surface. */
    #assessor-structure-nav-btn,
    #assessor-team-section,
    #hc-emp-org-structure-subsection,
    [data-call-arg="hc-emp-org-structure-subsection"] {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    body.device-mobile.persona-blue-collar #main-app #user-overview-section > .desktop-profile-dashboard,
    body.device-mobile.persona-white-collar #main-app #user-overview-section > .desktop-profile-dashboard,
    body.touch-device.persona-blue-collar #main-app #user-overview-section > .desktop-profile-dashboard,
    body.touch-device.persona-white-collar #main-app #user-overview-section > .desktop-profile-dashboard {
        display: none !important;
    }

    body.device-mobile.persona-blue-collar #main-app #user-overview-section > #mobile-stat-grid,
    body.device-mobile.persona-white-collar #main-app #user-overview-section > #mobile-stat-grid,
    body.touch-device.persona-blue-collar #main-app #user-overview-section > #mobile-stat-grid,
    body.touch-device.persona-white-collar #main-app #user-overview-section > #mobile-stat-grid,
    body.device-mobile.persona-blue-collar #bc-mobile-dashboard #mobile-stat-grid,
    body.touch-device.persona-blue-collar #bc-mobile-dashboard #mobile-stat-grid {
        display: grid !important;
    }

    body.device-mobile.persona-blue-collar #main-app #user-overview-section > #bc-mobile-dashboard,
    body.touch-device.persona-blue-collar #main-app #user-overview-section > #bc-mobile-dashboard,
    body.device-mobile.persona-white-collar #main-app #user-overview-section > #wc-mobile-dashboard,
    body.touch-device.persona-white-collar #main-app #user-overview-section > #wc-mobile-dashboard {
        display: flex !important;
    }

    body.device-mobile.persona-blue-collar #main-app #user-overview-section > #wc-mobile-dashboard,
    body.touch-device.persona-blue-collar #main-app #user-overview-section > #wc-mobile-dashboard,
    body.device-mobile.persona-white-collar #main-app #user-overview-section > #bc-mobile-dashboard,
    body.touch-device.persona-white-collar #main-app #user-overview-section > #bc-mobile-dashboard {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    body.device-mobile.persona-blue-collar #main-app #user-overview-section > .desktop-profile-dashboard,
    body.device-mobile.persona-white-collar #main-app #user-overview-section > .desktop-profile-dashboard,
    body.touch-device.persona-blue-collar #main-app #user-overview-section > .desktop-profile-dashboard,
    body.touch-device.persona-white-collar #main-app #user-overview-section > .desktop-profile-dashboard {
        display: none !important;
    }

    .persona-blue-collar #user-overview-section > .bc-quick-stats,
    .persona-blue-collar #user-overview-section > .bc-insights-section:not(#bc-mobile-insights),
    .persona-blue-collar #user-overview-section > #user-top-skills-card,
    .persona-blue-collar #user-overview-section > #bc-sharing-card,
    .persona-blue-collar #user-overview-section > .bc-quick-actions,
    .persona-blue-collar #user-overview-section > .mobile-logout-section:not(.mobile-dashboard-container .mobile-logout-section) {
        display: none !important;
    }
    
    /* Hide sub-nav on mobile for blue collar — single-page dashboard */
    .persona-blue-collar #user-sub-nav {
        display: none !important;
    }

    /* White collar: hide desktop overview cards, use mobile dashboard */
    .persona-white-collar #user-overview-section > .bc-quick-stats,
    .persona-white-collar #user-overview-section > .bc-insights-section,
    .persona-white-collar #user-overview-section > #user-top-skills-card,
    .persona-white-collar #user-overview-section > #bc-sharing-card,
    .persona-white-collar #user-overview-section > .bc-quick-actions,
    .persona-white-collar #user-overview-section > .mobile-logout-section:not(.mobile-dashboard-container .mobile-logout-section) {
        display: none !important;
    }

    /* Hide header sub-nav on mobile for white collar — in-page switcher replaces it */
    .persona-white-collar #user-sub-nav {
        display: none !important;
    }

    .persona-blue-collar .user-section-switcher,
    .persona-white-collar .user-section-switcher {
        display: flex;
    }

    /* ---- Dashboard: hide detail cards → content lives in respective tabs ---- */
    /* BC: hide individual dashboard cards (user accesses via Absen/Agenda tabs) */
    #bc-attendance-live-card,
    #bc-today-agenda,
    #bc-weekly-wage-card {
        display: none !important;
    }

    /* WC: detail cards are rendered inline in mobile Beranda — keep visible */
}

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .persona-blue-collar #user-overview-section,
    .persona-white-collar #user-overview-section {
        overflow: visible;
        padding-bottom: calc(84px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }

    .persona-blue-collar .mobile-dashboard-container,
    .persona-white-collar .mobile-dashboard-container {
        width: 100%;
        max-width: 100%;
    }
}

/* ============= WHITE COLLAR MOBILE DASHBOARD STYLES (Redesigned) ============= */

/* ---- WC Card: Projects (List-style) ---- */
.wc-card-projects {
    border-left: none;
}

.wc-project-stats-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.wc-stat-chip {
    background: rgba(var(--brand-color-rgb, 13,59,102), 0.08);
    border: none;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary, #334155);
}

.wc-stat-danger {
    background: rgba(239,68,68,0.1);
    color: var(--error-text, #991b1b);
}

.wc-stat-info {
    background: rgba(var(--brand-color-rgb, 13,59,102), 0.1);
    color: var(--brand-fg, var(--brand-color, #0D3B66));
}

.wc-project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color, #f0f1f3);
    cursor: pointer;
}

.wc-project-item:last-of-type {
    border-bottom: none;
}

.wc-project-item:active {
    opacity: 0.7;
}

.wc-project-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.wc-project-icon.overdue { background: var(--error-bg, rgba(239,68,68,0.12)); color: var(--error-text, #991b1b); }
.wc-project-icon.on-track { background: var(--success-bg, rgba(34,197,94,0.12)); color: var(--success-text, #166534); }
.wc-project-icon.in-progress { background: rgba(var(--brand-color-rgb, 13,59,102),0.12); color: var(--brand-fg, var(--brand-color, #0D3B66)); }

.wc-project-content {
    flex: 1;
    min-width: 0;
}

.wc-project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.wc-project-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.wc-project-pct {
    font-size: 0.88rem;
    font-weight: 700;
    flex-shrink: 0;
}

.wc-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color, #e5e7eb);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.wc-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.wc-project-meta {
    display: flex;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    flex-wrap: wrap;
}

.wc-delay-badge {
    color: var(--error-text, #991b1b);
    font-weight: 600;
}

/* ---- WC Card: Team Attendance (Redesigned Donut) ---- */
.wc-card-attendance {
    border-left: none;
}

.wc-att-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.wc-att-circle {
    width: 96px;
    height: 96px;
    min-width: 96px;
    min-height: 96px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: conic-gradient(
        var(--color) calc(var(--pct) * 1%),
        var(--bg) calc(var(--pct) * 1%)
    );
    position: relative;
}

.wc-att-circle::before {
    content: '';
    position: absolute;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--bg-surface-2, #fff);
}

.wc-att-circle-text {
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.wc-att-circle-pct {
    font-size: 1.3rem;
    font-weight: 800;
}

.wc-att-circle-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-att-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wc-att-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
}

.wc-att-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wc-att-detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color, #f0f1f3);
    font-size: 0.8rem;
}

.wc-att-label {
    font-weight: 600;
    color: var(--text-primary, #374151);
    white-space: nowrap;
}

.wc-att-names {
    color: var(--text-muted, #6b7280);
    flex: 1;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ---- WC Attendance: Mobile Responsive ---- */
@media (max-width: 480px) and (hover: none) and (pointer: coarse) {
    .wc-att-summary {
        gap: 12px;
    }
    .wc-att-circle {
        width: 80px;
        height: 80px;
        min-width: 80px;
        min-height: 80px;
    }
    .wc-att-circle::before {
        width: 56px;
        height: 56px;
    }
    .wc-att-circle-pct {
        font-size: 1.05rem;
    }
    .wc-att-circle-label {
        font-size: 0.58rem;
    }
    .wc-att-stat-row {
        font-size: 0.78rem;
        gap: 6px;
    }
    .wc-att-detail {
        font-size: 0.76rem;
        gap: 6px;
    }
    .wc-att-names {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
}

@media (max-width: 360px) {
    .wc-att-circle {
        width: 68px;
        height: 68px;
        min-width: 68px;
        min-height: 68px;
    }
    .wc-att-circle::before {
        width: 48px;
        height: 48px;
    }
    .wc-att-circle-pct {
        font-size: 0.9rem;
    }
    .wc-att-stat-row {
        font-size: 0.74rem;
    }
}

/* ---- WC Card: Team Competency ---- */
.wc-card-competency {
    border-left: none;
}

.wc-comp-overview {
    text-align: center;
    padding: 8px 0 14px;
}

.wc-comp-score-big {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
}

.wc-comp-score-label {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
}

.wc-comp-assessed-info {
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 4px;
}

.wc-pending-badge {
    background: rgba(234,179,8,0.1);
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
    text-align: center;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.wc-pending-badge:active {
    opacity: 0.7;
}

.wc-comp-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #94a3b8);
    margin: 12px 0 6px;
}

.wc-comp-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.wc-comp-member-name {
    font-size: 0.85rem;
    color: var(--text-primary, #334155);
    min-width: 80px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.wc-comp-bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--border-color, #e5e7eb);
    border-radius: 3px;
    overflow: hidden;
}

.wc-comp-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.wc-comp-score {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #334155);
    min-width: 32px;
    text-align: right;
}

.wc-comp-score-warn {
    color: var(--error-text, #991b1b);
}

/* ---- WC: Quick Actions (Redesigned with icon circles) ---- */
.wc-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 2px 0;
}

.wc-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px;
    border: 1px solid var(--border-color, #e8eaed);
    border-radius: 14px;
    background: var(--bg-surface-2, #fff);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    min-height: 68px;
}

.wc-action-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.wc-action-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.wc-action-icon-absen {
    background: rgba(34,197,94,0.12);
    color: var(--success-text, #166534);
}

.wc-action-icon-profil {
    background: rgba(var(--brand-color-rgb, 13,59,102),0.12);
    color: var(--brand-fg, var(--brand-color, #0D3B66));
}

.wc-action-icon-tim {
    background: rgba(139,92,246,0.12);
    color: #8b5cf6;
}

.wc-action-icon {
    font-size: 1.5rem;
}

.wc-action-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #475569);
}

/* ---- WC Empty state ---- */
.wc-empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted, #94a3b8);
    font-size: 0.88rem;
}

/* ---- WC: Dedicated mobile Riwayat + Tim pages ---- */
@media (max-width: 1024px) {
    body.device-mobile.persona-white-collar #main-app #user-history-section-wrapper,
    body.touch-device.persona-white-collar #main-app #user-history-section-wrapper,
    body.device-mobile.persona-white-collar #main-app #assessor-tab,
    body.touch-device.persona-white-collar #main-app #assessor-tab {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: auto;
        padding-bottom: calc(96px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }

    body.device-mobile.persona-white-collar #assessor-sub-nav,
    body.touch-device.persona-white-collar #assessor-sub-nav {
        display: none !important;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .mobile-profil-insights,
    body.touch-device.persona-white-collar #user-history-section-wrapper .mobile-profil-insights {
        margin: 0 0 12px;
        padding: 0;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-page-shell,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-page-shell {
        gap: 10px;
        margin-bottom: 12px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-hero-card,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-hero-card,
    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card,
    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-detail-panel,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-detail-panel,
    body.device-mobile.persona-white-collar #assessor-tab .org-preview-card,
    body.touch-device.persona-white-collar #assessor-tab .org-preview-card,
    body.device-mobile.persona-white-collar #assessor-tab .pending-assessments-card,
    body.touch-device.persona-white-collar #assessor-tab .pending-assessments-card,
    body.device-mobile.persona-white-collar #assessor-tab .mini-stats-card,
    body.touch-device.persona-white-collar #assessor-tab .mini-stats-card {
        border-radius: 8px;
        box-shadow: none;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-hero-card,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-hero-card {
        min-height: 0;
        padding: 14px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-title,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-title {
        font-size: 1.35rem;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-stat-strip,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-stat-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-stat-item,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-stat-item {
        min-height: 68px;
        padding: 10px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-stat-item strong,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-stat-item strong {
        font-size: 1.35rem;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-content-grid,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-content-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header,
    body.device-mobile.persona-white-collar #assessor-tab .section-header,
    body.touch-device.persona-white-collar #assessor-tab .section-header,
    body.device-mobile.persona-white-collar #assessor-tab .org-header-actions,
    body.touch-device.persona-white-collar #assessor-tab .org-header-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary,
    body.device-mobile.persona-white-collar #assessor-tab .section-header .btn-secondary,
    body.touch-device.persona-white-collar #assessor-tab .section-header .btn-secondary {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-tabs,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-tab-btn,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 40px;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-detail-body,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-detail-body {
        padding: 12px;
        overflow: hidden;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-detail-body .table-wrapper,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-detail-body .table-wrapper {
        overflow-x: auto;
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper #user-history-table,
    body.touch-device.persona-white-collar #user-history-section-wrapper #user-history-table,
    body.device-mobile.persona-white-collar #user-history-section-wrapper #user-given-history-table,
    body.touch-device.persona-white-collar #user-history-section-wrapper #user-given-history-table {
        min-width: 560px;
        font-size: 0.82rem;
    }

    body.device-mobile.persona-white-collar #user-history-section-wrapper .assessment-filter .filter-row,
    body.touch-device.persona-white-collar #user-history-section-wrapper .assessment-filter .filter-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.device-mobile.persona-white-collar #assessor-tab .assessor-section,
    body.touch-device.persona-white-collar #assessor-tab .assessor-section {
        max-width: 100%;
    }

    body.device-mobile.persona-white-collar #assessor-team-section .org-preview-card,
    body.touch-device.persona-white-collar #assessor-team-section .org-preview-card {
        width: 100%;
        margin: 0;
        padding: 12px;
    }

    body.device-mobile.persona-white-collar #assessor-team-section .org-controls,
    body.touch-device.persona-white-collar #assessor-team-section .org-controls {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body.device-mobile.persona-white-collar #assessor-team-section .search-box,
    body.touch-device.persona-white-collar #assessor-team-section .search-box {
        width: 100%;
        min-width: 0;
    }

    body.device-mobile.persona-white-collar #assessor-team-section .search-box input,
    body.touch-device.persona-white-collar #assessor-team-section .search-box input,
    body.device-mobile.persona-white-collar #assessor-team-section .org-controls .btn-secondary,
    body.touch-device.persona-white-collar #assessor-team-section .org-controls .btn-secondary {
        width: 100%;
        min-width: 0;
        min-height: 44px;
    }

    body.device-mobile.persona-white-collar #assessor-team-section .desktop-only,
    body.touch-device.persona-white-collar #assessor-team-section .desktop-only {
        display: none !important;
    }

    body.device-mobile.persona-white-collar #assessor-team-section .mobile-only,
    body.touch-device.persona-white-collar #assessor-team-section .mobile-only {
        display: block !important;
    }

    body.device-mobile.persona-white-collar #user-org-list,
    body.touch-device.persona-white-collar #user-org-list {
        display: grid !important;
        gap: 8px;
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-item,
    body.touch-device.persona-white-collar #user-org-list .org-list-item {
        padding: 0 !important;
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 8px;
        background: var(--bg-card, #fff);
        overflow: hidden;
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-item.is-me,
    body.touch-device.persona-white-collar #user-org-list .org-list-item.is-me {
        border-left: 3px solid var(--brand-color, #0D3B66);
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-header,
    body.touch-device.persona-white-collar #user-org-list .org-list-header {
        min-height: 58px;
        padding: 12px;
        gap: 10px;
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-info,
    body.touch-device.persona-white-collar #user-org-list .org-list-info {
        min-width: 0;
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-name,
    body.touch-device.persona-white-collar #user-org-list .org-list-name,
    body.device-mobile.persona-white-collar #user-org-list .org-list-pos,
    body.touch-device.persona-white-collar #user-org-list .org-list-pos {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-right,
    body.touch-device.persona-white-collar #user-org-list .org-list-right {
        flex: 0 0 auto;
    }

    body.device-mobile.persona-white-collar #user-org-list .org-list-children,
    body.touch-device.persona-white-collar #user-org-list .org-list-children {
        margin-left: 0;
        padding: 0 8px 8px 10px;
        border-left: 0;
        background: var(--bg-secondary, rgba(0,0,0,0.03));
    }
}

/* ---- Compact mobile Riwayat page ---- */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    #user-history-section-wrapper {
        width: 100%;
        max-width: none;
        overflow-x: hidden;
        padding-bottom: calc(90px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }

    #user-history-section-wrapper .history-page-shell {
        gap: 8px;
        margin-bottom: 8px;
    }

    #user-history-section-wrapper .history-hero-card {
        min-height: 58px;
        flex-direction: row;
        align-items: center;
        padding: 10px 12px;
        gap: 10px;
        border-radius: 8px;
        box-shadow: none;
    }

    #user-history-section-wrapper .history-hero-card > div {
        min-width: 0;
        flex: 1;
    }

    #user-history-section-wrapper .history-eyebrow {
        margin-bottom: 2px;
        font-size: 0.62rem;
        line-height: 1.1;
    }

    #user-history-section-wrapper .history-title {
        font-size: 1.08rem;
        line-height: 1.15;
    }

    #user-history-section-wrapper .history-subtitle {
        margin-top: 3px;
        max-width: 100%;
        overflow: hidden;
        color: var(--text-secondary);
        font-size: 0.76rem;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #user-history-section-wrapper .history-icon-action {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 8px;
        font-size: 1rem;
    }

    #user-history-section-wrapper .history-stat-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    #user-history-section-wrapper .history-stat-item {
        min-height: 46px;
        padding: 7px 5px;
        text-align: center;
        border-radius: 8px;
        box-shadow: none;
    }

    #user-history-section-wrapper .history-stat-item span {
        min-height: 1.7em;
        font-size: 0.58rem;
        line-height: 1.15;
    }

    #user-history-section-wrapper .history-stat-item strong {
        margin-top: 4px;
        font-size: 1rem;
        line-height: 1;
    }

    #user-history-section-wrapper .history-content-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #user-history-section-wrapper .history-panel-card,
    #user-history-section-wrapper .history-detail-panel {
        border-radius: 8px;
        box-shadow: none;
    }

    #user-history-section-wrapper .history-panel-head,
    #user-history-section-wrapper .history-detail-panel > summary {
        min-height: 40px;
        padding: 9px 11px;
        gap: 7px;
    }

    #user-history-section-wrapper .history-panel-head h4,
    #user-history-section-wrapper .history-detail-panel h4,
    #user-history-section-wrapper .history-detail-panel > summary {
        font-size: 0.88rem;
        line-height: 1.2;
    }

    #user-history-section-wrapper .history-career-panel .bc-timeline-container {
        padding: 8px;
    }

    #user-history-section-wrapper .bc-timeline {
        padding-left: 16px;
    }

    #user-history-section-wrapper .bc-timeline::before {
        left: 5px;
        width: 2px;
    }

    #user-history-section-wrapper .bc-timeline-item {
        margin-bottom: 8px;
        padding: 9px;
        border-radius: 8px;
        box-shadow: none;
    }

    #user-history-section-wrapper .bc-timeline-item:hover {
        transform: none;
    }

    #user-history-section-wrapper .bc-timeline-item::before {
        top: 17px;
        left: -15px;
        width: 9px;
        height: 9px;
        border-width: 2px;
    }

    #user-history-section-wrapper .bc-timeline-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 5px;
    }

    #user-history-section-wrapper .bc-timeline-company {
        min-width: 0;
        flex: 1;
        gap: 8px;
    }

    #user-history-section-wrapper .bc-timeline-logo {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 1rem;
    }

    #user-history-section-wrapper .bc-timeline-logo i {
        font-size: 1rem;
    }

    #user-history-section-wrapper .bc-timeline-company-name,
    #user-history-section-wrapper .bc-timeline-position {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #user-history-section-wrapper .bc-timeline-company-name {
        font-size: 0.86rem;
    }

    #user-history-section-wrapper .bc-timeline-position {
        font-size: 0.74rem;
    }

    #user-history-section-wrapper .bc-timeline-dates {
        max-width: 42%;
        margin-top: 0;
        text-align: right;
        font-size: 0.68rem;
        line-height: 1.25;
    }

    #user-history-section-wrapper .bc-timeline-date-range,
    #user-history-section-wrapper .bc-timeline-duration {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #user-history-section-wrapper .bc-timeline-rating {
        margin-top: 5px;
        gap: 5px;
    }

    #user-history-section-wrapper .bc-timeline-stars,
    #user-history-section-wrapper .bc-timeline-rating-label,
    #user-history-section-wrapper .bc-timeline-expand,
    #user-history-section-wrapper .bc-timeline-detail-item {
        font-size: 0.72rem;
    }

    #user-history-section-wrapper .bc-timeline-expand {
        margin-top: 4px;
        padding: 5px;
    }

    #user-history-section-wrapper .bc-timeline-details {
        margin-top: 7px;
        padding-top: 7px;
    }

    #user-history-section-wrapper .bc-timeline-detail-item {
        padding: 4px 0;
    }

    #user-history-section-wrapper .bc-timeline-empty {
        padding: 18px 12px;
    }

    #user-history-section-wrapper .bc-timeline-empty-icon {
        margin-bottom: 6px;
        font-size: 1.8rem;
    }

    #user-history-section-wrapper .bc-timeline-empty-text {
        margin-bottom: 6px;
        font-size: 0.86rem;
    }

    #user-history-section-wrapper .history-panel-card.riwayat-summary {
        padding: 10px;
    }

    #user-history-section-wrapper .history-panel-card .riwayat-summary-header,
    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 8px;
        margin-bottom: 8px;
    }

    #user-history-section-wrapper .riwayat-summary-title {
        font-size: 0.92rem;
        line-height: 1.2;
    }

    #user-history-section-wrapper .riwayat-summary-subtitle {
        display: -webkit-box;
        margin-top: 3px;
        overflow: hidden;
        font-size: 0.72rem;
        line-height: 1.25;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary,
    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary {
        width: auto;
        min-width: 0;
        min-height: 34px;
        justify-content: center;
        padding: 0 9px;
        border-radius: 8px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    #user-history-section-wrapper .history-panel-card .riwayat-summary-overall {
        margin-bottom: 8px;
    }

    #user-history-section-wrapper .overall-score-card,
    #user-history-section-wrapper .summary-card {
        padding: 9px;
        border-radius: 8px;
    }

    #user-history-section-wrapper .overall-score-value {
        font-size: 1.55rem;
        line-height: 1;
    }

    #user-history-section-wrapper .overall-score-label {
        font-size: 0.76rem;
    }

    #user-history-section-wrapper .overall-score-hint {
        margin-top: 3px;
        font-size: 0.7rem;
        line-height: 1.25;
    }

    #user-history-section-wrapper .riwayat-summary-grid {
        gap: 8px;
    }

    #user-history-section-wrapper .summary-card-header {
        gap: 7px;
        margin-bottom: 7px;
        font-size: 0.8rem;
    }

    #user-history-section-wrapper .summary-list {
        gap: 7px;
    }

    #user-history-section-wrapper .skill-row {
        gap: 6px;
    }

    #user-history-section-wrapper .skill-name {
        min-width: 0;
        overflow: hidden;
        font-size: 0.76rem;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #user-history-section-wrapper .skill-score {
        padding: 2px 7px;
        font-size: 0.72rem;
    }

    #user-history-section-wrapper .skill-meter {
        height: 6px;
    }

    #user-history-section-wrapper .summary-empty {
        padding: 8px;
        border-radius: 8px;
        font-size: 0.76rem;
        line-height: 1.3;
    }

    #user-history-section-wrapper .riwayat-summary-footer {
        margin-top: 5px;
    }

    #user-history-section-wrapper .link-btn {
        min-height: 32px;
        font-size: 0.78rem;
    }

    #user-history-section-wrapper .history-detail-panel {
        margin-top: 8px;
    }

    #user-history-section-wrapper .history-detail-body {
        padding: 9px;
    }

    #user-history-section-wrapper .history-detail-body .user-card-header h4 {
        font-size: 0.88rem;
    }

    #user-history-section-wrapper .history-tabs {
        gap: 6px;
        margin-bottom: 8px !important;
        padding-bottom: 6px !important;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    #user-history-section-wrapper .history-tab-btn {
        min-height: 34px;
        flex: 0 0 auto;
        padding: 6px 10px;
        font-size: 0.74rem;
        white-space: nowrap;
    }

    #user-history-section-wrapper .history-panel .helper-text {
        margin-bottom: 8px !important;
        font-size: 0.72rem;
        line-height: 1.3;
    }

    #user-history-section-wrapper .history-detail-body .table-wrapper {
        overflow-x: auto;
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 8px;
        -webkit-overflow-scrolling: touch;
    }

    #user-history-section-wrapper #user-history-table,
    #user-history-section-wrapper #user-given-history-table {
        min-width: 520px;
        font-size: 0.76rem;
    }

    #user-history-section-wrapper #user-history-table th,
    #user-history-section-wrapper #user-history-table td,
    #user-history-section-wrapper #user-given-history-table th,
    #user-history-section-wrapper #user-given-history-table td {
        padding: 7px 8px;
    }
}

@media (max-width: 360px) {
    #user-history-section-wrapper .history-stat-strip {
        gap: 4px;
    }

    #user-history-section-wrapper .history-stat-item {
        padding-inline: 3px;
    }

    #user-history-section-wrapper .history-stat-item span {
        font-size: 0.54rem;
    }

    #user-history-section-wrapper .history-stat-item strong {
        font-size: 0.92rem;
    }

    #user-history-section-wrapper .history-panel-card .riwayat-summary-header,
    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header {
        grid-template-columns: 1fr;
    }

    #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary,
    body.device-mobile.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary,
    body.touch-device.persona-white-collar #user-history-section-wrapper .history-panel-card .riwayat-summary-header .btn-secondary {
        width: 100%;
    }
}

/* ---- Mobile Profil Insights (in history section) ---- */
.mobile-profil-insights {
    margin-bottom: 16px;
    padding: 0 4px;
}

.mobile-profil-insights .bc-section-title {
    font-size: 1rem;
    margin-bottom: 10px;
}

.mobile-profil-insights .bc-insights-grid {
    gap: 8px;
}

/* ============================================================
   SKELETON LOADING — Redesigned for new layout
   ============================================================ */

@keyframes skeletonShimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.skeleton-card {
    background: var(--bg-surface-2, #fff);
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-color, #e8eaed);
    overflow: hidden;
}

.skeleton-line {
    height: 14px;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        var(--border-color, #e8eaed) 0px,
        rgba(0,0,0,0.03) 40px,
        var(--border-color, #e8eaed) 80px
    );
    background-size: 200px 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
    margin-bottom: 10px;
}

[data-theme="dark"] .skeleton-line {
    background: linear-gradient(
        90deg,
        var(--border-color, #333) 0px,
        rgba(255,255,255,0.08) 40px,
        var(--border-color, #333) 80px
    );
    background-size: 200px 100%;
}

.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-100 { width: 100%; }
.skeleton-line.h-lg { height: 28px; }
.skeleton-line.h-xl { height: 52px; border-radius: 14px; }

.skeleton-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.skeleton-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        var(--border-color, #e8eaed) 0px,
        rgba(0,0,0,0.03) 40px,
        var(--border-color, #e8eaed) 80px
    );
    background-size: 200px 100%;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

[data-theme="dark"] .skeleton-circle {
    background: linear-gradient(
        90deg,
        var(--border-color, #333) 0px,
        rgba(255,255,255,0.08) 40px,
        var(--border-color, #333) 80px
    );
    background-size: 200px 100%;
}

/* Stat grid skeleton */
.skeleton-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 4px;
}

.skeleton-stat-card {
    background: var(--bg-surface-2, #fff);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid var(--border-color, #e8eaed);
}

.skeleton-stat-card .skeleton-line:first-child {
    width: 40%;
    height: 10px;
    margin-bottom: 8px;
}

.skeleton-stat-card .skeleton-line:last-child {
    width: 70%;
    height: 24px;
    margin-bottom: 0;
}

/* ============================================================
   INSIGHTS ACCORDION — Collapsible Ringkasan on Mobile
   ============================================================ */

.bc-insights-collapsible {
    background: var(--bg-surface-2, #fff);
    border-radius: 20px;
    padding: 4px 16px;
    border: 1px solid var(--border-color, #e8eaed);
}

.bc-insights-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 0;
    color: var(--text-primary, #1a1a1a);
}

.bc-insights-toggle .bc-section-title {
    margin: 0;
    font-size: 1rem;
}

.bc-insights-chevron {
    font-size: 1.2rem;
    transition: transform 0.25s ease;
    color: var(--text-muted, #6b7280);
}

.bc-insights-content {
    padding-bottom: 12px;
}

/* ============================================================
   MOBILE STATUS BADGE
   ============================================================ */

.attendance-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 700;
}

.attendance-status-badge.working {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success-text, #166534);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.attendance-status-badge.not-checked {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-muted, #9ca3af);
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.attendance-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

.attendance-status-badge.working .attendance-status-dot {
    background: var(--success-solid, #15803d);
}

.attendance-status-badge.not-checked .attendance-status-dot {
    background: #9ca3af;
    animation: none;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================================
   BOTTOM NAV — Dynamic item count spacing
   ============================================================ */

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .bottom-nav-item {
        padding: 4px 1px;
        margin: 0 1px;
    }
    
    .bottom-nav-container {
        max-width: 100%;
        padding: 0 8px;
    }
}

/* ============================================================
   SMALL SCREEN FIXES (320px)
   ============================================================ */

@media (max-width: 374px) and (hover: none) and (pointer: coarse) {
    .mobile-dashboard-container {
        padding: 0 8px;
    }
    
    .mobile-card {
        padding: 12px;
        border-radius: 16px;
    }
    
    .wage-day-indicator {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .wage-day-label {
        font-size: 0.65rem;
    }
    
    .bottom-nav-item span {
        font-size: 11px;
    }
    
    .level-welcome {
        margin: 0 8px 4px !important;
        padding: 16px !important;
        border-radius: 16px !important;
    }
    
    .level-welcome-title {
        font-size: 1.15rem !important;
    }
}

/* ============= ABSEN / CUTI SWITCHER (White Collar Mobile) ============= */
.absen-cuti-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 8px 16px;
    background: var(--bg-surface-2, #f3f4f6);
    border-radius: 12px;
}
.absen-cuti-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.absen-cuti-tab.active {
    background: var(--bg-surface, #fff);
    color: var(--brand-fg, var(--brand-color, #0D3B66));
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 600;
}
.absen-cuti-tab i { font-size: 1rem; }

/* ============= PULL TO REFRESH ============= */
.pull-to-refresh-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 9999;
    background: var(--bg-surface, #fff);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: transform 0.25s ease;
    pointer-events: none;
}
.pull-to-refresh-indicator.visible {
    transform: translateX(-50%) translateY(16px);
}
.pull-to-refresh-indicator.loading .ptr-arrow {
    animation: ptr-spin 0.8s linear infinite;
}
.ptr-arrow { font-size: 1.25rem; color: var(--brand-fg, var(--brand-color, #0D3B66)); }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ============= SALARY PRIVACY MASK ============= */
.salary-masked { filter: blur(8px); transition: filter 0.3s ease; cursor: pointer; user-select: none; }
.salary-masked.revealed { filter: none; }
.salary-mask-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--bg-surface-2, #f3f4f6);
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
}
.salary-mask-toggle:hover { background: var(--bg-surface-3, #e5e7eb); }

/* ============= NOTIFICATION SKELETON ============= */
.notif-skeleton {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.notif-skeleton .skeleton-line {
    height: 12px;
    background: var(--bg-surface-2, #f3f4f6);
    border-radius: 6px;
    margin-bottom: 8px;
    animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.notif-skeleton .skeleton-line.w-40 { width: 40%; }
.notif-skeleton .skeleton-line.w-60 { width: 60%; }
.notif-skeleton .skeleton-line.w-80 { width: 80%; }
@keyframes skeleton-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* PWA mobile viewport fallback: keep dashboard constrained even when
   standalone browsers do not match hover:none/pointer:coarse. */
@media (max-width: 768px) {
    .level-welcome {
        background: linear-gradient(135deg, var(--brand-color, #0D3B66) 0%, var(--brand-hover, #082F49) 100%) !important;
        border-radius: 16px !important;
        padding: 14px 14px 12px !important;
        margin: 0 4px 4px !important;
        border: none !important;
        box-shadow: 0 4px 20px rgba(var(--brand-color-rgb, 13,59,102), 0.3) !important;
        position: relative;
        overflow: hidden;
        box-sizing: border-box;
    }

    .hero-welcome-inner {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        position: relative;
        z-index: 1;
    }

    .hero-welcome-content {
        flex: 1 1 auto;
        min-width: 0;
    }

    .level-welcome-title {
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        margin: 0 0 2px 0;
        line-height: 1.25;
    }

    .level-welcome-text {
        font-size: 0.8rem !important;
        color: rgba(255,255,255,0.85) !important;
        margin: 0;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .persona-blue-collar #user-overview-section > .desktop-profile-dashboard,
    .persona-white-collar #user-overview-section > .desktop-profile-dashboard {
        display: none !important;
    }

    #mobile-stat-grid,
    .mobile-stat-grid,
    .mobile-dashboard-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .mobile-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 4px;
    }

    .mobile-stat-card,
    .mobile-card,
    .mobile-card-wage,
    .mobile-card-payment,
    .mobile-card-agenda,
    .mobile-card-attendance {
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .wage-days-row {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .persona-blue-collar #user-overview-section,
    .persona-white-collar #user-overview-section {
        overflow-x: hidden;
        padding-bottom: calc(84px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }
}

@media (max-width: 374px) {
    .mobile-dashboard-container {
        padding: 0 8px;
    }

    .mobile-card {
        padding: 12px;
        border-radius: 16px;
    }
}
