/* Custom Premium CSS for Attendance App */

/* Dark theme defaults */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --card-bg: rgba(30, 41, 59, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --accent-teal: #14b8a6;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-bg: #1e293b; /* dark navbar background */
}

/* Light theme overrides */
:root.light {
    --bg-primary: #f3f4f6;
    --bg-secondary: #e5e7eb;
    --card-bg: rgba(255, 255, 255, 0.65);
    --border-color: rgba(0, 0, 0, 0.08);
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --success-gradient: linear-gradient(135deg, #22c55e 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --accent-teal: #0d9488;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --nav-bg: #f3f4f6; /* light navbar background */
}

/* Global reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Body styling */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Card Utility */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: var(--transition);
    overflow: visible;
    position: relative;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Custom Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
    overflow: visible;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    height: 42px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Select Dropdown Custom Styling - Dark Theme */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #1e293b !important;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding: 10px 38px 10px 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #f8fafc !important;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.40);
    transition: var(--transition);
    cursor: pointer;
    height: 44px;
    min-height: 44px;
    position: relative;
    z-index: 20;
    width: 100%;
    box-sizing: border-box;
    background-image: none !important;
}

/* Native select base (fallback) — hidden when custom dropdown .dd used */
select.form-control,
select.form-control:focus,
select.form-control:hover {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}

select.form-control option {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 36px;
    opacity: 1;
    text-shadow: none;
}

select.form-control option:hover {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 600;
    opacity: 1;
}

select.form-control option:checked {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700;
    opacity: 1;
}

select.form-control option:disabled {
    color: var(--text-muted);
    font-style: italic;
    background-color: #1e293b;
    opacity: 1;
}

select.form-control:hover {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.40);
}

select.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #1e293b !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.20);
}

select.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Light theme select overrides */
:root.light select.form-control {
    background-color: #ffffff;
    color: #111827;
    border-color: rgba(0, 0, 0, 0.20);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

:root.light select.form-control option {
    background-color: #ffffff !important;
    color: #111827 !important;
    border-bottom-color: rgba(0, 0, 0, 0.08);
    min-height: 36px;
    opacity: 1;
    text-shadow: none;
}

:root.light select.form-control option:hover {
    background-color: #3b82f6 !important;
    color: #ffffff !important;
    font-weight: 600;
    opacity: 1;
}

:root.light select.form-control option:checked {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700;
    opacity: 1;
}

:root.light select.form-control option:disabled {
    color: #6b7280;
    background-color: #ffffff;
    opacity: 1;
}

:root.light select.form-control:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.30);
}

:root.light select.form-control:focus {
    border-color: #3b82f6;
    background-color: rgba(255, 255, 255, 1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.20);
}

/* Select z-index inside modals - ensure options render above all */
.modal-overlay.active .modal-content select.form-control {
    z-index: 9999;
}
.modal-overlay.active .ket-modal-content select.form-control {
    z-index: 9999;
}

/* ==================== Custom Dropdown Component ==================== */
.custom-select-wrapper {
    position: relative;
    display: block;
    width: 100%;
    z-index: 1;
    transform: translateZ(0);
}

.custom-select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background-color: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.40);
    border-radius: 10px;
    padding: 10px 38px 10px 14px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: #f8fafc;
    cursor: pointer;
    height: 44px;
    min-height: 44px;
    transition: var(--transition);
    user-select: none;
}

.custom-select-display .custom-select-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.custom-select-display .custom-select-chevron {
    flex-shrink: 0;
    font-size: 16px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.custom-select-display:hover {
    background-color: #334155;
    border-color: rgba(255, 255, 255, 0.40);
}

.custom-select-display:focus-within {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.20);
}

.custom-select-display.open .custom-select-chevron {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.40);
    border-radius: 10px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
    padding: 3px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    will-change: transform, opacity;
}

.custom-select-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.custom-select-option {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #f8fafc;
    background-color: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    border-radius: 8px;
    margin: 0;
    transition: var(--transition);
    white-space: normal;
    word-break: break-word;
    opacity: 1;
}

.custom-select-option:hover {
    background-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
    opacity: 1;
}

.custom-select-option.selected {
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 700;
    opacity: 1;
}

.custom-select-option.disabled {
    color: #94a3b8;
    font-style: italic;
    cursor: not-allowed;
    opacity: 1;
}

/* Custom select inside modal - higher z-index */
.modal-overlay.active .custom-select-wrapper {
    z-index: 99998;
}

.modal-overlay.active .custom-select-options {
    z-index: 99999;
}

/* Light theme custom dropdown overrides */
:root.light .custom-select-display {
    background-color: #ffffff;
    color: #111827;
    border-color: rgba(0, 0, 0, 0.20);
}

:root.light .custom-select-display .custom-select-chevron {
    color: #6b7280;
}

:root.light .custom-select-display:hover {
    background-color: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.30);
}

:root.light .custom-select-display:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.20);
}

:root.light .custom-select-options {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.20);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

    :root.light .custom-select-option {
        color: #111827;
        background-color: #ffffff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        opacity: 1;
    }

:root.light .custom-select-option.disabled {
    color: #6b7280;
}

/* Dark theme custom dropdown overrides — improve visibility */
:root:not(.light) .custom-select-options {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

    :root:not(.light) .custom-select-option {
        color: #e2e8f0;
        background-color: #0f172a;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        opacity: 1;
    }

:root:not(.light) .custom-select-option:last-child {
    border-bottom: none;
}

:root:not(.light) .custom-select-option:hover {
    background-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
}

:root:not(.light) .custom-select-option.selected {
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 700;
}

:root:not(.light) .custom-select-option.disabled {
    color: #64748b;
    font-style: italic;
}

:root:not(.light) .custom-select-display {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.18);
    opacity: 1;
}

:root:not(.light) .custom-select-display:hover {
    background-color: #334155;
    border-color: rgba(255, 255, 255, 0.28);
    opacity: 1;
}

:root:not(.light) .custom-select-display .custom-select-chevron {
    color: #94a3b8;
}

/* Hidden native select when wrapped by custom dropdown */
.custom-select-wrapper select.form-control {
    opacity: 0 !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    pointer-events: none !important;
}

/* Nav Styles */
.navbar {
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-link i {
    flex-shrink: 0;
}

.nav-link:hover, .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Tables */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

/* Responsive Table Wrapper */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 0;
}

.custom-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.custom-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 15px;
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-admin {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.badge-operator {
    background: rgba(139, 92, 246, 0.2);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

.badge-employee {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Dashboard Layout */
.dashboard-container {
    max-width: 1400px;
    width: 100%;
    margin: 40px auto;
    padding: 0 40px;
    flex: 1;
    overflow: visible;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent-teal);
}

.stat-info h3 {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-info p {
    font-size: 22px;
    font-weight: 700;
    margin-top: 2px;
}

/* Camera & Map columns */
.main-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
}

@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.history-card {
    margin-top: 32px;
}

/* Modal Popup Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 380px;
    box-sizing: border-box;
    transform: scale(0.9);
    transition: var(--transition);
    overflow: visible;
    padding: 20px;
    position: relative;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content.map-modal {
    max-width: 600px;
    width: 90%;
}

/* Keterangan modal - wider & dropdown-safe z-index */
.modal-overlay.active .ket-modal-content {
    max-width: 420px;
    width: 92%;
    position: relative;
    z-index: 10001;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.modal-overlay.active .ket-modal-content .form-control {
    width: 100%;
    box-sizing: border-box;
    position: relative;
}
.modal-overlay.active .ket-modal-content select.form-control {
    width: 100%;
    box-sizing: border-box;
}
.modal-overlay.active .ket-modal-content select.form-control option {
    white-space: nowrap;
    overflow: visible;
    padding: 10px 14px;
    font-size: 14px;
}
.modal-overlay.active .ket-modal-content .custom-select-options {
    max-height: 80px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.modal-header h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

/* Mobile responsive for face registration modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95vw;
        border-radius: 16px;
        padding: 12px;
    }

    .modal-header h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        font-size: 16px;
    }

    #face-video {
        max-height: 180px;
        border-radius: 6px;
    }

    #face-form {
        margin-top: 10px;
    }

    #face-form .btn-primary,
    #face-form .btn-secondary {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 6px;
    }

    #face-status {
        font-size: 12px;
    }

    #face-error {
        font-size: 11px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-width: 98vw;
        border-radius: 12px;
        padding: 10px;
    }

    .modal-header h3 {
        font-size: 14px;
        margin-bottom: 8px;
    }

    #face-video {
        max-height: 160px;
    }

    .modal-close {
        top: 6px;
        right: 8px;
        font-size: 14px;
    }
}
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
    padding: 0;
}

.action-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--accent-teal);
}

.action-dropdown-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #3b82f6;
}

.action-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 170px;
    padding: 6px;
    margin-top: 4px;
    list-style: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
}

.action-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.action-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    text-align: left;
}

.action-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.action-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.action-dropdown-item i {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

/* Light theme dropdown overrides */
:root.light .action-dropdown-btn {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
}

:root.light .action-dropdown-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #2563eb;
}

:root.light .action-dropdown-menu {
    background: #f8fafc;
    border-color: var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

:root.light .action-dropdown-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

:root.light .action-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* ==================== Mobile Navbar ==================== */
.navbar {
    height: 60px;
    padding: 0 16px;
}

.nav-left {
    flex: 0 0 auto;
}

.nav-brand-text {
    font-size: 16px;
}

.nav-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.nav-mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 16px;
    padding: 0;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.nav-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hamburger-bar {
    display: block;
    position: absolute;
    left: 50%;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-bar:nth-child(1) {
    top: 11px;
    transform: translateX(-50%);
}

.hamburger-bar:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.hamburger-bar:nth-child(3) {
    bottom: 11px;
    transform: translateX(-50%);
}

.nav-mobile-toggle.active .hamburger-bar:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.nav-mobile-toggle.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active .hamburger-bar:nth-child(3) {
    bottom: 50%;
    transform: translate(-50%, 50%) rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.nav-link span {
    display: inline;
}

.nav-divider {
    width: 100%;
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.nav-user-text {
    font-size: 13px;
    color: var(--text-muted);
}

.nav-user-role {
    display: none;
}

.nav-theme-toggle {
    margin: 0;
    padding: 6px 10px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-logout {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ==================== Mobile Breakpoint 1024px ==================== */
@media (max-width: 1024px) {
    .dashboard-container {
        margin: 24px auto;
        padding: 0 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-info h3 {
        font-size: 12px;
    }

    .stat-info p {
        font-size: 20px;
    }

    .glass-card {
        padding: 20px;
    }

    .glass-card h3 {
        font-size: 16px;
    }

    .main-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .nav-menu {
        gap: 12px;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .nav-link {
        padding: 7px 12px;
        font-size: 13px;
    }

    .nav-user-text {
        font-size: 12px;
    }

    .nav-theme-toggle {
        width: 34px;
        height: 34px;
        padding: 4px;
    }

    .custom-table th {
        padding: 14px 10px;
        font-size: 13px;
    }

    .custom-table td {
        padding: 12px 10px;
        font-size: 14px;
    }
}

/* ==================== Mobile Breakpoint 768px ==================== */
@media (max-width: 768px) {
    /* Navbar */
    .nav-mobile-toggle {
        display: flex;
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-theme-toggle {
        position: absolute;
        right: 68px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        padding: 0;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--nav-bg);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0;
        max-height: 0;
        overflow-y: hidden;
        overflow-x: clip;
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 100;
    }

    .nav-menu.active {
        max-height: calc(100vh - 60px);
        opacity: 1;
        pointer-events: all;
        overflow-y: auto;
        overflow-x: visible;
    }

    .nav-link {
        color: var(--text-primary);
        padding: 12px 24px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        overflow: visible;
        opacity: 1;
    }

    .nav-link:hover,
    .nav-link.active {
        color: white;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-user-text {
        padding: 12px 16px;
        display: block;
        font-size: 14px;
        text-align: center;
        color: var(--text-primary);
        opacity: 1;
    }

    .nav-user-info {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-user-role {
        display: inline;
    }

    .nav-logout {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        color: #fca5a5;
        font-weight: 600;
        opacity: 1;
    }

    /* Container */
    .dashboard-container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .stat-info h3 {
        font-size: 10px;
    }

    .stat-info p {
        font-size: 16px;
    }

    /* Cards */
    .glass-card {
        padding: 14px;
        border-radius: 14px;
    }

    .glass-card h3 {
        font-size: 14px;
        margin-bottom: 15px;
    }

    /* Tables */
    .table-responsive {
        margin: 0 -12px;
        padding: 0 12px;
    }

    .custom-table th {
        padding: 10px 8px;
        font-size: 11px;
    }

    .custom-table td {
        padding: 8px;
        font-size: 12px;
    }

    /* Buttons */
    .btn-primary, .btn-success, .btn-danger, .btn-secondary {
        font-size: 14px;
        padding: 12px 16px;
    }

    /* Form */
    .form-control {
        font-size: 14px;
        height: 44px;
    }

    .history-card {
        margin-top: 20px;
    }

    /* Print styles */
    @media print {
        .dashboard-container {
            padding: 0;
            margin: 0;
        }
    }
}

/* ==================== Mobile Breakpoint 480px ==================== */
@media (max-width: 480px) {
    .dashboard-container {
        margin: 16px auto;
        padding: 0 10px;
    }

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

    .glass-card h3 {
        font-size: 13px;
    }

    .custom-table th {
        padding: 8px 6px;
        font-size: 10px;
    }

    .custom-table td {
        padding: 6px;
        font-size: 11px;
    }

    .stat-info p {
        font-size: 15px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .btn-primary, .btn-success, .btn-danger, .btn-secondary {
        font-size: 13px;
        padding: 12px 14px;
    }

    .nav-brand-text {
        font-size: 14px;
    }

    select.form-control {
        height: 44px;
        font-size: 13px;
        padding: 10px 36px 10px 12px;
    }

    /* Modal */
    .modal-content {
        width: 98%;
        max-width: 98vw;
        padding: 12px;
        border-radius: 14px;
    }

    .modal-header h3 {
        font-size: 14px;
    }

    .modal-close {
        top: 8px;
        right: 8px;
        font-size: 14px;
    }

    /* Hide image column on very small screens */
    .custom-table .hide-sm {
        display: none;
    }

    /* Badge font size */
    .badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}
