/* ============================================
   LIQUID GLASS DESIGN - iOS 26 Style
   Modern, Futuristic, Mobile-Optimized
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.gsmos-ac-bait {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

:root {
    /* Futuristic Color Palette */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Glass Colors */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-bg-light: rgba(255, 255, 255, 0.15);
    --glass-bg-dark: rgba(0, 0, 0, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-border-light: rgba(255, 255, 255, 0.3);

    /* Text Colors - High Contrast */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-tertiary: rgba(255, 255, 255, 0.85);
    --text-dark: #0f172a;

    /* Background Gradients */
    --bg-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --bg-gradient-2: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-gradient-3: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --bg-gradient-4: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --bg-gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

    /* Theme-Aware Tokens (Dark = default) */
    --body-bg: linear-gradient(135deg, #0f1429 0%, #1e2544 25%, #252d4a 50%, #1a2240 75%, #0a0e1f 100%);
    --body-bg-solid: #0f1429;
    --body-overlay-1: rgba(99, 102, 241, 0.35);
    --body-overlay-2: rgba(139, 92, 246, 0.35);
    --body-overlay-3: rgba(6, 182, 212, 0.25);
    --surface-bg: rgba(255, 255, 255, 0.1);
    --surface-bg-hover: rgba(255, 255, 255, 0.15);
    --surface-bg-active: rgba(255, 255, 255, 0.2);
    --elevated-bg: rgba(15, 23, 42, 0.85);
    --elevated-bg-solid: #0f172a;
    --elevated-bg-hover: rgba(15, 23, 42, 0.98);
    --card-bg: #1e293b;
    --card-bg-hover: #334155;
    --input-bg: rgba(30, 41, 59, 0.7);
    --input-bg-focus: rgba(30, 41, 59, 0.9);
    --input-border: rgba(255, 255, 255, 0.2);
    --input-text: #ffffff;
    --border-color: rgba(255, 255, 255, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-lighter: rgba(255, 255, 255, 0.05);
    --divider: rgba(255, 255, 255, 0.1);
    --text-on-surface: #ffffff;
    --text-on-surface-secondary: rgba(255, 255, 255, 0.85);
    --text-on-surface-muted: rgba(255, 255, 255, 0.6);
    --text-on-surface-hint: rgba(255, 255, 255, 0.4);
    --text-inverse: #0f172a;
    --nav-bg: #0f172a;
    --nav-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --nav-border: rgba(255, 255, 255, 0.1);
    --modal-bg: #0f172a;
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --dropdown-bg: #0f172a;
    --dropdown-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    --dropdown-item-hover: rgba(99, 102, 241, 0.15);
    --tooltip-bg: rgba(15, 23, 42, 0.95);
    --badge-bg: rgba(255, 255, 255, 0.1);
    --badge-text: rgba(255, 255, 255, 0.85);
    --table-header-bg: rgba(255, 255, 255, 0.05);
    --table-row-hover: rgba(255, 255, 255, 0.05);
    --table-border: rgba(255, 255, 255, 0.08);
    --scrollbar-track: rgba(255, 255, 255, 0.05);
    --scrollbar-thumb: rgba(255, 255, 255, 0.15);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.25);
    --status-indicator-border: rgba(15, 23, 42, 0.9);
    --skeleton-base: rgba(255, 255, 255, 0.05);
    --skeleton-shine: rgba(255, 255, 255, 0.1);
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.3);
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.3);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.3);
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-border: rgba(59, 130, 246, 0.3);
    --primary-bg: rgba(99, 102, 241, 0.1);
    --primary-border: rgba(99, 102, 241, 0.3);
    --focus-ring: rgba(99, 102, 241, 0.3);
    --theme-color: #0f1429;
    --chart-grid: rgba(255, 255, 255, 0.05);
    --chart-text: rgba(255, 255, 255, 0.6);
    --chart-text-light: rgba(255, 255, 255, 0.4);

    /* Spacing (Compact for Mobile) */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
    --spacing-2xl: 2rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --secondary: #7c3aed;

    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-bg-light: rgba(255, 255, 255, 0.8);
    --glass-bg-dark: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(15, 23, 42, 0.12);
    --glass-border-light: rgba(15, 23, 42, 0.18);

    --text-primary: #1e293b;
    --text-secondary: #334155;
    --text-tertiary: #475569;
    --text-dark: #0f172a;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.18);

    --body-bg: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 25%, #dce3ed 50%, #e2e8f0 75%, #f0f4f8 100%);
    --body-bg-solid: #edf2f7;
    --body-overlay-1: rgba(99, 102, 241, 0.05);
    --body-overlay-2: rgba(139, 92, 246, 0.05);
    --body-overlay-3: rgba(6, 182, 212, 0.03);
    --surface-bg: rgba(255, 255, 255, 0.75);
    --surface-bg-hover: rgba(255, 255, 255, 0.88);
    --surface-bg-active: rgba(255, 255, 255, 0.96);
    --elevated-bg: rgba(255, 255, 255, 0.92);
    --elevated-bg-solid: #ffffff;
    --elevated-bg-hover: #ffffff;
    --card-bg: #ffffff;
    --card-bg-hover: #f8fafc;
    --input-bg: #ffffff;
    --input-bg-focus: #ffffff;
    --input-border: rgba(15, 23, 42, 0.18);
    --input-text: #1e293b;
    --border-color: rgba(15, 23, 42, 0.15);
    --border-light: rgba(15, 23, 42, 0.09);
    --border-lighter: rgba(15, 23, 42, 0.05);
    --divider: rgba(15, 23, 42, 0.1);
    --text-on-surface: #1e293b;
    --text-on-surface-secondary: #334155;
    --text-on-surface-muted: #64748b;
    --text-on-surface-hint: #94a3b8;
    --text-inverse: #ffffff;
    --nav-bg: #ffffff;
    --nav-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.05);
    --nav-border: rgba(15, 23, 42, 0.1);
    --modal-bg: #ffffff;
    --modal-overlay: rgba(15, 23, 42, 0.45);
    --dropdown-bg: #ffffff;
    --dropdown-shadow: 0 8px 32px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);
    --dropdown-item-hover: rgba(79, 70, 229, 0.08);
    --tooltip-bg: #1e293b;
    --badge-bg: rgba(15, 23, 42, 0.07);
    --badge-text: #475569;
    --table-header-bg: rgba(15, 23, 42, 0.04);
    --table-row-hover: rgba(15, 23, 42, 0.04);
    --table-border: rgba(15, 23, 42, 0.08);
    --scrollbar-track: rgba(15, 23, 42, 0.04);
    --scrollbar-thumb: rgba(15, 23, 42, 0.15);
    --scrollbar-thumb-hover: rgba(15, 23, 42, 0.25);
    --status-indicator-border: rgba(255, 255, 255, 0.9);
    --skeleton-base: rgba(15, 23, 42, 0.06);
    --skeleton-shine: rgba(15, 23, 42, 0.1);
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-border: rgba(16, 185, 129, 0.25);
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-border: rgba(245, 158, 11, 0.25);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-border: rgba(239, 68, 68, 0.25);
    --info-bg: rgba(59, 130, 246, 0.1);
    --info-border: rgba(59, 130, 246, 0.25);
    --primary-bg: rgba(79, 70, 229, 0.1);
    --primary-border: rgba(79, 70, 229, 0.25);
    --focus-ring: rgba(79, 70, 229, 0.3);
    --theme-color: #edf2f7;
    --chart-grid: rgba(15, 23, 42, 0.07);
    --chart-text: #64748b;
    --chart-text-light: #94a3b8;
}

/* Theme transition for smooth toggle */
html[data-theme] body,
html[data-theme] .navbar,
html[data-theme] .modal-content,
html[data-theme] .card,
html[data-theme] .search-results,
html[data-theme] .user-dropdown,
html[data-theme] .mobile-menu,
html[data-theme] .floating-navbar {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* ============================================
   THEME TOGGLE – SMARTPHONE
   ============================================ */
.gsmos-phone-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.gsmos-phone-toggle:hover {
}

.gsmos-phone-toggle:active {
}

.phone-body {
    position: relative;
    width: 24px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(160deg, #6366f1 0%, #4f46e5 40%, #7c3aed 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.gsmos-phone-toggle:hover .phone-body {
}

.phone-notch {
    position: absolute;
    top: 1.5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: rgba(0, 0, 0, 0.35);
    z-index: 3;
}

.phone-screen {
    position: relative;
    width: 18px;
    height: 26px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1px;
    transition: background 0.5s ease;
}

/* --- DARK MODE: night sky screen --- */
[data-theme="dark"] .phone-screen {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 60%, #312e81 100%);
}

/* --- LIGHT MODE: day sky screen --- */
[data-theme="light"] .phone-screen {
    background: linear-gradient(180deg, #38bdf8 0%, #7dd3fc 50%, #bae6fd 100%);
}

/* ---- Sun ---- */
.screen-sun {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, #fbbf24, #f59e0b);
    left: 50%;
    transform: translateX(-50%);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 2;
}

[data-theme="light"] .screen-sun {
    top: 5px;
    opacity: 1;
    box-shadow: 0 0 6px 2px rgba(251, 191, 36, 0.55), 0 0 12px 4px rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .screen-sun {
    top: 28px;
    opacity: 0;
    box-shadow: none;
}

/* sun rays pulse */
[data-theme="light"] .screen-sun::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

@keyframes gsmos-sun-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.35); opacity: 0; }
}

/* ---- Moon ---- */
.screen-moon {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 2;
}

[data-theme="dark"] .screen-moon {
    top: 5px;
    opacity: 1;
    background: radial-gradient(circle at 35% 35%, #e2e8f0, #cbd5e1);
    box-shadow: 0 0 5px 1px rgba(226, 232, 240, 0.4), 0 0 10px 3px rgba(226, 232, 240, 0.15);
}

[data-theme="light"] .screen-moon {
    top: -12px;
    opacity: 0;
    background: #e2e8f0;
    box-shadow: none;
}

/* moon shadow (crescent illusion) */
[data-theme="dark"] .screen-moon::after {
    content: '';
    position: absolute;
    width: 5.5px;
    height: 5.5px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
    top: -1px;
    right: -1.5px;
}

/* ---- Stars ---- */
.screen-star {
    position: absolute;
    width: 1.5px;
    height: 1.5px;
    border-radius: 50%;
    background: #e2e8f0;
    z-index: 1;
    transition: opacity 0.4s ease;
}

[data-theme="dark"] .screen-star {
    opacity: 1;
}

[data-theme="light"] .screen-star {
    opacity: 0;
}

@keyframes gsmos-twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

/* ---- Mobile variant (slightly smaller) ---- */
.gsmos-phone-toggle--mobile {
    margin-right: 4px;
}

.gsmos-phone-toggle--mobile .phone-body {
    width: 21px;
    height: 32px;
    border-radius: 5px;
}

.gsmos-phone-toggle--mobile .phone-screen {
    width: 15px;
    height: 22px;
    border-radius: 2.5px;
}

.gsmos-phone-toggle--mobile .phone-notch {
    width: 7px;
    height: 2px;
}

.gsmos-phone-toggle--mobile .screen-sun {
    width: 6px;
    height: 6px;
}

.gsmos-phone-toggle--mobile .screen-moon {
    width: 5.5px;
    height: 5.5px;
}

.gsmos-phone-toggle--mobile .screen-star {
    width: 1px;
    height: 1px;
}

/* Desktop toggle between brand and search */
.gsmos-phone-toggle--brand {
    margin: 0 8px;
    flex-shrink: 0;
}

/* ============================================
   BASE STYLES
   ============================================ */

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--body-bg);
    background-attachment: scroll;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw;
}

/* Prevent horizontal overflow on mobile */
html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

img, video, svg, canvas, iframe {
    max-width: 100%;
}

/* Mobile-specific overflow fixes */
@media (max-width: 768px) {

    body,
    html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative;
    }

    .main-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: var(--spacing-md);
        padding-top: var(--app-content-top, var(--spacing-md));
        box-sizing: border-box;
    }

    .navbar {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .assistant-container,
    .dashboard-grid,
    .settings-layout {
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }
}

/* Background Gradient - Static for performance (animation disabled) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, var(--body-overlay-1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--body-overlay-2) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, var(--body-overlay-3) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Background animation keyframes kept for reference but not used
@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
} */

/* ============================================
   NAVBAR - Liquid Glass
   ============================================ */

/* ============================================
   NAVBAR - FULLY RESPONSIVE (REWRITTEN)
   ============================================ */

.navbar {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--nav-shadow);
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.75rem;
    overflow-x: clip;
    overflow-y: visible;
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
    opacity: 0;
}

/* Ensure modals are always above everything */
.modal {
    z-index: 999999 !important;
}

/* Nested modals (opening over other modals) should have higher z-index */
.modal[style*="z-index: 9999999"],
.modal[style*="z-index: 99999999"],
.modal.modal-nested {
    z-index: 99999999 !important;
}

.modal-content {
    z-index: 999999 !important;
}

/* Nested modal content should also have higher z-index */
.modal[style*="z-index: 9999999"] .modal-content,
.modal[style*="z-index: 99999999"] .modal-content,
.modal.modal-nested .modal-content {
    z-index: 99999999 !important;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-light), transparent);
}

/* NAV CONTAINER - Flex container that MUST stay within bounds */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    gap: 0.5rem;
    box-sizing: border-box;
}

/* NAV BRAND - Can shrink */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    position: relative;
    flex: 0 1 auto;
    /* Can shrink */
    min-width: 32px;
    /* Minimum = just icon */
}

.nav-brand::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width var(--transition-base);
}

.nav-brand:hover::after {
    width: 100%;
}

.nav-brand i {
    font-size: 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0;
}

.nav-brand img {
    height: 28px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.nav-brand-text {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Version display under logo */
.nav-brand-logo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
}

.nav-brand-version {
    font-size: 0.5rem;
    font-weight: 300;
    color: var(--text-on-surface-hint);
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1;
    margin-top: 4px;
}

/* Mobile version - even smaller and thinner */
@media (max-width: 768px) {
    .nav-brand-version {
        font-size: 0.4rem;
        font-weight: 200;
        color: var(--text-on-surface-hint);
        margin-top: 2px;
        letter-spacing: 0;
    }

    .nav-brand-logo-wrapper {
        gap: 0;
    }
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Desktop navbar - brand visible */
.nav-brand-desktop {
    order: 1;
}

/* SEARCH CONTAINER - Flexible, takes available space */
.navbar-search-container {
    flex: 1 1 100px;
    /* Grow, shrink, basis */
    min-width: 60px;
    max-width: 300px;
    position: relative;
    order: 2;
}

.search-bar-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 0.375rem 0.5rem 0.375rem 1.75rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-full);
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 16px !important;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    outline: none;
    -webkit-text-size-adjust: 100% !important;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.search-input:focus {
    background: var(--input-bg-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
    color: var(--input-text);
}

.search-icon {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-base);
    font-size: 0.7rem;
}

.search-input:focus+.search-icon {
    color: var(--primary-light);
}

.search-results {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 95vw;
    max-width: 1200px;
    background: var(--dropdown-bg);
    border: 1px solid var(--glass-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--dropdown-shadow);
    max-height: 60vh;
    overflow-y: auto;
    z-index: 100000;
    display: none;
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--card-bg-hover);
    padding-left: var(--spacing-lg);
    color: var(--text-primary);
}

.search-result-item i {
    font-size: 1.1rem;
    color: var(--primary-light);
    width: 24px;
    flex-shrink: 0;
}

.search-result-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
    color: var(--text-primary);
}

.search-result-subtitle {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* —— Navbar global search (dropdown cu taburi segmentate + culori pe tip) —— */
/* IMPORTANT: nu seta display:aici — .search-results are display:none; display:flex din aici
   bătea .search-results și containerul gol (#searchResultsContainer) rămânea vizibil (linie gri). */
.search-results.navbar-search-dropdown {
    display: none;
}

.navbar-search-dropdown {
    max-height: min(70vh, 520px);
    padding: 0;
    overflow: hidden;
    flex-direction: column;
}

.navbar-search-dropdown .ns-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.navbar-search-dropdown .ns-tabs-wrap {
    flex-shrink: 0;
    padding: 0.55rem 0.65rem 0.5rem;
    background: var(--surface-bg, rgba(15, 23, 42, 0.55));
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.navbar-search-dropdown .ns-tabs {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    overflow: hidden;
    background: var(--input-bg, rgba(15, 23, 42, 0.85));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.navbar-search-dropdown .ns-tab {
    flex: 1 1 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0.5rem 0.4rem;
    min-height: 2.5rem;
    border: none;
    border-radius: 0;
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.navbar-search-dropdown .ns-tab:last-child {
    border-right: none;
}

.navbar-search-dropdown .ns-tab:hover:not(.ns-tab--active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.navbar-search-dropdown .ns-tab:active:not(.ns-tab--active) {
}

.navbar-search-dropdown .ns-tab--active {
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.28), rgba(99, 102, 241, 0.12));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(99, 102, 241, 0.25);
}

.navbar-search-dropdown .ns-tab:focus-visible {
    outline: 2px solid var(--primary, #6366f1);
    outline-offset: 2px;
    z-index: 1;
}

.navbar-search-dropdown .ns-tab-count {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 0.12rem 0.38rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: inherit;
    opacity: 0.95;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.navbar-search-dropdown .ns-tab--active .ns-tab-count {
    background: rgba(0, 0, 0, 0.35);
}

.navbar-search-dropdown .ns-tab:hover .ns-tab-count {
}

.navbar-search-dropdown .ns-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 0.35rem 0 0.5rem;
}

.navbar-search-dropdown .ns-group-label {
    padding: 0.45rem 0.95rem 0.15rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary, #94a3b8);
}

.navbar-search-dropdown .ns-more {
    display: grid;
    gap: 0.4rem;
    padding: 0.35rem 0.45rem 0.15rem;
}

.navbar-search-dropdown .ns-more-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-md, 10px);
    color: var(--primary-color, #6366f1);
    background: var(--surface-bg, rgba(99, 102, 241, 0.08));
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.navbar-search-dropdown .ns-more-link:hover {
    border-color: var(--primary-color, #6366f1);
    background: rgba(99, 102, 241, 0.14);
}

.navbar-search-dropdown .ns-item {
    position: relative;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin: 0 0.45rem 0.4rem;
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    border-left-width: 3px;
    background: var(--card-bg);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.navbar-search-dropdown .ns-item:hover {
}

.navbar-search-dropdown .ns-item--entry {
    border-left-color: #ea580c;
    background: linear-gradient(90deg, rgba(234, 88, 12, 0.1), var(--card-bg));
}

.navbar-search-dropdown .ns-item--entry:hover {
    border-color: rgba(234, 88, 12, 0.35);
}

.navbar-search-dropdown .ns-item--client {
    border-left-color: #6366f1;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), var(--card-bg));
}

.navbar-search-dropdown .ns-item--client:hover {
    border-color: rgba(99, 102, 241, 0.35);
}

.navbar-search-dropdown .ns-item--order {
    border-left-color: #0ea5e9;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.1), var(--card-bg));
}

.navbar-search-dropdown .ns-item--order:hover {
    border-color: rgba(14, 165, 233, 0.35);
}

/* Icon: fundal deschis + simbol închis = contrast ridicat */
.navbar-search-dropdown .ns-item-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.navbar-search-dropdown .ns-item:hover .ns-item-icon {
}

.navbar-search-dropdown .ns-item-icon i {
    color: inherit;
}

.navbar-search-dropdown .ns-item--entry .ns-item-icon {
    background: rgba(234, 88, 12, 0.16);
    color: #9a3412;
    box-shadow: inset 0 0 0 1.5px rgba(234, 88, 12, 0.45);
}

.navbar-search-dropdown .ns-item--client .ns-item-icon {
    background: rgba(99, 102, 241, 0.18);
    color: #3730a3;
    box-shadow: inset 0 0 0 1.5px rgba(99, 102, 241, 0.4);
}

.navbar-search-dropdown .ns-item--order .ns-item-icon {
    background: rgba(14, 165, 233, 0.18);
    color: #0c4a6e;
    box-shadow: inset 0 0 0 1.5px rgba(14, 165, 233, 0.42);
}

.navbar-search-dropdown .ns-item-text {
    flex: 1;
    min-width: 0;
}

.navbar-search-dropdown .ns-item > i {
    display: none;
}

.navbar-search-dropdown .ns-item-badge {
    flex-shrink: 0;
    align-self: center;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 7px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.navbar-search-dropdown .ns-item:hover .ns-item-badge {
}

.navbar-search-dropdown .ns-item--entry .ns-item-badge {
    background: linear-gradient(180deg, #ea580c, #c2410c);
    color: #fffbeb;
    border-color: rgba(154, 52, 18, 0.5);
}

.navbar-search-dropdown .ns-item--client .ns-item-badge {
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    color: #ffffff;
    border-color: rgba(49, 46, 129, 0.45);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.navbar-search-dropdown .ns-item--order .ns-item-badge {
    background: linear-gradient(180deg, #0ea5e9, #0284c7);
    color: #f0f9ff;
    border-color: rgba(12, 74, 110, 0.45);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.navbar-search-dropdown .ns-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-secondary);
}

.navbar-search-dropdown .ns-empty i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.55;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.navbar-search-dropdown .ns-empty:hover i {
    opacity: 0.75;
}

.navbar-search-dropdown .ns-empty p {
    margin: 0 0 0.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.navbar-search-dropdown .ns-empty span {
    font-size: 0.8rem;
    opacity: 0.85;
}

.navbar-search-dropdown .ns-empty--error i {
    color: #f87171;
    opacity: 0.9;
}

/* Numărătorile se încarcă async: în loc de "…" afișăm un mini-spinner animat */
.status-tabs-compact .chip-count--pending {
    min-width: 1.1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 0;
}

.status-tabs-compact .chip-count--pending::after {
    content: '';
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.35);
    border-top-color: var(--chip-color, var(--primary, #6366f1));
    animation: chip-count-spin 0.7s linear infinite;
}

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

.navbar-search-dropdown .ns-empty--loading i,
.live-search-loading-shell i {
    color: var(--primary, #6366f1);
    opacity: 1;
}

.live-search-loading-shell {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-secondary);
}

.live-search-loading-shell p {
    margin: 0.5rem 0 0;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.live-search-autocomplete-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.is-live-search-loading input,
input.is-live-search-loading {
    background-image: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.08), transparent);
    background-size: 200% 100%;
    animation: live-search-input-shimmer 1.2s ease-in-out infinite;
}

.is-live-search-grid-busy .entry-card {
    opacity: 0.55;
    pointer-events: none;
}

.live-search-grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(1px);
    border-radius: inherit;
}

@keyframes live-search-input-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (max-width: 480px) {
    .navbar-search-dropdown .ns-item-badge {
        display: none;
    }
    .navbar-search-dropdown .ns-tab {
        font-size: 0.65rem;
        padding: 0.45rem 0.25rem;
        min-height: 2.35rem;
    }
}

/* NAV MENU - Can shrink and hide items */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    gap: 0;
    order: 3;
    flex: 0 1 auto;
    /* Can shrink */
    min-width: 0;
}

/* Each nav item should be able to shrink */
.nav-menu>li {
    flex: 0 1 auto;
    min-width: 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.375rem;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    position: relative;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--surface-bg);
    border-radius: var(--radius-md);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.nav-link:hover::before,
.nav-link.active::before {
    opacity: 1;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.nav-link.active::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.nav-link.active i {
    color: var(--primary-light);
}

.nav-link i {
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ALWAYS hide nav text on desktop until we have enough space */
.nav-link span:not(.user-status-indicator):not(.nav-badge) {
    display: none;
}

/* Phones unprocessed orders badge (desktop: on Telefoane link) */
.nav-item-phones {
    position: relative;
}
.nav-badge.nav-badge-phones {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.5);
}
.nav-badge.nav-badge-phones.nav-badge-mobile {
    position: static;
    flex-shrink: 0;
    margin-right: 6px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 0.7rem;
}

/* Leads: leaduri noi — aceeași bulină roșie ca la telefoane / marketplace */
.nav-link.nav-link--badge {
    position: relative;
}
.nav-badge.nav-badge-leads {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    -webkit-text-fill-color: #fff;
    background: var(--danger, #ef4444);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.5);
}
.nav-link > .nav-badge.nav-badge-leads {
    position: absolute;
    top: -2px;
    right: -2px;
}

/* Marketplace: badge produse noi de la ultima vizită */
.nav-item-marketplace {
    position: relative;
}
.nav-link--locked,
.nav-link.nav-link--locked {
    opacity: 0.42;
    filter: grayscale(0.75);
    cursor: not-allowed;
    color: var(--text-secondary);
}
.nav-link--locked:hover,
.nav-link.nav-link--locked:hover,
.nav-link--locked:focus,
.nav-link.nav-link--locked.active {
    color: var(--text-secondary);
    background: transparent;
    box-shadow: none;
}
.nav-link--locked::before,
.nav-link--locked:hover::before,
.nav-link--locked.active::before {
    opacity: 0;
}
.nav-lock-icon {
    font-size: 0.68rem;
    margin-left: 0.15rem;
    opacity: 0.95;
    flex-shrink: 0;
}
.nav-badge.nav-badge-marketplace {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.5);
}

/* Unelte: badge oferte buy-back (identic cu nav-badge-phones) */
.nav-item-unelte {
    position: relative;
}
.nav-badge.nav-badge-buyback {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.5);
}
.nav-item-unelte-mobile {
    display: flex;
    align-items: center;
}
.nav-badge.nav-badge-buyback.nav-badge-mobile {
    position: static;
    flex-shrink: 0;
    margin-right: 6px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    font-size: 0.7rem;
}

/* ============================================
   NAVBAR DROPDOWN MENU
   ============================================ */

.nav-menu .dropdown {
    position: relative;
}

.nav-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.nav-menu .dropdown-toggle .dropdown-icon {
    font-size: 0.6rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    margin-left: 0.125rem;
}

.nav-menu .dropdown:hover .dropdown-icon,
.nav-menu .dropdown.active .dropdown-icon {
}

.nav-menu .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--dropdown-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--dropdown-shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10000;
    padding: 0.5rem;
    margin-top: 0.25rem;
    list-style: none;
}

/* Show dropdown when parent has .open class (controlled by JS) */
.nav-menu .dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-menu .dropdown-menu li {
    margin: 0;
}

.nav-menu .dropdown-menu .dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.nav-menu .dropdown-menu .dropdown-link:hover {
    background: var(--dropdown-item-hover);
    color: var(--text-primary);
}

.nav-menu .dropdown-menu .dropdown-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.nav-menu .dropdown-menu .dropdown-link:hover i {
    color: var(--primary-light);
}

/* User menu - fixed size */
.user-menu-item {
    flex: 0 0 auto;
    margin-left: 0.25rem;
}


/* ============================================
   USER MENU DROPDOWN
   ============================================ */

.user-menu-item {
    position: relative;
    margin-left: var(--spacing-sm);
}

.user-menu-wrapper {
    position: relative;
    z-index: 1;
}

.user-menu-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 1;
}

.user-menu-trigger:hover {
}

.user-menu-trigger:active {
}

.user-avatar {
    width: clamp(32px, 4vw, 40px);
    height: clamp(32px, 4vw, 40px);
    border-radius: var(--radius-full);
    background: var(--surface-bg-hover);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-md);
}

.user-avatar:hover {
    background: var(--surface-bg-active);
    border-color: var(--glass-border-light);
}

.user-avatar i {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 2px;
    box-sizing: border-box;
    border-radius: 50%;
}

.user-avatar--brand-profile .user-avatar-initials {
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.user-status-indicator {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid var(--status-indicator-border);
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Badge notificări necitite (înlocuiește bulina verde pe logo) */
.user-notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    border: 2px solid var(--status-indicator-border, var(--surface-bg, #0f172a));
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    pointer-events: none;
    z-index: 2;
}

.user-notif-badge[hidden] {
    display: none !important;
}

/* Chat-cloud reminder: iese din logo când sunt notificări necitite */
.user-notif-cloud {
    position: fixed;
    z-index: 10180;
    max-width: min(16.5rem, calc(100vw - 1.5rem));
    margin: 0;
    padding: 0.48rem 0.78rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.01em;
    text-align: left;
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 1.05rem;
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) scale(0.86);
    transform-origin: center left;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1.2, 0.36, 1), visibility 0.22s ease;
}

.user-notif-cloud--from-right {
    transform-origin: center right;
}

.user-notif-cloud--below {
    transform: translateY(-6px) scale(0.92);
    transform-origin: top right;
}

.user-notif-cloud.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.user-notif-cloud--below.is-visible {
    transform: translateY(0) scale(1);
}

.user-notif-cloud::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 11px;
    height: 11px;
    background: #ef4444;
    transform: translateY(-50%) rotate(45deg);
    box-shadow: -1px 1px 2px rgba(220, 38, 38, 0.18);
}

.user-notif-cloud--from-left::before {
    left: -4px;
    background: #ef4444;
}

.user-notif-cloud--from-right::before {
    right: -4px;
    background: #dc2626;
    box-shadow: 1px -1px 2px rgba(220, 38, 38, 0.18);
}

.user-notif-cloud--below::before {
    top: -4px;
    right: 14px;
    left: auto;
    transform: rotate(45deg);
    background: #ef4444;
    box-shadow: -1px -1px 2px rgba(220, 38, 38, 0.16);
}

.user-notif-cloud__text {
    display: block;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .user-notif-cloud {
        font-size: 0.68rem;
        padding: 0.42rem 0.65rem;
        max-width: min(12.5rem, calc(100vw - 4.5rem));
    }

    .user-notif-cloud__text {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .user-notif-cloud {
        transition: opacity 0.15s ease, visibility 0.15s ease;
        transform: translateY(-50%);
    }

    .user-notif-cloud.is-visible {
        transform: translateY(-50%);
    }

    .user-notif-cloud--below,
    .user-notif-cloud--below.is-visible {
        transform: none;
    }
}

.user-dropdown-notifications {
    padding: 0.35rem 0.55rem 0.5rem;
    max-height: 14rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.user-dropdown-notifications__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.2rem;
}

.user-dropdown-notifications__title {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-on-surface-hint, rgba(255, 255, 255, 0.45));
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.user-dropdown-notifications__clear {
    border: none;
    background: transparent;
    color: var(--text-on-surface-muted, rgba(255, 255, 255, 0.55));
    font-size: 0.68rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
    opacity: 0.75;
    transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}

.user-dropdown-notifications__clear:hover {
    opacity: 1;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.user-dropdown-notifications__list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 11.5rem;
    margin: 0 -0.15rem;
    padding: 0 0.15rem;
}

.user-dropdown-notifications__empty {
    padding: 0.65rem 0.4rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-on-surface-hint, rgba(255, 255, 255, 0.4));
}

.user-dropdown-notification {
    display: block;
    padding: 0.45rem 0.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: background 0.12s ease, border-color 0.12s ease;
    cursor: pointer;
}

a.user-dropdown-notification:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.08);
}

.user-dropdown-notification.is-unseen {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
}

.user-dropdown-notification__title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-on-surface, #fff);
    line-height: 1.25;
    margin-bottom: 0.1rem;
}

.user-dropdown-notification__body {
    font-size: 0.7rem;
    color: var(--text-on-surface-muted, rgba(255, 255, 255, 0.65));
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.user-dropdown-notification__time {
    margin-top: 0.2rem;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-on-surface-hint, rgba(255, 255, 255, 0.4));
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    }

    50% {
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.8);
    }
}

.user-dropdown {
    position: fixed !important;
    top: 0 !important;
    left: auto !important;
    right: 0 !important;
    min-width: 240px;
    background: var(--dropdown-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--dropdown-shadow) !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 100000 !important;
    overflow: hidden;
    pointer-events: none;
    isolation: isolate;
}

.user-dropdown.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    display: block !important;
}

.user-dropdown.user-dropdown--open-up {
    transform-origin: bottom left;
}

.user-dropdown.user-dropdown--open-up.active {
    transform: translateY(0) scale(1) !important;
}


.user-dropdown-header {
    padding: var(--spacing-lg);
    background: var(--table-header-bg);
    border-bottom: 1px solid var(--border-light);
}

.user-dropdown-header-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    min-height: 40px;
}

.user-dropdown-logo {
    height: 40px;
    width: auto;
    max-width: calc(100% - 40px);
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.user-dropdown-theme-btn.gsmos-phone-toggle {
    margin: 0;
    margin-left: auto;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--divider);
    margin: var(--spacing-xs) 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.user-dropdown-item:hover {
    background: var(--dropdown-item-hover);
    color: var(--text-primary);
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.nav-store-switch-avatar {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--primary) 18%, var(--surface-bg, rgba(127, 127, 127, 0.12)));
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.nav-store-switch-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-store-switch-avatar__initial {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown-item .nav-store-switch-avatar,
.user-dropdown-item--store-switch > .nav-store-switch-avatar {
    width: 20px;
    height: 20px;
}

.mobile-menu-link .nav-store-switch-avatar,
.mobile-menu-link--store-switch > .nav-store-switch-avatar {
    width: 24px;
    height: 24px;
}

.user-dropdown-item-danger {
    color: var(--danger);
}

.user-dropdown-item-danger:hover {
    background: var(--danger-bg);
    color: #f87171;
}

.user-dropdown-theme-item .user-dropdown-theme-thumb.gsmos-phone-toggle {
    margin: 0;
    padding: 2px;
    border: none;
    background: none;
    cursor: inherit;
}

.user-dropdown-theme-item .user-dropdown-theme-thumb {
    flex-shrink: 0;
}

.mobile-menu-theme-item .mobile-menu-theme-thumb.gsmos-phone-toggle {
    margin: 0;
    padding: 2px;
    border: none;
    background: none;
    cursor: inherit;
}

.mobile-menu-theme-item .mobile-menu-theme-thumb {
    flex-shrink: 0;
}

/* Mobile adjustments for user menu */
@media (max-width: 768px) {
    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .user-avatar i {
        font-size: 1rem;
    }

    .user-status-indicator {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }

    .user-notif-badge {
        min-width: 0.95rem;
        height: 0.95rem;
        font-size: 0.52rem;
        border-width: 1.5px;
    }

    .user-dropdown {
        min-width: 200px;
        right: -10px;
    }

    .user-dropdown-header {
        padding: var(--spacing-md);
    }

    .user-dropdown-item {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.85rem;
    }
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
    padding-top: var(--app-content-top, calc(var(--spacing-lg) + 60px));
    box-sizing: border-box;
}

/* Dashboard: spațiu sub navbar/topbar măsurat — o singură dată, fără safe-area dublată */
body:has(.dashboard) .main-content {
    padding: var(--spacing-sm) var(--spacing-lg);
    padding-top: var(--app-content-top, calc(var(--app-safe-top, env(safe-area-inset-top, 0px)) + 4.5rem));
}

/* Dashboard pe desktop: umple lățimea ferestrei (ca la nav-sidebar) */
@media (min-width: 1280px) {
    body:has(.dashboard) .main-content {
        max-width: none;
        width: 100%;
    }

    html.nav-sidebar body:has(.dashboard) .main-content {
        width: calc(100% - var(--sidebar-w, 240px));
        max-width: calc(100% - var(--sidebar-w, 240px));
    }
}

/* Ensure modals are not affected by parent stacking contexts */
.modal {
    position: fixed !important;
    z-index: 999999 !important;
    isolation: isolate !important;
}

/* Force modals to be above everything, including navbar */
body>.modal,
body .modal {
    position: fixed !important;
    z-index: 999999 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .main-content {
        padding: var(--spacing-md);
        padding-top: var(--app-content-top, var(--spacing-md));
    }
}

/* ============================================
   CARDS - flat, low-cost surfaces
   ============================================ */

.card-3d,
.entry-card,
.client-card,
.phone-card,
.status-item,
.settings-card {
    background: var(--card-bg);
    /* Reduced blur for better performance when many cards */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.card-3d::before,
.entry-card::before,
.client-card::before,
.phone-card::before {
    content: none;
    display: none;
}

.card-3d:hover,
.entry-card:hover,
.client-card:hover,
.phone-card:hover,
.settings-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--glass-border-light);
}

.entry-card,
.client-card,
.phone-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.entry-header,
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

/* Standard badge style for all entry badges */
.entry-badge-standard,
.entry-badge-standard.entry-code,
.entry-badge-standard.entry-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    padding: 0.375rem 0.625rem !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: white !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease !important;
}

.entry-badge-standard i {
    font-size: 0.7rem !important;
    line-height: 1 !important;
}

/* Badge mic (doar iconiță) — notificări push active pe linkul public */
.entry-badge-standard.entry-push-badge {
    padding: 0.375rem 0.45rem !important;
}

/* Badge discret piese comandate pe card (detalii în title) */
.entry-badge-standard.entry-ordered-parts-badge {
    padding: 0.375rem 0.45rem !important;
    gap: 0.25rem !important;
}
.entry-badge-standard.entry-ordered-parts-badge .entry-ordered-parts-count {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}
.entry-badge-standard.entry-discount-badge {
    background: linear-gradient(135deg, #db2777, #be185d) !important;
}

.entry-code {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    padding: 0.375rem 0.625rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    color: white !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease !important;
}

@keyframes codeGlow {

    0%,
    100% {
        box-shadow: var(--shadow-sm);
    }

    50% {
        box-shadow: var(--shadow-sm), 0 0 15px rgba(99, 102, 241, 0.5);
    }
}

.entry-status,
.client-status {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    padding: 0.375rem 0.625rem !important;
    border-radius: 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: white !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease !important;
}

.entry-body,
.client-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.entry-info,
.client-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-sm);
    font-size: 0.875rem;
}

.entry-info p,
.client-info p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: var(--elevated-bg);
    font-weight: 500;
}

.entry-info strong,
.client-info strong {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Part Choice Cards */
.part-choice-card {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.part-choice-card:hover {
    border-color: var(--glass-border-light) !important;
}

.part-choice-card:active {
}

.entry-actions,
.client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    justify-content: center;
    align-items: center;
}


/* Mobile: Transform buttons into icon-only squares, 4 per row, centered */
/* Styles moved to end of mobile media query (line 2164) to override column layout */

/* ==================== STATUS PROGRESS BAR - BALANCED ==================== */
.status-progress-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0;
    margin: 0.4rem 0;
    border-top: 1px solid var(--border-light);
}

/* Pe carduri: butonul cu lățime fixă rămâne centrat */
.status-progress-container > .btn-advance-status:not(.btn-preda-client):not(.btn-warranty-return):not(.btn-buy-from-client) {
    align-self: center;
}

.status-progress-container > .status-card-actions-row {
    align-self: center;
}

/* Progress bar row with steps */
.status-progress-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    margin-bottom: 0.5rem;
}

/* Room for "time in status" above current bullet (entries only) */
.status-progress-bar:has(.status-progress-duration) {
    padding-top: 0.85rem;
}

/* Connecting line */
.status-progress-bar::before {
    content: '';
    position: absolute;
    top: 9px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--glass-border);
    z-index: 0;
}

.status-progress-bar:has(.status-progress-duration)::before {
    top: calc(0.85rem + 9px);
}

.status-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 55px;
}

/* Minutes/hours above bullet — current (live) or completed (+ check) */
.status-progress-duration {
    position: absolute;
    top: -0.85rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
}

.status-progress-step.current .status-progress-duration {
    color: var(--primary, #6366f1);
}

.status-progress-duration--done {
    color: #10b981;
}

.status-progress-duration--done .fa-check {
    font-size: 0.52rem;
    color: #10b981;
}

.status-progress-bullet {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bg-secondary, #1a1a2e);
    border: 2px solid var(--glass-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    margin-bottom: 0.25rem;
}

.status-progress-step.completed .status-progress-bullet {
    background: #10b981;
    border-color: #10b981;
}

.status-progress-step.current .status-progress-bullet {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.status-progress-step.future .status-progress-bullet {
    background: var(--border-lighter);
    border-color: var(--glass-border);
}

.status-progress-step.status-step-clickable {
    cursor: pointer;
}

.status-progress-step.status-step-clickable:not(.status-step-revertible):hover .status-progress-bullet {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
}

.status-progress-step.status-step-clickable:not(.status-step-revertible):hover .status-progress-label {
    color: var(--text-tertiary);
}

.status-progress-step.status-step-revertible {
    cursor: pointer;
}

.status-progress-step.status-step-revertible:hover .status-progress-bullet {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35);
    filter: brightness(1.08);
}

.status-progress-step.status-step-revertible:hover .status-progress-label {
    color: #f59e0b;
}

.status-progress-label {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-on-surface-hint);
    text-align: center;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.status-progress-step.completed .status-progress-label {
    color: #10b981;
}

.status-progress-step.current .status-progress-label {
    color: #60a5fa;
    font-weight: 700;
}

/* Advance Status Button - Clear and actionable with status badges */
.btn-advance-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem;
    background: var(--border-lighter);
    border: 2px solid var(--glass-border-light);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

/* Lățime egală indiferent de statusul următor */
.btn-advance-status:not(.btn-preda-client):not(.btn-warranty-return):not(.btn-buy-from-client) {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
}

.btn-advance-status:hover {
    background: color-mix(in srgb, var(--primary, #6366f1) 18%, var(--surface-bg, #1e293b));
    border-color: color-mix(in srgb, var(--primary, #6366f1) 55%, var(--glass-border-light));
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
    transform: translateY(-1px);
}

.btn-advance-status:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.18);
}

.advance-status-label {
    flex: 0 0 auto;
    color: var(--text-primary, #e2e8f0);
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.advance-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.18s ease, transform 0.15s ease, filter 0.18s ease;
}

.btn-advance-status:not(.btn-preda-client):not(.btn-warranty-return):not(.btn-buy-from-client) .advance-status-badge.advance-status-next {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advance-status-arrow {
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    flex-shrink: 0;
    transition: color 0.18s ease, transform 0.18s ease;
}

.btn-advance-status:hover .advance-status-arrow {
    color: var(--primary, #6366f1);
    transform: translateX(2px);
}

.btn-advance-status:hover .advance-status-badge {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
    filter: brightness(1.08);
}

.btn-advance-status:disabled {
    background: linear-gradient(135deg, #4b5563, #6b7280);
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* "Predă Client" button shown on abandoned repair cards (instead of progress bar) */
.btn-advance-status.btn-preda-client {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border-color: rgba(13, 148, 136, 0.5);
    color: #ffffff;
}

.btn-advance-status.btn-preda-client:hover {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border-color: rgba(13, 148, 136, 0.7);
    color: #ffffff;
}

.btn-advance-status.btn-preda-client i {
    font-size: 0.85rem;
}

/* "Întoarcere în garanție" on Predat Finalizat cards */
.btn-advance-status.btn-warranty-return {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: rgba(217, 119, 6, 0.5);
    color: #ffffff;
}

.btn-advance-status.btn-warranty-return:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    border-color: rgba(217, 119, 6, 0.7);
    color: #ffffff;
}

.btn-advance-status.btn-warranty-return i {
    font-size: 0.85rem;
}

/* "Cumpără de la client" pe cardurile Predat Finalizat / Eșuat / Abandonat */
.btn-advance-status.btn-buy-from-client {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-color: rgba(109, 40, 217, 0.5);
    color: #ffffff;
}

.btn-advance-status.btn-buy-from-client:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    border-color: rgba(109, 40, 217, 0.7);
    color: #ffffff;
}

.btn-advance-status.btn-buy-from-client i {
    font-size: 0.85rem;
}

/* Detalii reparație — acțiuni footer (abandon etc.) */
.entry-details-footer-action {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.entry-details-footer-action--center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    text-align: center;
}

.entry-details-footer-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.65rem;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
}

.entry-details-footer-buttons .btn-entry-footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: 0.7rem 0.55rem;
    border-radius: var(--radius-md);
    font-size: clamp(0.72rem, 2.8vw, 0.8125rem);
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.entry-details-footer-buttons .btn-entry-footer span {
    flex: 0 1 auto;
    min-width: 0;
}

/* Un singur buton — centrat, lățime rezonabilă */
.entry-details-footer-buttons:has(> :only-child) {
    grid-template-columns: minmax(0, 22rem);
    justify-content: center;
}

/* 3 butoane (rar): 2+1 pe același footer */
.entry-details-footer-buttons:has(> :nth-child(3):last-child) > :nth-child(3) {
    grid-column: 1 / -1;
    max-width: 22rem;
    justify-self: center;
    width: 100%;
}

/* ============================================
   Phone details — fixed modal footer actions
   ============================================ */
#phoneDetailsModal .phone-details-modal-shell {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

#phoneDetailsModal #phoneDetailsContent.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto !important;
}

#phoneDetailsModal .phone-details-actions {
    flex: 0 0 auto;
    position: relative;
    z-index: 6;
    width: 100%;
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: var(--form-surface-header, rgba(15, 23, 42, 0.96));
    border-radius: 0 0 24px 24px;
    box-sizing: border-box;
}

#phoneDetailsModal .phone-details-actions[hidden] {
    display: none !important;
}

#phoneDetailsModal .phone-details-actions .pda-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

#phoneDetailsModal .phone-details-actions .pda-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
}

#phoneDetailsModal .phone-details-actions .pda-group--primary,
#phoneDetailsModal .phone-details-actions .pda-group--manage {
    margin: 0;
    justify-content: center;
}

#phoneDetailsModal .phone-details-actions .pda-sep {
    width: 1px;
    align-self: stretch;
    min-height: 1.6rem;
    background: rgba(148, 163, 184, 0.28);
    flex: 0 0 1px;
}

#phoneDetailsModal .phone-details-actions .pda-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.15rem;
    padding: 0.4rem 0.75rem;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
    flex: 0 0 auto;
    min-width: 0;
}

#phoneDetailsModal .phone-details-actions .pda-btn i {
    font-size: 0.78rem;
    opacity: 0.95;
    flex-shrink: 0;
}

#phoneDetailsModal .phone-details-actions .pda-btn:hover {
    transform: translateY(-1px);
}

#phoneDetailsModal .phone-details-actions .pda-btn:active {
    transform: translateY(0);
}

#phoneDetailsModal .phone-details-actions .pda-btn--sell {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.55);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28);
}

#phoneDetailsModal .phone-details-actions .pda-btn--sell:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

#phoneDetailsModal .phone-details-actions .pda-btn--doc {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

#phoneDetailsModal .phone-details-actions .pda-btn--doc:hover {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(59, 130, 246, 0.5);
}

#phoneDetailsModal .phone-details-actions .pda-btn--ops {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

#phoneDetailsModal .phone-details-actions .pda-btn--ops:hover {
    background: rgba(245, 158, 11, 0.28);
}

#phoneDetailsModal .phone-details-actions .pda-btn--warn {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.35);
    color: #cbd5e1;
}

#phoneDetailsModal .phone-details-actions .pda-btn--warn:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

#phoneDetailsModal .phone-details-actions .pda-btn--edit {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
}

#phoneDetailsModal .phone-details-actions .pda-btn--edit:hover {
    background: rgba(99, 102, 241, 0.3);
}

#phoneDetailsModal .phone-details-actions .pda-btn--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

#phoneDetailsModal .phone-details-actions .pda-btn--danger:hover {
    background: rgba(239, 68, 68, 0.24);
    border-color: rgba(239, 68, 68, 0.55);
    color: #fecaca;
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions {
    background: var(--form-surface-header, #f8fafc);
    border-top-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions .pda-btn--doc {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.28);
    color: #2563eb;
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions .pda-btn--ops {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
    color: #b45309;
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions .pda-btn--warn {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.28);
    color: #475569;
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions .pda-btn--warn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions .pda-btn--edit {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: #4f46e5;
}

[data-theme="light"] #phoneDetailsModal .phone-details-actions .pda-btn--danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

@media (max-width: 640px) {
    #phoneDetailsModal .phone-details-actions {
        padding: 0.55rem 0.65rem;
        border-radius: 0 0 16px 16px;
    }

    #phoneDetailsModal .phone-details-actions .pda-inner {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
        justify-content: center;
        justify-items: stretch;
        gap: 0.35rem;
    }

    #phoneDetailsModal .phone-details-actions .pda-sep {
        display: none;
    }

    #phoneDetailsModal .phone-details-actions .pda-group {
        display: contents;
    }

    #phoneDetailsModal .phone-details-actions .pda-btn {
        width: 100%;
        min-height: 2.35rem;
        padding: 0.45rem 0.5rem;
        font-size: 0.75rem;
    }

    #phoneDetailsModal .phone-details-actions .pda-btn--sell {
        grid-column: 1 / -1;
        min-height: 2.5rem;
        font-size: 0.85rem;
    }
}

.btn-entry-warranty-return {
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.32) 0%, rgba(217, 119, 6, 0.42) 100%);
    color: #fffbeb;
}

.btn-entry-warranty-return i {
    font-size: 1rem;
    color: #fcd34d;
}

.btn-entry-warranty-return:hover {
    border-color: rgba(251, 191, 36, 0.65);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.48) 0%, rgba(180, 83, 9, 0.55) 100%);
}

.btn-entry-warranty-return:active {
}

[data-theme="light"] .btn-entry-warranty-return {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #b45309;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .btn-entry-warranty-return i {
    color: #d97706;
}

[data-theme="light"] .btn-entry-warranty-return:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.btn-entry-add-transaction {
    border: 1px solid rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28) 0%, rgba(5, 150, 105, 0.38) 100%);
    color: #ecfdf5;
}

.btn-entry-transaction-done {
    flex-direction: column;
    gap: 0.35rem;
    border: 1px solid rgba(14, 165, 233, 0.45);
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(2, 132, 199, 0.28) 100%);
    color: #e0f2fe;
    cursor: default;
    pointer-events: none;
}

.btn-entry-transaction-done i {
    font-size: 1.1rem;
    color: #38bdf8;
}

.btn-entry-transaction-done__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 0;
}

.btn-entry-transaction-done__main {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
}

.btn-entry-transaction-done__sub {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.25;
    opacity: 0.9;
    color: #bae6fd;
}

[data-theme="light"] .btn-entry-transaction-done {
    border-color: #7dd3fc;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0369a1;
}

[data-theme="light"] .btn-entry-transaction-done i {
    color: #0284c7;
}

[data-theme="light"] .btn-entry-transaction-done__sub {
    color: #0c4a6e;
}

.btn-entry-add-transaction i {
    font-size: 1rem;
    color: #6ee7b7;
}

.btn-entry-add-transaction:hover {
    border-color: rgba(52, 211, 153, 0.65);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.45) 0%, rgba(4, 120, 87, 0.55) 100%);
}

.btn-entry-add-transaction:active {
}

[data-theme="light"] .btn-entry-add-transaction {
    border-color: #6ee7b7;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.12);
}

[data-theme="light"] .btn-entry-add-transaction i {
    color: #059669;
}

[data-theme="light"] .btn-entry-add-transaction:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #34d399;
}

.btn-entry-mark-abandoned {
    border: 1px solid rgba(100, 116, 139, 0.45);
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.35) 0%, rgba(30, 41, 59, 0.5) 100%);
    color: var(--text-primary);
}

.btn-entry-mark-abandoned i {
    font-size: 1rem;
    color: #94a3b8;
    transition: color var(--transition-base);
}

.btn-entry-mark-abandoned:hover {
    border-color: rgba(239, 68, 68, 0.5);
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.35) 0%, rgba(69, 10, 10, 0.45) 100%);
    color: #fecaca;
}

.btn-entry-mark-abandoned:hover i {
    color: #f87171;
}

.btn-entry-mark-abandoned:active {
}

.entry-details-abandon-hint {
    margin: 0;
    max-width: 32rem;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-on-surface-muted);
    opacity: 0.85;
}

[data-theme="light"] .btn-entry-mark-abandoned {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #334155;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .btn-entry-mark-abandoned i {
    color: #64748b;
}

[data-theme="light"] .btn-entry-mark-abandoned:hover {
    border-color: #f87171;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
}

[data-theme="light"] .btn-entry-mark-abandoned:hover i {
    color: #dc2626;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .status-progress-step {
        max-width: 45px;
    }

    .status-progress-bullet {
        width: 16px;
        height: 16px;
    }

    .status-progress-step.current .status-progress-bullet {
        width: 20px;
        height: 20px;
    }

    .status-progress-label {
        font-size: 0.5rem;
    }

    .btn-advance-status {
        padding: 0.4rem;
        gap: 0.375rem;
    }

    .advance-status-badge {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }

    .advance-status-arrow {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .status-progress-label {
        font-size: 0.45rem;
    }

    .advance-status-badge {
        padding: 0.25rem 0.4rem;
        font-size: 0.65rem;
    }

    .advance-status-arrow {
        font-size: 0.7rem;
    }
}
/* ==================== END STATUS PROGRESS BAR ==================== */

/* ============================================
   BUTTONS - Modern & Animated
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn:hover::before {
    opacity: 1;
}

.btn:active {
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-info,
.btn-warning,
.btn-primary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-info:hover,
.btn-warning:hover,
.btn-primary:focus,
.btn-success:focus,
.btn-danger:focus,
.btn-info:focus,
.btn-warning:focus {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.btn-primary i,
.btn-success i,
.btn-danger i,
.btn-info i,
.btn-warning i {
    color: #ffffff !important;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

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

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.btn-success.active {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), var(--shadow-md);
    transform: scale(0.98);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.btn-danger.active {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), var(--shadow-md);
    transform: scale(0.98);
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #2563eb);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

/* ============================================
   MODALS - Glass Effect
   ============================================ */

.modal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--modal-overlay);
    /* Reduced blur for better performance */
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    animation: fadeIn var(--transition-base);
    overflow: hidden !important;
    /* Prevent modal backdrop from scrolling */
    overscroll-behavior: contain;
    /* Prevent scroll chaining */
    /* Performance optimizations */
    contain: layout style paint;
}

.modal.active,
.modal[style*="display: flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Dispozitive: editare deasupra detaliilor (ambele .modal aveau 999999; #phoneDetailsModal e mai târziu în DOM). Sub modalele la 9999999 (ex. specificații). */
#editPhoneModal.modal,
#editPhoneModal.qrw-modal {
    z-index: 1000100 !important;
}

@media (max-width: 768px) {
    .modal {
        padding: var(--spacing-md);
        align-items: center;
        justify-content: center;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--modal-bg);
    /* Reduced blur for better performance */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: calc(90vh - 100px);
    min-height: 400px;
    /* Ensure minimum height */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn var(--transition-bounce);
    position: relative;
    margin: auto;
    z-index: 999999 !important;
    color: var(--text-primary);
    /* Performance optimizations */
/* Force GPU acceleration */
    contain: layout style paint;
    /* CSS containment for performance - without size */
    isolation: isolate;
    /* Create new stacking context */
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: calc(100vh - 60px);
        min-height: 300px;
        /* Ensure minimum height on mobile */
        margin: auto;
        margin-top: 30px;
        margin-bottom: 30px;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;

    }

    to {
        opacity: 1;

    }
}

.bulk-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.bulk-preview-table th {
    background: var(--table-header-bg);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.bulk-preview-table td {
    vertical-align: top;
}

.bulk-preview-table tr:hover {
    background: var(--table-row-hover);
}

.modal-large {
    max-width: 800px;
    width: 100%;
}

.modal-wide {
    max-width: 700px;
    width: 100%;
}

@media (min-width: 768px) {
    .modal-wide {
        max-width: 800px;
    }
}

@media (min-width: 1024px) {
    .modal-wide {
        max-width: 900px;
    }
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.close,
.close-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-weight: 600;
}

.close:hover,
.close-btn:hover {
    background: var(--glass-bg-light);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    /* Critical performance optimizations for fast scrolling */
/* Force GPU acceleration - creates new layer */
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    overscroll-behavior: contain;
    /* Prevent scroll chaining */
    /* Use layout style paint without size to allow proper height calculation */
    contain: layout style paint;
    /* Disable smooth scroll for instant response */
    scroll-behavior: auto;
    /* Reduce repaints during scroll */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Optimize compositing */
    isolation: isolate;
    /* Force hardware acceleration */
    perspective: 1000px;
    -webkit-perspective: 1000px;
    /* Ensure proper height calculation */
    min-height: 0;
    height: auto;
    /* Optimize scrollbar rendering */
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Optimize scrollbar for WebKit browsers */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
    /* Optimize scrollbar rendering */
transition: opacity 0.2s;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Optimize detail sections for better scroll performance */
.detail-section {
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 200px;
    /* Force GPU layer - critical for fast scrolling */
/* Prevent expensive repaints */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Optimize rendering */
    isolation: isolate;
    /* Prevent layout thrashing */
    position: relative;
}

.entry-observations-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem}
.entry-observation-section{padding:.85rem;border-radius:12px}
.entry-observation-section--internal{background:linear-gradient(135deg,rgba(245,158,11,.15),rgba(217,119,6,.1));border:1px solid rgba(245,158,11,.3)}
.entry-observation-section--public{background:linear-gradient(135deg,rgba(14,165,233,.14),rgba(59,130,246,.08));border:1px solid rgba(14,165,233,.3)}
.entry-observation-section h3{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:0 0 .55rem;font-size:.95rem}
.entry-observation-section h3 span{display:flex;align-items:center;gap:.4rem}
.entry-observation-section>small{display:block;margin-top:.4rem;color:var(--text-on-surface-muted);font-size:.72rem}
.entry-observation-add{width:30px;height:30px;border:0;border-radius:8px;background:var(--primary,#6366f1);color:#fff;cursor:pointer}
.entry-observation-list{display:flex;flex-direction:column;gap:.45rem;max-height:260px;overflow:auto}
.entry-observation-item{padding:.55rem .65rem;border:1px solid var(--border-light);border-radius:8px;background:var(--surface-bg)}
.entry-observation-item p{margin:0;color:var(--text-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:.84rem;line-height:1.4}
.entry-observation-foot{display:flex;align-items:flex-start;justify-content:space-between;gap:.45rem;margin-top:.35rem}
.entry-observation-meta{display:flex;flex-wrap:wrap;gap:.3rem .7rem;margin-top:0;flex:1;color:var(--text-on-surface-muted);font-size:.68rem}
.entry-observation-origin{font-weight:700}
.entry-observation-origin--order{color:#f59e0b}
.entry-observation-origin--repair{color:#38bdf8}
.entry-observation-actions{display:flex;gap:.25rem;flex-shrink:0}
.entry-observation-action{width:28px;height:28px;border:1px solid var(--border-light);border-radius:7px;background:transparent;color:var(--text-on-surface-muted);cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.entry-observation-action:hover{color:var(--text-primary);background:rgba(148,163,184,.12)}
.entry-observation-action--danger:hover{color:#f87171;border-color:rgba(248,113,113,.45)}
.entry-observation-empty{padding:.75rem;text-align:center;border:1px dashed var(--border-light);border-radius:8px;color:var(--text-on-surface-muted);font-size:.8rem}
@media(max-width:700px){.entry-observations-grid{grid-template-columns:1fr}}

.detail-section * {
    /* Prevent expensive repaints during scroll */
/* Optimize text rendering */
    text-rendering: optimizeSpeed;
}

/* Optimize images in modals */
.modal-body img {
    content-visibility: auto;
    contain-intrinsic-size: 150px 150px;
    /* Lazy loading optimization */
    loading: lazy;
    /* Force GPU layer for images */
/* Prevent layout shifts */
    object-fit: cover;
    /* Optimize image rendering */
    image-rendering: -webkit-optimize-contrast;
}

/* Optimize entry-details container */
.entry-details {
    contain: layout style;
    /* Use CSS Grid with auto-fit for better performance */
    display: grid;
    gap: 1rem;
    /* Prevent layout thrashing */
/* Force GPU layer */
/* Optimize rendering */
    isolation: isolate;
    /* Prevent expensive repaints */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Ensure proper height calculation */
    min-height: 0;
    height: auto;
}

/* Optimize all interactive elements in modal */
.modal-body button,
.modal-body input,
.modal-body select,
.modal-body textarea {
    /* Prevent repaints during scroll */
    contain: layout style paint;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
}

/* ============================================
   FORMS - Glass Inputs
   ============================================ */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================
   PREVENT iOS ZOOM ON INPUT FOCUS
   ============================================ */

/* Force all inputs, textareas, and selects to have minimum 16px font-size */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
textarea,
select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
}

/* Numerele se scriu, nu se incrementează din spinner-ul nativ */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
    display: none !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Also apply to form-control class */
.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 16px;
    /* Minimum 16px to prevent iOS zoom on focus */
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    outline: none;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control:focus {
    background: var(--input-bg-focus);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
    color: var(--input-text);
    transform: scale(1.01);
}

/* IMEI Validation Styles */
.form-control.valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-control.valid:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), var(--shadow-md);
}

.form-control.invalid,
.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    background: var(--danger-bg);
}

.form-control.invalid:focus,
.form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3), var(--shadow-md);
}

.form-control.is-valid {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: var(--success-bg);
}

.form-control.is-valid:focus {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), var(--shadow-md);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--surface-bg);
}

.form-help {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    overflow: visible;
}

/* ============================================
   GRIDS - Responsive Layouts
   ============================================ */

.entries-grid,
.clients-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg);
    /* Fără content-visibility:auto — pe mobil, la scroll rapid, lăsa zone goale cu gradientul paginii */
    content-visibility: visible;
    contain: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.phones-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg);
    contain: layout style;
    content-visibility: auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.entries-container {
    background-color: var(--body-bg-solid);
}

.entries-grid > *,
.clients-grid > *,
.phones-grid > *,
.accessories-grid > * {
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 640px) {

    .entries-grid,
    .clients-grid,
    .phones-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {

    .entries-grid,
    .clients-grid,
    .phones-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ============================================
   PHONES LIST - Single Row Layout
   ============================================ */

.phones-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    grid-auto-rows: minmax(0, auto);
    gap: var(--spacing-xs);
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

@media (max-width: 1024px) {
    .phones-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .phones-list {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
}

/* Legacy phone list styles - keeping for backward compatibility */
.phones-list-legacy {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* New Phone Card Design */
.phone-list-item {
    margin-bottom: var(--spacing-md);
}

.phones-list > .phone-list-item {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.phone-card-wrapper {
    background: var(--border-lighter);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.phone-card-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--glass-border-light), transparent);
}

.phone-card-wrapper:hover {
    background: var(--surface-bg-hover);
    border-color: var(--glass-border-light);
}

/* Photo count badge on phone cards */
.phone-card-badge-photos {
    background: rgba(99, 102, 241, 0.25);
    color: var(--primary-light, #818cf8);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: none;
}

.phone-card-badge-no-photos {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-on-surface-hint, #6b7280);
    border-color: rgba(107, 114, 128, 0.15);
    box-shadow: none;
    opacity: 0.7;
}

html.light-mode .phone-card-badge-photos {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary, #6366f1);
    border-color: rgba(99, 102, 241, 0.15);
}

html.light-mode .phone-card-badge-no-photos {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
    border-color: rgba(107, 114, 128, 0.1);
}

/* Legacy thumbnail classes - hidden, kept for compatibility */
.phone-card-thumbs-grid,
.phone-card-thumbnail { display: none; }

/* Entry card camera button - shown on all screens */
.btn-entry-camera {
    display: inline-flex !important;
}

/* Poze în modalurile de avansare status */
.status-modal-photos {
    margin: 1rem 0;
    padding: 0.85rem 1rem;
    background: var(--surface-bg-hover, rgba(148, 163, 184, 0.08));
    border: 1px solid var(--border-light, rgba(148, 163, 184, 0.25));
    border-radius: 10px;
}

.status-modal-photos-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.status-modal-photos-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-modal-photos-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-modal-photos-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.status-modal-photos-thumbs:empty {
    display: none;
    margin-top: 0;
}

.status-modal-photo-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light, rgba(148, 163, 184, 0.3));
    background: var(--surface-bg, #0f172a);
    cursor: pointer;
    padding: 0;
}

.status-modal-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-modal-photos-add:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Header Section */
.phone-card-header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.35rem;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.phone-card-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.phone-card-brand-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.phone-card-shop-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #f59e0b;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
}

html.light-mode .phone-card-shop-badge {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.phone-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

/* Stoc compact lângă titlu — nu ocupă rândul de badge-uri */
.phone-card-stock-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    margin-left: 2px;
    padding: 0.08rem 0.3rem;
    font-size: 0.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    border-radius: var(--radius-full);
    color: #fff;
    background: #7c3aed;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

html.light-mode .phone-card-stock-pill {
    color: #5b21b6;
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.28);
}

.phone-card-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Compact select checkbox */
.phone-card-select-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    border-radius: 4px;
    background: var(--surface-bg);
    border: 1px solid var(--glass-border);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.phone-card-select-box:hover {
    background: var(--glass-bg-light);
    border-color: var(--success);
}

.phone-card-select-box input {
    display: none;
}

.phone-card-select-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: transparent;
    font-size: 10px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.phone-card-select-box input:checked+.phone-card-select-check {
    color: white;
    background: var(--success);
    border-radius: 3px;
}

.phone-card-select-box:has(input:checked) {
    border-color: var(--success);
    background: var(--success);
}

.phone-card-menu-wrapper {
    position: relative;
}

.phone-card-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.6875rem;
}

.phone-card-menu-btn:hover {
    background: var(--border-light);
}

.phone-card-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    background: var(--dropdown-bg);
border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    min-width: 160px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    padding: 0.375rem 0;
}

.phone-card-menu-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.phone-card-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.8125rem;
    text-align: left;
}

.phone-card-menu-item:hover {
    background: var(--dropdown-item-hover);
}

.phone-card-menu-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.phone-card-menu-item-danger {
    color: var(--danger);
}

.phone-card-menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.phone-card-menu-item-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8125rem;
    cursor: default;
}

.phone-card-menu-item-toggle-row span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phone-card-menu-item-toggle-row .toggle-switch {
    flex-shrink: 0;
}

.phone-card-menu-item i {
    width: 14px;
    text-align: center;
    font-size: 0.75rem;
}

/* Body Section */
.phone-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-height: 0;
}

.phone-card-status-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.2rem;
    align-items: center;
    min-height: 22px;
    margin-bottom: 0.15rem;
}

.phone-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.02em;
    line-height: 1.2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.phone-card-badge i {
    font-size: 0.6rem;
    flex-shrink: 0;
}

/* --- Status badge per-status colors (dark mode = solid bg, light mode = tinted bg + dark text) --- */

.phone-card-badge-status {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.625rem;
}

.phone-card-badge-ready      { background: #F59E0B; }
.phone-card-badge-in-service  { background: #EF4444; }
.phone-card-badge-sold        { background: #10B981; }
.phone-card-badge-on-order    { background: #8B5CF6; }
.phone-card-badge-default     { background: #6B7280; }

html.light-mode .phone-card-badge-ready      { background: rgba(245,158,11,0.14); color: #92400e; border-color: rgba(245,158,11,0.3); }
html.light-mode .phone-card-badge-in-service  { background: rgba(239,68,68,0.12); color: #991b1b; border-color: rgba(239,68,68,0.3); }
html.light-mode .phone-card-badge-sold        { background: rgba(16,185,129,0.12); color: #065f46; border-color: rgba(16,185,129,0.3); }
html.light-mode .phone-card-badge-on-order    { background: rgba(139,92,246,0.12); color: #5b21b6; border-color: rgba(139,92,246,0.3); }
html.light-mode .phone-card-badge-default     { background: rgba(107,114,128,0.1); color: #374151; border-color: rgba(107,114,128,0.2); }

/* --- OLX badge per-status colors --- */

.phone-card-badge-olx {
    font-size: 0.625rem;
    flex-shrink: 1;
    min-width: 0;
    max-width: 100%;
}

.phone-card-olx-new     { background: #3B82F6; }
.phone-card-olx-active  { background: #10B981; }
.phone-card-olx-warning { background: #F59E0B; }
.phone-card-olx-danger  { background: #DC2626; }

html.light-mode .phone-card-olx-new     { background: rgba(59,130,246,0.12); color: #1e40af; border-color: rgba(59,130,246,0.3); }
html.light-mode .phone-card-olx-active  { background: rgba(16,185,129,0.12); color: #065f46; border-color: rgba(16,185,129,0.3); }
html.light-mode .phone-card-olx-warning { background: rgba(245,158,11,0.14); color: #92400e; border-color: rgba(245,158,11,0.3); }
html.light-mode .phone-card-olx-danger  { background: rgba(220,38,38,0.12); color: #991b1b; border-color: rgba(220,38,38,0.3); }

.phone-card-badge-olx button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    padding: 1px 4px;
    margin-left: 3px;
    cursor: pointer;
    color: inherit;
    font-size: 9px;
    line-height: 1;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

html.light-mode .phone-card-badge-olx button {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
}

.phone-card-badge-olx button:hover {
    background: rgba(255, 255, 255, 0.35);
}

html.light-mode .phone-card-badge-olx button:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* --- Stock badge --- */

.phone-card-badge-stock { background: #8b5cf6; }
html.light-mode .phone-card-badge-stock { background: rgba(139,92,246,0.12); color: #5b21b6; border-color: rgba(139,92,246,0.25); }

/* --- Store „www”: mereu vizibil (dacă magazin); verde = sync ON, roșu = OFF --- */

.phone-card-badge-store-www .phone-card-badge-www-text {
    font-family: ui-monospace, 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
}

.phone-card-badge-store-www--on {
    background: #16a34a;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.phone-card-badge-store-www--off {
    background: #dc2626;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

html.light-mode .phone-card-badge-store-www--on {
    background: rgba(22, 163, 74, 0.16);
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.35);
}

html.light-mode .phone-card-badge-store-www--off {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.35);
}

.phone-card-badge-battery--original {
    background: #10b981;
}
.phone-card-badge-battery--aftermarket {
    background: #f59e0b;
}
html.light-mode .phone-card-badge-battery--original {
    background: rgba(16, 185, 129, 0.14);
    color: #065f46;
    border-color: rgba(16, 185, 129, 0.3);
}
html.light-mode .phone-card-badge-battery--aftermarket {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.3);
}

.phone-card-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.35rem;
    padding: 0.35rem 0.4rem;
    background: var(--table-header-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-lighter);
}

.phone-card-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
}

.phone-card-info-label {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.phone-card-info-value {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-card-code-value {
    font-family: 'Courier New', monospace;
    background: var(--border-color);
    padding: 0.0625rem 0.25rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    font-size: 0.6875rem;
}

.phone-card-prices-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem 0.4rem;
    background: var(--table-header-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-lighter);
}

.phone-card-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0;
}

.phone-card-price-row-profit {
    padding-top: 0.2rem;
    margin-top: 0.2rem;
    border-top: 1px solid var(--border-color);
}

.phone-card-price-label {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.phone-card-price-value {
    font-size: 0.8125rem;
    color: var(--text-primary);
    font-weight: 600;
}

.phone-card-price-sale {
    color: var(--primary-light);
    font-weight: 700;
}

.phone-card-price-profit {
    color: var(--success);
    font-weight: 700;
    font-size: 0.875rem;
}

/* OLX Statistics Footer Section */
.phone-card-stats-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.4rem 0.5rem;
    margin-top: auto;
    background: var(--table-header-bg);
    border-top: 1px solid var(--border-lighter);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-left: calc(-1 * var(--spacing-sm));
    margin-right: calc(-1 * var(--spacing-sm));
    flex-shrink: 0;
}

.phone-card-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--surface-bg-hover);
    border: 1px solid var(--glass-border);
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.phone-card-stat-badge:hover {
    background: var(--surface-bg-active);
    border-color: var(--glass-border-light);
}

.phone-card-stat-emoji {
    font-size: 0.75rem;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.phone-card-stat-value {
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    min-width: 0.875rem;
    text-align: center;
}

/* Special badge styles */
.phone-card-stat-badge-promoted {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.3), rgba(251, 146, 60, 0.2));
    border-color: rgba(251, 146, 60, 0.4);
    color: #fb923c;
}

.phone-card-stat-badge-promoted:hover {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.4), rgba(251, 146, 60, 0.3));
    border-color: rgba(251, 146, 60, 0.5);
}

.phone-card-stat-badge-messages {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.2));
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.phone-card-stat-badge-messages:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(239, 68, 68, 0.3));
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.875rem;
    background: var(--border-color);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-icon:hover {
}

.btn-icon-info,
.btn-icon-success,
.btn-icon-primary,
.btn-icon-danger {
    color: #ffffff !important;
    border: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.btn-icon-info i,
.btn-icon-success i,
.btn-icon-primary i,
.btn-icon-danger i {
    color: #ffffff !important;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.btn-icon-info {
    background: linear-gradient(135deg, var(--info), #2563eb);
}

.btn-icon-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.btn-icon-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.btn-icon-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

@media (max-width: 768px) {
    .phone-card-wrapper {
        padding: 10px;
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
    }

    .phone-card-header-section {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        margin-bottom: 0.35rem;
    }

    .phone-card-title-group {
        flex: 1;
        min-width: 0;
    }

    .phone-card-brand-logo {
        width: 20px;
        height: 20px;
    }

    .phone-card-title {
        font-size: 1.15rem;
        font-weight: 700;
        line-height: 1.25;
    }

    .phone-card-header-actions {
        gap: 6px;
        flex-shrink: 0;
    }

    .phone-card-shop-badge {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .phone-card-body {
        padding: 0;
        gap: 0.4rem;
    }

    .phone-card-status-group {
        margin-bottom: 0.35rem;
    }

    .phone-card-info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        padding: 6px;
        margin-bottom: 0;
    }

    .phone-card-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .phone-card-info-label {
        font-size: 0.65rem;
    }

    .phone-card-info-value {
        font-size: 0.8rem;
        font-weight: 600;
    }

    .phone-card-prices-section {
        padding: 6px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: stretch;
        gap: 5px;
    }

    .phone-card-price-row {
        flex: 1;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 5px 3px;
        background: var(--border-lighter);
        border-radius: 6px;
        text-align: center;
    }

    .phone-card-price-row-profit {
        background: rgba(16, 185, 129, 0.2);
    }

    .phone-card-price-label {
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .phone-card-price-value {
        font-size: 0.8rem;
        font-weight: 700;
    }

    .phone-card-menu {
        min-width: 160px;
        right: 0;
        left: auto;
    }

    .phone-card-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .phone-card-stats-footer {
        padding: 0.35rem 0.45rem;
        gap: 0.22rem;
        margin-left: -10px;
        margin-right: -10px;
    }

    .phone-card-stat-badge {
        padding: 0.1875rem 0.375rem;
        font-size: 0.5625rem;
        gap: 0.1875rem;
    }

    .phone-card-stat-emoji {
        font-size: 0.6875rem;
    }

    .phone-card-stat-value {
        font-size: 0.5625rem;
    }
}

@media (max-width: 480px) {
    .phone-card-wrapper {
        padding: 8px;
        min-height: 0;
    }

    .phone-card-header-section {
        margin-bottom: 0.3rem;
    }

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

    .phone-card-brand-logo {
        width: 18px;
        height: 18px;
    }

    .phone-card-select-box {
        width: 26px;
        height: 26px;
    }

    .phone-card-menu-btn {
        width: 26px;
        height: 26px;
    }

    .phone-card-info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 5px;
    }

    .phone-card-info-label {
        font-size: 0.6rem;
    }

    .phone-card-info-value {
        font-size: 0.75rem;
    }

    .phone-card-prices-section {
        padding: 5px;
        gap: 3px;
    }

    .phone-card-price-row {
        padding: 4px 2px;
    }

    .phone-card-price-label {
        font-size: 0.55rem;
    }

    .phone-card-price-value {
        font-size: 0.75rem;
    }

    .phone-card-badge {
        font-size: 0.6rem;
        padding: 0.175rem 0.35rem;
    }

    .phone-card-status-group {
        gap: 0.25rem;
    }

    .phone-card-stats-footer {
        padding: 0.3125rem 0.4375rem;
        gap: 0.1875rem;
        margin-left: -8px;
        margin-right: -8px;
    }

    .phone-card-stat-badge {
        padding: 0.1875rem 0.3125rem;
        font-size: 0.5rem;
        gap: 0.125rem;
    }

    .phone-card-stat-emoji {
        font-size: 0.625rem;
    }

    .phone-card-stat-value {
        font-size: 0.5rem;
        min-width: 0.75rem;
    }
}

/* Labels Page Styles */
.labels-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--glass-border);
    padding-bottom: var(--spacing-sm);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--border-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.875rem;
    font-weight: 600;
}

.tab-btn:hover {
    background: var(--border-light);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.tab-content {
    display: none;
}

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

.labels-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    align-items: center;
}

.discount-input-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--border-color);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

.discount-input-group label {
    white-space: nowrap;
    font-weight: 600;
}

.discount-input-group input {
    margin: 0;
}

.labels-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.labels-list .label-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.labels-list .label-item:hover {
}

.labels-list .label-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-top: 2px;
    flex-shrink: 0;
}

.labels-list .label-item-content {
    flex: 1;
    cursor: pointer;
}

.labels-list .label-item-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.labels-list .label-item-code {
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
}

.labels-list .label-item-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #10B981;
}

.labels-list .label-item-client {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.labels-list .label-item-specs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    font-size: 0.8125rem;
    color: var(--text-on-surface-secondary);
}

.labels-list .label-item-specs span {
    padding: 2px 6px;
    background: var(--border-color);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .labels-list {
        grid-template-columns: 1fr;
    }

    .labels-actions {
        flex-direction: column;
    }

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

    .tab-btn {
        flex: 1;
        font-size: 0.8125rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* Stock Value Info Cards - Compact Design */
.stock-value-info {
    display: flex;
    gap: 12px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stock-value-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.stock-value-card i {
    font-size: 0.875rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.stock-value-purchase {
    border-color: rgba(99, 102, 241, 0.4);
}

.stock-value-purchase i {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.stock-value-sale {
    border-color: rgba(16, 185, 129, 0.4);
}

.stock-value-sale i {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.stock-value-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.stock-value-label {
    font-size: 0.65rem;
    color: var(--text-on-surface-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stock-value-amount {
    font-size: 0.95rem;
    font-weight: 700;
}

.stock-value-purchase .stock-value-amount {
    color: #6366f1;
}

.stock-value-sale .stock-value-amount {
    color: #10b981;
}

@media (max-width: 768px) {
    .stock-value-info {
        gap: 8px;
        margin-bottom: 0.75rem;
    }

    .stock-value-card {
        padding: 6px 10px;
        gap: 8px;
        flex: 1;
        min-width: 140px;
    }

    .stock-value-card i {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .stock-value-label {
        font-size: 0.6rem;
    }

    .stock-value-amount {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stock-value-card {
        padding: 5px 8px;
        min-width: 120px;
    }

    .stock-value-card i {
        width: 22px;
        height: 22px;
    }

    .stock-value-amount {
        font-size: 0.8rem;
    }
}

.stats-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.dashboard-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.dashboard-stats-row::-webkit-scrollbar {
    height: 4px;
}

.dashboard-stats-row::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-width: fit-content;
}

.stat-card .stat-icon {
    font-size: 0.875rem;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border-radius: 6px;
    flex-shrink: 0;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
}

.stat-card .stat-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-info p {
    font-size: 0.65rem;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}

.dashboard-add-card {
    cursor: pointer;
}

.dashboard-add-card .stat-icon {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.dashboard-add-card .stat-info h3 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .dashboard-stats-row {
        justify-content: center;
        gap: 6px;
    }

    .stat-card {
        padding: 5px 10px;
        min-width: auto;
        gap: 6px;
    }

    .stat-card .stat-icon {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
        border-radius: 5px;
    }

    .stat-card .stat-info h3 {
        font-size: 0.85rem;
    }

    .stat-card .stat-info p {
        font-size: 0.55rem;
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    border-color: var(--glass-border-light);
}

.stat-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   STATUS TABS (Entries Page)
   ============================================ */

.status-tabs-container {
    margin-bottom: var(--spacing-lg);
    background: var(--elevated-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xs);
    overflow-x: auto;
}

.status-tabs {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    min-width: fit-content;
}

.status-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-on-surface-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    position: relative;
    min-width: fit-content;
}

.status-tab:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-light);
    color: var(--text-on-surface);
}

.status-tab.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.status-tab.active .tab-count {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

.status-tab.inactive {
    opacity: 0.6;
}

.status-tab.inactive:hover {
    opacity: 0.8;
}

.status-tab .tab-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.status-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 var(--spacing-xs);
    background: var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.status-tab.add-entry-tab {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    margin-left: auto;
}

.status-tab.add-entry-tab:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
}

.tab-separator {
    width: 1px;
    height: 32px;
    background: var(--divider);
    margin: 0 var(--spacing-xs);
    flex-shrink: 0;
}

.status-tab.delivered-tab {
    background: rgba(107, 114, 128, 0.4);
    border-left-color: rgba(107, 114, 128, 0.6);
}

.status-tab.delivered-tab:hover {
    background: rgba(107, 114, 128, 0.5);
    border-color: rgba(107, 114, 128, 0.4);
}

.status-tab.delivered-tab.active {
    background: rgba(107, 114, 128, 0.3);
    border-color: rgba(107, 114, 128, 0.5);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.status-tab.delivered-tab.active .tab-count {
    background: rgba(107, 114, 128, 0.4);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .status-tabs-container {
        padding: var(--spacing-xs);
    }

    .status-tab {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }

    .status-tab .tab-count {
        min-width: 20px;
        height: 20px;
        font-size: 0.625rem;
    }
}

/* ============================================
   FINANCIAL CATEGORIES MANAGER
   ============================================ */

.financial-categories-manager {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.financial-categories-sidebar {
    background: var(--elevated-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    height: fit-content;
    max-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
}

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

.sidebar-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.category-type-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.type-tab {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-on-surface-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.type-tab:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-light);
    color: var(--text-on-surface);
}

.type-tab.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
}

.categories-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.category-item {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-item:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-light);
}

.category-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-left-color: rgba(99, 102, 241, 0.6);
}

.category-item.income {
    border-left-color: #10B981;
}

.category-item.expense {
    border-left-color: #EF4444;
}

.category-item-info {
    flex: 1;
}

.category-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.category-item-description {
    font-size: 0.75rem;
    color: var(--text-on-surface-muted);
    margin: 0;
}

.category-item-actions {
    display: flex;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.category-item:hover .category-item-actions {
    opacity: 1;
}

.financial-subcategories-panel {
    background: var(--elevated-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    min-height: 400px;
}

.subcategories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.subcategories-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.subcategories-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.subcategory-item {
    padding: var(--spacing-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.subcategory-item:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-light);
}

.subcategory-item-info {
    flex: 1;
}

.subcategory-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.subcategory-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

.subcategory-item-description {
    font-size: 0.875rem;
    color: var(--text-on-surface-secondary);
    margin: var(--spacing-xs) 0;
}

.subcategory-item-prices {
    font-size: 0.75rem;
    color: var(--text-on-surface-muted);
    margin-top: var(--spacing-xs);
}

.subcategory-item-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-on-surface-hint);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

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

    .financial-categories-sidebar {
        max-height: 400px;
    }
}

/* ============================================
   CATEGORY MANAGER (catm) — unified card-based UI
   used by accessories modal & financial categories
   ============================================ */

.catm {
    --catm-radius-lg: 16px;
    --catm-radius-md: 12px;
    --catm-radius-sm: 8px;
    --catm-gap: 0.85rem;
    --catm-card-bg: var(--card-bg, rgba(30, 41, 59, 0.6));
    --catm-card-border: var(--border-color, rgba(255, 255, 255, 0.1));
    --catm-card-hover-border: var(--border-light, rgba(255, 255, 255, 0.22));
    --catm-text: var(--text-primary, #fff);
    --catm-text-soft: var(--text-on-surface-secondary, rgba(255, 255, 255, 0.78));
    --catm-text-muted: var(--text-on-surface-muted, rgba(255, 255, 255, 0.55));
    --catm-accent: #6366f1;
    --catm-income: #10b981;
    --catm-expense: #ef4444;
    display: flex;
    flex-direction: column;
    gap: var(--catm-gap);
}

/* Header / toolbar */
.catm-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.catm-search {
    position: relative;
    flex: 1 1 220px;
    min-width: 200px;
}

.catm-search > i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--catm-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.catm-search > input {
    width: 100%;
    padding: 0.6rem 0.85rem 0.6rem 2.3rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--input-border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    color: var(--catm-text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.catm-search > input:focus {
    outline: none;
    border-color: var(--catm-accent);
    background: var(--input-bg, rgba(255, 255, 255, 0.08));
}

.catm-tabs {
    display: inline-flex;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--catm-card-border);
    border-radius: 999px;
    gap: 0.2rem;
}

.catm-tab {
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--catm-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.catm-tab i { font-size: 0.7rem; }

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

.catm-tab.is-active {
    background: var(--catm-card-bg);
    color: var(--catm-text);
    box-shadow: 0 2px 6px -2px rgba(0, 0, 0, 0.3);
}

.catm-tab.is-active.income { color: var(--catm-income); }
.catm-tab.is-active.expense { color: var(--catm-expense); }

.catm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: none;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    box-shadow: 0 4px 12px -4px rgba(99, 102, 241, 0.5);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.catm-btn:hover { }
.catm-btn:disabled { opacity: 0.7; cursor: progress; transform: none; }

.catm-btn.is-income { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); box-shadow: 0 4px 12px -4px rgba(16, 185, 129, 0.5); }
.catm-btn.is-expense { background: linear-gradient(135deg, #f87171 0%, #ef4444 100%); box-shadow: 0 4px 12px -4px rgba(239, 68, 68, 0.5); }

.catm-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--catm-text-soft);
    border: 1px solid var(--catm-card-border);
    box-shadow: none;
}

.catm-btn-ghost:hover {
    color: var(--catm-text);
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--catm-card-hover-border);
}

.catm-btn-icon {
    padding: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    justify-content: center;
}

/* Breadcrumb */
.catm-crumbs {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    padding: 0.45rem 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--catm-card-border);
    border-radius: 999px;
    font-size: 0.78rem;
}

.catm-crumb {
    color: var(--catm-text-muted);
    background: none;
    border: none;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: color 0.12s, background 0.12s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.catm-crumb:hover { color: var(--catm-text); background: rgba(255, 255, 255, 0.05); }
.catm-crumb.is-current { color: var(--catm-text); cursor: default; }
.catm-crumb.is-current:hover { background: none; }
.catm-crumb-sep { color: var(--catm-text-muted); opacity: 0.5; font-size: 0.7rem; }

/* Edit / add inline panel */
.catm-edit-panel {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%), var(--catm-card-bg);
    border: 1px solid rgba(99, 102, 241, 0.32);
    border-radius: var(--catm-radius-md);
    padding: 1rem 1.1rem;
    box-shadow: 0 8px 22px -16px rgba(99, 102, 241, 0.6);
}

.catm-edit-panel.is-income { border-color: rgba(16, 185, 129, 0.32); background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(56, 189, 248, 0.04) 100%), var(--catm-card-bg); box-shadow: 0 8px 22px -16px rgba(16, 185, 129, 0.6); }
.catm-edit-panel.is-expense { border-color: rgba(239, 68, 68, 0.32); background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(245, 158, 11, 0.04) 100%), var(--catm-card-bg); box-shadow: 0 8px 22px -16px rgba(239, 68, 68, 0.6); }

.catm-edit-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}

.catm-edit-panel__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--catm-text);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.catm-edit-panel__title i { color: var(--catm-accent); }

.catm-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem 0.75rem;
}

.catm-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.catm-field--full { grid-column: 1 / -1; }

.catm-field > label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--catm-text-muted);
    margin: 0;
}

.catm-field > input,
.catm-field > select,
.catm-field > textarea {
    padding: 0.5rem 0.7rem;
    background: var(--input-bg, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--input-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--catm-radius-sm);
    color: var(--catm-text);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color 0.12s;
}

.catm-field > textarea { resize: vertical; min-height: 60px; }
.catm-field > input[type="color"] { padding: 0.2rem; height: 38px; cursor: pointer; }
.catm-field > input:focus,
.catm-field > select:focus,
.catm-field > textarea:focus { outline: none; border-color: var(--catm-accent); }

.catm-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
    justify-content: flex-end;
}

/* Card grid */
.catm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--catm-gap);
}

.catm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.95rem 1rem 0.85rem;
    background: var(--catm-card-bg);
    border: 1px solid var(--catm-card-border);
    border-radius: var(--catm-radius-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
    isolation: isolate;
    text-align: left;
    min-height: 110px;
}

.catm-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(80% 100% at 0% 0%, var(--catm-card-glow, rgba(99, 102, 241, 0.18)) 0%, transparent 60%);
    opacity: 0.55;
    transition: opacity 0.18s;
}

.catm-card > * { position: relative; z-index: 1; }

.catm-card:hover {
    border-color: var(--catm-card-hover-border);
}

.catm-card:hover::before { opacity: 0.95; }

.catm-card.is-income { --catm-card-glow: rgba(16, 185, 129, 0.18); }
.catm-card.is-expense { --catm-card-glow: rgba(239, 68, 68, 0.18); }

.catm-card__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.catm-card__icon {
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    color: #fff;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--catm-card-icon, #6366f1) 0%, color-mix(in srgb, var(--catm-card-icon, #6366f1) 70%, #000) 100%);
    box-shadow: 0 6px 14px -8px var(--catm-card-icon, rgba(99, 102, 241, 0.6));
}

.catm-card__name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--catm-text);
    line-height: 1.2;
    letter-spacing: -0.01em;
    word-break: break-word;
}

.catm-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.7rem;
    color: var(--catm-text-muted);
}

.catm-card__count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--catm-text-soft);
}

.catm-card__count i { font-size: 0.6rem; opacity: 0.85; }
.catm-card__count.is-warn { color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }
.catm-card__count.is-income { color: #34d399; border-color: rgba(16, 185, 129, 0.25); background: rgba(16, 185, 129, 0.08); }
.catm-card__count.is-expense { color: #f87171; border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.08); }

.catm-card__desc {
    font-size: 0.74rem;
    color: var(--catm-text-muted);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catm-card__chev {
    position: absolute;
    right: 0.85rem;
    bottom: 0.85rem;
    color: var(--catm-text-muted);
    font-size: 0.72rem;
    opacity: 0.6;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 1;
}

.catm-card:hover .catm-card__chev { opacity: 1;  }

.catm-card__actions {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    display: flex;
    gap: 0.2rem;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 2;
}

.catm-card:hover .catm-card__actions,
.catm-card:focus-within .catm-card__actions { opacity: 1; }

.catm-card__action {
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border-radius: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.7);
    color: var(--catm-text-soft);
    font-size: 0.65rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.catm-card__action:hover {
    color: var(--catm-text);
    background: rgba(99, 102, 241, 0.7);
    border-color: rgba(99, 102, 241, 0.6);
}

.catm-card__action.is-danger:hover {
    background: rgba(239, 68, 68, 0.75);
    border-color: rgba(239, 68, 68, 0.65);
}

/* "Add new" tile */
.catm-card-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 110px;
    background: rgba(255, 255, 255, 0.025);
    border: 2px dashed var(--catm-card-border);
    border-radius: var(--catm-radius-md);
    color: var(--catm-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    text-align: center;
    padding: 1rem;
    font-family: inherit;
}

.catm-card-add:hover {
    color: var(--catm-text);
    border-color: var(--catm-accent);
    background: rgba(99, 102, 241, 0.08);
}

.catm-card-add.is-income:hover { border-color: var(--catm-income); background: rgba(16, 185, 129, 0.08); }
.catm-card-add.is-expense:hover { border-color: var(--catm-expense); background: rgba(239, 68, 68, 0.08); }

.catm-card-add i { font-size: 1.1rem; }

/* Empty state */
.catm-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--catm-text-muted);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--catm-card-border);
    border-radius: var(--catm-radius-md);
}

.catm-empty i { font-size: 2.5rem; opacity: 0.4; display: block; margin-bottom: 0.85rem; }
.catm-empty h4 { margin: 0 0 0.35rem; font-size: 1rem; color: var(--catm-text); font-weight: 700; }
.catm-empty p { margin: 0 0 1rem; font-size: 0.85rem; }

/* Modal-specific shell for the accessory category manager */
.cat-modal-shell {
    width: min(100%, 920px);
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cat-modal-shell .modal-header {
    flex-shrink: 0;
}

.cat-modal-shell .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem 1.4rem 1.5rem;
}

@media (max-width: 640px) {
    .catm-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .catm-card { min-height: 100px; padding: 0.8rem 0.85rem 0.75rem; }
    .catm-card-add { min-height: 100px; }
    .catm-toolbar { flex-direction: column; align-items: stretch; }
    .catm-toolbar > * { width: 100%; }
    .catm-tabs { width: auto; align-self: flex-start; }
    .catm-btn { justify-content: center; }
}

/* ============================================
   SETTINGS PAGE
   ============================================ */

.settings-layout {
    display: flex;
    gap: var(--spacing-lg);
    min-height: calc(100vh - 200px);
}

.settings-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--elevated-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    height: fit-content;
    position: sticky;
    top: calc(var(--spacing-lg) + 80px);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

@media (max-width: 991px) {
    .settings-layout {
        flex-direction: column;
    }

    .settings-page {
        --settings-mobile-bar-h: 3.35rem;
    }

    html.nav-sidebar body:has(.settings-page) .main-content,
    html:not(.nav-sidebar) body:has(.settings-page) .main-content {
        padding-top: calc(var(--app-content-top, calc(var(--app-header-height, 56px) + 8px)) + var(--settings-mobile-bar-h));
    }

    /* Bară fixă imediat sub topbar / navbar */
    .settings-mobile-bar {
        position: fixed;
        top: var(--app-header-height, calc(var(--topbar-h, 56px) + env(safe-area-inset-top, 0px)));
        left: 0;
        right: 0;
        z-index: 999;
        padding: 0.45rem 0.65rem;
        background: color-mix(in srgb, var(--elevated-bg-solid, var(--elevated-bg)) 92%, transparent);
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    }

    html:not(.nav-sidebar) .settings-mobile-bar {
        top: var(--app-header-height, calc(env(safe-area-inset-top, 0px) + 60px));
    }

    .settings-mobile-bar-btn {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        width: 100%;
        padding: 0.55rem 0.7rem;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        background: var(--surface-bg);
        color: var(--text-primary);
        cursor: pointer;
        text-align: left;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    }

    .settings-mobile-bar-btn:active {
        transform: scale(0.99);
    }

    .settings-mobile-bar.is-open .settings-mobile-bar-btn,
    .settings-mobile-bar-btn[aria-expanded="true"] {
        border-color: var(--primary);
        background: var(--primary-bg);
        box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
    }

    .settings-mobile-bar-icon {
        flex-shrink: 0;
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
        color: var(--primary);
        font-size: 0.95rem;
    }

    .settings-mobile-bar-text {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.05rem;
    }

    .settings-mobile-bar-text small {
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-tertiary);
    }

    .settings-mobile-bar-text strong {
        font-size: 0.88rem;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .settings-mobile-bar-chevron {
        flex-shrink: 0;
        font-size: 0.72rem;
        color: var(--text-tertiary);
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    }

    .settings-mobile-bar.is-open .settings-mobile-bar-chevron {
        transform: rotate(90deg);
        color: var(--primary);
    }

    /* Mobile Settings Sidebar - Slide-out from left */
    .settings-sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        width: min(300px, 88vw);
        height: var(--app-visible-height, 100dvh);
        max-height: var(--app-visible-height, 100dvh);
        z-index: 210;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding-top: calc(var(--app-header-height, calc(var(--topbar-h, 56px) + env(safe-area-inset-top, 0px))) + var(--settings-mobile-bar-h, 3.35rem) + var(--spacing-md));
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: none;
        background: var(--elevated-bg-solid, var(--elevated-bg));
    }

    html:not(.nav-sidebar) .settings-sidebar {
        padding-top: calc(var(--app-header-height, 60px) + var(--settings-mobile-bar-h, 3.35rem) + var(--spacing-md));
    }

    .settings-sidebar.mobile-open {
        left: 0;
        box-shadow: var(--shadow-xl);
    }

    /* Close button in sidebar header */
    .settings-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: rgba(239, 68, 68, 0.15);
        border: 1px solid rgba(239, 68, 68, 0.3);
        border-radius: 10px;
        color: #f87171;
        cursor: pointer;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    }

    .settings-mobile-toggle:hover {
        background: rgba(239, 68, 68, 0.3);
        color: var(--text-primary);
    }

    /* Sidebar header layout */
    .settings-sidebar .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Settings overlay - sub sidebar, același stacking context ca .main-content */
    .settings-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: var(--modal-overlay);
        z-index: 200;
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .settings-sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .settings-mobile-bar.is-open {
        z-index: 220;
    }

    body.settings-nav-open {
        overflow: hidden;
    }

    /* Header + căutare fixe; doar lista de secțiuni derulează */
    .settings-sidebar .sidebar-header,
    .settings-sidebar .settings-search-container {
        flex-shrink: 0;
    }

    .settings-sidebar .settings-search-container {
        z-index: 2;
    }

    .settings-sidebar .sidebar-nav {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
    }

    .settings-content {
        padding: var(--spacing-md);
    }
}

/* Desktop - hide mobile elements */
@media (min-width: 992px) {
    .settings-mobile-bar {
        display: none;
    }

    .settings-mobile-toggle {
        display: none;
    }

    .settings-sidebar-overlay {
        display: none !important;
    }
}

/* Settings Search */
.settings-search-container {
    position: relative;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.settings-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.settings-search-box:focus-within {
    background: var(--input-bg-focus);
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.settings-search-box i {
    color: var(--text-tertiary);
    margin-right: var(--spacing-xs);
    font-size: 0.875rem;
}

.settings-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: var(--spacing-xs) 0;
}

.settings-search-input::placeholder {
    color: var(--text-tertiary);
}

.settings-search-clear {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    margin-left: var(--spacing-xs);
}

.settings-search-clear:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.settings-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--spacing-xs);
    background: var(--modal-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.settings-search-results::-webkit-scrollbar {
    width: 6px;
}

.settings-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.settings-search-results::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.settings-search-results::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.settings-search-result-item {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    border-bottom: 1px solid var(--border-lighter);
}

.settings-search-result-item:last-child {
    border-bottom: none;
}

.settings-search-result-item:hover {
    background: rgba(99, 102, 241, 0.15);
}

.settings-search-result-item i {
    color: var(--text-secondary);
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
}

.settings-search-result-item .result-text {
    flex: 1;
}

.settings-search-result-item .result-category {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--border-lighter);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
}

.settings-search-no-results {
    padding: var(--spacing-md);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.sidebar-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

@supports (-webkit-touch-callout: none) {

    /* iOS devices */
    .settings-sidebar,
    .settings-content,
    .settings-card {
        background: var(--elevated-bg-solid) !important;
    }

    .settings-sidebar {
        background: var(--elevated-bg-solid) !important;
    }

    .settings-content {
        background: var(--elevated-bg-solid) !important;
    }

    .settings-card {
        background: var(--card-bg) !important;
    }
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: var(--spacing-xs);
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-item:hover,
.sidebar-item.active {
    background: var(--surface-bg-hover);
    color: var(--text-primary);
}

.sidebar-item i {
    width: 20px;
    text-align: center;
}

/* Sidebar Groups (Collapsible Categories) */
.sidebar-group {
    margin: var(--spacing-xs) 0;
    border-radius: var(--radius-md);
    overflow: visible;
}

.sidebar-group-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    background: var(--border-lighter);
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    position: relative;
}

.sidebar-group-header:hover {
    background: var(--border-color);
}

.sidebar-group-header i:first-child {
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.8;
}

.sidebar-group-header span {
    flex: 1;
}

.sidebar-group-icon {
    width: 16px !important;
    font-size: 0.75rem !important;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.7;
}

.sidebar-group.expanded .sidebar-group-icon {
    transform: rotate(180deg);
}

.sidebar-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, padding 0.3s ease-in-out;
    padding-left: var(--spacing-md);
    opacity: 0;
}

.sidebar-group.expanded .sidebar-group-content {
    max-height: 5000px;
    padding-top: var(--spacing-xs);
    opacity: 1;
}

.sidebar-subitem {
    padding-left: calc(var(--spacing-md) + 20px);
    font-size: 0.8125rem;
    margin-left: var(--spacing-sm);
    border-left: 2px solid transparent;
}

.sidebar-subitem:hover {
    border-left-color: var(--border-light);
}

.sidebar-subitem.active {
    border-left-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.settings-content {
    flex: 1;
    background: var(--elevated-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

/* Dashboard: header compact */
.dashboard .page-header {
    margin-bottom: var(--spacing-sm);
}
.dashboard .page-header h1 {
    font-size: 1.35rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Daily Quote Static Line */
.daily-quote-line {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border-left: 4px solid rgba(99, 102, 241, 0.6);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-style: italic;
    color: var(--text-on-surface);
    line-height: 1.45;
    min-height: fit-content;
    box-sizing: border-box;
    text-align: center;
}

.daily-quote-line span {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

/* Dashboard: quote compact */
.dashboard .daily-quote-line {
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
}

@media (min-width: 769px) {
    .dashboard .daily-quote-line {
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    .daily-quote-line {
        padding: 0.7rem 0.9rem;
        font-size: 0.54rem; /* 40% mai mic față de 0.9rem */
        font-weight: 700;
        margin-bottom: 0.5rem;
        min-height: fit-content;
    }

    .daily-quote-line span {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.6;
        max-height: 3.2em;
        /* 2 linii * 1.6 line-height */
        padding: 0;
        margin: 0;
    }
}

/* Daily Motivational Quote */
.daily-quote-container {
    margin-bottom: var(--spacing-xl);
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.daily-quote-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: center;
    position: relative;
}

.daily-quote-icon {
    font-size: 1.25rem;
    color: rgba(99, 102, 241, 0.6);
    flex-shrink: 0;
}

.daily-quote-text {
    flex: 1;
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-on-surface);
    line-height: 1.6;
    margin: 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .daily-quote-container {
        padding: 0.875rem 1rem;
        margin-bottom: var(--spacing-lg);
    }

    .daily-quote-text {
        font-size: 0.875rem;
    }

    .daily-quote-icon {
        font-size: 1rem;
    }

    .daily-quote-content {
        gap: 0.75rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-on-surface);
    font-size: 0.875rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-item {
    padding: var(--spacing-sm);
    background: var(--border-lighter);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border-left: 3px solid var(--primary);
}

.item-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

/* ============================================
   FILTERS SECTION
   ============================================ */

.filters-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-group label {
    display: none;
}

.filter-group .form-control {
    width: 100%;
    margin: 0;
}

@media (max-width: 640px) {
    .filters-section {
        flex-direction: row;
        gap: var(--spacing-xs);
    }

    .filter-group {
        flex: 1;
        min-width: 0;
    }

    .filter-group .form-control {
        font-size: 16px;
        /* Minimum 16px to prevent iOS zoom on focus */
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ============================================
   PHONES STATUS TABS
   ============================================ */

.phones-status-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.phones-status-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    background: var(--border-lighter);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.phones-status-tab:hover {
    background: var(--surface-bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.phones-status-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
}

.phones-status-tab i {
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    .phones-status-tabs {
        gap: 0.35rem;
    }

    .phones-status-tab {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }

    .phones-status-tab span {
        display: none;
    }

    .phones-status-tab i {
        font-size: 0.9rem;
    }
}

/* ============================================
   PHONES TOOLBAR
   ============================================ */

.phones-toolbar-container {
    margin-bottom: var(--spacing-lg);
    overflow: visible;
}

.phones-toolbar-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    overflow: visible;
}

/* Search Group */
.phones-search-group {
    display: flex;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.phones-search-group .form-control {
    flex: 1;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}

.phones-search-btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    padding: var(--spacing-sm) var(--spacing-md) !important;
}

/* Actions Group */
.phones-actions-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    overflow: visible;
}

/* OLX Buttons */
.phones-btn-olx,
.phones-btn-olx-sync {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, #002f34 0%, #23e5db 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    position: relative;
}

.phones-btn-olx:hover,
.phones-btn-olx-sync:hover {
}

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

.phones-btn-olx-sync {
    background: linear-gradient(135deg, #002f34 0%, #0d9488 100%);
}

.phones-btn-olx-sync:hover {
}

.phones-olx-logo {
    height: 18px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) saturate(100%);
}

/* Toate butoanele din bara de acțiuni - dimensiune identică 40x40, conținut centrat */
.phones-toolbar-btn {
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-shrink: 0;
    line-height: 0;
    box-sizing: border-box;
    overflow: visible;
}
/* Butoane mai late cu text (Importă, Vinde) */
.phones-toolbar-btn-wide {
    width: auto !important;
    min-width: 110px;
    padding: 0 1.25rem !important;
    line-height: 1;
    overflow: visible;
}
.phones-toolbar-btn-wide span:not(.phones-btn-count) {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}
.phones-toolbar-btn i,
.phones-toolbar-btn .phones-olx-logo {
    display: block;
    flex-shrink: 0;
    line-height: 1;
}
.phones-toolbar-btn i {
    font-size: 1.05rem;
}
/* Logo OLX în butoanele OLX - centrat */
.phones-toolbar-btn .phones-olx-logo {
    height: 10px;
    width: auto;
    object-fit: contain;
}
/* Wrapper pentru butoane cu badge (Vinde, Postează OLX) - badge-ul e în afara butonului */
.phones-btn-with-badge-wrapper {
    position: relative;
    display: inline-flex;
}

.phones-btn-with-badge-wrapper .phones-btn-count {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    border: 2px solid var(--bg-dark);
    box-sizing: border-box;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    pointer-events: none;
}
.phones-btn-with-badge-wrapper .phones-btn-count.visible {
    display: inline-flex;
}

/* Store Orders Button */
.btn-store-orders-wrapper {
    position: relative;
    display: inline-flex;
}

.btn-store-orders {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    min-width: 40px;
    height: 40px;
}

.btn-store-orders:hover {
}

.btn-store-orders i {
    font-size: 1rem;
}

.store-orders-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
    text-align: center;
    line-height: 14px;
    border: 2px solid var(--bg-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-sizing: border-box;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .btn-store-orders {
        padding: var(--spacing-xs) var(--spacing-sm);
        min-width: 36px;
        height: 36px;
    }

    .btn-store-orders i {
        font-size: 0.9rem;
    }
}

/* Client card select box (similar to phone card) */
.client-card-select-box {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    border-radius: 4px;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.client-card-select-box:hover {
    background: var(--surface-bg-hover);
    border-color: var(--success);
}

.client-card-select-box input {
    display: none;
}

.client-card-select-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: transparent;
    font-size: 10px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.client-card-select-box input:checked+.client-card-select-check {
    color: white;
    background: var(--success);
    border-radius: 3px;
}

.client-card-select-box:has(input:checked) {
    border-color: var(--success);
    background: var(--success);
}

/* Client marketing button */
.clients-btn-marketing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    position: relative;
}

.clients-btn-marketing.btn-sm {
    padding: 0.375rem;
    gap: 0;
}

.clients-btn-marketing:hover {
}

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

/* Count badge for clients */
.clients-btn-count {
    display: none;
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    border: 1px solid var(--glass-border);
}

.clients-btn-count.visible {
    display: inline-block;
}

/* Sort Button + Popup - compact, matches toolbar buttons */
.phones-sort-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.phones-sort-btn {
    flex-shrink: 0;
}

.phones-sort-hidden-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.phones-sort-popup {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    padding: 6px 0;
    background: var(--dropdown-bg);
border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--dropdown-shadow);
    z-index: 1000;
}

.phones-sort-popup.is-open {
    display: block;
}

.phones-sort-option {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-on-surface);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.phones-sort-option:hover {
    background: var(--dropdown-item-hover);
}

.phones-sort-option.is-selected {
    color: var(--primary);
}

.phones-sort-option.is-selected::before {
    content: '✓ ';
    font-weight: 600;
}

/* OLX Category Search Dropdown */
.olx-category-search-wrapper {
    position: relative;
}

.olx-category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--dropdown-shadow);
    z-index: 1000;
    margin-top: 4px;
}

.olx-category-dropdown-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.olx-category-dropdown-item:hover {
    background: var(--dropdown-item-hover);
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .phones-toolbar-row {
        gap: var(--spacing-sm);
    }

    .phones-search-group {
        flex: 1 1 100%;
        max-width: none;
        order: 1;
    }

    .phones-actions-group {
        flex: 1 1 100%;
        order: 2;
        justify-content: flex-start;
    }

    .phones-toolbar-btn .phones-olx-logo {
        height: 10px;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .phones-actions-group {
        gap: var(--spacing-xs);
    }

    .phones-actions-group .btn:not(.phones-toolbar-btn) {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.875rem;
    }

    .phones-actions-group .phones-toolbar-btn {
        padding: 0;
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .phones-toolbar-btn .phones-olx-logo {
        height: 10px;
    }

    .phones-sort-popup {
        right: 0;
        left: auto;
        min-width: 150px;
    }
}

/* ============================================
   CLIENT SELECTOR WITH ADD BUTTON - MOBILE
   ============================================ */

/* Client and device select groups */
.client-select-group,
.device-select-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.client-select-group .form-control,
.device-select-group .form-control {
    flex: 1;
}

.client-select-group .btn-secondary,
.device-select-group .btn-secondary {
    flex-shrink: 0;
}

@media (max-width: 768px) {

    /* On mobile, selector takes 90%, button takes 10% */
    .modal .form-group>div[style*="display: flex"] .form-control[style*="flex: 1"],
    .modal .form-group>div[style*="display: flex"] select.form-control[style*="flex: 1"],
    .client-select-group .form-control,
    .device-select-group .form-control {
        flex: 0 0 90% !important;
        max-width: 90% !important;
    }

    .modal .form-group>div[style*="display: flex"] .btn-secondary,
    .client-select-group .btn-secondary,
    .device-select-group .btn-secondary {
        flex: 0 0 10% !important;
        max-width: 10% !important;
        min-width: auto;
        padding: var(--spacing-xs) !important;
        font-size: 0.875rem;
    }

    .modal .form-group>div[style*="display: flex"] .btn-secondary i,
    .client-select-group .btn-secondary i,
    .device-select-group .btn-secondary i {
        font-size: 0.875rem;
    }

    /* Hide text on buttons, show only icon */
    .modal .form-group>div[style*="display: flex"] .btn-secondary span,
    .client-select-group .btn-secondary span:not(:empty),
    .device-select-group .btn-secondary span:not(:empty) {
        display: none;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

/* Financial entries grid responsive */
@media (max-width: 768px) {
    .financial-entries-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   NAVBAR RESPONSIVE - COMPLETE REFACTOR
   ============================================ */

/* Default: Hide mobile elements */
.nav-top-row,
.nav-brand-mobile,
.nav-actions-mobile,
.navbar-search-container-mobile,
.hamburger-menu-btn,
.user-menu-wrapper-mobile,
.nav-link-mobile-login {
    display: none;
}

/* Mobile menu overlay - always fixed, hidden by default */
.mobile-menu-overlay {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: var(--modal-overlay);
    opacity: 0;
    visibility: hidden;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 99998 !important;
    pointer-events: none;
}

.mobile-menu-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Legacy right-drawer removed — card drawer lives in mobile-menu.css */
.mobile-menu:not(.mobile-menu--cards) {
    display: none !important;
}

/* Mobile menu internal styles */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}

.mobile-menu-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.mobile-menu-close {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    padding: 0;
}

.mobile-menu-close:hover {
    background: var(--surface-bg-hover);
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-lighter);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-weight: 500;
}

.mobile-menu-link i {
    width: 24px;
    text-align: center;
    color: rgba(99, 102, 241, 0.8);
    font-size: 1.1rem;
}

.mobile-menu-link:hover {
    background: var(--surface-bg);
    padding-left: 1.5rem;
    color: var(--text-primary);
}

.mobile-menu-link:hover i {
    color: rgba(99, 102, 241, 1);
}

.mobile-menu-link.active {
    background: var(--primary-bg);
    border-left: 3px solid var(--primary);
    padding-left: calc(1.25rem - 3px);
    color: var(--text-primary);
}

.mobile-menu-link.active i {
    color: var(--primary-light);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--divider);
    margin: 0.5rem 0;
    list-style: none;
}

.mobile-menu-user-header {
    padding: 1rem 1.25rem;
    background: var(--surface-bg);
    border-bottom: 1px solid var(--border-light);
    list-style: none;
    flex-shrink: 0;
}

.mobile-menu-user-info {
    display: flex;
    align-items: center;
}

.mobile-menu-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.mobile-menu-user-email {
    font-size: 0.8rem;
    color: var(--text-on-surface-secondary);
}

.mobile-menu-link-danger {
    color: #ef4444 !important;
}

.mobile-menu-link-danger:hover {
    background: var(--danger-bg) !important;
    color: #f87171 !important;
}

.mobile-menu-link-danger i {
    color: #ef4444 !important;
}

.mobile-menu-link-danger:hover i {
    color: #f87171 !important;
}

/* DESKTOP (≥1201px) - Full navbar with menu */
@media (min-width: 1201px) {
    .nav-container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }

    .nav-brand-desktop {
        display: flex !important;
    }

    .nav-brand-mobile,
    .nav-top-row {
        display: none !important;
    }

    .navbar-search-container {
        display: block !important;
        flex: 1 1 100px;
        min-width: 60px;
        max-width: 300px;
    }

    .navbar-search-container-mobile {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
    }

    .hamburger-menu-btn {
        display: none !important;
    }
}

/* TABLET/MEDIUM (769px - 1200px) - Horizontal layout with hamburger */
@media (min-width: 769px) and (max-width: 1200px) {
    .nav-container {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.5rem !important;
    }

    .nav-brand-desktop {
        display: flex !important;
    }

    .nav-brand-mobile {
        display: none !important;
    }

    /* Use display: contents to extract children from nav-top-row */
    .nav-top-row {
        display: contents !important;
    }

    /* Hide nav-brand-mobile but show hamburger */
    .nav-top-row .nav-brand-mobile {
        display: none !important;
    }

    .nav-top-row .navbar-search-container-mobile {
        display: none !important;
    }

    /* Show hamburger actions */
    .nav-top-row .nav-actions-mobile {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        order: 3;
        margin-left: auto;
    }

    .hamburger-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 40px;
        height: 40px;
        background: var(--surface-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
        padding: 8px;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
        z-index: 1001;
        flex-shrink: 0;
    }

    .navbar-search-container {
        display: block !important;
        flex: 1;
        max-width: 400px;
    }

    .navbar-search-container-mobile {
        display: none !important;
    }

    .nav-menu {
        display: none !important;
    }

    .hamburger-menu-btn:hover {
        background: var(--surface-bg-hover);
        border-color: var(--border-light);
    }

    .hamburger-menu-btn.active {
        background: rgba(99, 102, 241, 0.3);
        border-color: rgba(99, 102, 241, 0.5);
    }

    .hamburger-menu-btn span {
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
        transform-origin: center;
    }

    .hamburger-menu-btn.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-menu-btn.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .hamburger-menu-btn.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .mobile-menu-overlay,
    .mobile-menu {
        display: block !important;
    }
}

/* MOBILE (≤768px) - Vertical layout with mobile top row */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem var(--spacing-sm);
    }

    .nav-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
    }

    .nav-brand-desktop,
    .navbar-search-container,
    .nav-menu,
    .gsmos-phone-toggle--brand {
        display: none !important;
    }

    .nav-top-row {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .nav-brand-mobile {
        display: flex !important;
        font-size: 0.875rem;
        flex-shrink: 0;
        gap: 0.375rem;
        min-width: 0;
        overflow: hidden;
        max-width: 30%;
    }

    .nav-brand {
        font-size: 0.875rem;
        flex-shrink: 0;
        gap: 0.375rem;
        min-width: 0;
        overflow: hidden;
    }

    .nav-brand-text {
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 80px;
    }

    .nav-brand img {
        height: 24px !important;
        flex-shrink: 0;
    }

    .nav-brand i {
        font-size: 1.2rem !important;
        flex-shrink: 0;
    }

    .nav-actions-mobile {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
        min-width: 0;
    }

    .navbar-search-container-mobile {
        display: block !important;
        flex: 1;
        min-width: 0;
        max-width: 150px;
        overflow: hidden;
    }

    .navbar-search-container-mobile .search-input {
        max-width: 100%;
        overflow: hidden;
        font-size: 16px !important;
        padding: 0.4rem 0.5rem 0.4rem 2rem;
    }

    .navbar-search-container-mobile .search-icon {
        left: 0.5rem;
        font-size: 0.75rem;
    }

    .hamburger-menu-btn {
        display: flex !important;
        flex-shrink: 0;
        min-width: 32px;
        max-width: 32px;
        flex-direction: column;
        justify-content: space-around;
        width: 32px;
        height: 32px;
        background: var(--surface-bg);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
        padding: 6px;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
        z-index: 1001;
    }

    .hamburger-menu-btn:hover {
        background: var(--surface-bg-hover);
        border-color: var(--border-light);
    }

    .hamburger-menu-btn.active {
        background: rgba(99, 102, 241, 0.3);
        border-color: rgba(99, 102, 241, 0.5);
    }

    .hamburger-menu-btn span {
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
        transform-origin: center;
    }

    .hamburger-menu-btn.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger-menu-btn.active span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .hamburger-menu-btn.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-link-mobile-login {
        display: flex;
    }

    .mobile-menu-overlay,
    .mobile-menu {
        display: block !important;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .main-content {
        padding: var(--spacing-sm);
        /* Add top padding to account for fixed navbar */
        padding-top: calc(var(--spacing-sm) + 60px);
    }

    .card-3d,
    .entry-card,
    .client-card,
    .phone-card {
        padding: var(--spacing-md);
    }

    .modal-content {
        max-width: 95vw;
        max-height: calc(100vh - 60px);
        margin: 30px auto;
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .stats-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .stat-card {
        padding: var(--spacing-sm);
    }

    .stat-card h3 {
        font-size: 1.25rem;
    }

    /* Override: entry-actions and client-actions should NOT use column layout on mobile */
    /* They should use flex row with 4 buttons per row - override comes after this section */
    /* Only apply column layout to other buttons not in entry-actions or client-actions */
    /* Use more specific selector to avoid affecting buttons inside entry-actions/client-actions */
    .card-3d>.btn:not(.entry-actions .btn):not(.client-actions .btn),
    .modal-body>.btn:not(.entry-actions .btn):not(.client-actions .btn),
    .form-group>.btn:not(.entry-actions .btn):not(.client-actions .btn) {
        width: 100%;
        justify-content: center;
    }

    /* CRITICAL: Override column layout for entry-actions, client-actions, and action-buttons */
    /* Mobile: Use flexbox with calculated max-width to ensure 4 buttons per row */
    .entry-actions,
    .client-actions,
    .action-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: center !important;
        /* Center all buttons, including incomplete rows */
        align-items: center !important;
        padding: 0.75rem 0 !important;
        width: 100% !important;
        max-width: calc((52px * 4) + (0.5rem * 3)) !important;
        /* Exactly 4 buttons (52px each) + 3 gaps (0.5rem each) = 208px + 1.5rem */
        margin: 0 auto !important;
        /* Center the container itself */
    }

    /* Păstrează 2 rânduri explicite (Intrări / Comenzi) și pe ecran îngust */
    .entry-actions.entry-actions-two-rows {
        flex-direction: column !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .entry-actions.entry-actions-two-rows .entry-actions-row {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: calc((52px * 4) + (0.5rem * 3)) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        min-height: 0 !important;
    }

    .entry-actions .btn,
    .client-actions .btn,
    .action-buttons .btn,
    .entry-actions .btn-sm,
    .client-actions .btn-sm,
    .action-buttons .btn-sm {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 12px !important;
        font-size: 0 !important;
        position: relative !important;
        overflow: hidden !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Show only icons */
    .entry-actions .btn i,
    .client-actions .btn i,
    .action-buttons .btn i {
        font-size: 1.4rem !important;
        margin: 0 !important;
        display: block !important;
        line-height: 1 !important;
    }

    /* Hide text */
    .entry-actions .btn span,
    .client-actions .btn span,
    .action-buttons .btn span {
        display: none !important;
    }
}

/* SMS button - show only on mobile devices */
.btn-sms-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .btn-sms-mobile {
        display: flex !important;
    }
}

/* Hide SMS button on desktop */
@media (min-width: 769px) {
    .btn-sms-mobile {
        display: none !important;
    }
}

/* Call button - show only on mobile devices */
.btn-call-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .btn-call-mobile {
        display: flex !important;
    }
}

/* Hide call button on desktop */
@media (min-width: 769px) {
    .btn-call-mobile {
        display: none !important;
    }
}

/* Photo upload buttons - show desktop version by default, mobile version only on mobile */
.btn-upload-photo-desktop {
    display: flex !important;
}

.btn-upload-photo-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .btn-upload-photo-desktop {
        display: none !important;
    }

    .btn-upload-photo-mobile {
        display: flex !important;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

/* Hide main page scrollbar while keeping scroll functionality */
html,
body {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Default scrollbar styling for internal elements (modals, lists, etc.) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

/* Lista Intrări / Reparații (#entriesGrid) + Clienți (#clientsGrid): mod ultra-lite — minim GPU, minim straturi, fără animații */
#entriesGrid.entries-grid,
#clientsGrid.entries-grid {
    content-visibility: visible !important;
    contain-intrinsic-size: auto;
    contain: none !important;
    gap: 0.65rem;
}

#entriesGrid .entry-card,
#clientsGrid .entry-card {
    content-visibility: visible !important;
    contain-intrinsic-size: auto;
    contain: none !important;
    animation: none !important;
    transform: none !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    -webkit-font-smoothing: auto;
    /* umbră unică, slabă — fără shadow-xl + glow */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: none;
}

#entriesGrid .entry-card::before,
#clientsGrid .entry-card::before {
    display: none !important;
    content: none !important;
}

/* Hover: doar culoare bordură/fond — zero transform, zero umbră animată */
#entriesGrid .entry-card:hover,
#clientsGrid .entry-card:hover {
    border-color: var(--glass-border-light);
}

#entriesGrid .entry-card-category-icon-inline,
#clientsGrid .entry-card-category-icon-inline {
    background: var(--glass-bg);
    box-shadow: none;
    transition: none;
}

html.light-mode #entriesGrid .entry-card-category-icon-inline,
html.light-mode #clientsGrid .entry-card-category-icon-inline {
    background: rgba(255, 255, 255, 0.88);
}

#entriesGrid .entry-card:hover .entry-card-category-icon-inline,
#clientsGrid .entry-card:hover .entry-card-category-icon-inline {
}

#entriesGrid .status-progress-bullet,
#clientsGrid .status-progress-bullet {
    transition: none !important;
}

#entriesGrid .status-progress-step.status-step-clickable:hover .status-progress-bullet,
#clientsGrid .status-progress-step.status-step-clickable:hover .status-progress-bullet {
}

/* Intrări: 4 coloane doar pe ecrane late — sub ~1400px rămân 3 coloane (.entries-grid @1024) ca să nu fie înghesuit pe laptop/tablet landscape */
@media (min-width: 1400px) {

    #entriesGrid.entries-grid,
    #ordersGrid.entries-grid,
    #clientsGrid.entries-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

#entriesGrid .entry-card,
#ordersGrid .entry-card,
#clientsGrid .entry-card {
    min-width: 0;
    padding: 0.65rem 0.72rem;
    gap: 0.4rem;
    margin-bottom: 0;
}

#entriesGrid .entry-header,
#clientsGrid .entry-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    row-gap: 0.35rem;
    margin-bottom: 0.1rem;
}

#entriesGrid .entry-header .entry-badge-standard,
#clientsGrid .entry-header .entry-badge-standard {
    margin: 0;
}

/* Clienți: încasări + stele review + profit pe un rând; stele compacte ca să nu împingă header-ul pe verticală */
#clientsGrid .client-financial-badge {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    align-self: center;
    max-width: 100%;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: middle;
}

#clientsGrid .client-financial-badge__seg {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    white-space: nowrap;
    min-width: 0;
    line-height: 1.15;
    padding: 2px 5px;
}

#clientsGrid .client-financial-badge__seg--revenue {
    flex: 1 1 auto;
    background: #0ea5e9;
    color: white;
    padding-left: 6px;
}

#clientsGrid .client-financial-badge__seg--profit {
    flex: 1 1 auto;
    background: #059669;
    color: white;
    padding-right: 6px;
}

#clientsGrid .client-financial-badge__seg strong {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#clientsGrid .client-financial-badge__review {
    flex: 0 0 auto;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 3px !important;
    margin: 0;
    background: #f59e0b;
    color: white;
    line-height: 1;
    min-height: 0;
    align-self: stretch;
    max-width: 2.35rem;
}

#clientsGrid .client-financial-badge__star {
    font-size: 0.48rem !important;
    line-height: 1 !important;
    width: 0.42rem;
    flex: 0 0 0.42rem;
    text-align: center;
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.42);
}

#clientsGrid .client-financial-badge__star.is-on {
    color: #fef3c7;
}

#entriesGrid .status-progress-container,
#ordersGrid .status-progress-container,
#clientsGrid .status-progress-container {
    padding: 0.3rem 0;
    margin: 0.2rem 0;
}

#entriesGrid .status-progress-container > .status-progress-bar,
#ordersGrid .status-progress-container > .status-progress-bar,
#clientsGrid .status-progress-container > .status-progress-bar {
    margin-bottom: 0.35rem;
}

#entriesGrid .status-progress-container > .status-progress-bar::before,
#ordersGrid .status-progress-container > .status-progress-bar::before,
#clientsGrid .status-progress-container > .status-progress-bar::before {
    left: 8px;
    right: 8px;
    top: 8px;
}

#entriesGrid .status-progress-container > .status-progress-bar:has(.status-progress-duration)::before,
#clientsGrid .status-progress-container > .status-progress-bar:has(.status-progress-duration)::before {
    top: calc(0.85rem + 7px);
}

#entriesGrid .status-progress-container > .status-progress-bar .status-progress-duration,
#clientsGrid .status-progress-container > .status-progress-bar .status-progress-duration {
    font-size: 0.52rem;
}

#entriesGrid .status-progress-container > .status-progress-bar > .status-progress-step,
#ordersGrid .status-progress-container > .status-progress-bar > .status-progress-step,
#clientsGrid .status-progress-container > .status-progress-bar > .status-progress-step {
    flex: 1 1 0;
    min-width: 0;
    max-width: 38px;
}

#entriesGrid .status-progress-container > .status-progress-bar .status-progress-bullet,
#ordersGrid .status-progress-container > .status-progress-bar .status-progress-bullet,
#clientsGrid .status-progress-container > .status-progress-bar .status-progress-bullet {
    width: 14px;
    height: 14px;
    margin-bottom: 0.2rem;
}

#entriesGrid .status-progress-container > .status-progress-bar .status-progress-step.current .status-progress-bullet,
#ordersGrid .status-progress-container > .status-progress-bar .status-progress-step.current .status-progress-bullet,
#clientsGrid .status-progress-container > .status-progress-bar .status-progress-step.current .status-progress-bullet {
    width: 17px;
    height: 17px;
}

#entriesGrid .status-progress-container > .status-progress-bar > .status-progress-step > .status-progress-label,
#ordersGrid .status-progress-container > .status-progress-bar > .status-progress-step > .status-progress-label,
#clientsGrid .status-progress-container > .status-progress-bar > .status-progress-step > .status-progress-label {
    font-size: 0.48rem;
    letter-spacing: 0;
    line-height: 1.05;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

#entriesGrid .btn-advance-status,
#ordersGrid .btn-advance-status,
#clientsGrid .btn-advance-status {
    padding: 0.38rem 0.45rem;
    gap: 0.4rem;
}

#entriesGrid .btn-advance-status:not(.btn-preda-client):not(.btn-warranty-return):not(.btn-buy-from-client),
#ordersGrid .btn-advance-status:not(.btn-preda-client):not(.btn-warranty-return):not(.btn-buy-from-client),
#clientsGrid .btn-advance-status:not(.btn-preda-client):not(.btn-warranty-return):not(.btn-buy-from-client) {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
}

#entriesGrid .btn-advance-status .advance-status-badge,
#ordersGrid .btn-advance-status .advance-status-badge,
#clientsGrid .btn-advance-status .advance-status-badge {
    padding: 0.28rem 0.45rem;
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#entriesGrid .entry-info:not(.entry-info-quad),
#ordersGrid .entry-info:not(.entry-info-quad),
#clientsGrid .entry-info:not(.entry-info-quad) {
    grid-template-columns: 1fr;
    gap: 0.3rem;
}

/* 4 subsecțiuni: 2×2 (Client | Dispozitiv / Defect | Dată) */
#entriesGrid .entry-info.entry-info-quad,
#ordersGrid .entry-info.entry-info-quad,
#clientsGrid .entry-info.entry-info-quad {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 0.45rem;
    align-items: stretch;
}

#entriesGrid .entry-info.entry-info-quad > .entry-info-fullspan,
#ordersGrid .entry-info.entry-info-quad > .entry-info-fullspan,
#clientsGrid .entry-info.entry-info-quad > .entry-info-fullspan {
    grid-column: 1 / -1;
}

#entriesGrid .entry-info > p,
#ordersGrid .entry-info > p,
#clientsGrid .entry-info > p {
    padding: 0.32rem 0.42rem;
    font-size: 0.8125rem;
}

#entriesGrid .entry-info.entry-info-quad > p,
#ordersGrid .entry-info.entry-info-quad > p,
#clientsGrid .entry-info.entry-info-quad > p {
    margin: 0;
    min-width: 0;
}

/* Butoane card: mobil — 2 benzi (rânduri) ca înainte */
@media (max-width: 640px) {

    #entriesGrid .entry-actions.entry-actions-two-rows,
    #ordersGrid .entry-actions.entry-actions-two-rows,
    #clientsGrid .entry-actions.entry-actions-two-rows {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.35rem;
        flex-wrap: nowrap;
    }

    #entriesGrid .entry-actions-two-rows .entry-actions-row,
    #ordersGrid .entry-actions-two-rows .entry-actions-row,
    #clientsGrid .entry-actions-two-rows .entry-actions-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.35rem;
        min-height: 2.15rem;
    }

    #entriesGrid .entry-actions-two-rows .entry-actions-row:empty,
    #ordersGrid .entry-actions-two-rows .entry-actions-row:empty,
    #clientsGrid .entry-actions-two-rows .entry-actions-row:empty {
        min-height: 0;
    }
}

/* Mediu + mare: ~3 butoane pe rând, rândurile incomplete (ex. al 2-lea) centrate — flex + wrap, nu grid (grid alinia la stânga ultimul rând) */
@media (min-width: 641px) {

    #entriesGrid .entry-actions.entry-actions-two-rows,
    #ordersGrid .entry-actions.entry-actions-two-rows,
    #clientsGrid .entry-actions.entry-actions-two-rows {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-content: flex-start;
        align-items: stretch;
        gap: 0.4rem 0.45rem;
    }

    #entriesGrid .entry-actions-two-rows .entry-actions-row,
    #ordersGrid .entry-actions-two-rows .entry-actions-row,
    #clientsGrid .entry-actions-two-rows .entry-actions-row {
        display: contents;
        min-height: 0;
    }

    #entriesGrid .entry-actions-two-rows .entry-actions-row > .btn,
    #ordersGrid .entry-actions-two-rows .entry-actions-row > .btn,
    #clientsGrid .entry-actions-two-rows .entry-actions-row > .btn,
    #entriesGrid .entry-actions-two-rows .entry-actions-row > a.btn,
    #ordersGrid .entry-actions-two-rows .entry-actions-row > a.btn,
    #clientsGrid .entry-actions-two-rows .entry-actions-row > a.btn,
    #entriesGrid .entry-actions-two-rows .entry-actions-row > span.btn,
    #ordersGrid .entry-actions-two-rows .entry-actions-row > span.btn,
    #clientsGrid .entry-actions-two-rows .entry-actions-row > span.btn {
        flex: 0 1 calc((100% - 0.9rem) / 3);
        max-width: calc((100% - 0.9rem) / 3);
        width: auto;
        min-width: 0;
        justify-content: center;
        margin: 0;
    }
}

/* Lista Comenzi (#ordersGrid): același tratament vizual ca #entriesGrid (dimensiuni, umbră, fără animații) */
#ordersGrid.entries-grid {
    content-visibility: visible !important;
    contain-intrinsic-size: auto;
    contain: none !important;
    gap: 0.65rem;
}

#ordersGrid .entry-card {
    content-visibility: visible !important;
    contain-intrinsic-size: auto;
    animation: none !important;
    contain: none !important;
    transform: none !important;
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
    -webkit-font-smoothing: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: none;
}

#ordersGrid .entry-card::before {
    display: none !important;
    content: none !important;
}

#ordersGrid .entry-card:hover {
    border-color: var(--glass-border-light);
}

#ordersGrid .entry-card-category-icon-inline {
    background: var(--glass-bg);
    box-shadow: none;
    transition: none;
}

html.light-mode #ordersGrid .entry-card-category-icon-inline {
    background: rgba(255, 255, 255, 0.88);
}

#ordersGrid .entry-card:hover .entry-card-category-icon-inline {
}

#ordersGrid .status-progress-bullet {
    transition: none !important;
}

#ordersGrid .status-progress-step.status-step-clickable:hover .status-progress-bullet {
}

/* AWB: întins pe lățimea grid-ului entry-info (ca secțiuni full-width pe intrări) */
#ordersGrid .entry-info .awb-tracking-section {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

#ordersGrid .awb-tracking-section .awb-main-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
}

#ordersGrid .awb-tracking-section .awb-number-cell {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.8125rem;
}

#ordersGrid .awb-tracking-section .awb-number-cell > div {
    line-height: 1.2;
}

#ordersGrid .awb-tracking-section .awb-curier-cell {
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
}

#ordersGrid .awb-tracking-section .awb-status-cell {
    font-size: 0.75rem;
    font-weight: 700;
}

#ordersGrid .awb-tracking-section .awb-location-cell {
    font-size: 0.75rem;
    color: var(--text-muted);
}

#ordersGrid .awb-tracking-section .awb-eta-cell {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

#ordersGrid .awb-tracking-section .awb-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.35rem;
    margin-top: 0.15rem;
    border-top: 1px dashed var(--border-light);
    font-size: 0.65rem;
}

/* Comenzi: card compact (4 rânduri info ca la reparații, fără dublura Avansează status) */
#ordersGrid .order-card-header-compact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    row-gap: 0.35rem;
    margin-bottom: 0.15rem;
}

#ordersGrid .order-card-header-compact .entry-badge-standard {
    margin: 0;
}

#ordersGrid .order-card-phone-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.4rem;
    padding: 0.12rem 0.35rem;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 4px;
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 500;
    vertical-align: middle;
}

#ordersGrid .order-card-phone-pill i {
    font-size: 0.68rem;
}

#ordersGrid .order-card-info-compact > p {
    margin-bottom: 0.32rem;
}

#ordersGrid .order-card-info-compact > p:last-child {
    margin-bottom: 0;
}

#ordersGrid .order-card-line-plain {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    text-align: left;
}

#ordersGrid .order-card-meta-sep {
    opacity: 0.45;
    margin: 0 0.2rem;
}

#ordersGrid .order-card-notes-hint {
    margin-left: 0.35rem;
    opacity: 0.65;
    font-size: 0.75rem;
}

#ordersGrid .order-card-accesoriu {
    border-left: 3px solid rgba(234, 88, 12, 0.85);
}

#ordersGrid .order-card-anulat {
    opacity: 0.88;
}

#ordersGrid .order-card-anulat .entry-status {
    background: #EF4444 !important;
}

#ordersGrid .order-cancel-btn {
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.45);
}

#ordersGrid .order-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.7);
}

#ordersGrid .status-progress-container {
    margin-top: 0.15rem;
    margin-bottom: 0.35rem;
}

#ordersGrid .order-ecolet-tracking--compact {
    padding: 0.35rem 0.45rem;
    margin-top: 0.3rem;
}

#ordersGrid .order-ecolet-mini-progress {
    margin-bottom: 0.3rem;
}

#ordersGrid .order-ecolet-mini-progress .status-progress-label {
    font-size: 0.58rem;
}

#ordersGrid .order-ecolet-mini-progress .status-progress-step .status-progress-bullet {
    width: 7px;
    height: 7px;
}

#ordersGrid .order-ecolet-compact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.72rem;
    line-height: 1.25;
}

#ordersGrid .order-ecolet-awb {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    font-size: 0.78rem;
}

#ordersGrid .order-ecolet-courier {
    font-size: 0.65rem;
    opacity: 0.85;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--surface-bg);
}

#ordersGrid .order-ecolet-status {
    font-weight: 600;
    font-size: 0.7rem;
}

#ordersGrid .order-ecolet-curier-link {
    margin-left: auto;
    color: var(--text-secondary);
    padding: 0.2rem;
}

#ordersGrid .order-ecolet-err {
    font-size: 0.62rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--surface-bg), transparent);

}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   NEW DASHBOARD LAYOUT - 4 SECTIONS
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(500px, auto) auto;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dashboard-section {
    background: var(--card-bg);
border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    min-height: 0;
}

/* Chart section spans full width on second row */
.dashboard-section.chart-section {
    grid-column: 1 / -1;
    grid-row: 2;
    height: auto;
    min-height: auto;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.section-title i {
    color: var(--primary-light);
}

.stock-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Financial Section - Completely Redesigned for Desktop */
.financial-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.6rem;
    flex: 1;
    min-height: 0;
    height: 100%;
    align-content: stretch;
}

/* All 4 cards have the same size and structure */
.financial-card-main,
.financial-card-simple {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    min-height: 0;
    overflow: hidden;
    height: 100%;
}

.financial-card-main:hover,
.financial-card-simple:hover {
    border-color: var(--border-color);
    background: var(--surface-bg-hover);
}

/* Card header with icon and title */
.financial-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-shrink: 0;
}

.financial-icon-large,
.financial-icon-small {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.financial-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Main value display */
.financial-card-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 0.4rem;
    word-break: break-word;
    flex-shrink: 0;
}

/* Breakdown for sold total card */
.financial-card-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
    flex-shrink: 0;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
}

.breakdown-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 500;
    flex-shrink: 0;
}

.breakdown-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Simple card content (for income, expenses, profit) */
.financial-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    overflow: hidden;
}

.financial-card-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 0.4rem;
    line-height: 1.1;
    flex-shrink: 0;
}

.financial-card-amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Combined Section Container */
.combined-section-container {
    display: flex;
    gap: 1rem;
    height: 100%;
}

.combined-section-half {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.repairs-half {
    flex: 1;
}

.qr-half {
    display: none;
    /* Hidden on desktop by default */
    flex: 1;
}

/* Desktop: Hide QR section, show repairs full width */
@media (min-width: 769px) {
    .qr-half {
        display: none !important;
    }

    .repairs-half {
        width: 100%;
    }

    .combined-section-container {
        flex-direction: row;
    }
}

/* Repairs Section */
.repairs-list {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    min-height: 0;
    align-content: start;
}

.repairs-list::-webkit-scrollbar {
    width: 6px;
}

.repairs-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: var(--radius-full);
}

.repairs-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}

.repairs-list::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.repair-item {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.7rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 0;
}

.repair-item:hover {
    background: var(--surface-bg-hover);
    border-color: var(--border-color);
}

.repair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
    gap: 0.5rem;
}

.repair-code {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.repair-status {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-full);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    flex-shrink: 0;
}

.repair-client {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repair-device {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repair-defect {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.repair-cost {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Repair actions buttons */
.repair-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-repair-action {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    min-height: 44px;
    /* Minimum touch target size */
}

.btn-repair-action .btn-text {
    display: inline;
}

.btn-repair-action i {
    font-size: 1.1rem;
}

/* Mobile: Make buttons square with icons only */
@media (max-width: 768px) {
    .btn-repair-action {
        flex: 1 1 calc(50% - 0.25rem);
        min-width: 60px;
        aspect-ratio: 1;
        padding: 0.75rem;
        border-radius: var(--radius-md);
    }

    .btn-repair-action .btn-text {
        display: none;
    }

    .btn-repair-action i {
        font-size: 1.3rem;
    }

    /* Ensure both buttons fit nicely */
    .repair-actions {
        gap: 0.5rem;
    }

    .repair-actions .btn-repair-action {
        min-width: calc(50% - 0.25rem);
    }
}

/* Phone Search Section */
.phone-search-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    overflow: hidden;
}

.phone-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--input-text);
    font-size: 0.875rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.phone-search-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.phones-results {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    max-height: 100%;
}

.phones-results::-webkit-scrollbar {
    width: 6px;
}

.phones-results::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: var(--radius-full);
}

.phones-results::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}

.phones-results::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.phone-card {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.6rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 0;
}

.phone-card:hover {
    background: var(--surface-bg-hover);
    border-color: var(--border-color);
}

.phone-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
    gap: 0.5rem;
}

.phone-card-code {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.phone-card-status {
    font-size: 0.6rem;
    padding: 0.15rem 0.35rem;
    border-radius: var(--radius-full);
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.phone-card-model {
    font-size: 0.7rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phone-card-model i {
    color: var(--primary-light);
    margin-right: 0.35rem;
    font-size: 0.65rem;
}

.phone-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    margin-bottom: 0.4rem;
}

.phone-card-details>div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phone-card-details i {
    width: 12px;
    color: var(--primary-light);
    margin-right: 0.3rem;
    font-size: 0.65rem;
}

.phone-card-prices {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.price-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.price-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Client Search Section */
.client-search-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.client-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--input-text);
    font-size: 0.875rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.client-search-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--input-bg-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.clients-results {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.search-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-align: center;
    justify-content: center;
    flex: 1;
}

.client-card {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.6rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 0;
}

.client-card:hover {
    background: var(--surface-bg-hover);
    border-color: var(--border-color);
}

.client-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
}

.client-details>div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-details i {
    width: 12px;
    color: var(--primary-light);
    margin-right: 0.3rem;
    font-size: 0.65rem;
}

/* Document Archive Section */
.archive-documents-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.archive-document-card {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.archive-document-card:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-color);
}

.archive-document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.archive-document-type {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-full);
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.archive-document-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
}

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

.archive-document-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.archive-document-info>div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.archive-document-info i {
    width: 16px;
    color: var(--primary-light);
    font-size: 0.75rem;
}

.archive-document-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.archive-document-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.archive-document-date i {
    color: var(--primary-light);
}

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

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

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-tertiary);
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.loading-spinner i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Desktop optimizations - ensure cards fit properly */
@media (min-width: 1025px) {
    .financial-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        align-items: stretch;
    }

    .financial-card-main,
    .financial-card-simple {
        padding: 1rem;
        min-height: 0;
        max-height: 100%;
        height: 100%;
    }

    .financial-card-value {
        font-size: 1.3rem;
    }

    .financial-card-amount {
        font-size: 1.2rem;
    }

    .financial-icon-large,
    .financial-icon-small {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .financial-card-title {
        font-size: 0.8rem;
    }

    .breakdown-label {
        font-size: 0.7rem;
    }

    .breakdown-value {
        font-size: 0.75rem;
    }

    .financial-card-header {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .financial-card-breakdown {
        gap: 0.4rem;
        padding-top: 0.5rem;
    }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        min-height: auto;
    }

    .dashboard-section.chart-section {
        grid-column: 1;
        grid-row: auto;
    }

    .qr-half {
        display: none !important;
    }

    .repairs-half {
        width: 100%;
    }

    .combined-section-container {
        flex-direction: row;
    }

    .financial-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, auto);
        gap: 0.75rem;
    }

    .financial-card-main,
    .financial-card-simple {
        min-height: auto;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        min-height: auto;
    }

    .dashboard-section {
        padding: 1rem;
    }

    .dashboard-section.chart-section {
        grid-column: 1;
        grid-row: auto;
    }

    .combined-section-container {
        flex-direction: column;
        gap: 1rem;
    }

    .qr-half {
        display: flex !important;
        border-left: none !important;
        border-top: 1px solid var(--border-light) !important;
        padding-left: 0 !important;
        padding-top: 1rem !important;
        margin-top: 1rem !important;
    }

    .phone-search-container {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .phones-results {
        flex: 1;
        overflow-y: auto;
        margin-top: 1rem;
    }

    .financial-cards-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 0.75rem;
    }

    .financial-card-main,
    .financial-card-simple {
        padding: 1rem;
        min-height: auto;
    }

    .financial-card-value {
        font-size: 1.5rem;
    }

    .financial-card-amount {
        font-size: 1.4rem;
    }

    .financial-icon-large,
    .financial-icon-small {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .financial-card-title {
        font-size: 0.875rem;
    }
}

/* Photo Fullscreen Modal */
#photoFullscreenModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

#photoFullscreenModal.active {
    display: flex;
}

.photo-fullscreen-container {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: photoFadeIn 0.3s ease-in-out;
}

@keyframes photoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-inverse);
    font-size: 1.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 10001;
}

.photo-fullscreen-close:hover {
    background: var(--glass-bg-light);
}

.photo-fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-inverse);
    font-size: 1.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 10001;
}

.photo-fullscreen-nav:hover {
    background: var(--glass-bg-light);
}

.photo-fullscreen-prev {
    left: 1rem;
}

.photo-fullscreen-next {
    right: 1rem;
}

.photo-fullscreen-info {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .photo-fullscreen-container {
        width: 100%;
        height: 100%;
    }

    .photo-fullscreen-nav {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .photo-fullscreen-close {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .photo-fullscreen-prev {
        left: 0.5rem;
    }

    .photo-fullscreen-next {
        right: 0.5rem;
    }
}

/* Label Editor Styles */
.label-editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.label-editor-controls {
    background: var(--elevated-bg);
border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.label-editor-controls::-webkit-scrollbar {
    width: 8px;
}

.label-editor-controls::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}

.editor-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--glass-border);
}

.editor-section:last-child {
    border-bottom: none;
}

.editor-section h3 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.control-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.control-group label {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 150px;
}

.control-group input[type="number"],
.control-group select {
    flex: 0 0 100px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.control-group .unit {
    flex: 0 0 30px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    text-align: right;
}

.editor-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--glass-border);
}

.label-preview-container {
    background: var(--elevated-bg);
border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: sticky;
    top: var(--spacing-lg);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.label-preview-wrapper {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.label-preview {
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    padding: 3mm;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 200px;
    min-height: 150px;
    max-height: 250px;
}

.label-preview .label-header {
    font-weight: 900;
    font-size: 8px;
    margin-bottom: 0.2mm;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 0.2mm;
    line-height: 1.0;
    text-transform: uppercase;
    color: #1a1a1a;
}

.label-preview .label-code {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 900;
    color: #000;
    margin-bottom: 0.2mm;
    line-height: 1.1;
    background: #f0f0f0;
    padding: 0.2mm 0.5mm;
    border-radius: 2px;
    display: inline-block;
}

.label-preview .label-brand-model {
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 0.2mm;
    line-height: 1.1;
    color: #1a1a1a;
    text-transform: uppercase;
}

.label-preview .label-specs {
    font-size: 10px;
    font-weight: 800;
    margin: 0.2mm 0;
    line-height: 1.2;
    flex: 1;
}

.label-preview .label-specs span {
    display: block;
    margin: 0.1mm 0;
    padding: 0.2mm 0.3mm;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    border-left: 2px solid #4a90e2;
}

.label-preview .label-price {
    font-size: 18px;
    font-weight: 900;
    color: #d32f2f;
    text-align: center;
    margin-top: auto;
    padding: 0.5mm;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    border-radius: 3px;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
    flex-shrink: 0;
}

.toggle-switch .toggle-slider {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: relative;
    cursor: pointer;
    background-color: #6B7280;
    transition: .4s;
    border-radius: 34px;
    display: inline-block;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    top: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.toggle-slider {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-switch input:focus+.toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Small Toggle Switch */
.toggle-switch-sm .toggle-slider {
    width: 44px;
    height: 24px;
}

.toggle-switch-sm .toggle-slider:before {
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
}

.toggle-switch-sm input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* Autocomplete Results */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--dropdown-shadow);
}

.autocomplete-results .autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.autocomplete-results .autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-results .autocomplete-item:hover,
.autocomplete-results .autocomplete-item.selected {
    background: rgba(99, 102, 241, 0.2);
    border-left: 3px solid #6366f1;
}

.autocomplete-results .autocomplete-item .item-name {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.autocomplete-results .autocomplete-item .item-details {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.autocomplete-results .autocomplete-item .item-icon {
    color: #6366f1;
    font-size: 1.1rem;
}

.autocomplete-results .autocomplete-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

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

    .label-preview-container {
        position: relative;
        top: 0;
    }
}

/* Ecolet logistics components */
.ecolet-card {
    margin-top: 1.5rem;
    border: 1px solid var(--border-lighter);
    border-radius: 12px;
    padding: 1.25rem;
    background: var(--elevated-bg);
}

.ecolet-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ecolet-section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ecolet-section-header p {
    margin: 0.2rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ecolet-fields {
    margin-top: 1rem;
    display: none;
    gap: 1rem;
}

.ecolet-fields.active {
    display: block;
}

.ecolet-fields .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.ecolet-disabled-message {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    font-size: 0.9rem;
    display: none;
}

/* Ensure Ecolet preferences tab doesn't clip locality/street dropdowns */
#tab-preferences .card-3d,
#tab-preferences .card-body,
#tab-preferences form {
    overflow: visible !important;
}

.ecolet-locality-group,
.ecolet-street-group {
    position: relative;
    overflow: visible !important;
    z-index: 10;
}

.ecolet-locality-results,
.ecolet-street-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--elevated-bg-solid);
    border: 2px solid #6366f1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    max-height: 280px;
    overflow-y: auto;
    z-index: 99999;
    display: none;
    pointer-events: auto;
}

.ecolet-locality-results.active,
.ecolet-street-results.active {
    display: block;
}

.ecolet-locality-results.active {
    display: block;
}

.ecolet-locality-item {
    padding: 0.6rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    background: transparent;
    pointer-events: auto;
}

.ecolet-locality-item:hover {
    background: rgba(99, 102, 241, 0.3);
}

.ecolet-locality-item .locality-name {
    font-weight: 600;
    color: var(--text-primary);
}

.ecolet-locality-item .locality-county {
    font-size: 0.85em;
    color: var(--text-on-surface);
}

.ecolet-locality-item:last-child {
    border-bottom: none;
}

.ecolet-locality-item strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.ecolet-locality-item span {
    font-size: 0.8rem;
    color: var(--text-on-surface);
}

.ecolet-shipment-list {
    margin-top: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-lighter);
    background: var(--elevated-bg);
    padding: 1rem;
}

.ecolet-shipment-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.85rem 0.5rem;
    border-bottom: 1px solid var(--border-lighter);
}

.ecolet-shipment-item:last-child {
    border-bottom: none;
}

.ecolet-shipment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ecolet-shipment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.ecolet-shipment-error {
    font-size: 0.85rem;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.ecolet-shipment-error i {
    margin-right: 0.4rem;
}

.ecolet-shipment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.ecolet-shipment-details {
    margin-top: 0.75rem;
    display: none;
    border-top: 1px solid var(--border-lighter);
    padding-top: 0.75rem;
}

.ecolet-shipment-details.active {
    display: block;
}

.ecolet-shipment-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.ecolet-shipment-detail-grid h4 {
    margin: 0 0 0.35rem 0;
    font-size: 0.95rem;
}

.ecolet-status-history {
    margin-top: 0.85rem;
}

.ecolet-status-history h4 {
    margin: 0 0 0.35rem 0;
}

.ecolet-status-history ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ecolet-status-history li {
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.ecolet-status-history li div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.ecolet-status-history li p {
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.ecolet-json-preview {
    margin-top: 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: var(--elevated-bg);
    overflow: hidden;
}

.ecolet-json-preview__header {
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.15);
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.85rem;
}

.ecolet-json-preview pre {
    margin: 0;
    padding: 0.75rem;
    font-size: 0.8rem;
    max-height: 220px;
    overflow: auto;
    background: transparent;
    color: var(--text-secondary);
}

.ecolet-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ecolet-status-chip.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.ecolet-status-chip.success {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.ecolet-status-chip.error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.ecolet-status-chip.info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.ecolet-form-note {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.ecolet-shipments-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ecolet-shipments-table-wrapper {
    margin-top: 1rem;
    overflow-x: auto;
}

.ecolet-shipments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ecolet-shipments-table thead {
    background: var(--table-header-bg);
}

.ecolet-shipments-table th,
.ecolet-shipments-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--table-border);
    text-align: left;
}

.ecolet-shipments-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

.ecolet-shipments-table .actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.ecolet-shipments-pagination {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ============================================
   QUICK ACTION FLOATING BUTTON (FAB)
   Soap Bubble Style with Animated Cards
   ============================================ */

.quick-action-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.quick-action-fab:hover {
}

.quick-action-fab:active {
}

.fab-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Soap bubble effect */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid var(--glass-border);
    box-shadow:
        var(--shadow-lg),
        inset 0 2px 4px rgba(255, 255, 255, 0.4),
        inset 0 -2px 4px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(239, 68, 68, 0.3);
}

/* Bubble shine effect */
.fab-bubble::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 12px;
    width: 16px;
    height: 10px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.7) 0%,
            transparent 100%);
    border-radius: 50%;
    transform: rotate(-30deg);
}

/* Secondary bubble highlight */
.fab-bubble::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 8px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
}

.fab-bubble i {
    font-size: 24px;
    color: #ef4444;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    z-index: 1;
}

/* FisCool — bulină discretă casă de marcat pe colțul FAB */
.fab-fiscool-indicator {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 3;
    border: 1px solid rgba(15, 23, 42, 0.35);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
    pointer-events: none;
    transition: background-color 0.25s ease;
}
.fab-fiscool-indicator.is-online {
    background: #22c55e;
}
.fab-fiscool-indicator.is-offline {
    background: #ef4444;
}
.fab-fiscool-indicator i {
    display: none;
}

.quick-action-fab.active .fab-bubble i {
    transform: rotate(45deg);
}

@keyframes bubbleFloat {

    0%,
    100% {
        transform: translateY(0);
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 2px 4px rgba(255, 255, 255, 0.4),
            inset 0 -2px 4px rgba(0, 0, 0, 0.1),
            0 0 20px rgba(239, 68, 68, 0.3);
    }

    50% {
        transform: translateY(-4px);
        box-shadow:
            0 12px 40px rgba(0, 0, 0, 0.35),
            inset 0 2px 4px rgba(255, 255, 255, 0.5),
            inset 0 -2px 4px rgba(0, 0, 0, 0.1),
            0 0 30px rgba(239, 68, 68, 0.4);
    }
}

/* Quick Action Overlay */
.quick-action-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9997;
    /* Overlay opac simplu: separă clar meniul fără blur/GPU. */
    background: rgba(2, 6, 23, 0.82);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.quick-action-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Quick Action Cards Container */
.quick-action-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 680px;
    width: 100%;
    padding: 24px;
    transform-origin: center;
    position: relative;
    box-sizing: border-box;
    background: var(--elevated-bg-solid, #111827);
    border: 1px solid var(--border-color);
    border-radius: 20px;
}

/* Cards grid wrapper */
.quick-action-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    justify-items: stretch;
    align-items: stretch;
}

/* Individual Quick Action Card */
.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px 24px;
    background: var(--surface-bg-solid, var(--elevated-bg-solid, #111827));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 1;
    min-width: 0;
    width: 100%;
    aspect-ratio: 1;
    box-sizing: border-box;
}

.quick-action-card--empty {
    pointer-events: none;
    opacity: 0.28;
    border-style: dashed;
    cursor: default;
}
.quick-action-card--empty .quick-action-card-icon {
    background: transparent !important;
    border: 1.5px dashed var(--border-color);
    color: var(--text-tertiary);
}
.quick-action-card--empty .quick-action-card-label { color: var(--text-tertiary); }

.quick-action-overlay.active .quick-action-card {
    opacity: 1;
}

/* Staggered animation for cards */
.quick-action-overlay.active .quick-action-card:nth-child(1) {
    transition-delay: 0.05s;
}

.quick-action-overlay.active .quick-action-card:nth-child(2) {
    transition-delay: 0.08s;
}

.quick-action-overlay.active .quick-action-card:nth-child(3) {
    transition-delay: 0.11s;
}

.quick-action-overlay.active .quick-action-card:nth-child(4) {
    transition-delay: 0.14s;
}

.quick-action-overlay.active .quick-action-card:nth-child(5) {
    transition-delay: 0.17s;
}

.quick-action-overlay.active .quick-action-card:nth-child(6) {
    transition-delay: 0.2s;
}

/* Card closing animation - reverse to FAB */
.quick-action-overlay:not(.active) .quick-action-card {
    transition-delay: 0s;
}

.quick-action-card:hover {
    background: var(--elevated-bg-solid, #111827);
    border-color: var(--primary);
}

.quick-action-card:active {
}

.quick-action-card-icon {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.quick-action-card:hover .quick-action-card-icon {
}

.quick-action-card-icon i {
    font-size: 44px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quick-action-card-label {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.02em;
}

.qrw-shortcut-kbd {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.62rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 0.08rem 0.38rem;
    line-height: 1.2;
    pointer-events: none;
}

[data-theme="light"] .quick-action-card .qrw-shortcut-kbd,
html.light-mode .quick-action-card .qrw-shortcut-kbd {
    color: #334155;
    background: rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.btn .qrw-shortcut-kbd {
    margin-top: 0;
    margin-left: 0.15rem;
    color: inherit;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
}

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

/* Quick Actions — contrast explicit pentru tema light */
[data-theme="light"] .quick-action-overlay,
html.light-mode .quick-action-overlay {
    background: rgba(15, 23, 42, 0.68);
}

[data-theme="light"] .quick-action-cards,
html.light-mode .quick-action-cards {
    background: #ffffff;
    border-color: #94a3b8;
}

[data-theme="light"] .quick-action-card,
html.light-mode .quick-action-card {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

[data-theme="light"] .quick-action-card:hover,
html.light-mode .quick-action-card:hover {
    background: #e2e8f0;
    border-color: #4f46e5;
}

[data-theme="light"] .quick-action-card-label,
html.light-mode .quick-action-card-label {
    color: #0f172a;
    text-shadow: none;
}

/* Mobile Responsive Styles - 2 columns (2x2x2 layout) */
@media (max-width: 768px) {
    .quick-action-fab {
        bottom: 20px;
        right: 20px;
    }

    .fab-bubble {
        width: 56px;
        height: 56px;
    }

    .fab-bubble i {
        font-size: 22px;
    }

    .quick-action-cards {
        gap: 16px;
        max-width: 340px;
        padding: 16px;
        width: 100%;
    }

    .quick-action-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        width: 100%;
        justify-items: stretch;
        align-items: stretch;
    }

    .quick-action-card {
        padding: 24px 16px;
        border-radius: 18px;
        min-width: 0;
        width: 100%;
        aspect-ratio: 1;
    }

    .quick-action-card-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .quick-action-card-icon i {
        font-size: 28px;
    }

    .quick-action-card-label {
        font-size: 14px;
    }
}

/* Small Mobile - still 2 columns */
@media (max-width: 400px) {
    .quick-action-fab {
        bottom: 16px;
        right: 16px;
    }

    .fab-bubble {
        width: 52px;
        height: 52px;
    }

    .fab-bubble i {
        font-size: 20px;
    }

    .quick-action-cards {
        gap: 12px;
        max-width: 300px;
        padding: 12px;
    }

    .quick-action-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        justify-items: stretch;
        align-items: stretch;
    }

    .quick-action-card {
        padding: 20px 12px;
        gap: 10px;
        min-width: 0;
        width: 100%;
        aspect-ratio: 1;
    }

    .quick-action-card-icon {
        width: 56px;
        height: 56px;
        border-radius: 14px;
    }

    .quick-action-card-icon i {
        font-size: 24px;
    }

    .quick-action-card-label {
        font-size: 13px;
    }
}

/* Landscape Mode - all 6 in a row */
@media (max-height: 500px) and (orientation: landscape) {
    .quick-action-cards {
        max-width: 850px;
        gap: 12px;
        width: 100%;
    }

    .quick-action-cards-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
        width: 100%;
        justify-items: stretch;
        align-items: stretch;
    }

    .quick-action-card {
        padding: 16px 10px;
        gap: 8px;
        min-width: 0;
        width: 100%;
        aspect-ratio: 1;
    }

    .quick-action-card-icon {
        width: 48px;
        height: 48px;
    }

    .quick-action-card-icon i {
        font-size: 20px;
    }

    .quick-action-extra-row {
        margin-top: 12px;
        gap: 0.75rem;
    }

    .voice-command-button-icon {
        width: 44px;
        height: 44px;
    }

    .voice-command-button-icon i {
        font-size: 18px;
    }

    .price-quote-search-button-icon {
        width: 44px;
        height: 44px;
    }

    .price-quote-search-emoji {
        font-size: 22px;
    }

    .bug-report-button-icon {
        width: 44px;
        height: 44px;
    }

    .bug-report-button-icon i {
        font-size: 18px;
    }
}

/* Voice + bug: same row under quick action cards */
/* Telegram promo — meniu rapid (legare bot), puls când lipsește conexiunea */
@keyframes gsmosTelegramQuickPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 4px 16px rgba(37, 150, 217, 0.42),
            0 0 0 0 rgba(37, 150, 217, 0.35);
    }
    50% {
        transform: scale(1.045);
        box-shadow:
            0 8px 24px rgba(37, 150, 217, 0.5),
            0 0 0 14px rgba(37, 150, 217, 0);
    }
}

.telegram-connect-quick-button {
    position: relative;
    margin-top: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    pointer-events: none;
}

.quick-action-overlay.active .telegram-connect-quick-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.26s;
}

.telegram-connect-quick-button-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #2aabee 0%, #229ed9 40%, #1b8bcc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
}

.telegram-connect-quick-button-icon.telegram-connect-quick-button-icon--pulse {
}

.telegram-connect-quick-button-icon i {
    font-size: 24px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.telegram-connect-quick-button:hover .telegram-connect-quick-button-icon {
    animation-play-state: paused;
}

.telegram-connect-quick-button:active .telegram-connect-quick-button-icon {
}

@media (max-width: 768px) {
    .telegram-connect-quick-button-icon {
        width: 48px;
        height: 48px;
    }

    .telegram-connect-quick-button-icon i {
        font-size: 20px;
    }
}

.quick-action-extra-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
    margin-top: 20px;
    flex-shrink: 0;
}

/* Voice Command Button - Small button at bottom center */
.voice-command-button {
    position: relative;
    margin-top: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    pointer-events: none;
}

.quick-action-overlay.active .voice-command-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.25s;
}

/* Price quote search (FAB row, left of voice) */
.price-quote-search-button {
    position: relative;
    margin-top: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    pointer-events: none;
}

.quick-action-overlay.active .price-quote-search-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.22s;
}

.price-quote-search-button-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(20, 184, 166, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
}

.price-quote-search-emoji {
    font-size: 26px;
    line-height: 1;
    user-select: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.price-quote-search-button:hover .price-quote-search-button-icon {
        0 6px 20px rgba(20, 184, 166, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.price-quote-search-button:active .price-quote-search-button-icon {
}

@media (max-width: 768px) {
    .price-quote-search-button-icon {
        width: 48px;
        height: 48px;
    }

    .price-quote-search-emoji {
        font-size: 22px;
    }
}

.voice-command-button-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(139, 92, 246, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
}

.voice-command-button-icon i {
    font-size: 22px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.voice-command-button:hover .voice-command-button-icon {
        0 6px 20px rgba(139, 92, 246, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.voice-command-button:active .voice-command-button-icon {
}

/* Mobile responsive for voice command button */
@media (max-width: 768px) {
    .voice-command-button-icon {
        width: 48px;
        height: 48px;
    }

    .voice-command-button-icon i {
        font-size: 20px;
    }
}

/* Bug Report Button - next to voice in quick action row */
.bug-report-button {
    position: relative;
    margin-top: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    pointer-events: none;
}

.quick-action-overlay.active .bug-report-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.28s;
}

.bug-report-button-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(239, 68, 68, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
}

.bug-report-button-icon i {
    font-size: 22px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.bug-report-button:hover .bug-report-button-icon {
        0 6px 20px rgba(239, 68, 68, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.bug-report-button:active .bug-report-button-icon {
}

@media (max-width: 768px) {
    .bug-report-button-icon {
        width: 48px;
        height: 48px;
    }
    .bug-report-button-icon i {
        font-size: 20px;
    }
}

/* Bug Report Modal auto-info section */
.bug-report-auto-info {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-bg-hover, rgba(255,255,255,0.05));
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.bug-report-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
    padding: 0.25rem 0;
}

.bug-report-info-item i {
    width: 16px;
    text-align: center;
    color: var(--text-tertiary, #64748b);
    font-size: 0.75rem;
}

.bug-report-info-item strong {
    color: var(--text-primary, #e2e8f0);
    font-weight: 500;
    word-break: break-all;
}

/* ---- Quick price quote overlay (spotlight / glass, toate layout-urile) ---- */
.gsmos-quote-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: min(10vh, 100px) 1rem 2rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.gsmos-quote-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.gsmos-quote-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
}

.gsmos-quote-dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 640px);
    max-height: min(85vh, 720px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@keyframes gsmosQuoteIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gsmos-quote-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gsmos-quote-header {
    flex-shrink: 0;
    padding: 0 0.15rem 0.15rem;
}

.gsmos-quote-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.gsmos-quote-kbd {
    display: inline-flex;
    align-items: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--surface-bg, #0f172a) 80%, transparent);
    border: 1px solid var(--border-light);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 0.12rem 0.4rem;
    line-height: 1.2;
}

.gsmos-quote-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    line-height: 1.35;
}

.gsmos-quote-welcome {
    padding: 0.35rem 0.15rem 0.5rem;
}

.gsmos-quote-welcome-lead {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-secondary);
    text-align: left;
}

.gsmos-quote-welcome-lead strong {
    color: var(--text-primary);
}

.gsmos-quote-welcome-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.gsmos-quote-example-chip {
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border-light));
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    max-width: 100%;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.gsmos-quote-example-chip:hover {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border-light));
}

.gsmos-quote-field {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    background: var(--elevated-bg-solid, #111827);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    flex-shrink: 0;
}

.gsmos-quote-field-emoji {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.95;
}

.gsmos-quote-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 500;
    outline: none;
}

.gsmos-quote-input::placeholder {
    color: var(--text-on-surface-muted, var(--text-tertiary));
    font-weight: 400;
    font-size: 0.95rem;
}

.gsmos-quote-close {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: var(--surface-bg, #1e293b);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.gsmos-quote-close:hover {
    background: var(--surface-bg-hover);
    color: var(--text-primary);
}

.gsmos-quote-results {
    border-radius: 14px;
    background: var(--elevated-bg-solid, #111827);
    border: 1px solid var(--border-color);
    min-height: 3rem;
    max-height: min(52vh, 480px);
    overflow-y: auto;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.gsmos-quote-op-block {
    margin-bottom: 1rem;
}

.gsmos-quote-op-block:last-child {
    margin-bottom: 0;
}

.gsmos-quote-op-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin: 0 0 0.5rem 0.15rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border-light) 40%, transparent);
}

.gsmos-quote-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
}

.gsmos-quote-identified {
    display: grid;
    gap: 0.28rem;
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary, #6366f1) 8%, var(--surface-bg, #1e293b));
    border: 1px solid color-mix(in srgb, var(--primary, #6366f1) 28%, var(--border-light));
    font-size: 0.82rem;
}

.gsmos-quote-identified div {
    display: flex;
    gap: 0.45rem;
    align-items: baseline;
    min-width: 0;
}

.gsmos-quote-identified span {
    flex: 0 0 8.2rem;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.gsmos-quote-identified strong {
    font-weight: 650;
    color: var(--text-primary);
}

.gsmos-quote-card {
    padding: 0.7rem 0.75rem;
    border-radius: 12px;
    margin-bottom: 0.45rem;
    background: var(--surface-bg, #1e293b);
    border: 1px solid var(--border-light);
}

.gsmos-quote-card:hover {
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border-light));
    background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.gsmos-quote-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.55rem;
}

.gsmos-quote-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.2;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
}

.gsmos-quote-badge--brand {
    background: color-mix(in srgb, #3b82f6 16%, transparent);
    border-color: color-mix(in srgb, #3b82f6 35%, transparent);
}

.gsmos-quote-badge--model {
    background: color-mix(in srgb, #06b6d4 16%, transparent);
    border-color: color-mix(in srgb, #06b6d4 35%, transparent);
}

.gsmos-quote-badge--op {
    background: color-mix(in srgb, #8b5cf6 16%, transparent);
    border-color: color-mix(in srgb, #8b5cf6 35%, transparent);
}

.gsmos-quote-scope {
    margin-top: 0.35rem;
    font-size: 0.68rem;
    font-weight: 650;
    line-height: 1.3;
    color: #a5b4fc;
}

.gsmos-quote-badge--orig {
    background: color-mix(in srgb, #10b981 18%, transparent);
    border-color: color-mix(in srgb, #10b981 40%, transparent);
    color: #6ee7b7;
}

.gsmos-quote-badge--after {
    background: color-mix(in srgb, #f59e0b 18%, transparent);
    border-color: color-mix(in srgb, #f59e0b 40%, transparent);
    color: #fcd34d;
}

.gsmos-quote-badge--swap {
    background: color-mix(in srgb, #8b5cf6 18%, transparent);
    border-color: color-mix(in srgb, #8b5cf6 40%, transparent);
    color: #c4b5fd;
}

.gsmos-quote-price-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
}

.gsmos-quote-price-grid--dual {
    grid-template-columns: 1fr 1fr;
}

.gsmos-quote-price-grid--triple {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 520px) {
    .gsmos-quote-price-grid--dual,
    .gsmos-quote-price-grid--triple {
        grid-template-columns: 1fr;
    }
}

.gsmos-quote-variant {
    border-radius: 10px;
    padding: 0.5rem 0.55rem;
    background: color-mix(in srgb, var(--elevated-bg-solid, #0f172a) 70%, transparent);
    border: 1px solid var(--border-light);
}

.gsmos-quote-variant-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}

.gsmos-quote-money-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

.gsmos-quote-money-row + .gsmos-quote-money-row {
    margin-top: 0.12rem;
}

.gsmos-quote-money-row strong {
    color: var(--text-primary);
    font-weight: 600;
}

.gsmos-quote-money-row--total {
    margin-top: 0.28rem;
    padding-top: 0.28rem;
    border-top: 1px dashed color-mix(in srgb, var(--border-light) 70%, transparent);
    font-size: 0.86rem;
}

.gsmos-quote-money-row--total strong {
    font-size: 0.98rem;
    color: var(--primary-light, #a5b4fc);
}

.gsmos-quote-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin-top: 0.55rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    line-height: 1.35;
}

.gsmos-quote-meta i {
    margin-right: 0.2rem;
    opacity: 0.85;
}

.gsmos-quote-updated--stale-orange {
    color: #f59e0b;
    font-weight: 600;
}

.gsmos-quote-updated--stale-red {
    color: #ef4444;
    font-weight: 600;
}

.gsmos-quote-estimate {
    color: #67e8f9;
}

.gsmos-quote-estimate--muted {
    color: var(--text-tertiary);
}

.gsmos-quote-hint,
.gsmos-quote-empty {
    padding: 0.75rem 0.5rem;
    text-align: center;
    line-height: 1.45;
    color: var(--text-tertiary);
    font-size: 0.88rem;
}

.gsmos-quote-hint strong {
    color: var(--text-secondary);
}

body.gsmos-quote-open {
    overflow: hidden;
}

[data-theme="light"] .gsmos-quote-backdrop,
html.light-mode .gsmos-quote-backdrop {
    background: rgba(15, 23, 42, 0.68);
}

[data-theme="light"] .gsmos-quote-field,
[data-theme="light"] .gsmos-quote-results,
html.light-mode .gsmos-quote-field,
html.light-mode .gsmos-quote-results {
    background: #ffffff;
    border-color: #94a3b8;
}

[data-theme="light"] .gsmos-quote-card,
html.light-mode .gsmos-quote-card {
    background: #f8fafc;
    border-color: #cbd5e1;
}

[data-theme="light"] .gsmos-quote-variant,
html.light-mode .gsmos-quote-variant {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme="light"] .gsmos-quote-badge--orig,
html.light-mode .gsmos-quote-badge--orig {
    color: #047857;
}

[data-theme="light"] .gsmos-quote-badge--swap,
html.light-mode .gsmos-quote-badge--swap {
    color: #6d28d9;
}

[data-theme="light"] .gsmos-quote-badge--after,
html.light-mode .gsmos-quote-badge--after {
    color: #b45309;
}

[data-theme="light"] .gsmos-quote-scope,
html.light-mode .gsmos-quote-scope {
    color: #4338ca;
}

[data-theme="light"] .gsmos-quote-estimate,
html.light-mode .gsmos-quote-estimate {
    color: #0e7490;
}

[data-theme="light"] .gsmos-quote-close,
html.light-mode .gsmos-quote-close {
    background: #e2e8f0;
    color: #334155;
}

/* Bug Report filter buttons (admin) */
.bug-report-filter-btn {
    background: var(--surface-bg, rgba(255,255,255,0.05));
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    color: var(--text-secondary);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.bug-report-filter-btn.active {
    background: var(--primary, #6366f1);
    color: white;
    border-color: var(--primary, #6366f1);
}

/* Hide FAB on login/register/public pages */
body.auth-page .quick-action-fab,
body.auth-page .quick-action-overlay,
body.public-page .quick-action-fab,
body.public-page .quick-action-overlay {
    display: none !important;
}

/* Brand Autocomplete Styles */
.brand-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    margin-top: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--dropdown-shadow);
}

.brand-autocomplete-results .brand-suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
}

.brand-autocomplete-results .brand-suggestion-item:last-child {
    border-bottom: none;
}

.brand-autocomplete-results .brand-suggestion-item:hover {
    background: var(--dropdown-item-hover);
    border-left: 3px solid #6366f1;
}

.brand-autocomplete-results .brand-suggestion-item span {
    flex: 1;
    font-weight: 500;
}

/* Icon categorie – lângă Client / Dispozitiv / Defect / Data recepție, pătrățel glassmorphic 3D mic */
.entry-client-line,
.entry-defect-line,
.entry-defect-date-line,
.entry-device-line,
.entry-date-line {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    justify-content: flex-start;
    text-align: left;
}
.entry-date-line { align-items: center; }
.entry-client-line strong,
.entry-defect-line strong,
.entry-defect-date-line strong,
.entry-device-line strong,
.entry-date-line strong { flex-shrink: 0; }
/* Conținutul din casete (Client, Dispozitiv, Defect, Data) aliniat la stânga, uniform */
.entry-info p {
    text-align: left !important;
    align-items: flex-start;
}
/* Caseta Client: icon + conținut pe rând, la stânga */
.entry-info p.entry-client-line {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    align-items: center;
    min-width: 0;
    overflow: hidden;
}
.entry-info p.entry-client-line .entry-card-category-icon-inline,
.entry-info p.entry-client-line strong { flex-shrink: 0; }
/* Caseta Data receptie: conținut aliniat la stânga, fără overflow */
.entry-info p.entry-date-line {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center;
    align-content: flex-start;
    text-align: left !important;
    min-width: 0;
    overflow: hidden;
}
.entry-info p.entry-date-line .entry-card-category-icon-inline,
.entry-info p.entry-date-line strong { flex-shrink: 0; }
.entry-info p.entry-date-line > *:not(.entry-card-category-icon-inline):not(strong) { min-width: 0; }
/* Defect + dată (sau meta îmbinat) pe un singur rând de card */
.entry-info p.entry-defect-date-line {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: flex-start;
    align-content: flex-start;
    text-align: left !important;
    min-width: 0;
    overflow: hidden;
}
.entry-info p.entry-defect-date-line .entry-card-category-icon-inline,
.entry-info p.entry-defect-date-line strong { flex-shrink: 0; }

/* Celule 2×2 pe card (Client, Dispozitiv, Defect, Dată) */
.entry-info p.entry-quad-cell {
    flex-direction: row !important;
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.45rem !important;
}

.entry-quad-cell__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.entry-quad-cell__body > strong {
    font-size: 0.68rem;
    letter-spacing: 0.03em;
}

.entry-quad-cell__value {
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
    width: 100%;
}

.entry-quad-device-brand {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
}

.entry-quad-cell__phone {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.12rem 0.4rem;
    margin-top: 0.05rem;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 4px;
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 500;
}

.entry-quad-cell__phone i {
    font-size: 0.68rem;
}

.entry-quad-cell__sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin-top: 0.1rem;
}

.entry-card-category-icon-inline {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-on-surface);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.entry-card:hover .entry-card-category-icon-inline {
}

/* Entry card brand logo - small icon next to device name */
.entry-card-brand-logo-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

/* Entry card brand logo (old - keeping for compatibility) */
.entry-card .brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 0.5rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.entry-info .device-with-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   DASHBOARD CHARTS - 3D Animated Glass Style
   ============================================ */

.chart-section {
    background: var(--elevated-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.chart-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(99, 102, 241, 0.5),
            rgba(139, 92, 246, 0.5),
            transparent);
}

.chart-month-badge {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    color: #a5b4fc;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    margin-left: auto;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.chart-container-3d {
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.chart-glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse at center,
            rgba(99, 102, 241, 0.15) 0%,
            rgba(139, 92, 246, 0.1) 30%,
            transparent 70%);
pointer-events: none;
    z-index: 0;
}

@keyframes chartGlowPulse {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.chart-inner-container {
    position: relative;
    z-index: 1;
    height: 300px;
    padding: 1rem 0;
    transform: rotateX(2deg);
    transform-origin: center bottom;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.chart-inner-container:hover {
}

.chart-float-animated {
}

@keyframes chartFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Chart Header with Tabs */
.chart-header-with-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-header-with-tabs .section-title {
    margin-bottom: 0;
}

.chart-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-on-surface-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.chart-tab:hover {
    color: var(--text-on-surface);
    background: var(--surface-bg-hover);
}

.chart-tab.active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.chart-tab i {
    font-size: 0.875rem;
}

.chart-tab-content {
    width: 100%;
    height: 100%;
}

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

/* Chart Stats Row */
.chart-stats-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

.chart-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 1.5rem;
    background: var(--surface-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    min-width: 120px;
}

.chart-stat-item:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.chart-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.chart-stat-label {
    font-size: 0.75rem;
    color: var(--text-on-surface-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chart Error State */
.chart-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    gap: 1rem;
}

.chart-error i {
    font-size: 2.5rem;
    color: #f59e0b;
}

.chart-error p {
    margin: 0;
    font-size: 0.9rem;
}

/* Mobile Responsive for Charts */
@media (max-width: 768px) {
    .chart-section {
        padding: 1rem;
        grid-column: 1;
        grid-row: auto;
    }

    .chart-inner-container {
        height: 250px;
        transform: none;
    }

    .chart-inner-container:hover {
    }

    .chart-stats-row {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .chart-stat-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 100px;
        padding: 0.75rem 1rem;
    }

    .chart-stat-value {
        font-size: 1.4rem;
    }

    .chart-stat-label {
        font-size: 0.65rem;
    }

    .chart-month-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }

    .chart-float-animated {
        animation: none;
    }

    .chart-header-with-tabs {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-tabs {
        width: 100%;
        justify-content: center;
    }

    .chart-tab {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .chart-inner-container {
        height: 200px;
    }

    .chart-stat-item {
        flex: 1 1 100%;
    }

    .chart-tab span {
        display: none;
    }

    .chart-tab i {
        margin: 0;
    }
}

/* ============================================
   SHOW MORE / PAGINATION STYLES
   ============================================ */

/* Hidden entry cards */
.entry-card-hidden {
    display: none !important;
}

/* Show more container */
.show-more-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
    margin-top: 0.5rem;
}

/* Show more button */
.btn-show-more {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-show-more:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-show-more:active {
}

.btn-show-more i {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.btn-show-more:hover i {
}

.btn-show-more .show-more-count {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

/* „Afișează mai mult” pe intrări / clienți: fără animație — cardul apare instant */
#entriesGrid .entry-card-revealed,
#clientsGrid .entry-card-revealed {
    animation: none;
}

/* Animation for revealed cards (alte liste care folosesc aceeași clasă) */
.entry-card-revealed {
    animation: fadeInUp 0.4s ease forwards;
}

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

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-show-more {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .show-more-container {
        padding: 1rem 0;
    }
}

/* ============================================
   MODULAR DASHBOARD WIDGETS SYSTEM
   ============================================ */

/* ========== Dashboard filters: trigger compact + popover flotant ========== */
.df-wrap {
    position: relative;
    margin-bottom: 1.25rem;
}

/* Dashboard: filtre compacte */
.dashboard .df-wrap {
    margin-bottom: 0.6rem;
}

/* Filtre inline lângă titlu Dashboard – mic, compact */
.df-wrap-inline {
    margin-bottom: 0 !important;
    margin-left: auto;
    flex-shrink: 0;
}
.df-wrap-inline .df-trigger {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    gap: 0.35rem;
}
.df-wrap-inline .df-trigger-icon {
    width: 1rem;
    height: 1rem;
}
.df-wrap-inline .df-trigger-chevron {
    font-size: 0.55rem;
}
.df-wrap-inline .df-popover {
    left: auto;
    right: 0;
}

.df-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-on-surface);
    background: linear-gradient(145deg, var(--glass-bg) 0%, var(--surface-bg) 100%);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.df-trigger:hover {
    border-color: var(--border-lighter);
}
.df-trigger:active {
}
.df-trigger[aria-expanded="true"] {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.2);
}
.df-trigger[aria-expanded="true"] .df-trigger-chevron {
    transform: rotate(180deg);
}
.df-trigger-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0.9;
}
.df-trigger-text {
    letter-spacing: 0.02em;
}
.df-trigger-chevron {
    display: flex;
    align-items: center;
    font-size: 0.65rem;
    opacity: 0.7;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Popover: flotant sub trigger */
.df-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    min-width: 260px;
    max-width: min(360px, calc(100vw - 24px));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top left;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.df-popover[hidden] {
    display: block !important;
    pointer-events: none;
    position: absolute;
}
.df-popover.df-popover-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.df-popover-inner {
    padding: 1rem 1.1rem;
    background: var(--dropdown-bg);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.05) inset;
}
.df-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.df-row:last-of-type { margin-bottom: 0; }
.df-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-on-surface-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}
.df-select {
    width: 100%;
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}
.df-select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    background: var(--input-bg-focus);
}
.df-custom-dates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}
.df-date {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    padding: 0.5rem 0.6rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: inherit;
}
.df-date-sep {
    color: var(--text-on-surface-hint);
    font-size: 0.85rem;
}

/* Responsive: pe mobil popover fixed centrat în viewport */
@media (max-width: 768px) {
    .df-wrap { margin-bottom: 1rem; }
    .df-wrap-inline .df-trigger {
        padding: 0.5rem 0.75rem;
    }
    /* Popover fixed – centrat în ecran ca modal, nu se mai iese din viewport */
    .df-popover,
    .df-wrap-inline .df-popover {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        top: 50% !important;
        width: calc(100vw - 24px) !important;
        min-width: 0 !important;
        max-width: none !important;
        transform: translateY(calc(-50% - 6px)) scale(0.98);
        transform-origin: center center;
    }
    .df-popover.df-popover-open,
    .df-wrap-inline .df-popover.df-popover-open {
        transform: translateY(-50%) scale(1);
    }
    .df-popover-inner {
        padding: 1.1rem 1.25rem;
        border-radius: 16px;
    }
    .df-select, .df-date {
        padding: 0.65rem 0.75rem;
        font-size: 16px; /* evita zoom pe iOS la focus */
    }
}

@media (max-width: 480px) {
    .df-wrap .df-trigger {
        padding: 0.6rem 1rem;
    }
}

/* Container pentru stat cards adăugate individual (vizibil doar dacă există cel puțin unul) */
.dashboard-stat-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dashboard-stat-card-wrap {
    position: relative;
}
.dashboard-stat-card-wrap .stat-card-drag-handle {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.2rem;
    font-size: 0.65rem;
    opacity: 0.6;
    z-index: 2;
}
.dashboard-stat-card-wrap .stat-card-drag-handle:hover {
    opacity: 1;
}
.dashboard-stat-card-wrap .od-stat-card.dashboard-stat-card,
.dashboard-stat-card-wrap .od-stat-card {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg, 12px);
    padding: 0.75rem 1rem;
    min-width: 120px;
    position: relative;
}

.dashboard-stat-card-wrap .od-stat-card .od-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    display: block;
    margin-bottom: 0.25rem;
}

.dashboard-stat-card-wrap .od-stat-card .od-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.dashboard-stat-card-wrap .od-stat-card .od-stat-change.positive { color: var(--success, #10b981); }
.dashboard-stat-card-wrap .od-stat-card .od-stat-change.negative { color: var(--danger, #ef4444); }
.dashboard-stat-card-wrap .od-stat-card .od-stat-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary, rgba(255,255,255,0.6));
    margin-top: 0.15rem;
}

/* Container widgeturi — packer JS (.is-packed) umple spațiul sub widgeturi scurte */
.dashboard-widgets-grid {
    margin-top: 0.5rem;
    position: relative;
    width: 100%;
    display: block;
    min-height: 1px;
}
.dashboard-widgets-grid:not(.is-packed) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: 12px;
    align-items: start;
}
.dashboard-widget-sizer {
    display: none !important;
}
.dashboard-widget {
    min-width: 0;
    min-height: 0;
    touch-action: pan-y;
    -webkit-touch-callout: default;
    user-select: text;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}
.dashboard-widgets-grid:not(.is-packed) .dashboard-widget {
    grid-column: span 1;
    width: auto !important;
}
.dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="4"],
.dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="6"] { grid-column: span 1; }
.dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="8"] { grid-column: span 2; }
.dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="12"] { grid-column: span 3; }
.dashboard-widgets-grid.is-packed .dashboard-widget {
    /* lățimea/poziția sunt setate de packer */
    width: auto;
}

.widget-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: default;
    touch-action: pan-y;
    -webkit-user-select: text;
    user-select: text;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    /* fără height: 100% – wrapper-ul are doar înălțimea conținutului, nu se întinde */
}

/* Dashboard: contrast puternic față de canvas — override stilul generic */
body.dashboard-page .widget-wrapper {
    background: var(--dash-surface, #243447);
    border: 2px solid var(--dash-border, rgba(148, 163, 184, 0.42));
    box-shadow: var(--dash-tile-shadow, 0 8px 24px -10px rgba(0, 0, 0, 0.65));
    padding: 0.85rem 0.95rem 0.9rem;
}

.widget-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.widget-header h3 {
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.widget-drag-handle {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.widget-drag-handle:active {
  cursor: grabbing;
}

.widget-header-owner .widget-period-select:focus,
.widget-width-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4);
}

.widget-header-owner .widget-width-btn:hover {
    background: var(--surface-bg-hover) !important;
}

.widget-header h3 i {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.widget-loading,
.widget-error,
.widget-loading-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.widget-error {
    color: var(--danger);
}

/* Widget width classes (1-12 grid columns) */
.widget-width-1 {
    grid-column: span 1;
}

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

.widget-width-3 {
    grid-column: span 3;
}

.widget-width-4 {
    grid-column: span 4;
}

.widget-width-5 {
    grid-column: span 5;
}

.widget-width-6 {
    grid-column: span 6;
}

.widget-width-7 {
    grid-column: span 7;
}

.widget-width-8 {
    grid-column: span 8;
}

.widget-width-9 {
    grid-column: span 9;
}

.widget-width-10 {
    grid-column: span 10;
}

.widget-width-11 {
    grid-column: span 11;
}

.widget-width-12 {
    grid-column: span 12;
}

/* Financial Summary Widget */
.financial-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.financial-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.financial-card:hover {
}

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

.financial-info {
    flex: 1;
}

.financial-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.financial-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Financial Balance Widget */
.financial-balance-widget {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.balance-main {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
}

.balance-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.balance-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.balance-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.balance-item {
    text-align: center;
    padding: 1rem;
    background: var(--surface-bg);
    border-radius: var(--radius-md);
}

.balance-item-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.balance-item-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Financial Balance Widget Full - Enhanced Version */
.financial-balance-widget-full {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.balance-main-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
}

.balance-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.balance-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.balance-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.balance-breakdown-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.balance-breakdown-row .breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.balance-breakdown-row .breakdown-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.balance-breakdown-row .breakdown-label i {
    font-size: 0.75rem;
}

.balance-breakdown-row .breakdown-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Today Stats Row */
.today-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.today-stat-card {
    padding: 1.25rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.today-stat-card:hover {
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

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

.stat-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Responsive adjustments for financial balance widget */
@media (max-width: 992px) {
    .today-stats-row {
        grid-template-columns: 1fr;
    }

    .balance-breakdown-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .balance-breakdown-row .breakdown-item {
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--divider);
    }

    .balance-breakdown-row .breakdown-item:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .balance-value-large {
        font-size: 2rem;
    }

    .balance-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Repairs Summary Widget */
.repairs-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.stat-card:hover {
}

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

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Repairs List Widget */
.repairs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

.repair-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.repair-item:hover {
    background: var(--surface-bg-hover);
}

.repair-code {
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.repair-info {
    margin-bottom: 0.5rem;
}

.repair-client {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.repair-device {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.repair-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    display: inline-block;
}

/* Phones Summary Widget */
.phones-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.phones-summary-grid .stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    text-align: left;
    min-height: 80px;
}

.phones-summary-grid .stat-card:hover {
    background: var(--surface-bg-hover);
}

.phones-summary-grid .stat-card .stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}

.phones-summary-grid .stat-card .stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.phones-summary-grid .stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
    word-break: break-word;
}

.phones-summary-grid .stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .phones-summary-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .phones-summary-grid .stat-card {
        padding: 0.875rem;
        min-height: 70px;
    }

    .phones-summary-grid .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }

    .phones-summary-grid .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .phones-summary-grid .stat-card .stat-label {
        font-size: 0.7rem;
    }
}

/* Clients Summary Widget */
.clients-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.top-clients-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.client-item {
    padding: 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.client-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
    min-width: 40px;
}

.client-info {
    flex: 1;
}

.client-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.client-details {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.client-amount {
    font-weight: 700;
    color: var(--success);
    font-size: 1.1rem;
}

/* Parts Summary Widget */
.parts-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.low-stock-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.low-stock-item {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
}

.low-stock-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.low-stock-brand {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.low-stock-quantity {
    font-size: 1rem;
    font-weight: 700;
}

/* Accessories Summary Widget */
.accessories-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Technicians Summary Widget */
.technicians-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Design for Widgets (grid) */
@media (max-width: 768px) {
    .dashboard-widgets-grid:not(.is-packed) {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget,
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="3"],
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="4"],
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="6"],
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="8"],
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="9"],
    .dashboard-widgets-grid:not(.is-packed) .dashboard-widget[data-span="12"] {
        grid-column: span 1 !important;
        width: 100% !important;
    }

    .widget-wrapper {
        padding: 1rem;
    }

    .chart-container {
        height: 250px;
    }

    .financial-summary-grid,
    .repairs-summary-grid,
    .phones-summary-grid,
    .clients-summary-grid,
    .parts-summary-grid,
    .accessories-summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .technicians-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   TECHNICIAN BUTTONS - Mini Selectable Buttons
   ============================================ */

.technician-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.technician-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-on-surface);
    background: rgba(99, 102, 241, 0.15);
    border: 1.5px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
}

.technician-btn:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.6);
}

.technician-btn.selected {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.3));
    border-color: #6366f1;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.technician-btn.selected:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.4));
    border-color: #818cf8;
}

.entry-details-modal-antet {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
}

.entry-tech-badge,
.entry-addedby-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    color: #fff;
    line-height: 1.2;
    appearance: none;
}

.entry-tech-badge--assigned,
.entry-addedby-badge {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.entry-tech-badge--assigned {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.entry-addedby-badge {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

.entry-tech-badge--assign {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.entry-tech-badge--clickable,
.entry-tech-badge--assign {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.entry-tech-badge--clickable:hover,
.entry-tech-badge--assign:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.entry-tech-badge-label {
    opacity: 0.9;
}

.entry-tech-badge-name {
    background: var(--surface-bg-hover);
    color: var(--text-primary);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
}

.entry-tech-badge-edit {
    font-size: 0.68rem;
    opacity: 0.8;
}

.eat-modal-content {
    max-width: 560px;
}

.eat-hint {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
}

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

.eat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 110px;
    padding: 0.75rem 0.5rem;
    border-radius: 14px;
    border: 2px solid rgba(139, 92, 246, 0.28);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(99, 102, 241, 0.1));
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.eat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.55);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.18);
}

.eat-card.selected {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.38), rgba(99, 102, 241, 0.24));
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16), 0 8px 18px rgba(99, 102, 241, 0.22);
}

.eat-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.eat-card.selected .eat-card-avatar {
    transform: scale(1.08);
}

.eat-card-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
}

.eat-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1.25rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Mobile responsive for technician buttons */
@media (max-width: 768px) {
    .technician-btn {
        font-size: 0.75rem;
        padding: 0.4375rem 0.875rem;
        min-height: 2rem;
    }

    .technician-buttons-container {
        gap: 0.375rem;
    }
}

@media (max-width: 480px) {
    .dashboard-widgets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* All widgets full width on small mobile */
    [class*="widget-width-"] {
        grid-column: span 1 !important;
    }
}

/* Additional Widget Styles */
.monthly-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.comparison-item {
    text-align: center;
    padding: 1rem;
    background: var(--surface-bg);
    border-radius: var(--radius-md);
}

.comparison-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.comparison-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.comparison-subtitle {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.top-categories-list,
.top-brands-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.category-item,
.brand-item {
    padding: 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-rank,
.brand-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-light);
    min-width: 40px;
}

.category-info,
.brand-info {
    flex: 1;
}

.category-name,
.brand-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.category-count,
.brand-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.category-amount,
.brand-profit {
    font-weight: 700;
    color: var(--success);
    font-size: 1.1rem;
}

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

.warranty-item {
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
}

.warranty-part-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.warranty-part-brand {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.warranty-days {
    font-size: 1rem;
    font-weight: 700;
}

.inventory-value-widget,
.trend-widget,
.retention-rate-widget,
.lifetime-value-widget,
.turnover-rate-widget,
.cost-trend-widget,
.sales-trend-widget {
    display: flex;
    flex-direction: column;
}

.value-display,
.rate-display,
.trend-display,
.cost-display {
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
}

.time-display {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
}

.time-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.time-label {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.time-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: 1rem;
}

/* Widget Header Badge */
.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Active Repairs Grid — pe desktop coloanele se calculează din lățimea widgetului (JS) */
.active-repairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.55rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
    padding-bottom: 0.5rem;
    align-items: start; /* cardurile nu se dilată pe înălțimea rândului */
}

.active-repairs-grid::-webkit-scrollbar {
    width: 6px;
}

.active-repairs-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

.active-repairs-grid::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}

.active-repairs-grid .repair-item {
    padding: 0.55rem 0.6rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.active-repairs-grid .repair-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.active-repairs-grid .repair-item:hover {
    background: var(--surface-bg-hover);
    border-color: var(--border-lighter);
}

.active-repairs-grid .repair-item:hover::before {
    opacity: 1;
}

.active-repairs-grid .repair-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

.active-repairs-grid .repair-header {
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

.active-repairs-grid .repair-status-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.active-repairs-grid .repair-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.active-repairs-grid .repair-badges {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.active-repairs-grid .badge-finalizat,
.active-repairs-grid .badge-esuat,
.active-repairs-grid .badge-warranty,
.active-repairs-grid .badge-technician {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    flex-shrink: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.active-repairs-grid .badge-finalizat {
    background: #22C55E;
    color: white;
}

.active-repairs-grid .badge-esuat {
    background: #EF4444;
    color: white;
}

.active-repairs-grid .badge-warranty {
    background: #f59e0b;
    color: white;
}

.active-repairs-grid .badge-technician {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    width: auto;
    height: 20px;
    padding: 0 0.4rem;
    border-radius: 10px;
    font-size: 0.65rem;
    gap: 0.25rem;
}

.active-repairs-grid .badge-technician .badge-text {
    font-size: 0.6rem;
    font-weight: 500;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-repairs-grid .badge-unlock {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 4px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: monospace;
    margin-left: 0.3rem;
    flex-shrink: 0;
}

.active-repairs-grid .badge-unlock .badge-code {
    font-size: 0.65rem;
}

/* Client Approval Badges */
.active-repairs-grid .badge-approved {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.active-repairs-grid .badge-refused {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.active-repairs-grid .badge-pending-approval {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

/* Repair card highlighting based on approval status */
.active-repairs-grid .repair-item.repair-approved {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(22, 163, 74, 0.05) 100%);
    border-left-color: #22C55E !important;
}

.active-repairs-grid .repair-item.repair-refused {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.05) 100%);
    border-left-color: #EF4444 !important;
}

.active-repairs-grid .repair-item.repair-pending-approval {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.05) 100%);
    border-left-color: #F59E0B !important;
}

.active-repairs-grid .repair-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.active-repairs-grid .repair-client,
.active-repairs-grid .repair-device,
.active-repairs-grid .repair-defect,
.active-repairs-grid .repair-defect-constatat {
    font-size: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
}

.active-repairs-grid .repair-client i {
    color: var(--success);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.active-repairs-grid .repair-client-phone {
    display: flex;
    align-items: center;
    min-width: 0;
}

.active-repairs-grid .repair-client-phone .client-phone-badge {
    margin-left: 0;
    max-width: 100%;
}

.active-repairs-grid .repair-device i {
    color: var(--info);
    font-size: 0.7rem;
    flex-shrink: 0;
}

.active-repairs-grid .repair-defect i,
.active-repairs-grid .repair-defect-constatat i {
    color: var(--warning);
    font-size: 0.65rem;
    flex-shrink: 0;
}

.active-repairs-grid .repair-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.client-phone-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 4px;
    color: #10b981;
    font-size: 0.65rem;
    font-weight: 500;
    flex-shrink: 0;
    margin-left: auto;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.client-phone-badge:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

.client-phone-badge i {
    font-size: 0.6rem;
}

.client-phone-badge .phone-number {
    font-size: 0.65rem;
    font-weight: 600;
}

.active-repairs-grid .repair-device {
    color: var(--text-secondary);
}

.active-repairs-grid .repair-defect {
    color: var(--text-tertiary);
    font-style: italic;
}

.active-repairs-grid .repair-defect-constatat {
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 500;
}

.active-repairs-grid .repair-cost {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.active-repairs-grid .repair-cost i {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.active-repairs-grid > .empty-state {
    grid-column: 1 / -1;
}

.active-repairs-status-heading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.15rem 0.15rem;
    margin-top: 0.35rem;
    min-width: 0;
}

.active-repairs-status-heading:first-child {
    margin-top: 0;
}

.active-repairs-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--status-color, #6366f1);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-color, #6366f1) 25%, transparent);
}

.active-repairs-status-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-primary, #fff);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-repairs-status-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.15rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--status-color, #6366f1);
    background: color-mix(in srgb, var(--status-color, #6366f1) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--status-color, #6366f1) 30%, transparent);
    flex-shrink: 0;
}

.active-repairs-grid .repair-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.5rem;
    justify-content: stretch;
    flex-shrink: 0;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light);
}

.active-repairs-grid .btn-repair-action {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    min-height: 2.35rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    padding: 0.3rem 0.2rem;
    border-radius: 8px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.65rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    line-height: 1.1;
}

.active-repairs-grid .btn-repair-action::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.active-repairs-grid .btn-repair-action:active::before {
    width: 300px;
    height: 300px;
}

.active-repairs-grid .btn-call {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.active-repairs-grid .btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
}

.active-repairs-grid .btn-repair-action:hover {
}

.active-repairs-grid .btn-repair-action:active {
}

.active-repairs-grid .btn-repair-action i {
    font-size: 0.85rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    line-height: 1;
}

.active-repairs-grid .btn-repair-action .btn-text {
    position: relative;
    z-index: 1;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    line-height: 1;
}

/* Recent Phones Sold Widget */
.recent-phones-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.recent-phones-list::-webkit-scrollbar {
    width: 6px;
}

.recent-phones-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: var(--radius-full);
}

.recent-phones-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

.phone-sold-item {
    padding: 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.phone-sold-item:hover {
    background: var(--surface-bg-hover);
}

.phone-sold-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.phone-code {
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.phone-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.phone-model {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phone-model i {
    color: var(--info);
}

.phone-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.phone-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.phone-detail i {
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

.phone-prices {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.price-value {
    font-weight: 600;
    font-size: 0.95rem;
}

.price-value.sale {
    color: var(--primary-light);
}

/* Empty state improvements */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-style: italic;
}

/* Responsive adjustments for new widgets */
@media (max-width: 768px) {
    .monthly-comparison-grid {
        grid-template-columns: 1fr;
    }

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

    /* Keep 2 columns on mobile - ALWAYS 2, no matter what */
    .active-repairs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
        max-height: 500px;
    }

    .active-repairs-grid .repair-item {
        padding: 0.6rem;
        min-height: 160px;
    }

    .active-repairs-grid .repair-content {
        gap: 0.4rem;
    }

    .active-repairs-grid .repair-status {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .active-repairs-grid .repair-badges {
        gap: 0.25rem;
    }

    .active-repairs-grid .badge-finalizat,
    .active-repairs-grid .badge-esuat,
    .active-repairs-grid .badge-warranty {
        width: 18px;
        height: 18px;
        font-size: 0.6rem;
    }

    .active-repairs-grid .badge-technician {
        height: 18px;
        padding: 0 0.3rem;
        font-size: 0.6rem;
    }

    .active-repairs-grid .badge-technician .badge-text {
        max-width: 35px;
        font-size: 0.55rem;
    }

    /* Mobile styles for approval badges */
    .active-repairs-grid .badge-approved,
    .active-repairs-grid .badge-refused,
    .active-repairs-grid .badge-pending-approval {
        padding: 0.15rem 0.35rem;
        font-size: 0.6rem;
    }

    .active-repairs-grid .badge-approved .badge-text,
    .active-repairs-grid .badge-refused .badge-text,
    .active-repairs-grid .badge-pending-approval .badge-text {
        display: none;
    }

    .active-repairs-grid .badge-unlock {
        padding: 0.1rem 0.3rem;
        font-size: 0.6rem;
        margin-left: 0.2rem;
    }

    .active-repairs-grid .badge-unlock .badge-code {
        font-size: 0.6rem;
    }

    .active-repairs-grid .repair-body {
        gap: 0.3rem;
    }

    .active-repairs-grid .repair-client,
    .active-repairs-grid .repair-device,
    .active-repairs-grid .repair-defect,
    .active-repairs-grid .repair-defect-constatat {
        font-size: 0.7rem;
        gap: 0.3rem;
    }

    .active-repairs-grid .repair-client i,
    .active-repairs-grid .repair-device i {
        font-size: 0.65rem;
    }

    .active-repairs-grid .repair-defect i,
    .active-repairs-grid .repair-defect-constatat i {
        font-size: 0.6rem;
    }

    .client-phone-badge {
        padding: 0.1rem 0.3rem;
        font-size: 0.6rem;
        gap: 0.2rem;
        margin-left: 0.3rem;
    }

    .client-phone-badge i {
        font-size: 0.55rem;
    }

    .client-phone-badge .phone-number {
        font-size: 0.6rem;
    }

    .active-repairs-grid .repair-defect-constatat {
        font-size: 0.65rem;
    }

    .active-repairs-grid .repair-cost {
        font-size: 0.75rem;
        gap: 0.3rem;
        padding-top: 0.4rem;
    }

    .active-repairs-grid .repair-cost i {
        font-size: 0.7rem;
    }

    .active-repairs-grid .repair-actions {
        gap: 0.4rem;
        margin-top: 0.5rem;
        padding-top: 0.4rem;
    }

    .active-repairs-grid .btn-repair-action {
        height: auto;
        min-height: 2.3rem;
        padding: 0.3rem 0.2rem;
        font-size: 0.65rem;
        gap: 0.12rem;
        flex-direction: column;
    }

    .active-repairs-grid .btn-repair-action i {
        font-size: 0.8rem;
    }

    .active-repairs-grid .btn-repair-action .btn-text {
        font-size: 0.55rem;
        display: block;
        white-space: nowrap;
    }

    .recent-phones-list,
    .active-repairs-grid {
        max-height: 450px;
    }

    /* Remove any min-height on mobile */
    .active-repairs-grid {
        min-height: auto !important;
    }
}

/* Desktop: carduri mai compacte ca să încapă mai multe pe rând */
@media (min-width: 769px) {
    .active-repairs-grid {
        min-height: 0;
        gap: 0.5rem;
    }

    .active-repairs-grid .repair-item {
        min-height: 0;
        padding: 0.5rem 0.55rem;
    }

    .active-repairs-grid .repair-content {
        gap: 0.35rem;
    }

    .active-repairs-grid .repair-body {
        gap: 0.28rem;
    }

    .active-repairs-grid .btn-repair-action .btn-text {
        display: inline;
    }

    .active-repairs-grid .btn-repair-action {
        min-height: 2.25rem;
        padding: 0.28rem 0.15rem;
    }
}

/* Tablet adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .active-repairs-grid .repair-item {
        min-height: 0;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .active-repairs-grid {
        gap: 0.55rem;
    }

    .active-repairs-grid .repair-item {
        padding: 0.55rem 0.6rem;
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .active-repairs-grid {
        gap: 0.4rem;
    }

    .active-repairs-grid .repair-item {
        padding: 0.5rem;
        min-height: 150px;
    }

    .active-repairs-grid .repair-status {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
    }

    .active-repairs-grid .repair-client,
    .active-repairs-grid .repair-device,
    .active-repairs-grid .repair-defect {
        font-size: 0.65rem;
    }

    .active-repairs-grid .repair-cost {
        font-size: 0.7rem;
    }

    .active-repairs-grid .btn-repair-action {
        height: 30px;
        padding: 0.35rem 0.4rem;
        font-size: 0.65rem;
    }

    .active-repairs-grid .btn-repair-action .btn-text {
        display: none;
    }

    .client-phone-badge {
        width: 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 0.2rem;
    }

    .active-repairs-grid .repair-client {
        flex-wrap: wrap;
    }

    .phone-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Widget Static - Reparații în Lucru fără animație 3D */
.widget-wrapper.widget-static {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
transform: none;
}
.widget-wrapper.widget-static:hover {
}
.widget-wrapper.widget-static .active-repairs-grid .repair-item {
    transition: background 0.2s ease;
}
.widget-wrapper.widget-static .active-repairs-grid .repair-item:hover {
    background: var(--surface-bg-hover);
    border-color: var(--border-lighter);
}
.widget-wrapper.widget-static .active-repairs-grid .repair-item:hover::before {
    opacity: 0;
}

/* Compact Widget Wrapper - Minimal height */
.widget-wrapper.widget-compact {
    padding: 0.35rem 0.5rem;
    min-height: auto;
    background: transparent;
    box-shadow: none;
}

/* Daily Quote Compact Widget - Single Line Only */
.daily-quote-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
    border-radius: 4px;
    border-left: 2px solid rgba(99, 102, 241, 0.4);
    min-height: fit-content;
    box-sizing: border-box;
    text-align: center;
}

.daily-quote-compact .quote-text {
    width: 100%;
    font-size: 0.85rem;
    font-weight: 600;
    font-style: italic;
    color: var(--text-on-surface);
    line-height: 1.3;
    margin: 0;
    /* Single line with ellipsis */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .widget-wrapper.widget-compact {
        padding: 0.4rem 0.5rem;
    }

    .daily-quote-compact {
        padding: 1.25rem 1.35rem;
        min-height: fit-content;
    }

    .daily-quote-compact .quote-text {
        font-size: 0.8rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.5;
        max-height: 3em;
        /* 2 linii * 1.5 line-height */
        width: 100%;
        padding: 0;
        margin: 0;
    }
}

/* QR Scanner Widget */
.qr-scanner-widget {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.qr-scan-btn {
    width: 100%;
    max-width: 300px;
    padding: 1.5rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    color: white;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.qr-scan-btn:hover {
}

.qr-scan-btn i {
    font-size: 1.5rem;
}

.qr-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.qr-info i {
    color: var(--primary-light);
}

.qr-quick-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
}

.qr-quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.qr-quick-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--primary-light);
}

.qr-quick-link i {
    font-size: 1.5rem;
}

.qr-quick-link span {
    font-size: 0.8rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .qr-quick-links {
        grid-template-columns: repeat(2, 1fr);
    }

    .qr-scan-btn {
        max-width: 100%;
    }
}

/* Chart Stats Row Styling */
.chart-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.chart-stat-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--surface-bg);
    border-radius: var(--radius-md);
}

.chart-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.25rem;
}

.chart-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-month-badge {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

@media (max-width: 768px) {
    .chart-stats-row {
        grid-template-columns: 1fr;
    }

    .chart-stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }

    .chart-stat-value {
        font-size: 1.25rem;
        margin-bottom: 0;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   Reduces GPU usage and improves scrolling
   ============================================ */

.modal,
.navbar,
.quick-action-fab,
.quick-action-overlay,
.mobile-menu,
.mobile-menu-overlay {
}

/* Content-visibility for off-screen cards - major performance boost
   (fără .entry-card: pe lista Reparații/Intrări amâna randarea la scroll și părea „lazy”) */
.phone-card,
.client-card,
.accessory-card,
.stock-card,
.order-card,
.transaction-item {
    content-visibility: auto;
    contain-intrinsic-size: 0 200px;
}

@media (max-width: 768px) {
    #entriesGrid .entry-card,
    #clientsGrid .entry-card,
    #ordersGrid .entry-card {
        background-color: var(--card-bg);
    }

    .navbar,
    .search-results,
    .user-dropdown,
    .mobile-menu {
    }

    .modal-content,
    .card-3d,
    .stat-card,
    .widget-card {
    }

    .entry-card,
    .phone-card,
    .client-card,
    .accessory-card,
    .search-input,
    .form-control {
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    body::before {
        animation: none !important;
    }

    .navbar,
    .modal,
    .quick-action-fab,
    .mobile-menu {
        transition: none !important;
    }
}

/* ============================================
   VIRTUAL SCROLLER STYLES
   For efficiently rendering large lists
   ============================================ */

.virtual-scroller-wrapper {
    position: relative;
    width: 100%;
}

.virtual-scroller-wrapper>* {
    box-sizing: border-box;
}

/* Ensure absolute positioned items in virtual scroller maintain proper styling */
.entries-grid.virtual-scroll-enabled,
.phones-grid.virtual-scroll-enabled,
.accessories-grid.virtual-scroll-enabled {
    position: relative;
    min-height: 200px;
}

.entries-grid.virtual-scroll-enabled>.entry-card,
.phones-grid.virtual-scroll-enabled>.phone-card,
.accessories-grid.virtual-scroll-enabled>.accessory-card {
    position: absolute;
    width: calc(25% - 12px);
    transition: none;
    /* Disable transitions for better scroll performance */
}

@media (max-width: 1200px) {

    .entries-grid.virtual-scroll-enabled>.entry-card,
    .phones-grid.virtual-scroll-enabled>.phone-card,
    .accessories-grid.virtual-scroll-enabled>.accessory-card {
        width: calc(33.333% - 12px);
    }
}

@media (max-width: 900px) {

    .entries-grid.virtual-scroll-enabled>.entry-card,
    .phones-grid.virtual-scroll-enabled>.phone-card,
    .accessories-grid.virtual-scroll-enabled>.accessory-card {
        width: calc(50% - 8px);
    }
}

@media (max-width: 600px) {

    .entries-grid.virtual-scroll-enabled>.entry-card,
    .phones-grid.virtual-scroll-enabled>.phone-card,
    .accessories-grid.virtual-scroll-enabled>.accessory-card {
        width: 100%;
        left: 0 !important;
    }
}

/* ============================================
   VERSION DISPLAY - Bottom Left Corner
   ============================================ */

.version-display {
    position: fixed;
    bottom: 8px;
    left: 8px;
    z-index: 1000;
    font-size: 9px;
    color: var(--text-on-surface-hint);
    font-family: 'Monaco', 'Consolas', monospace;
    user-select: none;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity var(--transition-base);
}

.version-display:hover {
    opacity: 0.8;
    pointer-events: auto;
}

/* ============================================
   CHANGELOG MODAL
   ============================================ */

.changelog-modal {
    display: none;
    align-items: center !important;
    justify-content: center !important;
}

.changelog-modal .modal-content {
    max-width: 600px;
    width: 90%;
    margin: auto;
}

.changelog-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.changelog-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.changelog-title i {
    color: var(--accent);
}

.changelog-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.changelog-version {
    margin-bottom: var(--spacing-xl);
}

.changelog-version:last-child {
    margin-bottom: 0;
}

.changelog-version-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.changelog-version-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Monaco', 'Consolas', monospace;
}

.changelog-version-date {
    font-size: 0.75rem;
    color: var(--text-on-surface-muted);
    margin-left: auto;
}

.changelog-latest-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin-left: 0.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.changelog-version-latest {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: var(--spacing-xl);
}

.changelog-version-latest .changelog-version-header {
    border-bottom-color: rgba(99, 102, 241, 0.3);
}

.changelog-version:not(.changelog-version-latest) {
    padding: 0.75rem;
    background: var(--surface-bg);
    border-radius: 8px;
    border-left: 3px solid var(--border-light);
}

.changelog-changes {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-change-item {
    padding: var(--spacing-sm) 0;
    padding-left: var(--spacing-lg);
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.changelog-change-item::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 1.2rem;
}

.changelog-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .version-display {
        font-size: 8px;
        bottom: 6px;
        left: 6px;
    }

    .changelog-modal .modal-content {
        max-width: 95vw;
    }

    .changelog-body {
        max-height: calc(100vh - 250px);
    }
}

/* Highlight Card Animation */
.highlight-card {
    border: 2px solid #F59E0B !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4) !important;
    position: relative;
    z-index: 10;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* ============================================
   BANNERS STYLES
   ============================================ */

.banners-container {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--spacing-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 10;
}

.dashboard-banner {
    width: 100%;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    position: relative;
    overflow: hidden;
border: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-banner:last-child {
    margin-bottom: 0;
}

.dashboard-banner:hover {
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.banner-text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
    color: inherit;
}

.banner-close {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    color: inherit;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    outline: none;
}

.banner-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

.banner-close:active {
}

.banner-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.banner-close i {
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .banners-container {
        padding: 0 var(--spacing-sm);
    }

    .dashboard-banner {
        padding: 0.875rem 1rem;
        border-radius: 10px;
    }

    .banner-text {
        font-size: 0.875rem;
    }

    .banner-close {
        width: 28px;
        height: 28px;
    }

    .banner-close i {
        font-size: 0.75rem;
    }
}

/* Admin banner list styles */
.banner-item {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.banner-item:hover {
}

.banner-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Sursa client – selector cu butoane */
.client-source-buttons {
    margin-top: 0.25rem;
}
.client-source-buttons-inner {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.5rem;
    width: 100%;
}
/* Legacy butoane (fallback in caz ca raman in HTML undeva) */
.client-source-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-lighter);
    border-radius: 8px;
    background: var(--surface-bg);
    color: var(--text-on-surface);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.client-source-btn:hover {
    background: var(--surface-bg-hover);
    border-color: var(--border-lighter);
}
.client-source-btn.selected {
    background: rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.7);
    color: var(--text-primary);
}

/* === Carduri sursa client (custom, cu icon + culoare) === */
.client-source-card {
    --src-color: #6366f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem 0.4rem;
    border-radius: 12px;
    border: 2px solid transparent;
    background: var(--surface-bg-hover, rgba(255,255,255,0.04));
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    min-height: 86px;
    text-align: center;
    font: inherit;
    position: relative;
    overflow: hidden;
}
.client-source-card:hover {
    border-color: var(--src-color);
}
.client-source-card.selected {
    border-color: var(--src-color);
    background: color-mix(in srgb, var(--src-color) 18%, transparent);
    box-shadow: inset 0 0 0 1px var(--src-color), 0 4px 14px color-mix(in srgb, var(--src-color) 30%, transparent);
}
.client-source-card.selected::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--src-color);
    box-shadow: 0 0 0 2px var(--surface-bg, #1a1f2e);
}
.client-source-card .csc-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--src-color);
    background: color-mix(in srgb, var(--src-color) 18%, transparent);
    font-size: 1.05rem;
    flex-shrink: 0;
}
.client-source-card .csc-label {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--text-primary);
    word-break: break-word;
    max-width: 100%;
}
.client-source-card.client-source-add {
    border: 2px dashed var(--border-lighter, rgba(255,255,255,0.18));
    background: transparent;
    color: var(--text-secondary);
    --src-color: #10B981;
}
.client-source-card.client-source-add:hover {
    border-color: #10B981;
    color: #10B981;
}
.client-source-card.client-source-add .csc-icon {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
}

@media (max-width: 540px) {
    .client-source-buttons-inner {
        grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
        gap: 0.4rem;
    }
    .client-source-card {
        min-height: 72px;
        padding: 0.5rem 0.3rem;
    }
    .client-source-card .csc-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .client-source-card .csc-label {
        font-size: 0.62rem;
    }
}

/* Acord marketing – compact inline (icon only, pe aceeași linie cu Sursa client) */
.marketing-consent-compact-wrap {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}
.marketing-consent-compact {
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.2rem 0;
    flex-shrink: 0;
}
.marketing-consent-compact.mkt-inline {
    padding: 0.3rem 0.5rem;
    background: var(--surface-bg);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}
.marketing-consent-compact input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    margin: 0;
    cursor: pointer;
    accent-color: #6366f1;
    flex-shrink: 0;
}
.marketing-consent-compact .mkt-consent-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.75rem;
    color: var(--text-on-surface-muted);
    transition: color 0.2s;
}
.marketing-consent-compact:hover .mkt-consent-icon,
.marketing-consent-compact:has(input:checked) .mkt-consent-icon {
    color: #22c55e;
}
.marketing-consent-compact input:checked + .mkt-consent-icon {
    color: #22c55e;
}
.marketing-consent-compact .mkt-consent-text {
    font-size: 0.78rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.2;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.marketing-consent-compact:has(input:checked) .mkt-consent-text {
    color: #22c55e;
    font-weight: 600;
}
@media (max-width: 600px) {
    .marketing-consent-compact .mkt-consent-text {
        font-size: 0.72rem;
        white-space: normal;
        line-height: 1.15;
    }
}

/* ============================================
   SMS Config Section - Provider Cards (Setări)
   ============================================ */
.sms-config-section .sms-provider-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1rem;
}
@media (max-width: 640px) {
    .sms-config-section .sms-provider-cards {
        grid-template-columns: 1fr;
    }
}
.sms-config-section .sms-provider-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 1.25rem;
    background: var(--elevated-bg);
    border: 2px solid var(--border-light);
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    color: var(--text-primary);
}
.sms-config-section .sms-provider-card:hover {
    border-color: var(--primary);
}
.sms-config-section .sms-provider-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: 0 0 0 2px var(--primary);
}
.sms-config-section .sms-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}
.sms-config-section .sms-card-icon.sendsms {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}
.sms-config-section .sms-card-icon.gateway {
    background: rgba(33, 150, 243, 0.2);
    color: #2196f3;
}
.sms-config-section .sms-provider-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.3rem 0;
}
.sms-config-section .sms-provider-card .sms-card-desc {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 0.6rem;
}
.sms-config-section .sms-card-features {
    list-style: none;
    margin: 0 0 0.6rem 0;
    padding: 0;
}
.sms-config-section .sms-card-features li {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: 0.35rem;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}
.sms-config-section .sms-card-features li i.fa-check {
    color: var(--success);
    flex-shrink: 0;
}
.sms-config-section .sms-card-features li i.fa-exclamation-triangle {
    color: var(--warning);
    flex-shrink: 0;
}
.sms-config-section .sms-card-hint {
    font-size: 0.75rem;
    color: var(--primary-light);
    margin-top: auto;
}
.sms-config-section .sms-gateway-download-link:hover {
    background: rgba(33, 150, 243, 0.35);
    color: #42a5f5;
}

/* SMS Gateway credentials panel */
.sms-config-section .sms-gw-panel {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--elevated-bg);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    overflow: hidden;
}
.sms-config-section .sms-gw-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.sms-config-section .sms-gw-panel-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 150, 243, 0.18);
    color: #42a5f5;
    font-size: 1.15rem;
}
.sms-config-section .sms-gw-panel-titles h4 {
    margin: 0 0 0.2rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}
.sms-config-section .sms-gw-panel-titles p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.sms-config-section .sms-gw-help,
.sms-config-section .sms-gw-advanced {
    margin-bottom: 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--card-bg, var(--bg-secondary, transparent));
}
.sms-config-section .sms-gw-help > summary,
.sms-config-section .sms-gw-advanced > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
}
.sms-config-section .sms-gw-help > summary::-webkit-details-marker,
.sms-config-section .sms-gw-advanced > summary::-webkit-details-marker {
    display: none;
}
.sms-config-section .sms-gw-help > summary > span,
.sms-config-section .sms-gw-advanced > summary > span {
    flex: 1;
}
.sms-config-section .sms-gw-help-chevron {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}
.sms-config-section .sms-gw-help[open] > summary .sms-gw-help-chevron,
.sms-config-section .sms-gw-advanced[open] > summary .sms-gw-help-chevron {
    transform: rotate(180deg);
}
.sms-config-section .sms-gw-help-body {
    padding: 0 0.85rem 0.9rem;
}
.sms-config-section .sms-gw-download {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(33, 150, 243, 0.45);
    background: rgba(33, 150, 243, 0.16);
    color: #42a5f5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}
.sms-config-section .sms-gw-download:hover {
    background: rgba(33, 150, 243, 0.28);
    color: #64b5f6;
}
.sms-config-section .sms-gw-steps {
    margin: 0 0 0.85rem 0;
    padding-left: 1.15rem;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
}
.sms-config-section .sms-gw-steps li {
    margin-bottom: 0.35rem;
}
.sms-config-section .sms-gw-shot {
    margin: 0;
    text-align: center;
}
.sms-config-section .sms-gw-shot img {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto 0.4rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
}
.sms-config-section .sms-gw-shot figcaption {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}
.sms-config-section .sms-gw-scan-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(33, 150, 243, 0.45);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.22), rgba(33, 150, 243, 0.08));
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.sms-config-section .sms-gw-scan-btn:hover {
    border-color: #42a5f5;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.32), rgba(33, 150, 243, 0.14));
}
.sms-config-section .sms-gw-scan-btn:active {
    transform: scale(0.99);
}
.sms-config-section .sms-gw-scan-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2196f3;
    color: #fff;
    font-size: 1.15rem;
}
.sms-config-section .sms-gw-scan-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.sms-config-section .sms-gw-scan-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
}
.sms-config-section .sms-gw-scan-text small {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.sms-config-section .sms-gw-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.sms-config-section .sms-gw-fields-advanced {
    padding: 0 0.85rem 0.9rem;
}
.sms-config-section .sms-gw-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.sms-config-section .sms-gw-field label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.sms-config-section .sms-gw-field label em {
    font-style: normal;
    font-weight: 500;
    color: var(--text-tertiary);
}
.sms-config-section .sms-gw-field .form-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    overflow-x: auto;
}
.sms-config-section .sms-gw-advanced {
    margin-top: 0.85rem;
    margin-bottom: 0;
}
@media (max-width: 640px) {
    .sms-config-section .card-3d {
        padding: 1rem !important;
    }
    .sms-config-section .sms-gw-panel {
        padding: 0.85rem;
        border-radius: 12px;
    }
    .sms-config-section .sms-gw-fields {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }
    .sms-config-section .sms-gw-scan-btn {
        padding: 0.75rem 0.85rem;
        gap: 0.7rem;
    }
    .sms-config-section .sms-gw-scan-icon {
        width: 40px;
        height: 40px;
    }
    .sms-config-section .sms-gw-panel-titles h4 {
        font-size: 0.95rem;
    }
    .sms-config-section .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   TEMPLATES PAGE - Șabloane Documente
   ============================================ */
.templates-page {
    max-width: 960px;
}
.templates-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.templates-toolbar h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.templates-toolbar h1 i {
    color: var(--primary);
}
.templates-toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.templates-bg-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--elevated-bg);
    border: 1px solid var(--border-light);
    border-radius: 10px;
}
.templates-bg-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.templates-bg-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.templates-bg-label i {
    color: var(--primary);
}
.templates-bg-preview {
    position: relative;
    display: flex;
    align-items: center;
}
.templates-bg-preview img {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}
.templates-bg-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.65rem;
}
.templates-bg-empty {
    width: 48px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border-light);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}
.templates-bg-opacity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 140px;
    max-width: 220px;
}
.templates-bg-opacity input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-secondary);
    outline: none;
}
.templates-bg-opacity span {
    min-width: 36px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
}
.templates-bg-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.templates-bg-status--ok {
    color: var(--success, #10b981);
}
.templates-bg-status--err {
    color: var(--danger, #ef4444);
}
.templates-agr-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    margin-bottom: 1rem;
    background: var(--elevated-bg);
    border: 1px solid rgba(37, 150, 217, 0.25);
    border-radius: 10px;
}
.templates-agr-badge {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}
.templates-agr-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}
.templates-agr-toggle input {
    width: 16px;
    height: 16px;
    accent-color: #2596d9;
}
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}
.template-card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--divider);
    border-radius: 10px;
    transition: border-color 0.2s ease;
}
.template-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}
.template-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}
.template-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}
.template-card-badge {
    flex-shrink: 0;
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-radius: 4px;
}
.template-card-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin: 0;
}
.template-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
}
.template-card-actions .btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.75rem;
}
.templates-grid-empty {
    grid-column: 1 / -1;
    padding: 1.25rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    background: var(--surface-bg);
    border-radius: 10px;
    border: 1px dashed var(--border-light);
}
.templates-grid-empty i {
    display: block;
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
    opacity: 0.5;
}

/* ============================================
   LIGHT MODE: Detail sections & modal content
   Stronger backgrounds, borders, and contrast
   for dynamically generated detail modals
   ============================================ */
[data-theme="light"] .detail-section {
    background-image: none !important;
    border-width: 1.5px !important;
    box-shadow: var(--shadow-sm);
}
[data-theme="light"] .detail-section[style*="rgba(99, 102, 241"] {
    background: rgba(79, 70, 229, 0.08) !important;
    border-color: rgba(79, 70, 229, 0.25) !important;
}
[data-theme="light"] .detail-section[style*="rgba(59, 130, 246"] {
    background: rgba(37, 99, 235, 0.08) !important;
    border-color: rgba(37, 99, 235, 0.25) !important;
}
[data-theme="light"] .detail-section[style*="rgba(245, 158, 11"] {
    background: rgba(217, 119, 6, 0.08) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
}
[data-theme="light"] .detail-section[style*="rgba(16, 185, 129"],
[data-theme="light"] .detail-section[style*="rgba(6, 182, 212"] {
    background: rgba(5, 150, 105, 0.08) !important;
    border-color: rgba(5, 150, 105, 0.25) !important;
}
[data-theme="light"] .detail-section[style*="rgba(139, 92, 246"] {
    background: rgba(109, 40, 217, 0.08) !important;
    border-color: rgba(109, 40, 217, 0.25) !important;
}
[data-theme="light"] .detail-section[style*="rgba(251, 191, 36"] {
    background: rgba(217, 119, 6, 0.08) !important;
    border-color: rgba(217, 119, 6, 0.25) !important;
}
[data-theme="light"] .detail-section h3 {
    color: var(--text-primary) !important;
}
[data-theme="light"] .modal-body [style*="background: var(--surface-bg)"] {
    border: 1px solid var(--border-light);
}
[data-theme="light"] .detail-actions {
    border-width: 1.5px !important;
    box-shadow: var(--shadow-sm);
}
[data-theme="light"] .entry-details-modal-antet {
    border-width: 1.5px !important;
}
[data-theme="light"] .eat-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.06));
    border-color: rgba(109, 40, 217, 0.22);
}
[data-theme="light"] .eat-card.selected {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(99, 102, 241, 0.14));
}

/* ============================================
   PRINT STYLES - Always use light theme
   ============================================ */
@media print {
    :root {
        --text-primary: #0f172a !important;
        --text-secondary: #334155 !important;
        --text-tertiary: #475569 !important;
        --text-on-surface: #0f172a !important;
        --text-on-surface-secondary: #334155 !important;
        --text-on-surface-muted: #64748b !important;
        --text-on-surface-hint: #94a3b8 !important;
        --border-color: rgba(15, 23, 42, 0.12) !important;
        --border-light: rgba(15, 23, 42, 0.06) !important;
        --divider: rgba(15, 23, 42, 0.08) !important;
    }

    body {
        background: #ffffff !important;
        color: #0f172a !important;
    }

    body::before {
        display: none !important;
    }

    .navbar,
    .floating-navbar,
    .gsmos-phone-toggle,
    .quick-action-fab,
    .quick-action-overlay {
        display: none !important;
    }
}

/* ============================================
   SETTINGS — API listă prețuri site (integrations-site-price)
   ============================================ */
.ipp-section {
    max-width: 100%;
}

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

.ipp-page-header-main {
    flex: 1;
    min-width: min(100%, 280px);
}

.ipp-page-header h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    line-height: 1.25;
}

.ipp-page-lead {
    margin: 0 0 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.55;
    max-width: 52rem;
}

.ipp-page-header-actions {
    flex-shrink: 0;
}

.ipp-page-header-actions .btn {
    white-space: nowrap;
}

.ipp-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ipp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-secondary);
}

.ipp-badge-readonly {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: var(--text-primary);
}

.ipp-badge-store {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

.ipp-secret-reveal {
    margin-bottom: 1.25rem;
    padding: 0;
    border: 2px solid rgba(245, 158, 11, 0.45);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);
}

.ipp-secret-reveal[hidden] {
    display: none !important;
}

.ipp-secret-reveal-inner {
    padding: 1.25rem 1.35rem;
}

.ipp-secret-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ipp-secret-alert {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ipp-secret-meta {
    margin: 0.65rem 0 0.75rem 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.ipp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ipp-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

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

.ipp-keys-card,
.ipp-dev-card {
    padding: 1.35rem 1.5rem;
}

.ipp-card-head h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.ipp-card-desc {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.ipp-cors-alert {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.ipp-cors-alert code {
    font-size: 0.8125rem;
}

.ipp-keys-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.ipp-field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.ipp-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.ipp-form-actions .btn {
    min-width: 12rem;
}

@media (max-width: 576px) {
    .ipp-form-actions {
        justify-content: stretch;
    }

    .ipp-form-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .ipp-page-header-actions {
        width: 100%;
    }

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

.ipp-subheading {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.65rem 0;
    color: var(--text-primary);
}

.ipp-keys-table {
    margin: 0;
    font-size: 0.875rem;
}

.ipp-keys-table thead th {
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    border-bottom-width: 1px;
    padding: 0.65rem 0.75rem;
    white-space: nowrap;
}

.ipp-keys-table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-color: var(--border-light);
}

.ipp-key-origins-cell {
    max-width: 14rem;
    word-break: break-word;
    font-size: 0.8125rem;
}

.ipp-keys-table .ipp-col-actions {
    width: 1%;
    text-align: right;
    white-space: nowrap;
}

.ipp-keys-table-wrap {
    margin-bottom: 0.5rem;
}

.ipp-keys-cards {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.ipp-key-card {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.12);
}

.ipp-key-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.ipp-key-card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin: 0;
    color: var(--text-primary);
}

.ipp-key-card-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0 0;
    line-height: 1.45;
}

.ipp-key-card-meta code,
.ipp-key-card-origins {
    word-break: break-all;
    font-size: 0.78rem;
}

.ipp-empty-state {
    margin: 0.75rem 0 0 0;
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    border: 1px dashed var(--border-light);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .ipp-keys-table-wrap {
        display: none;
    }

    .ipp-keys-cards {
        display: flex;
    }
}

.ipp-endpoint-field {
    margin-bottom: 1rem;
}

.ipp-endpoint-copy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.ipp-endpoint-copy-row .form-control {
    flex: 1;
    min-width: min(100%, 200px);
}

.ipp-endpoint-copy-row .btn {
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .ipp-endpoint-copy-row .btn {
        width: 100%;
    }
}

.ipp-monospace-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem !important;
}

.ipp-dev-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ipp-dev-panels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ipp-details {
    border: 1px solid var(--border-light);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
}

.ipp-details summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--text-primary);
}

.ipp-details summary::-webkit-details-marker {
    display: none;
}

.ipp-details summary::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.65rem;
    opacity: 0.7;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.ipp-details[open] summary::before {
    transform: rotate(90deg);
}

.ipp-details-body {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid var(--border-light);
}

.ipp-doc-p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0.75rem 0;
}

.ipp-copy-snippet {
    margin-bottom: 0.5rem;
}

.ipp-code-block {
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: var(--text-primary);
}

.ipp-code-block-tall {
    max-height: 22rem;
    overflow: auto;
    white-space: pre;
    word-break: normal;
}

.ipp-doc-p-muted {
    font-size: 0.75rem;
    opacity: 0.9;
}

.ipp-dev-doc-full {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: pre-wrap;
    border: 0;
}

.ipp-dev-card {
    position: relative;
}

/* ============================================
   IMEI result modal – tiered result (contrast)
   Scope: #imeiResultModal only
   ============================================ */
#imeiResultModal .imei-tiered-root {
    --imei-ink: #f8fafc;
    --imei-ink-muted: #cbd5e1;
    --imei-ink-faint: #94a3b8;
    --imei-panel: rgba(15, 23, 42, 0.94);
    --imei-panel-border: rgba(255, 255, 255, 0.28);
    --imei-subpanel: rgba(2, 6, 23, 0.55);
    --imei-kv-label: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

[data-theme="light"] #imeiResultModal .imei-tiered-root {
    --imei-ink: #0f172a;
    --imei-ink-muted: #334155;
    --imei-ink-faint: #64748b;
    --imei-panel: #ffffff;
    --imei-panel-border: rgba(15, 23, 42, 0.2);
    --imei-subpanel: #f1f5f9;
    --imei-kv-label: #475569;
}

/* --- Hero (gradient band; text always light on gradient) --- */
#imeiResultModal .imei-tiered-hero {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    background: var(--imei-hero-gradient, linear-gradient(135deg, #6366f1, #4f46e5));
    color: #ffffff;
}

[data-theme="light"] #imeiResultModal .imei-tiered-hero {
    border-color: rgba(15, 23, 42, 0.14);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.12);
}

#imeiResultModal .imei-tiered-hero-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.22;
    background: #fff;
}

#imeiResultModal .imei-tiered-hero-deco-a {
    width: 180px;
    height: 180px;
    top: -70px;
    right: -40px;
}

#imeiResultModal .imei-tiered-hero-deco-b {
    width: 120px;
    height: 120px;
    bottom: -50px;
    left: -20px;
}

#imeiResultModal .imei-tiered-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    flex-wrap: wrap;
}

#imeiResultModal .imei-tiered-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 220px;
}

#imeiResultModal .imei-tiered-hero-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 12px;
    flex-shrink: 0;
    padding: 5px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

#imeiResultModal .imei-tiered-hero-logo--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
}

#imeiResultModal .imei-tiered-hero-text {
    min-width: 0;
}

#imeiResultModal .imei-tiered-hero-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.95;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

#imeiResultModal .imei-tiered-hero-title {
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    font-weight: 800;
    line-height: 1.2;
    margin-top: 0.15rem;
    word-break: break-word;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

#imeiResultModal .imei-tiered-hero-titleline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    margin-top: 0.15rem;
    min-width: 0;
}

#imeiResultModal .imei-tiered-hero-titleline .imei-tiered-hero-title {
    margin-top: 0;
    flex: 1 1 auto;
    min-width: 0;
}

#imeiResultModal .imei-tiered-hero-flag {
    font-size: clamp(1.2rem, 3.2vw, 1.65rem);
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

#imeiResultModal .imei-tiered-hero-meta {
    margin-top: 0.45rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.96);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

#imeiResultModal .imei-tiered-hero-meta i {
    margin-right: 0.25rem;
    opacity: 0.95;
}

#imeiResultModal .imei-tiered-hero-time {
    font-weight: 600;
    opacity: 0.95;
}

#imeiResultModal .imei-tiered-hero-brand {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

#imeiResultModal .imei-tiered-hero-thumb-wrap {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#imeiResultModal .imei-tiered-hero-thumb {
    max-height: 112px;
    max-width: min(42vw, 200px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.42);
    padding: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

/* --- Overall status --- */
#imeiResultModal .imei-tiered-status {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 2px solid transparent;
    background: var(--imei-panel);
    color: var(--imei-ink);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status {
    box-shadow: none;
}

#imeiResultModal .imei-tiered-status-iconwrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status-iconwrap {
    border-color: rgba(15, 23, 42, 0.12);
}

#imeiResultModal .imei-tiered-status-body {
    min-width: 0;
}

#imeiResultModal .imei-tiered-status-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

#imeiResultModal .imei-tiered-status-desc {
    margin-top: 0.3rem;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--imei-ink-muted);
}

#imeiResultModal .imei-tiered-status--risk {
    border-color: #f87171;
    background: rgba(69, 10, 10, 0.92);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--risk {
    background: #fff1f2;
    border-color: #e11d48;
}

#imeiResultModal .imei-tiered-status--risk .imei-tiered-status-iconwrap {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.55);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--risk .imei-tiered-status-iconwrap {
    background: #ffe4e6;
    color: #be123c;
    border-color: #fda4af;
}

#imeiResultModal .imei-tiered-status--risk .imei-tiered-status-title {
    color: #fff;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--risk .imei-tiered-status-title {
    color: #881337;
}

#imeiResultModal .imei-tiered-status--risk .imei-tiered-status-desc {
    color: #fecdd3;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--risk .imei-tiered-status-desc {
    color: #9f1239;
}

#imeiResultModal .imei-tiered-status--clean {
    border-color: #34d399;
    background: rgba(6, 46, 32, 0.92);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--clean {
    background: #ecfdf5;
    border-color: #059669;
}

#imeiResultModal .imei-tiered-status--clean .imei-tiered-status-iconwrap {
    background: rgba(52, 211, 153, 0.2);
    color: #bbf7d0;
    border-color: rgba(52, 211, 153, 0.55);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--clean .imei-tiered-status-iconwrap {
    background: #d1fae5;
    color: #047857;
    border-color: #6ee7b7;
}

#imeiResultModal .imei-tiered-status--clean .imei-tiered-status-title {
    color: #ecfdf5;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--clean .imei-tiered-status-title {
    color: #065f46;
}

#imeiResultModal .imei-tiered-status--clean .imei-tiered-status-desc {
    color: #d1fae5;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--clean .imei-tiered-status-desc {
    color: #166534;
}

#imeiResultModal .imei-tiered-status--partial {
    border-color: #60a5fa;
    background: rgba(15, 30, 60, 0.92);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--partial {
    background: #eff6ff;
    border-color: #2563eb;
}

#imeiResultModal .imei-tiered-status--partial .imei-tiered-status-iconwrap {
    background: rgba(96, 165, 250, 0.2);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.55);
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--partial .imei-tiered-status-iconwrap {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

#imeiResultModal .imei-tiered-status--partial .imei-tiered-status-title {
    color: #eff6ff;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--partial .imei-tiered-status-title {
    color: #1e3a8a;
}

#imeiResultModal .imei-tiered-status--partial .imei-tiered-status-desc {
    color: #bfdbfe;
}

[data-theme="light"] #imeiResultModal .imei-tiered-status--partial .imei-tiered-status-desc {
    color: #1e40af;
}

/* --- KV grid & field cards --- */
#imeiResultModal .imei-tiered-kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 152px), 1fr));
    gap: 0.55rem;
}

#imeiResultModal .imei-tiered-kv-grid--dense {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr));
}

#imeiResultModal .imei-kv-card {
    border-radius: 12px;
    padding: 0.55rem 0.65rem;
    border: 1.5px solid var(--imei-panel-border);
    background: var(--imei-subpanel);
    text-align: left;
}

#imeiResultModal .imei-kv-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--imei-kv-label);
    margin-bottom: 0.28rem;
    line-height: 1.25;
}

#imeiResultModal .imei-kv-row {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

#imeiResultModal .imei-kv-icon {
    flex-shrink: 0;
    margin-top: 0.12rem;
    font-size: 0.88rem;
}

#imeiResultModal .imei-kv-value {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--imei-ink);
    word-break: break-word;
}

#imeiResultModal .imei-kv-flagwrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    max-width: 100%;
}

#imeiResultModal .imei-kv-flag {
    font-size: 1.35em;
    line-height: 1;
    flex-shrink: 0;
}

#imeiResultModal .imei-kv-flagtext {
    font-weight: inherit;
    color: inherit;
    min-width: 0;
}

#imeiResultModal .imei-kv-card--good {
    border-color: rgba(52, 211, 153, 0.75);
    background: rgba(16, 185, 129, 0.12);
}

[data-theme="light"] #imeiResultModal .imei-kv-card--good {
    background: #ecfdf5;
    border-color: #059669;
}

#imeiResultModal .imei-kv-card--good .imei-kv-icon {
    color: #6ee7b7;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--good .imei-kv-icon {
    color: #047857;
}

#imeiResultModal .imei-kv-card--good .imei-kv-value {
    color: #ecfdf5;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--good .imei-kv-value {
    color: #064e3b;
}

#imeiResultModal .imei-kv-card--bad {
    border-color: rgba(248, 113, 113, 0.85);
    background: rgba(239, 68, 68, 0.12);
}

[data-theme="light"] #imeiResultModal .imei-kv-card--bad {
    background: #fff1f2;
    border-color: #e11d48;
}

#imeiResultModal .imei-kv-card--bad .imei-kv-icon {
    color: #fca5a5;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--bad .imei-kv-icon {
    color: #be123c;
}

#imeiResultModal .imei-kv-card--bad .imei-kv-value {
    color: #ffe4e6;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--bad .imei-kv-value {
    color: #881337;
}

#imeiResultModal .imei-kv-card--warn {
    border-color: rgba(251, 191, 36, 0.85);
    background: rgba(245, 158, 11, 0.12);
}

[data-theme="light"] #imeiResultModal .imei-kv-card--warn {
    background: #fffbeb;
    border-color: #d97706;
}

#imeiResultModal .imei-kv-card--warn .imei-kv-icon {
    color: #fcd34d;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--warn .imei-kv-icon {
    color: #b45309;
}

#imeiResultModal .imei-kv-card--warn .imei-kv-value {
    color: #fef3c7;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--warn .imei-kv-value {
    color: #92400e;
}

#imeiResultModal .imei-kv-card--info {
    border-color: rgba(96, 165, 250, 0.85);
    background: rgba(59, 130, 246, 0.12);
}

[data-theme="light"] #imeiResultModal .imei-kv-card--info {
    background: #eff6ff;
    border-color: #2563eb;
}

#imeiResultModal .imei-kv-card--info .imei-kv-icon {
    color: #93c5fd;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--info .imei-kv-icon {
    color: #1d4ed8;
}

#imeiResultModal .imei-kv-card--info .imei-kv-value {
    color: #dbeafe;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--info .imei-kv-value {
    color: #1e3a8a;
}

#imeiResultModal .imei-kv-card--neutral {
    border-color: rgba(148, 163, 184, 0.55);
    background: rgba(148, 163, 184, 0.1);
}

[data-theme="light"] #imeiResultModal .imei-kv-card--neutral {
    background: #f8fafc;
    border-color: #94a3b8;
}

#imeiResultModal .imei-kv-card--neutral .imei-kv-icon {
    color: #cbd5e1;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--neutral .imei-kv-icon {
    color: #64748b;
}

#imeiResultModal .imei-kv-card--neutral .imei-kv-value {
    color: #e2e8f0;
}

[data-theme="light"] #imeiResultModal .imei-kv-card--neutral .imei-kv-value {
    color: #1e293b;
}

/* --- Collapsible sections --- */
#imeiResultModal .imei-tiered-sections-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

#imeiResultModal .imei-tiered-section {
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid var(--imei-panel-border);
    background: var(--imei-panel);
}

#imeiResultModal .imei-tiered-section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 2px solid var(--imei-panel-border);
    background: rgba(99, 102, 241, 0.1);
    background: color-mix(in srgb, var(--imei-sec-accent, #6366f1) 14%, var(--imei-panel));
}

#imeiResultModal .imei-tiered-section-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(99, 102, 241, 0.22);
    background: color-mix(in srgb, var(--imei-sec-accent, #6366f1) 28%, transparent);
    border: 1.5px solid rgba(165, 180, 252, 0.45);
    border-color: color-mix(in srgb, var(--imei-sec-accent, #6366f1) 55%, transparent);
    color: var(--imei-sec-accent, #a5b4fc);
    font-size: 0.82rem;
}

[data-theme="light"] #imeiResultModal .imei-tiered-section-icon {
    color: var(--imei-sec-accent, #4338ca);
    background: rgba(99, 102, 241, 0.08);
    background: color-mix(in srgb, var(--imei-sec-accent, #6366f1) 12%, #ffffff);
    border-color: rgba(99, 102, 241, 0.28);
    border-color: color-mix(in srgb, var(--imei-sec-accent, #6366f1) 35%, #cbd5e1);
}

#imeiResultModal .imei-tiered-section-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--imei-ink);
    letter-spacing: 0.02em;
}

#imeiResultModal .imei-tiered-section-body {
    padding: 0.65rem 0.75rem;
    background: var(--imei-subpanel);
}

/* --- Warnings --- */
#imeiResultModal .imei-tiered-warnbox {
    border-radius: 14px;
    border: 2px solid #f87171;
    background: rgba(50, 8, 8, 0.88);
    padding: 0.75rem 0.9rem;
}

[data-theme="light"] #imeiResultModal .imei-tiered-warnbox {
    background: #fff1f2;
    border-color: #e11d48;
}

#imeiResultModal .imei-tiered-warnbox-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fecaca;
    margin-bottom: 0.4rem;
}

[data-theme="light"] #imeiResultModal .imei-tiered-warnbox-head {
    color: #be123c;
}

#imeiResultModal .imei-tiered-warnlist {
    margin: 0;
    padding-left: 1.1rem;
    color: #fecdd3;
    font-size: 0.82rem;
    line-height: 1.45;
}

[data-theme="light"] #imeiResultModal .imei-tiered-warnlist {
    color: #9f1239;
}

#imeiResultModal .imei-tiered-warnlist li {
    margin: 0.2rem 0;
}

/* --- Raw button --- */
#imeiResultModal .imei-tiered-raw-wrap {
    display: flex;
    justify-content: center;
    padding-top: 0.15rem;
}

#imeiResultModal .imei-tiered-raw-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.15rem;
    border-radius: 11px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 2px solid var(--imei-panel-border);
    background: var(--imei-panel);
    color: var(--imei-ink-muted);
}

#imeiResultModal .imei-tiered-raw-btn:hover {
    border-color: rgba(99, 102, 241, 0.65);
    color: var(--imei-ink);
}

[data-theme="light"] #imeiResultModal .imei-tiered-raw-btn:hover {
    border-color: #6366f1;
    color: #1e293b;
}

/* IMEI OCR — wrapper keeps input full-width, button inside on the right */
.imei-ocr-wrap {
    display: block;
    position: relative;
    width: 100%;
}
.imei-ocr-wrap > input {
    width: 100% !important;
    padding-right: 2.4rem !important;
    box-sizing: border-box;
}
.imei-ocr-wrap.has-imei-lookup > input,
.imei-ocr-wrap:has(.imei-lookup-btn) > input {
    padding-right: 4.8rem !important;
}
.imei-lookup-btn {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    right: 38px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: none;
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.imei-lookup-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    color: #4f46e5;
}
.imei-lookup-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}
[data-theme="light"] .imei-lookup-btn {
    background: rgba(99, 102, 241, 0.1);
}
[data-theme="light"] .imei-lookup-btn:hover {
    background: rgba(99, 102, 241, 0.2);
}
.imei-ocr-scan-btn {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: none;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.imei-ocr-scan-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    color: #059669;
}
[data-theme="light"] .imei-ocr-scan-btn {
    background: rgba(16, 185, 129, 0.1);
}
[data-theme="light"] .imei-ocr-scan-btn:hover {
    background: rgba(16, 185, 129, 0.2);
}

/* Modal OCR IMEI (global — used from any page) */
.qrw-imei-ocr-modal {
    position: fixed;
    inset: 0;
    z-index: 10000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
}
.qrw-imei-ocr-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
z-index: 0;
}
.qrw-imei-ocr-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    max-height: min(92dvh, 860px);
    display: flex;
    flex-direction: column;
    background: var(--surface-bg, rgba(30, 30, 45, 0.95));
    border: 1px solid var(--border-light, rgba(255,255,255,0.1));
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    padding: 1rem 1.1rem 1.1rem;
    color: var(--text-primary, #fff);
}
.qrw-imei-ocr-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.65rem;
}
.qrw-imei-ocr-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.qrw-imei-ocr-close {
    appearance: none;
    border: none;
    background: var(--surface-bg-hover, rgba(255,255,255,0.05));
    color: var(--text-secondary, rgba(255,255,255,0.6));
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.qrw-imei-ocr-close:hover {
    color: var(--text-primary, #fff);
}
.qrw-imei-ocr-panel-hint {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    color: var(--text-secondary, rgba(255,255,255,0.6));
    line-height: 1.35;
}
.qrw-imei-ocr-video-wrap {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4 / 3;
}
.qrw-imei-ocr-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.qrw-imei-ocr-canvas {
    display: none;
}
.qrw-imei-ocr-scan-line {
    position: absolute;
    left: 5%;
    width: 90%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    box-shadow: 0 0 8px #10b981;
    pointer-events: none;
    z-index: 2;
}
@keyframes imeiScanLine {
    0%, 100% { top: 20%; opacity: 0.6; }
    50% { top: 80%; opacity: 1; }
}
.qrw-imei-ocr-status {
    margin: 0.6rem 0 0;
    font-size: 0.8rem;
    min-height: 2.4em;
    color: var(--text-secondary, rgba(255,255,255,0.6));
}
.qrw-imei-ocr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 0.75rem;
}
.qrw-imei-ocr-actions .btn {
    flex: 1 1 auto;
    min-width: 120px;
}
[data-theme="light"] .qrw-imei-ocr-panel {
    background: var(--surface-bg, #fff);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
}

/* ========== Platform Help AI Chat (în meniul rapid +) ========== */
.platform-help-button {
    position: relative;
    margin-top: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border: none;
    pointer-events: none;
}

.quick-action-overlay.active .platform-help-button {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition-delay: 0.27s;
}

.platform-help-button-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(99, 102, 241, 0.45),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
}

.platform-help-button-icon i {
    font-size: 22px;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Icon: balon chat SVG cu „?” în interior */
.platform-help-chat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex-shrink: 0;
}
.platform-help-chat-icon-svg {
    width: 1.35em;
    height: 1.35em;
    display: block;
}
.platform-help-chat-icon-bubble {
    fill: currentColor;
}
.platform-help-chat-icon-q {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    font-weight: 800;
    fill: #fff;
}
.platform-help-nav-btn .platform-help-chat-icon-q,
.sidebar-tool-btn .platform-help-chat-icon-q {
    fill: #fff;
}
.platform-help-nav-btn .platform-help-chat-icon,
.sidebar-tool-btn .platform-help-chat-icon {
    color: var(--primary-light, #818cf8);
}
.platform-help-button-icon .platform-help-chat-icon {
    color: #fff;
}
.platform-help-button-icon .platform-help-chat-icon-q {
    fill: #5b21b6;
}

.platform-help-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: 0.35rem;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary-light, #818cf8);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.platform-help-nav-btn:hover {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
}
.platform-help-nav-btn.platform-help-trigger--active,
.platform-help-button-icon.platform-help-trigger--active {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.45);
}
.nav-brand-container .platform-help-nav-btn {
    margin-left: 0.5rem;
}

.platform-help-page-hint {
    margin: 0.15rem 0 0;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-on-surface-muted, var(--text-secondary));
    line-height: 1.35;
}

.platform-help-button-icon:hover {
        0 6px 20px rgba(99, 102, 241, 0.55),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.platform-help-button-icon--active {
    transform: scale(1.05);
    box-shadow:
        0 0 0 3px rgba(139, 92, 246, 0.45),
        0 6px 20px rgba(99, 102, 241, 0.5);
}

.platform-help-panel--in-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    margin: 0;
    width: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
}

.platform-help-panel--in-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 20, 41, 0.82);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.platform-help-panel--in-menu.platform-help-panel--open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.platform-help-panel--in-menu.platform-help-panel--open::before {
    opacity: 1;
}

.platform-help-panel--in-menu .platform-help-panel-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(540px, 96vw);
    flex-shrink: 0;
    overflow: visible;
    transform: scale(0.96);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.platform-help-panel--in-menu.platform-help-panel--open .platform-help-panel-stage {
    transform: scale(1);
}

.platform-help-panel--in-menu .platform-help-panel-inner {
    position: relative;
    width: 100%;
    height: min(680px, 88vh);
    max-height: min(680px, 88vh);
    min-height: min(480px, 75vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--body-bg-solid, #0f1429);
    border: 1px solid var(--border-light, rgba(255,255,255,0.12));
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5);
}

/* Când chatul e deschis: ascunde butonul din rândul de jos (se folosește FAB-ul din colțul panoului) */
.platform-help-panel--in-menu.platform-help-panel--open ~ .quick-action-extra-row .platform-help-button {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    margin: 0 !important;
}

/* Închide chat — colț dreapta-jos, suprapus peste card (în afara overflow-ului interior) */
.platform-help-close-fab {
    display: none;
    position: absolute;
    right: -12px;
    bottom: -12px;
    z-index: 30;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    box-shadow:
        0 4px 18px rgba(99, 102, 241, 0.55),
        0 0 0 3px rgba(15, 20, 41, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    pointer-events: auto;
}
.platform-help-close-fab i {
    font-size: 1.15rem;
}
.platform-help-close-fab:hover {
        0 6px 22px rgba(99, 102, 241, 0.65),
        0 0 0 3px rgba(15, 20, 41, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.platform-help-panel--in-menu.platform-help-panel--open .platform-help-close-fab {
    display: inline-flex;
}

.platform-help-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.08));
    flex-shrink: 0;
}
.platform-help-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
}
.platform-help-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.85rem 1.1rem;
    min-height: 220px;
    max-height: none;
}
.platform-help-msg {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
}
.platform-help-msg--user {
    justify-content: flex-end;
}
.platform-help-msg--assistant {
    justify-content: flex-start;
}
.platform-help-msg-body {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 40px);
    min-width: 0;
}
.platform-help-msg--user .platform-help-msg-body {
    align-items: flex-end;
}
.platform-help-msg--assistant .platform-help-msg-body {
    align-items: flex-start;
}
.platform-help-msg-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.28),
        0 3px 8px rgba(0, 0, 0, 0.18);
}
.platform-help-msg-avatar--assistant {
    background: var(--surface-bg, #1e293b);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
}
.platform-help-msg-avatar--assistant img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    box-sizing: border-box;
}
.platform-help-msg-avatar--user {
    background: var(--surface-bg, #1e293b);
    border: 1px solid var(--border-light, rgba(255, 255, 255, 0.1));
}
.platform-help-msg-avatar--user img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 3px;
    box-sizing: border-box;
}
.platform-help-msg-avatar-initials {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #a5b4fc;
}
.platform-help-msg-bubble {
    position: relative;
    max-width: 100%;
    padding: 0.6rem 0.82rem;
    border-radius: 16px;
    font-size: 0.86rem;
    line-height: 1.45;
    word-wrap: break-word;
}
.platform-help-msg--user .platform-help-msg-bubble {
    background: linear-gradient(165deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 1px 2px rgba(0, 0, 0, 0.22),
        0 4px 12px rgba(79, 70, 229, 0.38),
        0 8px 22px rgba(79, 70, 229, 0.18);
}
.platform-help-msg--user .platform-help-msg-bubble::after {
    content: '';
    position: absolute;
    right: -5px;
    bottom: 7px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-left-color: #4f46e5;
    border-right: 0;
    filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.18));
}
.platform-help-msg--assistant .platform-help-msg-bubble {
    background: linear-gradient(180deg, #2d3548 0%, #252b3d 100%);
    color: var(--text-primary, #e2e8f0);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom-left-radius: 5px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.05) inset,
        0 1px 3px rgba(0, 0, 0, 0.28),
        0 5px 14px rgba(0, 0, 0, 0.22),
        0 2px 5px rgba(0, 0, 0, 0.14);
}
.platform-help-msg--assistant .platform-help-msg-bubble::before {
    content: '';
    position: absolute;
    left: -5px;
    bottom: 7px;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    border-right-color: #252b3d;
    border-left: 0;
    filter: drop-shadow(-1px 2px 2px rgba(0, 0, 0, 0.14));
}
.platform-help-msg-bubble--typing::after {
    content: '▋';
    display: inline-block;
    margin-left: 2px;
    color: #a5b4fc;
    vertical-align: baseline;
}
@keyframes platform-help-cursor-blink {
    50% { opacity: 0; }
}
.platform-help-link {
    color: #a5b4fc;
    text-decoration: underline;
}
.platform-help-sources {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0;
    padding: 0 0.15rem;
    max-width: 100%;
}
.platform-help-source-link {
    color: #818cf8;
    margin-right: 0.5rem;
}
.platform-help-source-tag {
    margin-right: 0.5rem;
    opacity: 0.85;
}
.platform-help-msg--typing {
    margin-bottom: 0.5rem;
}
.platform-help-msg-bubble--dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 54px;
    min-height: 38px;
    padding: 0.55rem 0.85rem;
}
.platform-help-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(226, 232, 240, 0.9);
}
.platform-help-dot:nth-child(2) {
    animation-delay: 0.16s;
}
.platform-help-dot:nth-child(3) {
    animation-delay: 0.32s;
}
@keyframes platform-help-dot-bounce {
    0%, 55%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    28% {
        transform: translateY(-5px);
        opacity: 1;
    }
}
.platform-help-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0 0.75rem 0.5rem;
    flex-shrink: 0;
}
.platform-help-suggestion {
    font-size: 0.72rem;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: var(--surface-bg-hover, rgba(255,255,255,0.04));
    color: var(--text-secondary);
    cursor: pointer;
}
.platform-help-suggestion:hover {
    border-color: #6366f1;
    color: #a5b4fc;
}
.platform-help-footer {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.platform-help-input {
    width: 100%;
    resize: none;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    background: var(--surface-bg, rgba(0,0,0,0.2));
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    margin-bottom: 0.65rem;
    min-height: 52px;
    line-height: 1.45;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.platform-help-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.platform-help-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    align-items: stretch;
}
.platform-help-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    border: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.platform-help-action i {
    font-size: 0.95rem;
    opacity: 0.95;
}
.platform-help-action:active:not(:disabled) {
}
.platform-help-action--reset {
    background: color-mix(in srgb, var(--surface-bg-hover, rgba(255,255,255,0.06)) 90%, transparent);
    color: var(--text-primary, #e2e8f0);
    border: 1px solid var(--border-light, rgba(255,255,255,0.14));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.platform-help-action--reset:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface-bg-hover, rgba(255,255,255,0.08)));
    border-color: rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
}
.platform-help-action--send {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    box-shadow:
        0 4px 14px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.platform-help-action--send:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
        0 6px 18px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.platform-help-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}
@media (max-width: 768px) {
    .platform-help-button-icon {
        width: 48px;
        height: 48px;
    }
    .platform-help-button-icon .platform-help-chat-icon-svg {
        width: 1.2em;
        height: 1.2em;
    }
    .platform-help-panel--in-menu .platform-help-panel-stage {
        max-width: min(100%, 96vw);
    }
    .platform-help-panel--in-menu .platform-help-panel-inner {
        max-height: min(620px, 90vh);
        min-height: min(460px, 78vh);
    }
    .platform-help-close-fab {
        right: -8px;
        bottom: -8px;
        width: 44px;
        height: 44px;
    }
    .platform-help-messages {
        min-height: 180px;
    }
    .platform-help-action {
        min-height: 42px;
        font-size: 0.82rem;
    }
}