/* ==========================================================================
   Design System & Reset
   ========================================================================== */
:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-soft: rgba(2, 132, 199, 0.1);
    --secondary: #4f46e5;
    --secondary-soft: rgba(79, 70, 229, 0.1);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    
    --bg-main: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-solid: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    
    --sidebar-width: 280px;
    --header-height: 80px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --glass-blur: blur(12px);
    --glass-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.08);
}

/* Dark mode overrides (Clean dark tech theme) */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #38bdf8;
        --primary-hover: #0ea5e9;
        --primary-soft: rgba(56, 189, 248, 0.12);
        --secondary: #818cf8;
        --secondary-soft: rgba(129, 140, 248, 0.12);
        --success: #34d399;
        --success-soft: rgba(52, 211, 153, 0.12);
        --warning: #fbbf24;
        --warning-soft: rgba(251, 191, 36, 0.12);
        --danger: #f87171;
        --danger-soft: rgba(248, 113, 113, 0.12);
        
        --bg-main: #0f172a;
        --surface: rgba(30, 41, 59, 0.7);
        --surface-solid: #1e293b;
        --border-color: rgba(51, 65, 85, 0.5);
        
        --text-main: #f8fafc;
        --text-muted: #94a3b8;
        
        --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-soft) transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Helper Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.w-full { width: 100%; }
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.passkey-button {
    justify-content: center;
    gap: 10px;
}

.passkey-icon {
    color: var(--primary);
    font-size: 1.25rem;
}

.passkey-security-card {
    margin-bottom: 24px;
}

.passkey-device {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
}

.passkey-device:first-child {
    border-top: 0;
}

.passkey-device strong,
.passkey-device small {
    display: block;
}

.passkey-device small {
    margin-top: 4px;
    color: var(--text-muted);
}

.passkey-secure-note {
    margin-top: 12px;
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-solid);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

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

.sidebar-header .logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.sidebar-header .logo-placeholder {
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-text h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.nav-item {
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    text-align: right;
    width: 100%;
}

.nav-item i {
    width: 20px;
    height: 20px;
    stroke-width: 2px;
}

.nav-item:hover {
    color: var(--primary);
    background-color: var(--primary-soft);
}

.nav-item.active {
    color: var(--surface-solid);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.nav-item .badge {
    margin-right: auto;
    background-color: var(--danger);
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: bold;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    background-color: var(--bg-main);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.user-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Workspace */
.main-content {
    margin-right: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    transition: margin-right 0.3s ease;
}

/* ==========================================================================
   Header Styling
   ========================================================================== */
.header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    padding: 16px 24px;
    border-radius: var(--radius-md);
    gap: 20px;
    position: relative;
    z-index: 400;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

.page-title h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.page-title p {
    font-size: 0.8rem;
    font-weight: 500;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Clock & Time */
.clock-widget {
    text-align: left;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.clock-widget .time {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

.clock-widget .date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Role Switcher */
.role-switcher-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.switcher-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.role-selector {
    display: flex;
    background-color: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 4px;
    border: 1px solid var(--border-color);
}

.role-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 4px);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.role-btn i {
    width: 14px;
    height: 14px;
}

.role-btn.active {
    background-color: var(--surface-solid);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Notifications Button */
.notifications-dropdown {
    position: relative;
    z-index: 410;
}

.icon-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    position: relative;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: var(--primary-soft);
    color: var(--primary);
}

.icon-btn .dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--danger);
    border: 2px solid var(--surface-solid);
}

.icon-btn .notif-fallback {
    display: none;
    font-size: 1.05rem;
    line-height: 1;
}

.icon-btn:not(:has(svg)) .notif-fallback {
    display: inline;
}

.icon-btn:not(:has(svg)) [data-lucide] {
    display: none;
}

.notification-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    width: min(320px, calc(100vw - 24px));
    background-color: var(--surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    overflow: hidden;
}

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

.notification-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
}

.text-btn:hover {
    text-decoration: underline;
}

.notification-list {
    max-height: 250px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: var(--bg-main);
}

.notification-item h4 {
    font-size: 0.85rem;
    font-weight: 700;
}

.notification-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-item span {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: left;
}

.empty-state {
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   Tab Navigation & Animation
   ========================================================================== */
.tab-container {
    flex-grow: 1;
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease forwards;
}

.tab-content.active {
    display: block;
}

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

/* Buttons */
.btn {
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    background-color: var(--bg-main);
}

/* ==========================================================================
   1. Dashboard Views
   ========================================================================== */
.welcome-card {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

/* Glowing decoration in the welcome panel */
.welcome-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-info h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.welcome-info p {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 24px;
}

.dashboard-quick-actions {
    display: flex;
    gap: 12px;
}

.quick-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    background-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 700;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.green {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 1.5s infinite;
}

.status-dot.red {
    background-color: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

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

.stat-card {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-md);
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: var(--glass-shadow);
}

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

.stat-icon i {
    width: 26px;
    height: 26px;
}

.bg-primary-soft { background-color: var(--primary-soft); color: var(--primary); }
.bg-success-soft { background-color: var(--success-soft); color: var(--success); }
.bg-warning-soft { background-color: var(--warning-soft); color: var(--warning); }
.bg-info-soft { background-color: var(--secondary-soft); color: var(--secondary); }

.stat-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-data .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-data h3 {
    font-size: 1.35rem;
    font-weight: 800;
}

.stat-data .trend {
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.positive { color: var(--success); }
.trend.neutral { color: var(--text-muted); }
.trend.negative { color: var(--danger); }
.trend.info { color: var(--secondary); }

/* Dashboard Grid Split */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

.dashboard-card {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    min-height: 380px;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Tracker Dial Component */
.tracker-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
}

.circular-progress-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

.tracker-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.tracker-info {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.info-item {
    text-align: center;
}

.info-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
}

.info-item .val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Timeline Component */
.timeline {
    position: relative;
    padding-right: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 280px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-right: 16px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    right: 1px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--surface-solid);
    transition: all 0.2s;
}

.timeline-item.in::after { background-color: var(--success); }
.timeline-item.out::after { background-color: var(--danger); }
.timeline-item.req::after { background-color: var(--warning); }
.timeline-item.appr::after { background-color: var(--primary); }

.timeline-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
}

.timeline-desc {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 2px;
}

/* ==========================================================================
   2. Attendance Panel (تسجيل حضور وانصراف)
   ========================================================================== */
.attendance-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.attendance-card-actions {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    justify-content: center;
}

.clock-display-large {
    text-align: center;
}

.time-large {
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    letter-spacing: -1px;
}

.date-large {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-top: 4px;
}

/* GPS Simulator */
.gps-simulator-box {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gps-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gps-status i {
    width: 24px;
    height: 24px;
}

.pulse-icon.green { color: var(--success); }
.pulse-icon.red { color: var(--danger); animation: pulse 1.5s infinite; }

.gps-text h4 {
    font-size: 0.85rem;
    font-weight: 700;
}

.gps-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.simulator-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.alert-message {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.alert-message.warning {
    background-color: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Toggle Switch Pure CSS */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-muted);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Attendance Big Buttons */
.attendance-buttons {
    display: flex;
    gap: 16px;
    width: 100%;
}

.btn-attendance {
    flex: 1;
    border: none;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-attendance i {
    width: 32px;
    height: 32px;
}

.btn-attendance small {
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.8;
}

.check-in-btn {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.check-in-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    opacity: 0.95;
}

.check-out-btn {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.check-out-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    opacity: 0.95;
}

.btn-attendance.disabled,
.btn-attendance:disabled {
    background: var(--border-color) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

/* Manual Correction Form */
.attendance-card-form {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

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

.request-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-info-badge {
    background-color: var(--primary-soft);
    color: var(--primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   3. Requests Panel (الطلبات)
   ========================================================================== */
.requests-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.request-tabs-box {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

.request-tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    gap: 16px;
    margin-bottom: 20px;
}

.req-tab-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.req-tab-btn:hover {
    color: var(--primary);
}

.req-tab-btn.active {
    color: var(--primary);
    background-color: var(--primary-soft);
}

.req-form-panel {
    display: none;
}

.req-form-panel.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

/* Tables design */
.requests-history-card,
.detailed-report-card,
.manager-section-card {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.data-table th {
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 600;
}

.data-table tbody tr:hover {
    background-color: var(--primary-soft);
}

/* Badges for status */
.badge-status {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-block;
}

.badge-status.pending { background-color: var(--warning-soft); color: var(--warning); }
.badge-status.approved { background-color: var(--success-soft); color: var(--success); }
.badge-status.rejected { background-color: var(--danger-soft); color: var(--danger); }

/* ==========================================================================
   4. Reports Panel
   ========================================================================== */
.reports-view-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.reports-header-box {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    box-shadow: var(--glass-shadow);
}

.filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
}

.form-select-inline {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    outline: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.report-highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.highlight-card {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--glass-shadow);
    text-align: center;
}

.highlight-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.5;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.highlight-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.highlight-icon svg {
    width: 22px;
    height: 22px;
}

/* Salary + payslip side-by-side on reports */
.salary-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.card-header-with-icon {
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
}

.card-header-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.card-header-icon svg {
    width: 22px;
    height: 22px;
}

.card-header-text .subtitle {
    margin-top: 2px;
}

.icon-soft-blue   { background: var(--primary-soft); color: var(--primary); }
.icon-soft-green  { background: var(--success-soft); color: var(--success); }
.icon-soft-red    { background: var(--danger-soft);  color: var(--danger); }
.icon-soft-orange { background: var(--warning-soft); color: var(--warning); }

.highlight-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 4px;
}

/* Charts SVG Styling */
.charts-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
}

.chart-card {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--glass-shadow);
}

.chart-card h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.chart-container {
    width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG Chart Classes */
.chart-bar {
    fill: var(--primary);
    transition: height 0.5s ease-out, y 0.5s ease-out;
}

.chart-bar:hover {
    fill: var(--primary-hover);
}

.chart-grid-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 4;
}

.chart-label {
    fill: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
}

/* ==========================================================================
   5. Manager Portal (بوابة الإدارة)
   ========================================================================== */
.manager-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.manager-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.manager-stat-card {
    background-color: var(--surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: inherit;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button.manager-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

button.manager-stat-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.manager-section-card.section-flash {
    animation: managerSectionFlash 1.2s ease;
}

@keyframes managerSectionFlash {
    0%, 100% { box-shadow: var(--glass-shadow); }
    35% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent); }
}

.border-left-primary { border-right: 4px solid var(--primary); }
.border-left-warning { border-right: 4px solid var(--warning); }
.border-left-danger { border-right: 4px solid var(--danger); }

.stat-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-meta .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-meta h3 {
    font-size: 1.4rem;
    font-weight: 800;
}

.stat-icon-large {
    width: 48px;
    height: 48px;
    opacity: 0.8;
}

.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* Manager Action Buttons */
.manager-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-success-sm {
    background-color: var(--success);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s;
}

.btn-danger-sm {
    background-color: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: opacity 0.2s;
}

.btn-success-sm:hover,
.btn-danger-sm:hover {
    opacity: 0.9;
}

/* Approval request cards (manager queue) */
.approval-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.approval-card {
    background: var(--surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.approval-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.approval-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--secondary);
    background: var(--secondary-soft);
}

.approval-identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.approval-identity strong {
    font-size: 0.95rem;
}

.approval-identity span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.approval-badge-pending {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--warning-soft);
    color: var(--warning);
    white-space: nowrap;
}

.approval-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.approval-duration {
    font-size: 1rem;
}

.approval-type {
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.85rem;
}

.approval-card-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 10px;
    border-top: 1px dashed rgba(100, 116, 139, 0.25);
    font-size: 0.85rem;
}

.approval-date-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.approval-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.approval-card-actions button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.approval-card-actions button:active {
    transform: scale(0.98);
}

.approval-card-actions i {
    width: 15px;
    height: 15px;
}

.approval-btn-reject {
    background: var(--surface-solid);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.approval-btn-reject i { color: var(--danger); }

.approval-btn-approve {
    background: #2e8b7c;
    border: none;
    color: #fff;
}

.approval-btn-approve:hover,
.approval-btn-reject:hover {
    opacity: 0.9;
}

/* Badge tags inside tables */
.badge-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-tag.attendance-present { background-color: var(--success-soft); color: var(--success); }
.badge-tag.attendance-late { background-color: var(--warning-soft); color: var(--warning); }
.badge-tag.attendance-absent { background-color: var(--danger-soft); color: var(--danger); }
.badge-tag.attendance-leave { background-color: var(--secondary-soft); color: var(--secondary); }

/* ==========================================================================
   Responsive Adaptations & Print Styles
   ========================================================================== */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 280px;
        max-width: 85vw;
        transform: translateX(105%);
        box-shadow: none;
        visibility: hidden;
    }
    
    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        box-shadow: -12px 0 40px rgba(15, 23, 42, 0.25);
    }
    
    .main-content {
        margin-right: 0;
        padding: 16px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .attendance-container {
        grid-template-columns: 1fr;
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 99;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 14px 16px;
        align-items: flex-start;
        gap: 10px;
    }
    
    .header-right {
        width: 100%;
        gap: 12px;
    }

    .page-title h1 {
        font-size: 1.15rem;
    }

    .page-title p {
        font-size: 0.78rem;
    }
    
    .header-left {
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .clock-widget {
        border-left: none;
        padding-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .welcome-card {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .dashboard-quick-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .dashboard-quick-actions button {
        width: 100%;
    }

    .passkey-security-card .flex-header {
        align-items: stretch;
        flex-direction: column;
    }

    .passkey-security-card .btn,
    .passkey-device {
        width: 100%;
    }

    .passkey-device {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .stat-card,
    .manager-section-card,
    .reports-header-box {
        padding: 16px;
    }

    .attendance-buttons {
        flex-direction: column;
    }

    .manager-overview-grid,
    .report-highlights-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .request-tabs-header {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 8px;
    }

    .req-tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .filter-group select {
        width: 100%;
    }

    .filter-controls .btn {
        width: 100%;
        justify-content: center;
    }

    .time-large {
        font-size: 2.2rem;
    }

    .salary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
        white-space: nowrap;
    }

    .manager-actions {
        flex-direction: column;
        gap: 6px;
    }

    .manager-actions button {
        width: 100%;
        justify-content: center;
    }

    .notification-menu {
        position: fixed;
        top: calc(12px + env(safe-area-inset-top, 0px) + 56px);
        left: 12px;
        right: 12px;
        width: auto;
        max-height: min(60vh, 420px);
        overflow-y: auto;
        z-index: 1200;
    }

    .notifications-dropdown.open .notification-menu,
    .notification-menu:not(.hidden) {
        display: block;
    }

    .attendance-card-actions,
    .attendance-card-form {
        padding: 20px 16px;
    }

    .management-page {
        padding: 16px;
    }

    .management-actions {
        flex-wrap: wrap;
    }

    .management-actions .btn,
    .management-actions form,
    .management-actions form .btn {
        width: 100%;
        justify-content: center;
    }

    .location-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .location-actions .btn,
    .location-actions form,
    .location-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .company-map {
        height: 240px;
    }
}

/* Print Styling */
@media print {
    .sidebar,
    .header,
    .dashboard-quick-actions,
    .filter-controls button,
    .icon-btn,
    .role-switcher-container {
        display: none !important;
    }
    
    .main-content {
        margin-right: 0 !important;
        padding: 0 !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .reports-view-container {
        gap: 0 !important;
    }
    
    .report-highlights-grid,
    .charts-grid {
        page-break-inside: avoid;
    }
    
    .detailed-report-card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Authentication & account management */
.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 20%, var(--primary-soft), transparent 28%),
        var(--bg-main);
}

.auth-card {
    width: min(100%, 460px);
    padding: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--surface-solid);
    box-shadow: var(--glass-shadow);
}

.auth-brand,
.auth-heading,
.auth-form {
    margin-bottom: 24px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand .logo,
.auth-card .logo {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
}

/* Real brand image replaces the gradient letter placeholder.
   The wordmark has white parts, so it sits on a dark chip. */
.logo-img {
    width: auto !important;
    height: 52px;
    max-width: 140px;
    flex-shrink: 0;
    padding: 8px 14px;
    box-sizing: border-box;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: #0f172a !important;
}

/* The wordmark already spells the brand name — hide the duplicate text */
.logo-img + .logo-text h2,
.auth-brand .logo-img + div h1 {
    display: none;
}

.auth-brand h1,
.auth-heading h1,
.auth-heading h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.auth-brand p,
.auth-heading p,
.auth-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form input {
    width: 100%;
}

.form-alert {
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 700;
}

.form-alert.success {
    border-color: rgba(16, 185, 129, 0.25);
    background: var(--success-soft);
    color: var(--success);
}

.management-toast {
    position: sticky;
    top: 12px;
    z-index: 40;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.field-error {
    color: var(--danger);
    font-size: 0.72rem;
}

.activation-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.activation-meta span {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
}

.management-page {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 32px;
}

.management-header,
.management-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.management-header {
    margin-bottom: 16px;
}

.management-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px;
    border-radius: 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
}

.management-tab {
    flex: 1 1 auto;
    min-width: 120px;
    text-align: center;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.management-tab:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.management-tab.active {
    color: #fff;
    background: var(--primary);
}

.employee-detail-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.employee-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.employee-detail-grid {
    margin-top: 0;
}

.employee-section-title {
    margin: 8px 0 4px;
    font-size: 0.95rem;
    font-weight: 800;
}

.allowance-row {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.management-grid {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(500px, 1.5fr);
    gap: 24px;
}

.management-invitations {
    margin-top: 24px;
}

.activation-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

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

    .management-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .management-tabs {
        gap: 6px;
    }

    .management-tab {
        min-width: calc(50% - 6px);
        font-size: 0.8rem;
        padding: 10px 8px;
    }
}

/* Management pages: dedicated mobile pass */
@media (max-width: 768px) {
    .management-page {
        padding: 12px;
        max-width: 100vw;
        overflow-x: clip;
    }

    .management-page * {
        min-width: 0;
    }

    .management-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .management-header h1 {
        font-size: 1.3rem;
    }

    .management-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .management-actions .btn,
    .management-actions form,
    .management-actions form .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .management-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px;
    }

    .management-tab {
        min-width: 0;
        padding: 12px 6px;
        font-size: 0.82rem;
        line-height: 1.3;
        white-space: normal;
    }

    .management-grid,
    .employee-detail-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .manager-section-card,
    .management-invitations {
        max-width: 100%;
        padding: 16px 14px;
    }

    .management-invitations {
        margin-top: 14px;
    }

    .management-page .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .management-page .form-group input,
    .management-page .form-group select,
    .management-page .form-group textarea {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 48px;
    }

    .management-page .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .management-page .location-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .management-page .location-actions form,
    .management-page .location-actions .btn,
    .management-page .location-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .management-page .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .management-page .activation-link {
        display: inline-block;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-all;
    }

    .management-toast {
        overflow-wrap: anywhere;
    }

    .employee-detail-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

.company-map {
    width: 100%;
    height: 320px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin: 8px 0 4px;
    z-index: 1;
}

.location-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.attendance-location-actions {
    margin-top: 4px;
}

.checkbox-row {
    margin-top: 4px;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.salary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.salary-grid .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.salary-grid h3 {
    margin: 0;
    font-size: 1.1rem;
}

/* ==========================================================================
   Mobile App Experience (ZenHR style) — hidden on desktop
   ========================================================================== */
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    /* Show each mobile block with its natural display type */
    .mobile-only.mobile-home-head,
    .mobile-only.mobile-balance-strip,
    .mobile-only.mobile-clockin,
    .mobile-only.mobile-request-head,
    .mobile-only.mobile-bottom-nav {
        display: flex !important;
    }

    .mobile-only.mobile-section-title {
        display: block !important;
    }

    .mobile-only.mobile-actions-grid {
        display: grid !important;
    }

    body {
        overflow-x: hidden;
    }

    .app-container,
    .main-content,
    .tab-container {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* --- Layout adjustments --- */
    .main-content {
        padding: 12px 14px calc(88px + env(safe-area-inset-bottom));
    }

    /* Slim top header — override the older 600px column layout */
    .header {
        flex-direction: row !important;
        align-items: center !important;
        height: auto;
        min-height: 52px;
        padding: 8px 4px;
        gap: 8px;
        margin-bottom: 4px;
    }

    .header-right {
        width: auto !important;
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    .header-left {
        width: auto !important;
        border-top: none !important;
        padding-top: 0 !important;
        gap: 4px;
        flex-wrap: nowrap !important;
        justify-content: flex-end;
    }

    .header .clock-widget,
    .header form,
    .page-title p {
        display: none !important;
    }

    .page-title h1 {
        font-size: 1.2rem;
        line-height: 1.2;
    }

    .menu-toggle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }

    .icon-btn {
        width: 40px;
        height: 40px;
    }

    /* Hide desktop-oriented dashboard blocks */
    #tab-dashboard .welcome-card,
    #tab-dashboard .stats-grid,
    #tab-dashboard .dashboard-grid {
        display: none !important;
    }

    /* Compact passkey card under actions */
    #tab-dashboard .passkey-security-card {
        margin-top: 4px;
        padding: 14px;
        border-radius: 16px;
    }

    #tab-dashboard .passkey-security-card .flex-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #tab-dashboard .passkey-security-card h3 {
        font-size: 0.95rem;
    }

    #tab-dashboard .passkey-security-card .subtitle {
        font-size: 0.75rem;
        line-height: 1.45;
    }

    #tab-dashboard .passkey-security-card .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    #tab-dashboard .passkey-secure-note {
        font-size: 0.7rem;
    }

    /* Hide desktop attendance widgets */
    #tab-attendance .clock-display-large,
    #tab-attendance .gps-simulator-box,
    #tab-attendance .attendance-buttons {
        display: none !important;
    }

    #tab-attendance .attendance-card-actions {
        padding: 0;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    /* --- Mobile home header --- */
    .mobile-home-head {
        align-items: center;
        gap: 12px;
        margin: 2px 0 16px;
        width: 100%;
    }

    .mobile-avatar {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
        display: grid;
        place-items: center;
        border-radius: 14px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: #fff;
        font-size: 1.25rem;
        font-weight: 900;
    }

    .mobile-welcome {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-welcome h2 {
        font-size: 1.05rem;
        font-weight: 800;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .mobile-welcome > span {
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 700;
    }

    .mobile-status-chip {
        display: inline-flex;
        align-items: center;
        align-self: flex-start;
        gap: 5px;
        margin-top: 4px;
        padding: 3px 8px;
        border-radius: 999px;
        background: var(--surface-solid);
        border: 1px solid var(--border-color);
        font-size: 0.68rem;
        font-weight: 800;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .mobile-status-chip .status-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        display: inline-block;
    }

    .mobile-status-chip .status-dot.red { background: var(--danger); }
    .mobile-status-chip .status-dot.green { background: var(--success); }

    /* --- Section titles --- */
    .mobile-section-title {
        font-size: 0.95rem;
        font-weight: 800;
        color: var(--text-main);
        margin: 0 2px 10px;
        line-height: 1.3;
    }

    /* --- Balance strip --- */
    .mobile-balance-strip {
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 2px 2px 10px;
        margin: 0 -14px 16px;
        padding-inline: 14px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .mobile-balance-strip::-webkit-scrollbar {
        display: none;
    }

    .mobile-balance-card {
        position: relative;
        flex: 0 0 auto;
        width: min(72vw, 260px);
        scroll-snap-align: start;
        background: var(--surface-solid);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 14px 36px 14px 14px;
        cursor: pointer;
        display: flex;
        align-items: center;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
        box-sizing: border-box;
    }

    .mobile-balance-card .mb-body {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        flex: 1;
    }

    .mobile-balance-card .mb-label {
        color: var(--text-main);
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1.3;
    }

    .mobile-balance-card .mb-value {
        display: flex;
        align-items: baseline;
        gap: 4px;
        flex-wrap: wrap;
    }

    .mobile-balance-card .mb-value strong {
        font-size: 1.35rem;
        font-weight: 900;
        color: var(--text-main);
        line-height: 1.2;
    }

    .mobile-balance-card .mb-value span {
        color: var(--text-muted);
        font-size: 0.78rem;
        font-weight: 700;
    }

    .mobile-balance-card .mb-arrow {
        position: absolute;
        top: 50%;
        left: 10px;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
        color: var(--text-muted);
        pointer-events: none;
    }

    /* --- Actions grid: 3 columns like ZenHR --- */
    .mobile-actions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 16px;
        width: 100%;
    }

    .mobile-action-tile-form {
        display: contents;
    }

    .mobile-action-tile {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 96px;
        padding: 12px 6px 10px;
        background: var(--surface-solid);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        cursor: pointer;
        text-decoration: none;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
        width: 100%;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-action-tile span {
        font-size: 0.72rem;
        font-weight: 800;
        color: var(--text-main);
        text-align: center;
        line-height: 1.25;
        max-width: 100%;
        word-break: break-word;
    }

    .mat-icon {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .mat-icon svg {
        width: 22px;
        height: 22px;
    }

    .tile-teal   { background: rgba(13, 148, 136, 0.12);  color: #0d9488; }
    .tile-orange { background: var(--warning-soft);       color: var(--warning); }
    .tile-blue   { background: var(--primary-soft);       color: var(--primary); }
    .tile-red    { background: var(--danger-soft);        color: var(--danger); }
    .tile-purple { background: var(--secondary-soft);     color: var(--secondary); }
    .tile-indigo { background: rgba(99, 102, 241, 0.12);  color: #6366f1; }
    .tile-green  { background: var(--success-soft);       color: var(--success); }
    .tile-gray   { background: rgba(100, 116, 139, 0.12); color: var(--text-muted); }

    .mat-badge {
        position: absolute;
        top: 6px;
        right: 6px;
        min-width: 18px;
        height: 18px;
        display: grid;
        place-items: center;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--danger);
        color: #fff;
        font-size: 0.65rem;
        font-weight: 900;
        z-index: 2;
    }

    /* --- Bottom navigation --- */
    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 90;
        align-items: center;
        justify-content: space-around;
        height: calc(60px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--surface-solid);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.08);
    }

    .mbn-item {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        border: none;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        border-radius: 14px;
    }

    .mbn-item svg {
        width: 24px;
        height: 24px;
    }

    .mbn-item.active {
        color: #0d9488;
    }

    .mbn-fab {
        width: 54px;
        height: 54px;
        margin-top: -22px;
        display: grid;
        place-items: center;
        border: 4px solid var(--bg-main);
        border-radius: 50%;
        background: #0d9488;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 8px 20px rgba(13, 148, 136, 0.45);
        flex-shrink: 0;
    }

    .mbn-fab svg {
        width: 24px;
        height: 24px;
    }

    /* --- Mobile clock-in screen --- */
    .mobile-clockin {
        flex-direction: column;
        margin: -12px -14px 16px;
        width: calc(100% + 28px);
    }

    #mobileAttendanceMap {
        width: 100%;
        height: 38vh;
        min-height: 220px;
        max-height: 320px;
        background: var(--bg-main);
        z-index: 1;
    }

    .mobile-clockin-sheet {
        position: relative;
        z-index: 2;
        margin-top: -28px;
        background: var(--surface-solid);
        border-radius: 24px 24px 0 0;
        padding: 16px 14px 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    }

    .mobile-gps-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 0.76rem;
        font-weight: 800;
        color: var(--warning);
        text-align: center;
        line-height: 1.35;
        margin: 0;
    }

    .mobile-gps-hint.ok { color: var(--success); }
    .mobile-gps-hint.err { color: var(--danger); }

    .mobile-gps-hint svg {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    .mobile-since-checkin {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        color: var(--text-main);
        font-size: 0.78rem;
        font-weight: 700;
        margin: 0;
    }

    .mobile-since-checkin svg {
        width: 14px;
        height: 14px;
        color: var(--text-muted);
    }

    .mobile-time-card {
        background: var(--primary-soft);
        border-radius: 16px;
        padding: 14px 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .mobile-time-big {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: clamp(1.5rem, 7vw, 1.9rem);
        font-weight: 900;
        color: var(--text-main);
        direction: ltr;
        line-height: 1.1;
    }

    .mobile-time-big svg {
        width: 22px;
        height: 22px;
        color: var(--text-main);
    }

    .mobile-time-meta {
        color: var(--text-muted);
        font-size: 0.75rem;
        font-weight: 700;
        text-align: center;
    }

    .mobile-accuracy-row {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.76rem;
        font-weight: 700;
        color: var(--text-main);
    }

    .acc-badge {
        padding: 2px 10px;
        border-radius: 999px;
        font-size: 0.7rem;
        font-weight: 800;
    }

    .acc-badge.acc-bad {
        background: var(--danger-soft);
        color: var(--danger);
    }

    .acc-badge.acc-good {
        background: var(--success-soft);
        color: var(--success);
    }

    .mobile-punch-cards {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .mobile-punch-card {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 12px;
        border-radius: 14px;
        background: var(--bg-main);
        border: 1px solid var(--border-color);
        opacity: 0.65;
        min-width: 0;
    }

    .mobile-punch-card.active {
        background: var(--surface-solid);
        border-color: var(--primary);
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
        opacity: 1;
    }

    .mobile-punch-card span {
        font-size: 0.78rem;
        font-weight: 800;
        color: var(--text-main);
    }

    .mobile-punch-card strong {
        font-size: 1rem;
        font-weight: 900;
        color: var(--text-muted);
        direction: ltr;
        text-align: right;
    }

    .mobile-main-action-btn {
        width: 100%;
        min-height: 50px;
        padding: 14px;
        border: none;
        border-radius: 14px;
        background: #0d9488;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 900;
        cursor: pointer;
        transition: background 0.2s, opacity 0.2s;
    }

    .mobile-main-action-btn:disabled {
        background: #99c9c4;
        cursor: not-allowed;
    }

    .mobile-main-action-btn.checkout {
        background: var(--danger);
    }

    /* Keep attendance forms readable under the sheet */
    #tab-attendance .attendance-card-form,
    #tab-attendance .manager-section-card {
        margin-top: 8px;
    }

    /* --- Consistent ZenHR-style forms on all pages --- */
    .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .card-header h3 {
        font-size: 1.02rem;
    }

    .card-header .subtitle {
        margin: 0;
        line-height: 1.6;
    }

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

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
        min-height: 48px;
        padding: 12px 14px;
        border: 1px solid transparent;
        border-radius: 14px;
        background: var(--bg-main);
        font-size: 0.9rem;
    }

    /* Date/time pickers collapse to content width on WebKit without this */
    .form-group input[type="date"],
    .form-group input[type="time"] {
        -webkit-appearance: none;
        appearance: none;
        display: block;
    }

    .form-group input::-webkit-date-and-time-value {
        text-align: start;
        min-height: 1.2em;
    }

    .form-group textarea {
        min-height: 100px;
        resize: vertical;
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--primary-soft);
    }

    /* Full-width rounded submit buttons in forms */
    .request-form .btn,
    .attendance-card-form form .btn,
    .manager-section-card .btn {
        width: 100%;
        justify-content: center;
        min-height: 50px;
        border-radius: 14px;
        font-size: 0.92rem;
        font-weight: 800;
    }

    /* --- ZenHR-style requests screen --- */
    .mobile-request-head {
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 4px;
        padding: 18px 18px 44px;
        border-radius: 22px;
        background: linear-gradient(165deg, #2dd4bf 0%, #14b8a6 40%, #0d9488 100%);
    }

    .mobile-request-head h2 {
        color: #fff;
        font-size: 1.2rem;
        font-weight: 900;
        margin: 0;
    }

    .mrh-close {
        width: 38px;
        height: 38px;
        flex-shrink: 0;
        display: grid;
        place-items: center;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
        cursor: pointer;
    }

    .mrh-close svg {
        width: 20px;
        height: 20px;
    }

    #tab-requests .requests-container {
        position: relative;
        z-index: 2;
        gap: 16px;
    }

    /* Only overlap the teal head when it exists */
    .mobile-request-head + .requests-container {
        margin-top: -28px;
    }

    #tab-requests .request-tabs-box {
        background: var(--surface-solid);
        border: none;
        border-radius: 22px;
        padding: 16px 14px 20px;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
    }

    /* Segmented pills: 3 equal tabs, no horizontal scroll */
    #tab-requests .request-tabs-header {
        border-bottom: none;
        overflow: visible;
        padding-bottom: 0;
        margin-bottom: 16px;
        gap: 6px;
    }

    #tab-requests .req-tab-btn {
        flex: 1 1 0;
        min-width: 0;
        white-space: normal;
        text-align: center;
        line-height: 1.3;
        padding: 10px 6px;
        border-radius: 14px;
        background: var(--bg-main);
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 800;
    }

    #tab-requests .req-tab-btn.active {
        background: rgba(13, 148, 136, 0.14);
        color: #0d9488;
    }

    /* ZenHR-like soft fields */
    #tab-requests .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    #tab-requests .form-group {
        gap: 8px;
    }

    #tab-requests .form-group label {
        font-size: 0.88rem;
        font-weight: 800;
    }

    #tab-requests .form-group input,
    #tab-requests .form-group select,
    #tab-requests .form-group textarea {
        min-height: 50px;
        padding: 14px;
        border: 1px solid transparent;
        border-radius: 14px;
        background: var(--bg-main);
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }

    #tab-requests .form-group textarea {
        min-height: 110px;
        resize: vertical;
    }

    #tab-requests .form-group input:focus,
    #tab-requests .form-group select:focus,
    #tab-requests .form-group textarea:focus {
        border-color: #0d9488;
        box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.16);
    }

    #tab-requests .form-info-badge {
        min-height: 50px;
        padding: 14px;
        border-radius: 14px;
        background: rgba(13, 148, 136, 0.12);
        color: #0d9488;
    }

    /* Big teal submit button */
    #tab-requests .req-form-panel button[type="submit"] {
        width: 100%;
        justify-content: center;
        min-height: 52px;
        margin-top: 6px;
        border: none;
        border-radius: 14px;
        background: #0d9488;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 900;
        box-shadow: 0 8px 18px rgba(13, 148, 136, 0.3);
    }

    #tab-requests .req-form-panel button[type="submit"]:hover {
        background: #0f766e;
    }

    /* Requests history as a soft card */
    #tab-requests .requests-history-card {
        border: none;
        border-radius: 20px;
        padding: 16px;
        box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    }

    #tab-requests .requests-history-card .card-header h3 {
        font-size: 1rem;
    }

    /* History: cards instead of the wide table */
    #tab-requests .requests-history-card .table-responsive {
        display: none;
    }

    .mobile-only.mobile-request-list {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
        margin-top: 12px;
    }

    .mobile-request-item {
        background: var(--bg-main);
        border-radius: 16px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .mobile-request-item .mri-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .mobile-request-item .mri-top strong {
        font-size: 0.92rem;
        color: var(--text-main);
    }

    .mobile-request-item .mri-details {
        margin: 0;
        font-size: 0.82rem;
        color: var(--text-muted);
        line-height: 1.5;
    }

    .mobile-request-item .mri-meta {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--text-muted);
    }

    .mobile-request-item .mri-comment {
        margin: 0;
        padding: 8px 10px;
        border-radius: 10px;
        background: rgba(13, 148, 136, 0.1);
        color: #0d9488;
        font-size: 0.78rem;
        line-height: 1.5;
    }
}

/* Account settings */
.settings-page {
    width: min(100%, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 20px 48px;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.settings-header h1 {
    font-size: 1.55rem;
    font-weight: 900;
}

.settings-header p,
.settings-card-heading p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.settings-back {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--surface-solid);
    color: var(--text-main);
    font-size: 1.3rem;
    text-decoration: none;
}

.settings-card {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--surface-solid);
    box-shadow: var(--glass-shadow);
}

.settings-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.settings-card-heading h2 {
    font-size: 1.05rem;
    font-weight: 900;
}

.settings-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-form input[type="password"] {
    width: 100%;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
}

.language-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.language-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.language-option span {
    display: flex;
    flex-direction: column;
}

.language-option strong {
    font-size: 0.9rem;
}

.language-option small,
.password-help {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.password-help ul {
    margin-top: 6px;
    padding-inline-start: 18px;
}

html[dir="ltr"] body {
    font-family: Arial, sans-serif;
}

html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
}

html[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
}

@media (max-width: 900px) {
    html[dir="ltr"] .sidebar {
        transform: translateX(-105%);
    }

    html[dir="ltr"] .sidebar.open {
        transform: translateX(0);
    }

    html[dir="ltr"] .main-content {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .settings-page {
        padding: 18px 14px 36px;
    }

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