/* ================================================================
   ManageMax — Dark Futuristic Theme
   ================================================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0d0d14;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(37, 99, 235, 0.2);
    --accent-cyan: #2563eb;
    --accent-green: #94a3b8;
    --accent-cyan-dim: rgba(37, 99, 235, 0.15);
    --accent-green-dim: rgba(148, 163, 184, 0.15);
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --text-muted: #555;
    --danger: #ff4757;
    --danger-dim: rgba(255, 71, 87, 0.12);
    --success: #2ed573;
    --font-latin: 'Inter', sans-serif;
    --font-arabic: 'Cairo', sans-serif;
    --sidebar-width: 240px;
    --navbar-height: 56px;
    --bottom-tabs-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --border-row: rgba(255, 255, 255, 0.02);
}

/* Light theme */
html[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border-glass: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(37, 99, 235, 0.25);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --danger-dim: rgba(255, 71, 87, 0.15);
    --border-row: rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .glass-card:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.08);
}

html[data-theme="light"] .btn-primary {
    color: #fff;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font-latin);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

html[dir="rtl"] body {
    font-family: var(--font-arabic);
}

a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: var(--accent-green);
}

/* ── Glass Card ────────────────────────────────────────────── */

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.06);
}

/* ── Layouts ───────────────────────────────────────────────── */

.auth-layout {
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(ellipse at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 70%);
    overflow: hidden;
    position: relative;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-content {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.page-content {
    padding: 1.5rem;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ── Sidebar ───────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-inline-end: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    z-index: 100;
    padding: 1.5rem 0;
}

.sidebar-logo {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1rem;
}

.logo-img {
    height: auto;
    width: auto;
    max-width: 100%;
    display: block;
    object-fit: contain;
}

/* Auth Pages: Large but not massive */
.auth-logo .logo-img {
    height: 80px;
    margin: 0 auto;
}

/* Internal App: Professional & Compact */
.navbar-logo.logo-img,
.landing-logo.logo-img {
    height: 40px;
}

.sidebar-logo .logo-img {
    height: 38px;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.logo-accent {
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    font-size: 0.9rem;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
}

.sidebar-link.active {
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
    border-inline-start: 3px solid var(--accent-cyan);
}

/* ── Top Navbar ────────────────────────────────────────────── */

.top-navbar {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background var(--transition);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.navbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.navbar-user {
    color: var(--text-secondary);
    font-size: 0.8rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Bottom Tabs (Mobile) ──────────────────────────────────── */

.bottom-tabs {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 1rem;
    right: 1rem;
    height: 64px;
    background: rgba(13, 13, 20, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    justify-content: space-around;
    align-items: center;
    padding: 0 0.5rem;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .bottom-tabs {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 500;
    padding: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    flex: 1;
    min-width: 0;
}

.tab-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: transform 0.3s ease, stroke 0.3s ease;
}

.tab-item.active {
    color: var(--accent-cyan);
    transform: translateY(-2px);
}

.tab-item.active svg {
    filter: drop-shadow(0 0 8px var(--accent-cyan-dim));
}

.navbar-user {
    color: var(--text-primary);
    font-weight: 500;
}

.tab-item:active {
    transform: scale(0.92);
}

/* ── Auth Pages ────────────────────────────────────────────── */

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    min-height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-logo .logo-text {
    font-size: 2.5rem;
}

.auth-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-store-name {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.auth-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* ── Landing Page ────────────────────────────────────────────── */

.landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Subtle dot-grid background */
.landing-grid-bg {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, rgba(37, 99, 235, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}

html[data-theme="light"] .landing-grid-bg {
    background-image: radial-gradient(circle, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
}

/* ── Header / Nav ─────────────────────────────────────────── */

.landing-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}

html[data-theme="light"] .landing-header {
    background: rgba(241, 245, 249, 0.92);
}

.landing-nav {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 72px;
}

.landing-logo {
    user-select: none;
}

.landing-logo-sm {
    height: 32px;
    width: auto;
    user-select: none;
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ── Hero ─────────────────────────────────────────────────── */

.landing-hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1140px;
    margin: 0 auto;
    padding: 5rem 1.5rem 4rem;
    width: 100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

html[dir="rtl"] .hero-content {
    align-items: flex-end;
    text-align: right;
}

/* Badge above headline */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    margin-bottom: 1.5rem;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: badge-pulse 2.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

.landing-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.12;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
}

.landing-hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 2rem;
    max-width: 440px;
}

.landing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-login-link {
    color: var(--text-secondary);
}

/* ── Dashboard Preview Widget ─────────────────────────────── */

.hero-visual {
    position: relative;
}

.hero-preview {
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-glass);
}

html[data-theme="light"] .hero-preview {
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--border-glass);
}

.preview-topbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .preview-topbar {
    background: rgba(0, 0, 0, 0.02);
}

.preview-dots {
    display: flex;
    gap: 5px;
}

.preview-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-glass);
    display: block;
}

.preview-dots span:nth-child(1) {
    background: #ff5f57;
}

.preview-dots span:nth-child(2) {
    background: #ffbd2e;
}

.preview-dots span:nth-child(3) {
    background: #28ca41;
}

.preview-topbar-label {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.preview-clock {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* Stats row */
.preview-stats-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-glass);
}

.preview-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 0.5rem;
    gap: 0.2rem;
}

.preview-stat-divider {
    width: 1px;
    background: var(--border-glass);
    align-self: stretch;
}

.preview-stat-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

.preview-stat-val--on {
    color: var(--success);
}

.preview-stat-key {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Worker rows */
.preview-workers {
    list-style: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-glass);
}

.preview-worker {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 1rem;
    transition: background var(--transition);
}

.preview-worker:hover {
    background: var(--bg-card-hover);
}

.preview-worker-av {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.preview-worker-av--off {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.preview-worker-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.preview-worker-tag {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.preview-worker-tag--in {
    color: var(--success);
    border-color: rgba(46, 213, 115, 0.25);
    background: rgba(46, 213, 115, 0.06);
}

/* Mini bar chart */
.preview-bar-section {
    padding: 0.75rem 1rem 0.85rem;
}

.preview-bar-label {
    font-size: 1.1rem;
    /* Slightly larger for prominence */
    color: var(--text-primary);
    font-weight: 800;
    /* Extra bold for charts */
    margin-bottom: 2.25rem;
    /* More breathing room */
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: -0.015em;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.preview-bar-label span:last-child:not(:first-child) {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.6;
}

.preview-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 36px;
}

.preview-bar {
    flex: 1;
    height: var(--h, 50%);
    background: rgba(37, 99, 235, 0.2);
    border-radius: 3px 3px 0 0;
    transition: height 0.3s ease;
}

.preview-bar--accent {
    background: rgba(37, 99, 235, 0.55);
}

/* ── AI Feature Section ───────────────────────────────────── */

.landing-ai-feature {
    position: relative;
    z-index: 1;
    padding: 6rem 1.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, transparent 0%, rgba(59, 130, 246, 0.03) 50%, transparent 100%);
}


.landing-ai-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

@media (max-width: 900px) {
    .landing-ai-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

.ai-feature-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.ai-feature-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ai-feature-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 500;
}

.ai-chat-preview {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.1);
    height: 100%;
}

.ai-chat-glow-tr {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(40px);
    border-radius: 50%;
}

.ai-chat-glow-bl {
    position: absolute;
    bottom: -50px;
    left: -50px;
    width: 150px;
    height: 150px;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(40px);
    border-radius: 50%;
}

.ai-chat-container {
    z-index: 1;
    position: relative;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 7rem;
}


.ai-chat-bubble {
    padding: 0.85rem 1.25rem;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: transform 0.2s ease;
}

.ai-chat-bubble.user-bubble {
    align-self: flex-end;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 16px 16px 0 16px;
    color: var(--text-primary);
}

.ai-chat-bubble.ai-bubble {
    align-self: flex-start;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px 16px 16px 0;
    color: var(--text-primary);
}

.ai-chat-bubble.ai-bubble-success {
    align-self: flex-start;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px 16px 16px 0;
    color: #10b981;
}

.ai-bubble.flex-icon {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.ai-bubble.flex-icon svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-mic-wrapper {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.ai-mic-btn {
    position: relative;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.ai-mic-btn svg {
    width: 20px;
    height: 20px;
}

.ai-mic-pulse,
.ai-mic-pulse2 {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #3b82f6;
    animation: aiPulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-mic-pulse2 {
    animation-delay: 1s;
}

@keyframes aiPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

html[data-theme="light"] .ai-chat-bubble.user-bubble {
    color: #1e3a8a;
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.2);
}

html[data-theme="light"] .ai-chat-bubble.ai-bubble {
    color: #1e3a8a;
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

html[data-theme="light"] .ai-chat-bubble.ai-bubble-success {
    color: #064e3b;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
}

/* ── Features Section ─────────────────────────────────────── */


.landing-features {
    position: relative;
    z-index: 1;
    padding: 4rem 1.5rem;
    max-width: 1140px;
    margin: 0 auto;
    width: 100%;
}

.landing-features-inner {
    border-top: 1px solid var(--border-glass);
    padding-top: 3rem;
}

.landing-features-head {
    margin-bottom: 2.5rem;
}

.section-overline {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-cyan);
}

.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-left: 2px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
    overflow: hidden;
}

.feature-item:hover {
    border-left-color: var(--accent-cyan);
    transform: translateY(-1px);
}

html[dir="rtl"] .feature-item {
    border-left: none;
    border-right: 2px solid transparent;
}

html[dir="rtl"] .feature-item:hover {
    border-right-color: var(--accent-cyan);
}

.feature-num {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

html[dir="rtl"] .feature-num {
    right: auto;
    left: 1rem;
}

.feature-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.feature-body {
    flex: 1;
    min-width: 0;
}

.feature-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.feature-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* ── CTA Section ──────────────────────────────────────────── */

.landing-cta {
    position: relative;
    z-index: 1;
    padding: 0 1.5rem 5rem;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.landing-cta-inner {
    position: relative;
    text-align: center;
    padding: 3rem 2rem;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.cta-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 120%, rgba(37, 99, 235, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

.landing-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
    position: relative;
}

.landing-cta-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.75rem;
    line-height: 1.6;
    position: relative;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    position: relative;
}

/* ── Footer ───────────────────────────────────────────────── */

.landing-footer {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.landing-footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Shared ───────────────────────────────────────────────── */

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 0.95rem;
    min-height: 46px;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
    .landing-hero {
        grid-template-columns: 1fr;
        padding: 3.5rem 1.5rem 3rem;
        gap: 2.5rem;
    }

    .hero-content {
        align-items: center;
        text-align: center;
    }

    html[dir="rtl"] .hero-content {
        align-items: center;
    }

    .landing-hero-subtitle {
        max-width: 100%;
    }

    .landing-hero-actions {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .landing-nav {
        padding: 0.75rem 1rem;
    }

    .landing-nav-actions .btn-ghost:not(:last-child) {
        display: none;
    }

    .feature-list {
        grid-template-columns: 1fr;
    }

    .landing-cta-inner {
        padding: 2rem 1.25rem;
    }
}

/* ── Forms ──────────────────────────────────────────────────── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

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

.form-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.9rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    width: 100%;
    min-height: 48px;
}

.form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-inline-end: 2rem;
}

html[dir="rtl"] select.form-input {
    background-position: left 0.75rem center;
}

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--accent-cyan);
    color: #fff;
    border-color: var(--accent-cyan);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-cyan);
    box-shadow: 0 0 20px var(--accent-cyan-dim);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-glass);
}

.btn-ghost:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger-dim);
}

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

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ── Alerts ────────────────────────────────────────────────── */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid;
}

.alert-error {
    background: var(--danger-dim);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(46, 213, 115, 0.12);
    border-color: var(--success);
    color: var(--success);
}

/* ── Page Header ───────────────────────────────────────────── */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Tables ────────────────────────────────────────────────── */

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    text-align: start;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-glass);
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-row);
    vertical-align: middle;
}

.table-row-hover:hover {
    background: var(--bg-card-hover);
}

/* ── Mobile Card Layout (replaces tables on small screens) ── */

.mobile-cards {
    display: none;
}

.mobile-card {
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.mobile-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
}

.mobile-card-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.mobile-card-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    text-align: end;
    word-break: break-word;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass);
}

.mobile-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-cyan);
}

.mobile-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-glass);
}

.mobile-card-actions .btn {
    flex: 1;
}

/* ── Badges ────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.badge-admin {
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
}

.badge-manager {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.badge-special_user {
    background: rgba(255, 200, 50, 0.12);
    color: #ffc832;
}

.badge-worker {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* ── Info Card ─────────────────────────────────────────────── */

.info-card {
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
}

.info-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* ── Tabs ──────────────────────────────────────────────────── */

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

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

.tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}

.tab-content {
    min-height: 200px;
}

/* ── Section ───────────────────────────────────────────────── */

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* ── Summary Cards ─────────────────────────────────────────── */

.summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
    padding: 1rem;
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.35rem;
    font-weight: 700;
}

.accent-text {
    color: var(--accent-cyan);
}

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

/* ── Detail Cards ──────────────────────────────────────────── */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.detail-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.detail-dates {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

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

.detail-card-action {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-glass);
}

/* ── Filter Bar ────────────────────────────────────────────── */

.filter-bar {
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-form .form-group {
    flex: 1;
    min-width: 140px;
}

/* ── Month Selector ────────────────────────────────────────── */

.month-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.month-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.month-nav-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan-dim);
}

.month-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 160px;
    text-align: center;
}

/* ── Modals ────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 1rem;
}

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

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* ── Clock In/Out ──────────────────────────────────────────── */

.clock-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height) - 3rem);
    min-height: calc(100dvh - var(--navbar-height) - 3rem);
}

.clock-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: 0 1rem;
}

.clock-display {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.clock-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.clocked-in .status-dot {
    background: var(--accent-green);
}

.clock-info {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}

.clock-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.clock-btn-in {
    background: transparent;
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.clock-btn-in:hover,
.clock-btn-in:active {
    background: var(--accent-cyan-dim);
    box-shadow: 0 0 40px rgba(37, 99, 235, 0.25), inset 0 0 40px rgba(37, 99, 235, 0.05);
}

.clock-btn-out {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.clock-btn-out:hover,
.clock-btn-out:active {
    background: var(--danger-dim);
    box-shadow: 0 0 40px rgba(255, 71, 87, 0.3), inset 0 0 40px rgba(255, 71, 87, 0.05);
}

.clock-geo-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* ── Language Switcher ─────────────────────────────────────── */

.lang-switcher {
    display: flex;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 0.15rem;
}

.lang-btn {
    padding: 0.35rem 0.65rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    min-width: 36px;
    text-align: center;
}

.lang-btn.active {
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
}

.lang-btn:hover {
    color: var(--accent-cyan);
}

/* Theme toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.theme-icon {
    display: none;
}

.theme-icon-sun {
    display: block;
}

.theme-icon-moon {
    display: none;
}

html[data-theme="light"] .theme-icon-sun {
    display: none;
}

html[data-theme="light"] .theme-icon-moon {
    display: block;
}

/* ── Pagination ────────────────────────────────────────────── */

.pagination {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

.pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-prev.disabled,
.pagination-next.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

/* ── Empty State ───────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

/* ── Link Accent ───────────────────────────────────────────── */

.link-accent {
    color: var(--accent-cyan);
    font-weight: 500;
}

.link-accent:hover {
    text-decoration: underline;
}

/* ── Animations ────────────────────────────────────────────── */

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.pulse-glow {
    animation: pulseGlow 2.5s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
    }

    50% {
        box-shadow: 0 0 40px rgba(37, 99, 235, 0.3), 0 0 80px rgba(37, 99, 235, 0.1);
    }
}

/* ── Scrollbar ─────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── RTL Adjustments ───────────────────────────────────────── */

html[dir="rtl"] .sidebar-link.active {
    border-inline-start: 3px solid var(--accent-cyan);
    border-inline-end: none;
}

html[dir="rtl"] .action-btns {
    flex-direction: row-reverse;
}

/* ================================================================
   RESPONSIVE — Tablet (768px)
   ================================================================ */

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-inline-start: 0;
    }

    .bottom-tabs {
        display: flex;
    }

    .page-content {
        padding: 1rem 0.75rem;
        padding-bottom: calc(64px + 2.5rem + var(--safe-bottom));
    }

    .filter-row {
        justify-content: center;
        text-align: center;
    }

    .filter-bar.glass-card,
    .month-nav.glass-card {
        flex: 1 1 100% !important;
        justify-content: center !important;
    }

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

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-header .btn {
        width: 100%;
    }

    /* Tables become cards on mobile */
    .table-container .data-table {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

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

    .filter-form {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .filter-form .form-group {
        min-width: 0;
    }

    .filter-form .btn {
        width: 100%;
    }

    .summary-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        justify-items: center;
    }

    .summary-card {
        padding: 1rem 0.75rem;
        max-width: 260px;
    }

    .summary-value {
        font-size: 1.5rem;
    }

    .summary-label {
        font-size: 0.75rem;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .clock-page {
        min-height: calc(100dvh - var(--navbar-height) - var(--bottom-tabs-height) - var(--safe-bottom) - 2rem);
    }

    .clock-display {
        font-size: 2.75rem;
    }

    .clock-btn {
        width: 160px;
        height: 160px;
        font-size: 0.95rem;
    }

    .navbar-user {
        display: none;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
    }

    .glass-card {
        padding: 1rem;
    }

    /* Modals go full-width on mobile */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 1.5rem 1rem;
        padding-bottom: calc(1.5rem + var(--safe-bottom));
    }

    .modal-overlay.open .modal {
        transform: translateY(0);
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .btn {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        margin-inline: -0.75rem;
        padding-inline: 0.75rem;
    }

    .tab {
        padding: 0.7rem 1rem;
        font-size: 0.82rem;
    }

    .month-label {
        font-size: 0.95rem;
        min-width: 120px;
    }

    .empty-state {
        padding: 2rem 1rem;
    }
}

/* ================================================================
   RESPONSIVE — Small phone (380px)
   ================================================================ */

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

    .auth-card {
        padding: 1.25rem 1rem;
    }

    .auth-logo .logo-text {
        font-size: 2rem;
    }

    .clock-display {
        font-size: 2.25rem;
    }

    .clock-btn {
        width: 140px;
        height: 140px;
        font-size: 0.85rem;
    }
}

/* ================================================================
   VOICE COMMAND SYSTEM — Creative & Professional Redesign
   ================================================================ */

/* ── Trigger Types ─────────────────────────────────────────── */

/* 1. Sidebar Widget (Desktop) */
.sidebar-voice {
    margin: 1.25rem 0.75rem 0.5rem;
    padding: 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(37, 99, 235, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    width: calc(100% - 1.5rem);
    text-align: left;
}

.sidebar-voice:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(37, 99, 235, 0.18) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.sidebar-voice:active {
    transform: translateY(0);
}

/* 2. Floating Pill (Mobile) */
.voice-pill-mobile {
    position: fixed;
    bottom: calc(var(--bottom-tabs-height) + var(--safe-bottom) + 32px);
    left: 50%;
    transform: translateX(-50%);
    display: none;
    /* Desktop hidden */
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(37, 99, 235, 0.2);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 200;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    margin-right: 0.5rem;
}

[dir="rtl"] .btn-back {
    margin-right: 0;
    margin-left: 0.5rem;
    transform: scaleX(-1);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-1px);
}

[dir="rtl"] .btn-back:hover {
    transform: scaleX(-1) translateY(-1px);
}

.btn-back:active {
    transform: translateY(0) scale(0.95);
}

@media (max-width: 1024px) {
    .sidebar-voice {
        display: none;
    }

    .voice-pill-mobile {
        display: flex;
    }
}

/* ── Inner Components ─────────────────────────────────────────── */

.sv-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-voice:hover .sv-glow {
    opacity: 1;
}

.sv-icon,
.vp-icon {
    width: 38px;
    height: 38px;
    background: #6366f1;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
}

.vp-icon {
    width: 24px;
    height: 24px;
    background: transparent;
    box-shadow: none;
}

.sv-icon svg,
.vp-icon svg {
    width: 20px;
    height: 20px;
}

.sv-text {
    display: flex;
    flex-direction: column;
}

.sv-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sv-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sv-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 12px;
    margin-left: auto;
}

.sv-bar {
    width: 2px;
    height: 4px;
    background: #6366f1;
    border-radius: 1px;
}

/* ── States ─────────────────────────────────────────────────── */

/* Recording State */
.sidebar-voice.recording,
.voice-pill-mobile.recording {
    border-color: #ef4444;
}

.sidebar-voice.recording .sv-icon {
    background: #ef4444;
    animation: voice-pulse-red 1.5s ease-in-out infinite;
}

.sidebar-voice.recording .sv-bar {
    animation: voice-bar-grow 0.8s ease-in-out infinite alternate;
}

.sidebar-voice.recording .sv-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.sidebar-voice.recording .sv-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.sidebar-voice.recording .sv-bar:nth-child(4) {
    animation-delay: 0.1s;
}

.sidebar-voice.recording .sv-bar:nth-child(5) {
    animation-delay: 0s;
}

/* Processing State */
.sv-spinner {
    position: absolute;
    right: 12px;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    display: none;
    animation: voice-spin 0.6s linear infinite;
}

.sidebar-voice.processing .sv-spinner {
    display: block;
}

.sidebar-voice.processing .sv-bars {
    display: none;
}

@keyframes voice-pulse-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

@keyframes voice-bar-grow {
    to {
        height: 16px;
    }
}

@keyframes voice-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Modal Redesign ───────────────────────────────────────────── */

.voice-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.voice-modal {
    width: 90%;
    max-width: 440px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translatey(20px);
    transition: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.voice-modal-overlay.open .voice-modal {
    transform: scale(1) translatey(0);
}

.voice-modal-header {
    margin-bottom: 2rem;
    text-align: center;
}

.voice-modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.voice-modal-title svg {
    width: 20px;
    height: 20px;
    color: #6366f1;
}

.voice-modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-modal-close:hover {
    background: var(--border-glass);
    color: var(--text-primary);
}

/* Recording View */
.voice-listening {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.voice-mic-glow {
    width: 80px;
    height: 80px;
    background: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    animation: voice-pulse-blue 2s ease-in-out infinite;
    will-change: transform, box-shadow;
}

.voice-mic-glow svg {
    width: 32px;
    height: 32px;
}

@keyframes voice-pulse-blue {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px rgba(99, 102, 241, 0.7);
    }
}

.voice-wave-container {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-wave-canvas {
    width: 100%;
    height: 100%;
}

/* Result View */
.voice-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: result-fade-up 0.5s ease;
}

@keyframes result-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.voice-result-icon {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.is-success .voice-result-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.is-error .voice-result-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.voice-result-icon svg {
    width: 28px;
    height: 28px;
}

.voice-result-text {
    text-align: center;
}

.voice-msg-ar {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-arabic);
    direction: rtl;
}

.voice-msg-fr {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.voice-data-summary {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
}

.voice-stop-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}

.voice-stop-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    transform: translateY(-2px);
}

.voice-stop-btn svg {
    width: 16px;
    height: 16px;
}

.voice-dismiss-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, #6366f1, #2563eb);
    width: 100%;
    border-radius: 0 0 28px 28px;
    transform-origin: left;
}