/* =========================================
   1. GLOBAL VARIABLES & THEMES (APPLE/MAC STYLE)
   ========================================= */
:root {
    /* DARK MODE (Default) */
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(20, 20, 30, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --accent-color: #0A84FF;
    --danger-color: #FF453A;
    --success-color: #32D74B;
    --warning-color: #FFD60A;
    --input-bg: rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --msg-mine: linear-gradient(135deg, #0A84FF, #005bb5);
    --msg-other: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    /* LIGHT MODE - Ultra Crisp & Modern */
    --bg-gradient: linear-gradient(135deg, #f6f8fd 0%, #f1f5f9 100%); 
    --glass-bg: rgba(255, 255, 255, 0.85); 
    --glass-border: rgba(255, 255, 255, 0.8); 
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06); 
    --text-main: #1d1d1f; 
    --text-muted: rgba(0, 0, 0, 0.55);
    --accent-color: #007AFF; 
    --danger-color: #FF3B30; 
    --success-color: #34C759; 
    --warning-color: #FF9500; 
    --input-bg: rgba(255, 255, 255, 0.95);
    --hover-bg: rgba(0, 0, 0, 0.03); 
    --msg-mine: linear-gradient(135deg, #007AFF, #0056b3);
    --msg-other: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    font-size: 15px;
    transition: background 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), color 0.6s ease;
}

/* =========================================
   2. FLOATING THEME TOGGLE
   ========================================= */
.theme-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 990; 
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 14px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="light"] .theme-toggle-btn {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.theme-toggle-btn:hover {
    transform: rotate(20deg) scale(1.15);
    background: var(--hover-bg);
}

/* =========================================
   3. GLASS UTILITIES & RESPONSIVE FLAGS
   ========================================= */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.mobile-only {
    display: none !important;
}

/* =========================================
   4. INPUTS & FORMS
   ========================================= */
.glass-input {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0 12px;
    height: 42px; /* Perfect match with buttons */
    border-radius: 10px;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.login-input {
    height: 48px !important;
    font-size: 1rem !important;
    border-radius: 12px !important;
}

[data-theme="light"] .glass-input {
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.glass-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
    transform: translateY(-2px);
}

.glass-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0,0,0,0.5);
}

select.glass-input option {
    background: #1c1c1e;
    color: white;
}

[data-theme="light"] select.glass-input option {
    background: #ffffff;
    color: black;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
    width: 100%;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-input-wrap {
    position: relative;
    margin-bottom: 20px;
}

.login-input-wrap i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    transition: color 0.3s;
    font-size: 1.1rem;
}

.login-input-wrap input {
    padding-left: 48px;
}

.login-input-wrap input:focus + i, 
.login-input-wrap input:focus ~ i {
    color: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

/* =========================================
   5. BUTTONS & ANIMATIONS (LAYOUT FIXED)
   ========================================= */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px; /* Match input box radius */
    font-size: 0.95rem;
    white-space: nowrap;
    border: none;
    outline: none;
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center;
}

button:active {
    transform: scale(0.93) !important;
}

/* Global button baseline */
.btn-glow, .btn-primary, .btn-danger {
    height: 42px; /* Harmonized with inputs */
    padding: 0 20px;
    font-weight: 600;
}

.btn-glow {
    background: var(--accent-color);
    color: white;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.4);
}

.btn-glow:hover {
    background: #0066cc;
    box-shadow: 0 8px 25px rgba(10, 132, 255, 0.5);
    transform: translateY(-3px);
}

.btn-glow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666;
    transform: none !important;
    box-shadow: none;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

[data-theme="light"] .btn-primary {
    background: rgba(0, 122, 255, 0.05);
}

.btn-primary:hover {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 69, 58, 0.4);
    animation: wiggle 0.4s ease-in-out;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
    transform: none !important;
}

/* Small add-on buttons (next to select inputs) */
.btn-small {
    background: var(--hover-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0 14px;
    height: 42px; /* Perfect match for adjacent inputs */
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-small:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Tiny specialized buttons (e.g. headers) */
.btn-xs-primary {
    background: var(--accent-color);
    color: white;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.btn-xs-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

/* ★ FIX: TABLE BUTTONS (Stop stretching!) ★ */
.glass-table button {
    height: 30px !important;
    padding: 0 10px !important;
    min-width: 0 !important;
    width: auto !important;
    font-size: 0.8rem;
    border-radius: 6px;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
    75% { transform: rotate(-6deg); }
}

/* =========================================
   6. CUSTOM TOASTS & NOTIFICATIONS
   ========================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000; 
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 15px 20px;
    border-radius: 12px;
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    min-width: 250px;
    pointer-events: auto;
}

[data-theme="light"] .toast {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    color: #111;
}

.toast.info { border-left: 4px solid var(--accent-color); }
.toast.error { border-left: 4px solid var(--danger-color); }
.toast.success { border-left: 4px solid var(--success-color); }
.toast i { font-size: 1.2rem; }
.toast.info i { color: var(--accent-color); }
.toast.error i { color: var(--danger-color); }
.toast.success i { color: var(--success-color); }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

.unread-dot {
    width: 10px;
    height: 10px;
    background: var(--danger-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--danger-color);
    animation: pulse 2s infinite;
}

.typing-indicator {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-style: italic;
    opacity: 0.8;
    margin-left: 15px;
    animation: pulseFade 1.5s infinite;
}

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

/* =========================================
   7. SLEEK INTRO ANIMATION (GIANT LOGO)
   ========================================= */
.intro-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999; 
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    transition: opacity 0.8s ease, visibility 0.8s ease;
    flex-direction: column;
}

.fluid-orb-container {
    width: auto;
    height: auto;
    position: relative;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-custom-logo { 
    width: 220px; 
    height: 220px; 
    font-size: 10rem !important;
    object-fit: contain; 
    animation: logoPulseGlow 4s infinite ease-in-out; 
    z-index: 2; 
}

@keyframes logoPulseGlow { 
    0% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 25px rgba(10, 132, 255, 0.7)); } 
    33% { transform: scale(1.1) translateY(-15px); filter: drop-shadow(0 0 60px rgba(50, 215, 75, 1)); } 
    66% { transform: scale(1.05) translateY(-5px); filter: drop-shadow(0 0 40px rgba(255, 214, 10, 0.9)); } 
    100% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 25px rgba(10, 132, 255, 0.7)); } 
}

#intro-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 2px;
    animation: fadeInUp 1s ease forwards;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    margin-bottom: 5px;
}

#intro-tagline {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    animation: fadeInUp 1.2s ease forwards;
    opacity: 0;
}

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

/* =========================================
   8. LOGIN SECTION
   ========================================= */
#login-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease;
}

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

.login-card {
    width: 380px;
    padding: 40px;
    text-align: center;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

[data-theme="light"] .login-card {
    box-shadow: 0 25px 50px rgba(0,0,0,0.08);
}

.login-header {
    margin-bottom: 30px;
}

.login-logo-container {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    animation: slowPulse 3s infinite alternate;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

@keyframes slowPulse {
    0% { transform: scale(0.95); text-shadow: 0 0 10px rgba(10, 132, 255, 0.4); }
    100% { transform: scale(1.05); text-shadow: 0 0 25px rgba(10, 132, 255, 0.8); }
}

/* =========================================
   9. DASHBOARD & SIDEBAR
   ========================================= */
#dashboard-section {
    display: flex;
    height: 100vh;
    animation: fadeIn 0.8s ease;
}

.sidebar {
    width: 280px;
    margin: 15px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
}

.content-area {
    flex: 1;
    padding: 15px 15px 15px 0;
    overflow-y: auto;
}

#sidebar-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-main);
}

#sidebar-brand i {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin-right: 10px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] .user-profile {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.avatar {
    width: 48px;
    height: 48px;
    background: var(--hover-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.user-info h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.user-info small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.nav-links {
    list-style: none;
}

.nav-links li {
    padding: 14px 18px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-muted);
}

.nav-links li:hover {
    background: var(--hover-bg);
    color: var(--text-main);
    transform: translateX(6px);
}

.nav-links li.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 6px 20px rgba(10, 132, 255, 0.35);
    transform: translateX(4px);
}

.logout-btn {
    margin-top: auto;
    padding: 14px;
    background: rgba(255, 69, 58, 0.1);
    color: var(--danger-color);
    border-radius: 14px;
    font-weight: 600;
}

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

/* =========================================
   10. WIDGETS & CARDS
   ========================================= */
.header-glass {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-glass h3 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status-indicator .online {
    color: var(--success-color);
    font-weight: bold;
    font-size: 0.95rem;
    text-shadow: 0 0 12px var(--success-color);
    animation: pulse 2s infinite;
}

[data-theme="light"] .status-indicator .online {
    text-shadow: 0 0 8px rgba(52, 199, 89, 0.4);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.card {
    padding: 25px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 45px rgba(0,0,0,0.2);
}

[data-theme="light"] .card:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
}

[data-theme="light"] .card h3 {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.timer-display {
    font-size: 3.8rem;
    font-weight: 700;
    margin: 20px 0;
    text-align: center;
    letter-spacing: 2px;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

#current-date {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Ensure Time Tracker Buttons flex equally */
.action-buttons button {
    flex: 1; 
    max-width: 200px;
}

.status-log {
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 8px;
    border-radius: 8px;
    background: var(--hover-bg);
}

/* =========================================
   11. IDLE RING & MONITOR
   ========================================= */
.idle-ring-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.idle-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color) 0deg, var(--glass-border) 0deg);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.1);
    transition: background 0.5s linear;
}

[data-theme="light"] .idle-ring {
    background: conic-gradient(var(--accent-color) 0deg, rgba(0,0,0,0.05) 0deg);
}

.idle-inner {
    width: 125px;
    height: 125px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.warning-text {
    color: var(--warning-color);
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* =========================================
   12. LIVE MONITOR PANEL
   ========================================= */
.live-monitor {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
    padding: 18px;
    margin-bottom: 15px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

[data-theme="light"] .live-monitor {
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.monitor-stats {
    display: flex;
    gap: 15px;
}

.stat-box {
    flex: 1;
    background: var(--hover-bg);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s;
}

[data-theme="light"] .stat-box {
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.5);
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-box small {
    display: block;
    opacity: 0.7;
    font-size: 0.7rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-box h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* =========================================
   13. REPORTS & TEAM HIERARCHY
   ========================================= */
.reports-layout {
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
}

.team-sidebar {
    width: 320px;
    background: var(--glass-bg);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.sidebar-header {
    padding: 22px;
    font-weight: 800;
    background: var(--hover-bg);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

[data-theme="light"] .sidebar-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
}

.team-list-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 15px;
}

.tree-group {
    margin-bottom: 8px;
}

.tree-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.25s ease;
    margin-bottom: 4px;
}

.tree-node:hover {
    background: var(--hover-bg);
    transform: translateX(4px);
}

.tree-node.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
    transform: translateX(4px);
}

.tree-node.active .status-dot {
    box-shadow: 0 0 0 2px white;
}

.tree-parent {
    font-weight: 700;
    color: var(--accent-color);
    background: rgba(10, 132, 255, 0.05);
    border: 1px solid rgba(10, 132, 255, 0.1);
    margin-top: 10px;
}

.tree-children {
    margin-left: 20px;
    border-left: 2px solid var(--glass-border);
    padding-left: 8px;
}

[data-theme="light"] .tree-children {
    border-left: 2px solid rgba(0,0,0,0.1);
}

/* =========================================
   14. TELEGRAM-STYLE CHAT INTERFACE
   ========================================= */
.chat-interface {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--glass-bg);
    border-radius: 20px;
}

.chat-header-bar {
    padding: 18px 25px;
    background: var(--hover-bg);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 700;
    font-size: 1.1rem;
}

[data-theme="light"] .chat-header-bar {
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02);
}

.chat-feed {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(0,0,0,0.02);
}

[data-theme="light"] .chat-feed {
    background: rgba(0,0,0,0.01);
}

.chat-bubble {
    max-width: 75%;
    padding: 14px 20px;
    border-radius: 20px;
    background: var(--msg-other);
    line-height: 1.5;
    position: relative;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom-left-radius: 4px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom left;
    border: 1px solid transparent;
    overflow-wrap: break-word; 
    word-wrap: break-word;     
    word-break: break-word;    
}

[data-theme="light"] .chat-bubble {
    border: 1px solid rgba(0,0,0,0.05);
}

.chat-bubble.mine {
    align-self: flex-end;
    background: var(--msg-mine);
    color: white;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 4px;
    transform-origin: bottom right;
    box-shadow: 0 4px 15px rgba(10, 132, 255, 0.25);
    border: none;
}

.msg-header {
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 6px;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.msg-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.9) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.log-separator {
    text-align: center;
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.85rem;
    margin: 20px 0;
    opacity: 0.9;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-separator::before, 
.log-separator::after {
    content: '';
    height: 1px;
    background: var(--glass-border);
    flex: 1;
    margin: 0 15px;
}

[data-theme="light"] .log-separator::before, 
[data-theme="light"] .log-separator::after {
    background: rgba(0,0,0,0.1);
}

.log-summary {
    text-align: center;
    background: rgba(50, 215, 75, 0.15);
    border: 1px solid rgba(50, 215, 75, 0.3);
    color: var(--success-color);
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    margin: 15px 0;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(50, 215, 75, 0.1);
}

.chat-input-zone {
    padding: 20px 25px;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
}

[data-theme="light"] .chat-input-zone {
    border-top: 1px solid rgba(0,0,0,0.08);
}

.input-wrapper {
    display: flex;
    background: var(--input-bg);
    border-radius: 30px;
    padding: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s;
}

[data-theme="light"] .input-wrapper {
    border: 1px solid rgba(0,0,0,0.1);
}

.input-wrapper:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.type-selector {
    background: transparent;
    border: none;
    color: var(--accent-color);
    padding: 0 15px;
    font-weight: 700;
    border-right: 1px solid var(--glass-border);
    outline: none;
    cursor: pointer;
}

[data-theme="light"] .type-selector {
    border-right: 1px solid rgba(0,0,0,0.1);
}

#chat-message {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0 18px;
    color: var(--text-main);
    outline: none;
    font-size: 1rem;
}

.send-btn {
    background: var(--accent-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.send-btn:hover {
    transform: scale(1.15) rotate(-10deg);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

/* =========================================
   15. TABLES & LISTS
   ========================================= */
.glass-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.glass-table th {
    text-align: left;
    padding: 14px 18px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] .glass-table th {
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.glass-table td {
    padding: 14px 18px;
    background: var(--hover-bg);
    vertical-align: middle;
    transition: transform 0.25s, background 0.25s;
    max-width: 250px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="light"] .glass-table td {
    background: rgba(0,0,0,0.02);
    border: 1px solid transparent;
}

.glass-table tr {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.glass-table tr:hover td {
    background: rgba(255,255,255,0.1);
    transform: scale(1.01);
    color: var(--accent-color);
}

[data-theme="light"] .glass-table tr:hover td {
    background: #ffffff;
    color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.05);
}

.glass-table td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.glass-table td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.log-list li {
    padding: 14px 18px;
    background: var(--hover-bg);
    margin-bottom: 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    display: flex;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="light"] .log-list li {
    background: rgba(0,0,0,0.02);
}

.log-list li:hover {
    transform: translateX(8px);
    border-color: var(--glass-border);
    background: var(--glass-bg);
}

[data-theme="light"] .log-list li:hover {
    border-color: rgba(0,0,0,0.1);
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

/* =========================================
   16. MODALS & STATUS BADGES
   ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999; 
    opacity: 1;
    transition: opacity 0.4s;
}

.modal-content {
    padding: 35px;
    border-radius: 24px;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(40px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.idle-modal-content {
    width: 420px;
    text-align: center;
    padding: 40px !important;
    border-color: var(--warning-color) !important;
    box-shadow: 0 0 50px rgba(255, 214, 10, 0.15) !important;
}

.idle-icon-wrap {
    font-size: 3.5rem;
    color: var(--warning-color);
    margin-bottom: 20px;
}

.warning-pulse {
    animation: warningPulse 1.5s infinite alternate;
}

@keyframes warningPulse {
    0% { transform: scale(0.95); text-shadow: 0 0 10px rgba(255, 214, 10, 0.4); }
    100% { transform: scale(1.05); text-shadow: 0 0 25px rgba(255, 214, 10, 0.8); }
}

.idle-title {
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1.6rem;
}

.idle-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 30px;
}

.idle-actions {
    display: flex;
    gap: 15px;
}

.idle-actions button {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Ensure prompt modal buttons don't blow up */
#custom-confirm-modal button,
#custom-prompt-modal button,
#batch-leave-modal button {
    flex: 1;
    max-width: 150px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-working {
    background: rgba(50, 215, 75, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(50, 215, 75, 0.3);
}

.status-idle {
    background: rgba(255, 214, 10, 0.15);
    color: var(--warning-color);
    border: 1px solid rgba(255, 214, 10, 0.3);
}

.status-offline {
    background: rgba(150, 150, 150, 0.15);
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

[data-theme="light"] .status-offline {
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.04);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: 0.4s;
}

.dot-active {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.dot-idle {
    background-color: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
}

.dot-offline {
    background-color: #666;
}

/* =========================================
   17. JOB BOARD & RICH TEXT TOOLBAR
   ========================================= */
.job-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    align-items: stretch;
    margin-top: 20px;
}

.job-card {
    background: var(--hover-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    position: relative;
}

[data-theme="light"] .job-card {
    background: rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.08);
}

.job-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    border-color: var(--accent-color);
}

[data-theme="light"] .job-card:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.job-card h4 {
    color: var(--accent-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.job-desc-content {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    overflow-wrap: break-word; 
    word-wrap: break-word;     
    word-break: break-word;    
    white-space: pre-wrap;     
    max-height: 250px;         
    overflow-y: auto;          
}

.job-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.6;
    border-top: 1px dashed var(--glass-border);
    padding-top: 12px;
    margin-top: auto;
}

[data-theme="light"] .job-meta {
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.job-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.interested-btn {
    background: linear-gradient(135deg, #32D74B, #28a745);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 6px 20px rgba(50, 215, 75, 0.4);
}

.job-card:hover .interested-btn {
    transform: translateY(0);
}

.interested-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(50, 215, 75, 0.6);
}

.interested-tag {
    display: inline-block;
    background: var(--hover-bg);
    border: 1px solid var(--glass-border);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin: 3px;
    transition: 0.3s;
    font-weight: 600;
}

[data-theme="light"] .interested-tag {
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
}

.interested-tag:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.rich-text-toolbar {
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 12px 12px 0 0;
    border: 1px solid var(--glass-border);
    border-bottom: none;
    align-items: center;
}

[data-theme="light"] .rich-text-toolbar {
    background: rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.1);
    border-bottom: none;
}

.rich-text-toolbar button {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="light"] .rich-text-toolbar button {
    border: 1px solid rgba(0,0,0,0.1);
}

.rich-text-toolbar button:hover {
    background: var(--accent-color);
    color: white;
    transform: scale(1.1);
    border-color: var(--accent-color);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--glass-border);
    margin: 0 5px;
}

[data-theme="light"] .toolbar-divider {
    background: rgba(0,0,0,0.1);
}

/* =========================================
   18. FORM GRIDS & ALIGNMENT
   ========================================= */
.create-user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: end;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] .create-user-grid {
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* ONBOARDING 1-LINER FIX */
#onboarding-tab .create-user-grid {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1fr auto;
    gap: 15px;
    align-items: flex-end; 
}

#onboarding-tab .submit-group {
    margin-top: 0;
    grid-column: span 1;
}

/* LEAVE MANAGEMENT EQUAL SIZING FIX */
.leave-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-top: 20px;
}

.leave-form-grid .input-group {
    margin-bottom: 0;
    width: 100%;
}

.full-width {
    grid-column: span 2;
}

.submit-group {
    display: flex;
    justify-content: flex-start;
    grid-column: span 3;
    margin-top: 15px;
}

/* SLEEK SETTINGS CARDS */
.settings-card {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.1));
    border: 1px solid var(--glass-border);
    border-left: 4px solid var(--accent-color);
    padding: 25px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="light"] .settings-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(240,245,255,0.7));
    border-color: rgba(0,0,0,0.05);
}

.settings-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    border-left-color: var(--success-color);
}

.settings-card .card-content {
    flex: 1;
}

.settings-card h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-weight: 700;
}

.settings-card p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 15px;
}

.card-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
    background: var(--hover-bg);
    border-radius: 14px;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--glass-border);
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

[data-theme="light"] .card-icon {
    background: rgba(0,122,255,0.05);
    border: 1px solid rgba(0,122,255,0.1);
}

/* =========================================
   19. DASHBOARD CHARTS
   ========================================= */
.chart-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 150px;
    margin-top: 15px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 0px;
    gap: 10px;
}

[data-theme="light"] .chart-container {
    border-bottom: 2px solid rgba(0,0,0,0.08);
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    height: 100%;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s;
    cursor: pointer;
    position: relative;
}

[data-theme="light"] .bar {
    background: rgba(0,0,0,0.08);
}

.bar:hover {
    background: var(--accent-color);
    transform: scaleX(1.1);
}

.active-bar {
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
}

[data-theme="light"] .active-bar {
    box-shadow: 0 0 12px rgba(10, 132, 255, 0.4);
}

.bar-group span {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
}

[data-theme="light"] .bar:hover::after {
    background: var(--text-main);
}

/* =========================================
   20. INVOICE PDF TEMPLATE
   ========================================= */
.invoice-container {
    max-width: 800px;
    margin: 0 auto;
    color: #000;
    font-family: Helvetica, Arial, sans-serif;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.invoice-header h1 {
    font-size: 2.5rem;
    color: #000;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.invoice-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.invoice-details div {
    width: 48%;
}

.invoice-details h4 {
    margin-bottom: 5px;
    color: #555;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.invoice-details p {
    margin: 3px 0;
    font-size: 0.95rem;
    color: #000;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table th {
    background: #f4f4f4;
    color: #000;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #ccc;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.invoice-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #000;
    font-size: 0.95rem;
}

.invoice-total-box {
    width: 300px;
    float: right;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #333;
}

.invoice-total-final {
    display: flex;
    justify-content: space-between;
    border-top: 2px solid #ccc;
    padding-top: 10px;
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
}

/* =========================================
   21. RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================= */

/* Tablet & Smaller Laptops */
@media (max-width: 1024px) {
    .reports-layout {
        flex-direction: column;
        height: auto;
    }
    
    .team-sidebar {
        width: 100%;
        height: 250px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    
    .chat-interface {
        height: 500px;
    }

    .create-user-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .leave-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Devices (Phones) */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    #dashboard-section {
        flex-direction: column;
        height: 100%;
        overflow: visible;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: flex !important;
    }
    
    /* Transforms Sidebar into Bottom Navigation */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        margin: 0;
        padding: 0;
        border-radius: 20px 20px 0 0;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        background: var(--glass-bg);
        border-top: 1px solid var(--glass-border);
        z-index: 900; 
        box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
    }

    #sidebar-brand, .user-profile, .logout-btn {
        display: none !important;
    }

    .nav-links {
        display: flex;
        width: 100%;
        justify-content: space-around;
        margin: 0;
        padding: 0;
    }

    .nav-links li {
        flex-direction: column;
        padding: 8px;
        font-size: 0.7rem;
        gap: 4px;
        margin: 0;
        border-radius: 12px;
        text-align: center;
    }

    .nav-links li i { 
        font-size: 1.3rem; 
        margin: 0;
    }
    
    .nav-links li:not(.mobile-tab):not(.mobile-only) {
        display: none !important;
    }
    
    #mobile-logout-btn {
        color: var(--danger-color) !important;
        transition: 0.2s;
    }

    #mobile-logout-btn:active {
        background: rgba(255, 69, 58, 0.2);
        transform: scale(0.95);
    }

    /* Add bottom padding so bottom nav doesn't cover content */
    .content-area {
        padding: 15px 15px 90px 15px; 
        overflow: visible;
    }
    
    /* Adjust Grids to Single Column */
    .grid-container, .responsive-grid {
        grid-template-columns: 1fr;
    }
    
    /* FORCE GRIDS TO STACK ON MOBILE */
    #onboarding-tab .create-user-grid, 
    .leave-form-grid, 
    .create-user-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* BUTTONS EXPAND ON MOBILE (Except specific table/icon buttons) */
    .btn-glow, .btn-primary, .btn-danger {
        width: 100%;
    }

    /* Important: keep table action buttons from getting huge on mobile */
    .glass-table button {
        width: auto !important;
    }

    .submit-group, .full-width {
        grid-column: span 1 !important;
    }

    .modal-content {
        width: 95% !important;
        padding: 20px !important;
    }

    .login-card {
        width: 90%;
        padding: 30px 20px;
    }

    .theme-toggle-btn {
        bottom: 90px;
        right: 20px;
    }
    
    .job-card {
        min-height: auto;
    }
    
    .glass.card.full-width {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================
   22. CUSTOM DATE PICKER (FLATPICKR OVERRIDES)
   ========================================= */
.flatpickr-calendar {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: 16px !important;
    padding: 10px !important;
    z-index: 999999 !important; 
    width: auto !important;
    max-width: 320px !important;
    box-sizing: border-box !important;
}

.flatpickr-months .flatpickr-month, 
.flatpickr-current-month .flatpickr-monthDropdown-months, 
.flatpickr-current-month input.cur-year {
    color: var(--text-main) !important;
    font-weight: bold !important;
}

.flatpickr-day {
    color: var(--text-main) !important;
    border-radius: 8px !important;
}

.flatpickr-day.selected {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(10, 132, 255, 0.4) !important;
}

.flatpickr-day:hover {
    background: var(--hover-bg) !important;
    border-color: var(--glass-border) !important;
}

span.flatpickr-weekday {
    color: var(--text-muted) !important;
    font-weight: 700 !important;
}

.flatpickr-calendar.arrowTop:before { border-bottom-color: var(--glass-border) !important; }
.flatpickr-calendar.arrowTop:after { border-bottom-color: var(--glass-bg) !important; }
.flatpickr-calendar.arrowBottom:before { border-top-color: var(--glass-border) !important; }
.flatpickr-calendar.arrowBottom:after { border-top-color: var(--glass-bg) !important; }

[data-theme="light"] .flatpickr-calendar {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

[data-theme="light"] span.flatpickr-weekday { color: rgba(0,0,0,0.6) !important; }
[data-theme="light"] .flatpickr-day:hover { background: rgba(0,0,0,0.05) !important; }

/* =========================================
   23. BUG FIXES & LAYOUT ADJUSTMENTS
   ========================================= */
.flatpickr-days { width: 100% !important; }
.dayContainer { width: 100% !important; min-width: 260px !important; }