/* ==========================================================================
   Pulse Mark - Ultra Modern Control Panel Design System
   ========================================================================== */

:root {
    /* Color Palette */
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --primary-light: rgba(14, 165, 233, 0.15);
    --secondary: #6366f1;
    --secondary-hover: #4f46e5;
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #f43f5e;
    --danger-light: rgba(244, 63, 94, 0.15);
    --info: #06b6d4;

    /* Theme Variables - Dark (Default) */
    --bg-main: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(14, 165, 233, 0.3);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --sidebar-width: 270px;
    --navbar-height: 70px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(14, 165, 233, 0.35);

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Light Mode Overrides & Inversion Engine (High Contrast & Crystal Clear)
   ========================================================================== */
[data-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #cbd5e1;
    --border-color-hover: rgba(14, 165, 233, 0.5);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-theme="light"] .glass-panel {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
    color: #0f172a !important;
}

[data-theme="light"] .page-title,
[data-theme="light"] .card-title,
[data-theme="light"] h1, 
[data-theme="light"] h2, 
[data-theme="light"] h3, 
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 {
    color: #0f172a !important;
}

[data-theme="light"] .page-subtitle,
[data-theme="light"] p {
    color: #334155 !important;
}

[data-theme="light"] strong:not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] b:not(#blackSurface *):not(#cameraViewfinder *) {
    color: #0f172a;
}

[data-theme="light"] code {
    color: #0284c7 !important;
    background: #e0f2fe !important;
    padding: 3px 7px;
    border-radius: 6px;
    border: 1px solid #bae6fd;
    font-weight: 700;
}

/* Invert inline white/light colors in light mode */
[data-theme="light"] [style*="color: #fff"]:not(.btn-primary):not(.btn-primary *):not(.badge):not(.avatar):not(.nav-link.active):not(.nav-link.active *):not(.icon-admin):not(.icon-agent):not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #ffffff"]:not(.btn-primary):not(.btn-primary *):not(.badge):not(.avatar):not(.nav-link.active):not(.nav-link.active *):not(.icon-admin):not(.icon-agent):not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #f8fafc"]:not(.btn-primary):not(.btn-primary *):not(.badge):not(.avatar):not(.nav-link.active):not(.nav-link.active *):not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #f1f5f9"]:not(.btn-primary):not(.btn-primary *):not(.badge):not(.avatar):not(.nav-link.active):not(.nav-link.active *):not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #f3f4f6"]:not(.btn-primary):not(.btn-primary *):not(.badge):not(.avatar):not(.nav-link.active):not(.nav-link.active *):not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #e2e8f0"]:not(.btn-primary):not(.btn-primary *):not(.badge):not(.avatar):not(.nav-link.active):not(.nav-link.active *):not(#blackSurface *):not(#cameraViewfinder *) {
    color: #0f172a !important;
}

[data-theme="light"] [style*="color: #cbd5e1"]:not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #94a3b8"]:not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #9ca3af"]:not(#blackSurface *):not(#cameraViewfinder *),
[data-theme="light"] [style*="color: #64748b"]:not(#blackSurface *):not(#cameraViewfinder *) {
    color: #475569 !important;
}

[data-theme="light"] small,
[data-theme="light"] .text-muted,
[data-theme="light"] .text-dim {
    color: #475569 !important;
}

/* Inputs, Selects, Datetime & Forms */
[data-theme="light"] .form-control,
[data-theme="light"] .form-control-sm,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="datetime-local"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="search"],
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] [style*="background: #0f172a"]:is(select, input, textarea),
[data-theme="light"] [style*="background: #0b1329"]:is(select, input, textarea),
[data-theme="light"] [style*="background: rgba(15, 23, 42"]:is(select, input, textarea) {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .form-control:focus,
[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

[data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder,
[data-theme="light"] .form-control::placeholder {
    color: #94a3b8 !important;
}

[data-theme="light"] .form-label {
    color: #0f172a !important;
    font-weight: 700 !important;
}

/* Data Tables & Custom Tables */
[data-theme="light"] .data-table,
[data-theme="light"] .custom-table {
    color: #0f172a !important;
}

[data-theme="light"] .data-table th,
[data-theme="light"] .custom-table th {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

[data-theme="light"] .data-table td,
[data-theme="light"] .custom-table td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: transparent !important;
}

[data-theme="light"] .data-table tbody tr:hover,
[data-theme="light"] .custom-table tbody tr:hover {
    background: #f8fafc !important;
}

/* Navigation & Sidebar */
[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .sidebar-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .user-profile-badge {
    background: #f1f5f9 !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .user-name {
    color: #0f172a !important;
}

[data-theme="light"] .nav-link {
    color: #475569 !important;
}

[data-theme="light"] .nav-link:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

[data-theme="light"] .nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7, #4f46e5) !important;
}

[data-theme="light"] .top-navbar {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .nav-search {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] .nav-search input {
    color: #0f172a !important;
}

[data-theme="light"] .nav-search input::placeholder {
    color: #64748b !important;
}

[data-theme="light"] .nav-btn {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #334155 !important;
}

[data-theme="light"] .nav-btn:hover {
    color: #0284c7 !important;
    background: #e2e8f0 !important;
}

[data-theme="light"] .btn-secondary {
    background: #f8fafc !important;
    color: #1e293b !important;
    border: 1.5px solid #cbd5e1 !important;
}

[data-theme="light"] .btn-secondary:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

[data-theme="light"] .btn:disabled,
[data-theme="light"] button:disabled,
[data-theme="light"] [style*="background: #1e293b"]:is(button, .btn):disabled {
    background: #e2e8f0 !important;
    color: #64748b !important;
    border: 1.5px solid #cbd5e1 !important;
    opacity: 0.7 !important;
}

[data-theme="light"] ol,
[data-theme="light"] ul {
    color: #334155;
}

/* Tab Switcher Buttons (e.g. Attendance Report) */
[data-theme="light"] .tab-btn,
[data-theme="light"] #tabBtnSummary,
[data-theme="light"] #tabBtnLogs {
    border: 1.5px solid #cbd5e1 !important;
}

[data-theme="light"] button[onclick*="switchView"]:not([style*="linear-gradient"]) {
    background: #ffffff !important;
    color: #334155 !important;
    border: 1.5px solid #cbd5e1 !important;
}

/* Modals */
[data-theme="light"] .modal-backdrop .glass-panel,
[data-theme="light"] .modal-box {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12) !important;
    color: #0f172a !important;
}

[data-theme="light"] .modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme="light"] .modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* Sub-containers, Cards, Schedule Boxes & Biometric/Face Panels */
[data-theme="light"] div[style*="background: rgba(10, 16, 30"],
[data-theme="light"] div[style*="background: rgba(11, 19, 41"],
[data-theme="light"] div[style*="background: rgba(15, 23, 42"],
[data-theme="light"] div[style*="background: rgba(17, 24, 39"],
[data-theme="light"] div[style*="background: rgba(30, 41, 59"],
[data-theme="light"] div[style*="background: #0f172a"],
[data-theme="light"] div[style*="background: #0b1329"],
[data-theme="light"] div[style*="background: #111827"],
[data-theme="light"] div[style*="background: #1e293b"],
[data-theme="light"] .agent-item-card,
[data-theme="light"] .credentials-box,
[data-theme="light"] .credentials-badge {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

[data-theme="light"] div[style*="background: rgba(56, 189, 248, 0.05)"],
[data-theme="light"] div[style*="background: rgba(14, 165, 233, 0.05)"],
[data-theme="light"] div[style*="background: rgba(16, 185, 129, 0.05)"] {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* Badges in Light Mode (Crisp Pastel with High Contrast Text) */
[data-theme="light"] .badge-normal,
[data-theme="light"] .badge-active,
[data-theme="light"] .badge-completed,
[data-theme="light"] .badge[style*="color: #34d399"],
[data-theme="light"] .badge[style*="color: #10b981"],
[data-theme="light"] .badge[style*="color: #059669"] {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac !important;
    font-weight: 700 !important;
}

[data-theme="light"] .badge-attention,
[data-theme="light"] .badge-pending,
[data-theme="light"] .badge[style*="color: #fbbf24"],
[data-theme="light"] .badge[style*="color: #f59e0b"],
[data-theme="light"] .badge[style*="color: #fb923c"],
[data-theme="light"] .badge[style*="color: #f97316"],
[data-theme="light"] .badge[style*="color: #d97706"] {
    background: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a !important;
    font-weight: 700 !important;
}

[data-theme="light"] .badge-critical,
[data-theme="light"] .badge-cancelled,
[data-theme="light"] .badge-inactive,
[data-theme="light"] .badge[style*="color: #f87171"],
[data-theme="light"] .badge[style*="color: #ef4444"],
[data-theme="light"] .badge[style*="color: #dc2626"] {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 700 !important;
}

[data-theme="light"] .badge[style*="color: #38bdf8"],
[data-theme="light"] .badge[style*="color: #0ea5e9"],
[data-theme="light"] .badge[style*="color: #06b6d4"],
[data-theme="light"] .badge[style*="color: #0284c7"] {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd !important;
    font-weight: 700 !important;
}

[data-theme="light"] .badge[style*="color: #c084fc"],
[data-theme="light"] .badge[style*="color: #818cf8"],
[data-theme="light"] .badge[style*="color: #a855f7"],
[data-theme="light"] .badge[style*="color: #6366f1"],
[data-theme="light"] .badge[style*="color: #7c3aed"] {
    background: #ede9fe !important;
    color: #6d28d9 !important;
    border: 1px solid #ddd6fe !important;
    font-weight: 700 !important;
}

/* Metric / Stat Cards */
[data-theme="light"] .stat-card,
[data-theme="light"] .metric-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .stat-info .stat-value,
[data-theme="light"] .metric-card [style*="font-size: 1.9rem"],
[data-theme="light"] .metric-card [style*="font-size: 2rem"],
[data-theme="light"] .metric-card [style*="font-size: 1.85rem"] {
    color: #0f172a !important;
}

/* Dashboard Action Cards */
[data-theme="light"] .glass-panel a[style*="min-height: 125px"],
[data-theme="light"] a.glass-panel[style*="min-height: 125px"],
[data-theme="light"] .glass-panel a[style*="min-height: 145px"],
[data-theme="light"] a.glass-panel[style*="min-height: 145px"] {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] a.glass-panel[style*="min-height: 125px"]:hover,
[data-theme="light"] a.glass-panel[style*="min-height: 145px"]:hover {
    background: #f8fafc !important;
    border-color: #0ea5e9 !important;
}

[data-theme="light"] a.btn[style*="min-height: 64px"] {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] a.btn[style*="min-height: 64px"]:hover {
    background: #f1f5f9 !important;
}

/* Step cards in Biometric Entry */
[data-theme="light"] .scan-card,
[data-theme="light"] .step-card,
[data-theme="light"] [id^="punchCard"],
[data-theme="light"] [id^="scanStep"] {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] [id^="punchCard"] [style*="color: #94a3b8"],
[data-theme="light"] [id^="scanStep"] [style*="color: #94a3b8"],
[data-theme="light"] [id^="punchCard"] [style*="color: #64748b"],
[data-theme="light"] [id^="scanStep"] [style*="color: #64748b"] {
    color: #475569 !important;
}

[data-theme="light"] .scan-card.active,
[data-theme="light"] .step-card.active {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
}

/* ==========================================================================
   Hardware Scanner Viewports (Always Pure Black with Luminous Neon HUD Text)
   ========================================================================== */
#blackSurface,
#cameraViewfinder,
[data-theme="light"] #blackSurface,
[data-theme="light"] #cameraViewfinder {
    background: #000000 !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
}

#blackSurface *,
#cameraViewfinder *,
[data-theme="light"] #blackSurface *,
[data-theme="light"] #cameraViewfinder * {
    color: inherit;
}

#blackSurface #surfaceMsg,
[data-theme="light"] #blackSurface #surfaceMsg,
#cameraViewfinder #faceSurfaceMsg,
[data-theme="light"] #cameraViewfinder #faceSurfaceMsg {
    color: #cbd5e1 !important;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95) !important;
}

#blackSurface #surfaceMsg i,
[data-theme="light"] #blackSurface #surfaceMsg i,
#cameraViewfinder #faceSurfaceMsg i,
[data-theme="light"] #cameraViewfinder #faceSurfaceMsg i {
    color: #38bdf8 !important;
}

#blackSurface #surfaceMsg strong,
[data-theme="light"] #blackSurface #surfaceMsg strong,
#blackSurface #surfaceMsg b,
[data-theme="light"] #blackSurface #surfaceMsg b,
#cameraViewfinder #faceSurfaceMsg strong,
[data-theme="light"] #cameraViewfinder #faceSurfaceMsg strong {
    color: #38bdf8 !important;
    font-weight: 800 !important;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.6) !important;
}

#blackSurface #hudIndex,
[data-theme="light"] #blackSurface #hudIndex,
#blackSurface #hudResolution,
[data-theme="light"] #blackSurface #hudResolution,
#cameraViewfinder [id^="hud"],
[data-theme="light"] #cameraViewfinder [id^="hud"] {
    color: #94a3b8 !important;
}

#blackSurface #fpSvgStandby,
[data-theme="light"] #blackSurface #fpSvgStandby {
    opacity: 0.3 !important;
}

/* Login Page Light Mode */
[data-theme="light"] .login-wrapper {
    background: radial-gradient(circle at 50% 50%, #e0e7ff 0%, #f1f5f9 100%) !important;
}

[data-theme="light"] .login-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08) !important;
    color: #0f172a !important;
}

[data-theme="light"] .login-title {
    color: #0f172a !important;
}

[data-theme="light"] .login-desc {
    color: #475569 !important;
}

/* Base & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.glass-panel:hover {
    border-color: var(--border-color-hover);
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
}

.pulse-icon-box {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    box-shadow: var(--shadow-glow);
    animation: pulse-glow 2.5s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 15px rgba(14, 165, 233, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 25px rgba(99, 102, 241, 0.6); transform: scale(1.03); }
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
    padding: 12px 14px 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.nav-link:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
    transform: translateX(4px);
}

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.95rem;
}

.user-info {
    flex: 1;
    overflow: hidden;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: capitalize;
}

/* Main Content Area */
.main-content {
    flex: 1 1 0%;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Navbar */
.top-navbar {
    height: var(--navbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(12px);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.nav-search {
    display: flex;
    align-items: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    width: 320px;
    gap: 10px;
    color: var(--text-muted);
}

.nav-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-size: 0.9rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    text-decoration: none;
}

.nav-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger);
}

/* Page Body */
.page-body {
    padding: 32px;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* Tab Switcher Buttons */
.tab-btn {
    padding: 10px 22px;
    font-weight: 700;
    border-radius: 12px;
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface);
    border-color: var(--border-color-hover);
}

.tab-btn.active {
    background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
}

[data-theme="light"] .tab-btn {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1.5px solid #cbd5e1 !important;
}

[data-theme="light"] .tab-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}

[data-theme="light"] .tab-btn.active {
    background: linear-gradient(135deg, #0284c7, #4f46e5) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.purple { background: rgba(99, 102, 241, 0.15); color: var(--secondary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.rose { background: var(--danger-light); color: var(--danger); }

.stat-info .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info .stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 4px 0;
    color: var(--text-main);
}

.stat-info .stat-trend {
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* Charts & Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    padding: 24px;
}

.card-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Tables */
.table-container,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    box-sizing: border-box;
}

.custom-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 880px;
}

.custom-table th {
    padding: 14px 18px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
}

.custom-table td {
    padding: 16px 18px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.custom-table tbody tr {
    transition: var(--transition-fast);
}

.custom-table tbody tr:hover {
    background: var(--bg-surface-elevated);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-normal, .badge-confirmed, .badge-active, .badge-completed {
    background: var(--success-light);
    color: var(--success);
}

.badge-attention, .badge-pending {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-critical, .badge-cancelled, .badge-inactive {
    background: var(--danger-light);
    color: var(--danger);
}

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

select option {
    background-color: var(--bg-surface-elevated);
    color: var(--text-main);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 580px;
    box-shadow: var(--shadow-lg);
    animation: modal-zoom 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-zoom {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--danger);
}

/* Alerts / Toast */
.alert-box {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: var(--danger);
}

/* ==========================================================================
   PulseMark Fully Responsive & Adaptive Engine
   (Mobile, Tablet, Handheld, Laptop & Desktop)
   ========================================================================== */

/* Base helper / Mobile toggle buttons */
#mobileMenuBtn {
    display: none;
}
.sidebar-close-btn {
    display: none;
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 18, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* --------------------------------------------------------------------------
   1. Large Tablets & Small Laptops (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    div[style*="grid-template-columns: 1.15fr 1fr"],
    div[style*="grid-template-columns: 1.1fr 1fr"],
    div[style*="grid-template-columns: 1.2fr 1fr"],
    div[style*="grid-template-columns: 2fr 1fr"],
    div[style*="grid-template-columns: 1fr 340px"] {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
}

/* --------------------------------------------------------------------------
   2. Tablets & Mobile Devices (max-width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    /* Mobile Drawer Sidebar */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 290px !important;
        max-width: 86vw !important;
        height: 100vh !important;
        z-index: 999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: 0 0 45px rgba(0, 0, 0, 0.65) !important;
    }
    
    .sidebar.open {
        transform: translateX(0) !important;
    }
    
    .sidebar-close-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
        background: var(--bg-surface-elevated);
        color: var(--text-muted);
        cursor: pointer;
        margin-left: auto;
        transition: all 0.2s ease;
    }
    .sidebar-close-btn:hover {
        color: var(--danger);
        border-color: var(--danger);
    }
    
    #mobileMenuBtn {
        display: inline-flex !important;
    }

    /* Main Content spans full viewport */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Navbar on Tablet */
    .top-navbar {
        padding: 0 20px !important;
    }
    
    .nav-search {
        width: 220px;
    }
    
    /* Page Body */
    .page-body {
        padding: 24px 20px !important;
    }
}

/* --------------------------------------------------------------------------
   3. Smart Phones & Standard Handhelds (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* Top Navbar Adjustments */
    .top-navbar {
        padding: 8px 14px !important;
        min-height: 58px !important;
        height: auto !important;
        gap: 10px !important;
    }

    .top-navbar > div:first-child {
        gap: 10px !important;
        flex: 1;
        min-width: 0;
    }

    .top-navbar > div:first-child span[style*="color: var(--text-muted)"] {
        display: none !important;
    }

    .nav-search {
        width: 100% !important;
        max-width: 180px !important;
        padding: 6px 12px !important;
    }
    .nav-search input {
        font-size: 0.82rem !important;
    }

    .nav-actions {
        gap: 8px !important;
    }

    .nav-btn {
        width: 36px !important;
        height: 36px !important;
    }

    /* Page Header: Stack vertically with full width touch targets */
    .page-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        margin-bottom: 22px !important;
    }

    .page-header > div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .page-header > div:last-child .btn,
    .page-header > div:last-child a.btn {
        flex: 1 1 calc(50% - 8px) !important;
        min-width: 130px !important;
        text-align: center !important;
        justify-content: center !important;
        padding: 9px 12px !important;
        font-size: 0.85rem !important;
    }

    .page-title {
        font-size: 1.45rem !important;
        line-height: 1.25 !important;
    }

    .page-subtitle {
        font-size: 0.84rem !important;
        line-height: 1.45 !important;
    }

    .page-body {
        padding: 18px 12px !important;
    }

    /* KPI Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
        gap: 12px !important;
        margin-bottom: 22px !important;
    }

    .metric-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 12px !important;
        margin-bottom: 20px !important;
    }

    .stat-card {
        padding: 16px 14px !important;
        border-radius: 14px !important;
    }

    .stat-info .stat-value {
        font-size: 1.55rem !important;
    }

    .stat-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }

    /* All Multi-Column Grids (Forms, Settings, Modals, Attendance) collapse to 1 Column */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr 1fr"],
    div[style*="grid-template-columns: 1.1fr 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr 1fr 1.3fr"],
    div[style*="grid-template-columns: 1fr 1fr 1.3fr"],
    div[style*="grid-template-columns: 1fr 340px"],
    div[style*="grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))"],
    div[style*="grid-template-columns: repeat(auto-fit, minmax(260px, 1fr))"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Table Containers: Horizontal Scrolling with smooth touch */
    .table-container {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 12px !important;
    }

    .custom-table, .data-table {
        min-width: 650px !important;
    }

    .custom-table th, .custom-table td,
    .data-table th, .data-table td {
        padding: 11px 12px !important;
        font-size: 0.84rem !important;
    }

    /* Card Title Bars */
    .card-title-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .card-title-bar .nav-search,
    .card-title-bar input.table-search-input {
        width: 100% !important;
        max-width: 100% !important;
    }

    .card-title-bar > div:last-child {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    /* Scanner & Camera Displays (Live Biometric & Optical Viewfinder) */
    #blackSurface,
    #cameraViewfinder {
        height: 310px !important;
        max-height: 45vh !important;
    }

    /* Modals */
    .modal-backdrop {
        padding: 10px !important;
    }

    .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 94vh !important;
        border-radius: 16px !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-header {
        padding: 14px 18px !important;
    }

    .modal-body {
        padding: 16px !important;
        max-height: calc(94vh - 120px) !important;
        overflow-y: auto !important;
    }

    .modal-footer {
        padding: 12px 16px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
        min-width: 100px;
    }

    /* Glass Panels */
    .glass-panel {
        padding: 18px 14px !important;
        border-radius: 14px !important;
    }

    /* Charts */
    .chart-card {
        padding: 18px 14px !important;
    }
    .chart-card div[style*="height: 270px"] {
        height: 220px !important;
    }
    .chart-card div[style*="height: 200px"] {
        height: 180px !important;
    }

    /* Dialog Cards */
    .pulse-dialog-card {
        padding: 24px 18px 20px !important;
        border-radius: 18px !important;
        max-width: 95vw !important;
    }

    /* Login Cards */
    .login-card {
        padding: 28px 20px !important;
    }
}

/* --------------------------------------------------------------------------
   4. Small Mobiles & Narrow Screens (max-width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    /* Navbar compact */
    .top-navbar .nav-search {
        display: none !important;
    }

    #liveClock {
        font-size: 0.78rem !important;
    }
    .top-navbar > .nav-actions > div[style*="padding: 8px 14px"] {
        padding: 5px 8px !important;
    }

    .top-navbar .btn-sm span {
        display: none;
    }

    /* KPI Stats 1 column */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .page-title {
        font-size: 1.3rem !important;
    }

    .page-header > div:last-child .btn,
    .page-header > div:last-child a.btn {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* Scanner height */
    #blackSurface,
    #cameraViewfinder {
        height: 260px !important;
    }

    /* Tab Switcher Buttons (Attendance Reports) */
    .tab-btn {
        flex: 1 1 100% !important;
        justify-content: center !important;
        padding: 10px 14px !important;
    }

    /* Modal footer full width buttons */
    .modal-footer {
        flex-direction: column-reverse !important;
    }
    .modal-footer .btn {
        width: 100% !important;
    }

    /* Login Cards */
    .login-wrapper {
        padding: 12px !important;
    }
    .login-card {
        padding: 24px 16px !important;
        border-radius: 16px !important;
    }
    .login-title {
        font-size: 1.35rem !important;
    }
    .credentials-badge {
        padding: 10px !important;
        font-size: 0.8rem !important;
    }
}

/* ==========================================================================
   PulseMark Ultra-Modern Dialog & Notification Modal System
   ========================================================================== */
.pulse-dialog-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 8, 18, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}

.pulse-dialog-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.pulse-dialog-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: 22px;
    width: 100%;
    max-width: 460px;
    padding: 32px 28px 26px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(14, 165, 233, 0.12);
    transform: scale(0.88) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.pulse-dialog-backdrop.active .pulse-dialog-card {
    transform: scale(1) translateY(0);
}

.pulse-dialog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.pulse-dialog-card.type-error::before {
    background: linear-gradient(90deg, #f43f5e, #ef4444);
}

.pulse-dialog-card.type-success::before {
    background: linear-gradient(90deg, #10b981, #06b6d4);
}

.pulse-dialog-card.type-warning::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.pulse-dialog-icon-wrapper {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    position: relative;
    animation: iconSpring 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconSpring {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-dialog-card.type-error .pulse-dialog-icon-wrapper {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 2px solid rgba(244, 63, 94, 0.35);
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.35);
}

.pulse-dialog-card.type-success .pulse-dialog-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 2px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}

.pulse-dialog-card.type-warning .pulse-dialog-icon-wrapper {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 2px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
}

.pulse-dialog-card.type-info .pulse-dialog-icon-wrapper {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border: 2px solid rgba(14, 165, 233, 0.35);
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.35);
}

.pulse-dialog-title {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.pulse-dialog-message {
    font-size: 0.94rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    word-break: break-word;
}

.pulse-dialog-message .emp-chip {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    font-weight: 800;
    font-family: monospace;
    font-size: 0.92rem;
}

.pulse-dialog-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.pulse-dialog-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 110px;
}

.pulse-dialog-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.pulse-dialog-card.type-error .pulse-dialog-btn-primary {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
}

.pulse-dialog-card.type-success .pulse-dialog-btn-primary {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.pulse-dialog-card.type-warning .pulse-dialog-btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.pulse-dialog-btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1.5px solid var(--border-color);
}

.pulse-dialog-btn:hover {
    transform: translateY(-2px);
}

/* Light Theme Adaptations for Pulse Dialog */
[data-theme="light"] .pulse-dialog-backdrop {
    background: rgba(15, 23, 42, 0.45);
}

[data-theme="light"] .pulse-dialog-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

[data-theme="light"] .pulse-dialog-title {
    color: #0f172a !important;
}

[data-theme="light"] .pulse-dialog-message {
    color: #334155 !important;
}

[data-theme="light"] .pulse-dialog-message .emp-chip {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #bae6fd !important;
}

[data-theme="light"] .pulse-dialog-btn-secondary {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}
