/**
 * CRM Construct NIL4WEB (SaaS v2.0)
 * Main Theme Stylesheet — Dual Light/Dark Mode
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ─── VARIABILE CSS GLOBALE ─────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════════════════════════════
   PREVENT ALPINE.JS FOUC (FLASH OF UNSTYLED CONTENT)
   ═══════════════════════════════════════════════════════════════════════ */
[x-cloak] {
    display: none !important;
}

:root {
    --brand-green: #059470;
    --brand-green-hover: #047857;
    --brand-green-light: #10b981;
    --brand-green-glow: rgba(5, 148, 112, 0.25);
}

/* ─── TIPOGRAFIE ŞI FOND DE BAZĂ (Minim 16px pentru conținut principal) ─── */
html {
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem; /* 16px */
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Light mode defaults (aplicat de body class via Tailwind dark: prefix) */
/* Dark mode controlat prin .dark class pe <html> */

/* ─── DROPDOWN NAVIGARE (TOP-BAR) ────────────────────────────────────────── */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.nav-dropdown-item:hover {
    background-color: #f1f5f9; /* slate-100 */
}

.dark .nav-dropdown-item:hover {
    background-color: rgba(30, 41, 59, 0.6); /* slate-800/60 */
}

.nav-dropdown-item.nav-dropdown-active {
    background-color: #ecfdf5; /* emerald-50 */
}

.dark .nav-dropdown-item.nav-dropdown-active {
    background-color: rgba(5, 148, 112, 0.1);
}

.nav-dropdown-item .font-semibold {
    color: #1e293b;
}

.dark .nav-dropdown-item .font-semibold {
    color: #f1f5f9;
}

.nav-dropdown-item.nav-dropdown-active .font-semibold {
    color: #059470;
}

.dark .nav-dropdown-item.nav-dropdown-active .font-semibold {
    color: #10b981;
}

/* ─── GLASSMORPHISM (păstrat pentru compatibilitate blade views existente) ── */
.glass-panel {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8); /* slate-200 */
}

.dark .glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(51, 65, 85, 0.6);
}

.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.dark .glass-card {
    background: rgba(19, 30, 49, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(51, 65, 85, 0.6);
}

.glass-dropdown {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.dark .glass-dropdown {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.8);
}

/* ─── HERO GLOW ──────────────────────────────────────────────────────────── */
.hero-glow {
    background: radial-gradient(circle at 50% 30%, rgba(5, 148, 112, 0.08) 0%, transparent 70%);
}

.dark .hero-glow {
    background: radial-gradient(circle at 50% 30%, rgba(5, 148, 112, 0.22) 0%, rgba(15, 23, 42, 0) 70%);
}

/* ─── SCROLLBARS ─────────────────────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f8fafc;
}

.dark .custom-scrollbar::-webkit-scrollbar-track {
    background: #0f172a;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ─── BADGE-URI DE STATUS (Contrast Ridicat WCAG AA/AAA) ────────────────── */
.badge-emerald {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 700 !important;
}
.dark .badge-emerald {
    background-color: rgba(6, 78, 59, 0.4) !important;
    color: #6ee7b7 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    font-weight: 700 !important;
}

.badge-amber {
    background-color: #fffbeb !important;
    color: #92400e !important;
    border: 1px solid #fde68a !important;
    font-weight: 700 !important;
}
.dark .badge-amber {
    background-color: rgba(120, 53, 15, 0.4) !important;
    color: #fcd34d !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    font-weight: 700 !important;
}

.badge-rose {
    background-color: #fff1f2 !important;
    color: #9f1239 !important;
    border: 1px solid #fecdd3 !important;
    font-weight: 700 !important;
}
.dark .badge-rose {
    background-color: rgba(136, 19, 55, 0.4) !important;
    color: #fda4af !important;
    border: 1px solid rgba(244, 63, 94, 0.3) !important;
    font-weight: 700 !important;
}

.badge-sky, .badge-blue {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 700 !important;
}
.dark .badge-sky, .dark .badge-blue {
    background-color: rgba(30, 58, 138, 0.4) !important;
    color: #93c5fd !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    font-weight: 700 !important;
}

.badge-purple {
    background-color: #faf5ff !important;
    color: #6b21a8 !important;
    border: 1px solid #e9d5ff !important;
    font-weight: 700 !important;
}
.dark .badge-purple {
    background-color: rgba(88, 28, 135, 0.4) !important;
    color: #d8b4fe !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    font-weight: 700 !important;
}

/* ─── BANNER / TIP BOX ADAPTIV (LIGHT & DARK) ────────────────────────────── */
.crm-tip-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    background-color: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #064e3b !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.dark .crm-tip-banner {
    background-color: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    color: #6ee7b7 !important;
    box-shadow: none;
}

/* ─── CARDURI & ELEVAŢIE ENTERPRISE (LIGHT & DARK) ───────────────────────── */
.crm-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.crm-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
}
.dark .crm-card {
    background-color: rgba(15, 23, 42, 0.85);
    border-color: #1e293b;
    box-shadow: none;
}
.dark .crm-card:hover {
    border-color: #334155;
}

/* ─── TABEL FIXAT (MATRICE DEVIZ) ────────────────────────────────────────── */
.table-sticky-col {
    position: sticky;
    left: 0;
    z-index: 20;
    background-color: #ffffff;
}
.dark .table-sticky-col {
    background-color: #0f172a;
}

.table-sticky-th {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(8px);
}
.dark .table-sticky-th {
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
}

/* ─── NAVIGARE ACTIVĂ (compatibilitate blade views vechi) ────────────────── */
.nav-link-active {
    background: linear-gradient(to right, rgba(5, 148, 112, 0.12), rgba(5, 148, 112, 0.02));
    color: #059470;
    border-color: rgba(5, 148, 112, 0.35);
    font-weight: 700;
}
.dark .nav-link-active {
    background: linear-gradient(to right, rgba(5, 148, 112, 0.22), rgba(5, 148, 112, 0.04));
    color: #34d399;
    border-color: rgba(5, 148, 112, 0.5);
}

.nav-link-inactive {
    color: #64748b;
    font-weight: 600;
}
.dark .nav-link-inactive {
    color: #94a3b8;
}

.nav-link-inactive:hover {
    color: #1e293b;
    background-color: rgba(241, 245, 249, 0.8);
}
.dark .nav-link-inactive:hover {
    color: #ffffff;
    background-color: rgba(30, 41, 59, 0.6);
}


/* ─── DIAGRAMA GANTT (ГПР) ───────────────────────────────────────────────── */
.gantt-grid-line {
    border-right: 1px dashed rgba(203, 213, 225, 0.5);
}
.dark .gantt-grid-line {
    border-right: 1px dashed rgba(51, 65, 85, 0.4);
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #f43f5e;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.7);
    z-index: 25;
    pointer-events: none;
}

.gantt-bar-completed {
    background: linear-gradient(135deg, #059470 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(5, 148, 112, 0.3);
}

.gantt-bar-progress-outer {
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(5, 148, 112, 0.35);
}
.dark .gantt-bar-progress-outer {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(5, 148, 112, 0.45);
}

.gantt-bar-progress-inner {
    background: linear-gradient(90deg, #059470 0%, #10b981 100%);
    box-shadow: 0 2px 8px rgba(5, 148, 112, 0.35);
}

.gantt-bar-pending {
    background: rgba(241, 245, 249, 0.6);
    border: 1px dashed rgba(148, 163, 184, 0.6);
}
.dark .gantt-bar-pending {
    background: rgba(15, 23, 42, 0.6);
    border: 1px dashed rgba(100, 116, 139, 0.6);
}

.gantt-tooltip {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 120 !important;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.18s ease, transform 0.18s ease;
    transform: translate(-50%, 6px);
}

.gantt-tooltip.gantt-tooltip-down {
    top: calc(100% + 8px) !important;
    bottom: auto !important;
    margin-bottom: 0 !important;
    transform: translate(-50%, -6px);
}

.group\/bar:hover .gantt-tooltip,
.group:hover .gantt-tooltip {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translate(-50%, 0) !important;
    z-index: 120 !important;
}

/* ─── OPTIMIZARE PENTRU IMPRIMARE & SALVARE PDF ─────────────────────────── */
@media print {
    header, nav, .no-print, button, form, .est-mode-btn, .room-pill, .superadmin-banner, #mobile-nav, [x-data] button, .filter-bar, footer {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body, main, .glass-panel, .glass-card {
        background: #ffffff !important;
        color: #000000 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        filter: none !important;
    }
    .hero-glow {
        display: none !important;
    }
    /* Elimină antetul și bara superadmin lipicioasă din PDF */
    .sticky {
        position: static !important;
    }
}


/* ─── SISTEM GLOBAL AUTOMAT PENTRU LIGHT MODE (CÂND HTML NU ARE CLASA .dark) ─── */
html:not(.dark) {
    color-scheme: light;
}

/* Fondul de bază: gri arhitectural odihnitor (#eef2f6) ce elimină senzația de alb șters și oferă contrast ferm cu cardurile albe */
html:not(.dark) body {
    background-color: #eef2f6 !important;
    color: #0f172a !important;
}

/* Header Top-Bar: alb solid curat cu bordură fină și fără blur/pelită */
html:not(.dark) header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Toate cardurile devin carduri albe solide (#ffffff) cu contur clar (#e2e8f0) şi umbră stratificată modernă */
html:not(.dark) .glass-panel,
html:not(.dark) .glass-card,
html:not(.dark) .crm-card:not(.kpi-card),
html:not(.dark) .bg-white:not(.kpi-card) {
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html:not(.dark) .glass-panel,
html:not(.dark) .glass-card,
html:not(.dark) .crm-card:not(.kpi-card) {
    border-width: 1px;
    border-style: solid;
    border-color: #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.02) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

html:not(.dark) .glass-panel:hover,
html:not(.dark) .glass-card:hover,
html:not(.dark) .crm-card:hover {
    box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04) !important;
}

/* Cartonașe KPI cu fundal tintat semantic și accent superior */
.kpi-card {
    border-radius: 1rem !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}
.kpi-card:hover {
    transform: translateY(-2px);
}

html:not(.dark) .kpi-card-emerald {
    background: linear-gradient(145deg, #ecfdf5 0%, #ffffff 68%) !important;
    border: 1px solid #a7f3d0 !important;
    border-top: 4px solid #059470 !important;
    box-shadow: 0 6px 16px -4px rgba(5, 148, 112, 0.14) !important;
}
html:not(.dark) .kpi-card-blue {
    background: linear-gradient(145deg, #eff6ff 0%, #ffffff 68%) !important;
    border: 1px solid #bfdbfe !important;
    border-top: 4px solid #2563eb !important;
    box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.14) !important;
}
html:not(.dark) .kpi-card-amber {
    background: linear-gradient(145deg, #fffbeb 0%, #ffffff 68%) !important;
    border: 1px solid #fde68a !important;
    border-top: 4px solid #d97706 !important;
    box-shadow: 0 6px 16px -4px rgba(217, 119, 6, 0.14) !important;
}
html:not(.dark) .kpi-card-purple {
    background: linear-gradient(145deg, #f5f3ff 0%, #ffffff 68%) !important;
    border: 1px solid #ddd6fe !important;
    border-top: 4px solid #7c3aed !important;
    box-shadow: 0 6px 16px -4px rgba(124, 58, 237, 0.14) !important;
}

.dark .kpi-card-emerald {
    background: linear-gradient(145deg, rgba(5, 148, 112, 0.18) 0%, #0f172a 75%) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    border-top: 4px solid #10b981 !important;
}
.dark .kpi-card-blue {
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.18) 0%, #0f172a 75%) !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
    border-top: 4px solid #3b82f6 !important;
}
.dark .kpi-card-amber {
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.18) 0%, #0f172a 75%) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-top: 4px solid #f59e0b !important;
}
.dark .kpi-card-purple {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.18) 0%, #0f172a 75%) !important;
    border: 1px solid rgba(139, 92, 246, 0.35) !important;
    border-top: 4px solid #8b5cf6 !important;
}

/* Carduri Dark Mode cu adâncime obsidian și buza superioară luminoasă (inner rim-light) */
.dark .glass-panel,
.dark .glass-card,
.dark .crm-card:not(.kpi-card) {
    background-color: #0f172a !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.06) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dark .glass-panel:hover,
.dark .glass-card:hover,
.dark .crm-card:not(.kpi-card):hover {
    border-color: #334155 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.1) !important;
}

/* Borduri clare și definite pentru toate containerele în light mode */
html:not(.dark) .border-slate-200,
html:not(.dark) .border-slate-300,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-700\/60,
html:not(.dark) .border-slate-700\/80 {
    border-color: #e2e8f0 !important;
}

/* Titluri și texte mari în light mode: contrast maxim (Slate-900 #0f172a) */
html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4,
html:not(.dark) .glass-panel h1,
html:not(.dark) .glass-panel h2,
html:not(.dark) .glass-panel h3,
html:not(.dark) .glass-panel h4,
html:not(.dark) .glass-card h1,
html:not(.dark) .glass-card h2,
html:not(.dark) .glass-card h3,
html:not(.dark) .glass-card h4,
html:not(.dark) main h1,
html:not(.dark) main h2,
html:not(.dark) main h3,
html:not(.dark) main h4,
html:not(.dark) .text-slate-800,
html:not(.dark) .text-slate-900 {
    color: #0f172a !important;
}

/* ─── HEADER & TOP-BAR NAVIGATION (COMPARTIMENTE) ───────────────────────── */
html:not(.dark) header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.dark header {
    background-color: #0f172a !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.6) !important;
}

/* Nav Items Individuale (Объекты, Задачи, Бригада, Инструменты, Склад, Деньги) */
html:not(.dark) header nav .nav-item-btn:not(.nav-pill-active) {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.05) !important;
}

html:not(.dark) header nav .nav-item-btn:not(.nav-pill-active):hover {
    color: #047857 !important;
    background-color: #ffffff !important;
    border-color: #10b981 !important;
    box-shadow: 0 3px 8px rgba(5, 148, 112, 0.14) !important;
}

/* Item activ în antet */
header nav .nav-pill-active,
html:not(.dark) header nav .nav-pill-active {
    background-color: #059470 !important;
    border: 1px solid #059470 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 10px rgba(5, 148, 112, 0.28) !important;
}

header nav .nav-pill-active *,
html:not(.dark) header nav .nav-pill-active * {
    color: #ffffff !important;
}

header nav .nav-pill-active:hover,
html:not(.dark) header nav .nav-pill-active:hover {
    background-color: #047857 !important;
    border-color: #047857 !important;
    color: #ffffff !important;
}

.dark header nav .nav-item-btn:not(.nav-pill-active) {
    background-color: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid #334155 !important;
    color: #e2e8f0 !important;
    font-weight: 700 !important;
}

.dark header nav .nav-item-btn:not(.nav-pill-active):hover {
    color: #ffffff !important;
    background-color: #1e293b !important;
    border-color: #10b981 !important;
}

/* ─── BUTOANE SECUNDARE & CONTRAST (LIGHT & DARK) ────────────────────────── */
/* Butoane secundare (ex: Отклонить, Отмена) */
html:not(.dark) button.bg-slate-200,
html:not(.dark) a.bg-slate-200,
html:not(.dark) .btn-secondary {
    background-color: #f1f5f9 !important;
    color: #334155 !important; /* Slate-700, NICIODATĂ alb! */
    border: 1px solid #cbd5e1 !important;
    font-weight: 600 !important;
}

html:not(.dark) button.bg-slate-200:hover,
html:not(.dark) a.bg-slate-200:hover,
html:not(.dark) .btn-secondary:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.dark button.bg-slate-200,
.dark a.bg-slate-200,
.dark .btn-secondary {
    background-color: #1e293b !important;
    color: #cbd5e1 !important;
    border: 1px solid #334155 !important;
    font-weight: 600 !important;
}

.dark button.bg-slate-200:hover,
.dark a.bg-slate-200:hover,
.dark .btn-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
    border-color: #475569 !important;
}

/* Buton «Войти» în tabel Superadmin */
html:not(.dark) .bg-amber-100.text-amber-900 {
    background-color: #fef3c7 !important;
    color: #78350f !important;
    border: 1px solid #fcd34d !important;
}
html:not(.dark) .bg-amber-100.text-amber-900:hover {
    background-color: #fde68a !important;
    color: #451a03 !important;
}

/* ─── CARD DEPTH & CONTRAST (COMBATERE MONOTONIE) ──────────────────────── */
/* Light Mode Card Elevation — contur ferm și umbre stratificate */
html:not(.dark) .glass-panel,
html:not(.dark) .glass-card,
html:not(.dark) .crm-card:not(.kpi-card) {
    background-color: #ffffff !important;
    border-color: #d8e1ea;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 4px 14px -2px rgba(15, 23, 42, 0.04) !important;
    border-radius: 1rem !important;
}

html:not(.dark) .glass-panel:hover,
html:not(.dark) .glass-card:hover,
html:not(.dark) .crm-card:not(.kpi-card):hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 10px 20px -3px rgba(15, 23, 42, 0.05) !important;
}

/* Dark Mode Card Elevation */
.dark .glass-panel,
.dark .glass-card,
.dark .crm-card {
    background-color: #0f172a !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 0 rgba(255, 255, 255, 0.06) !important;
    border-radius: 1rem !important;
}
.dark .glass-panel:hover,
.dark .glass-card:hover,
.dark .crm-card:hover {
    border-color: #334155 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.1) !important;
}

/* Ierarhie tipografică vie și contrastantă pe suprafețe luminoase (WCAG AAA) */
html:not(.dark) h1,
html:not(.dark) h2,
html:not(.dark) h3,
html:not(.dark) h4 {
    color: #0f172a !important;
}

html:not(.dark) .text-slate-900,
html:not(.dark) .text-slate-800 {
    color: #0f172a !important;
}

html:not(.dark) .text-slate-700 {
    color: #1e293b !important;
}

html:not(.dark) .text-slate-600 {
    color: #334155 !important;
}

html:not(.dark) .text-slate-500 {
    color: #475569 !important; /* 4.5:1 ratio pe alb, 100% lizibil */
}

html:not(.dark) .text-slate-400 {
    color: #64748b !important;
}

/* Tab-uri inactive și active în fișa obiectului (eliminare conflict hover alb-pe-alb) */
html:not(.dark) .tab-btn:not([class*="bg-[#059470]"]):not([class*="bg-emerald"]) {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
html:not(.dark) .tab-btn:not([class*="bg-[#059470]"]):not([class*="bg-emerald"]):hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}
.tab-btn[class*="bg-[#059470]"],
.tab-btn[class*="bg-[#059470]"]:hover,
html:not(.dark) .tab-btn[class*="bg-[#059470]"]:hover {
    background-color: #047857 !important;
    color: #ffffff !important;
    border-color: #047857 !important;
}

/* Coloane înghețate (Gantt, Smetă Matrix) în light mode */
html:not(.dark) .table-sticky-col {
    background-color: #ffffff !important;
    border-right: 1px solid #cbd5e1 !important;
}
html:not(.dark) .table-sticky-th {
    background-color: #f8fafc !important;
    border-bottom: 1px solid #cbd5e1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Doar butoanele cu fundal plin verde de brand au text alb */
html:not(.dark) .bg-emerald-600,
html:not(.dark) .bg-emerald-700,
html:not(.dark) .bg-\[\#059470\],
html:not(.dark) .bg-\[\#047857\],
html:not(.dark) a.bg-emerald-600,
html:not(.dark) button.bg-emerald-600,
html:not(.dark) a.bg-\[\#059470\],
html:not(.dark) button.bg-\[\#059470\] {
    color: #ffffff !important;
}

html:not(.dark) .bg-emerald-600 *,
html:not(.dark) .bg-\[\#059470\] * {
    color: #ffffff !important;
}

/* Badge-uri și butoane cu verde deschis au text verde închis, NICIODATĂ alb */
html:not(.dark) .bg-emerald-50,
html:not(.dark) .bg-emerald-100,
html:not(.dark) .bg-emerald-500\/10,
html:not(.dark) .bg-emerald-500\/15 {
    color: #047857 !important;
}
html:not(.dark) .bg-emerald-50 *,
html:not(.dark) .bg-emerald-100 * {
    color: #047857 !important;
}

/* ─── PROTECȚIE CÂMPURI FORMULARE ÎN LIGHT MODE (GARANȚIE FUNDAL ALB & CONTRAST) ─── */
html:not(.dark) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
html:not(.dark) select,
html:not(.dark) textarea {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html:not(.dark) input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
    background-color: #ffffff !important;
    border-color: #059470 !important;
    box-shadow: 0 0 0 1px #059470 !important;
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
    color: #94a3b8 !important;
}

/* Protecție containere interne de poziții (aprovizionare / sklad) */
html:not(.dark) .procurement-items-box {
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* ─── TIPOGRAFIE CLARĂ & MINIM 16PX PENTRU CONȚINUT PRINCIPAL ERP ─────────── */
header nav a,
header nav button,
.nav-dropdown-item {
    font-size: 1rem !important; /* Minim 16px și în meniul principal */
}

main table td {
    font-size: 1rem !important; /* Minim 16px pentru datele din tabele */
}

main input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
main select,
main textarea,
main label {
    font-size: 1rem !important; /* Minim 16px pentru formulare */
}

.tab-btn,
.est-mode-btn,
.gpr-mode-btn {
    font-size: 1rem !important; /* 16px pe butoanele de navigare/mod */
}

.gpr-subview table th,
.est-subview table th,
.tab-content table th,
main table th {
    font-size: 0.875rem !important; /* 14px doar pentru capete de coloană/sub-etichete */
    font-weight: 700 !important;
    letter-spacing: 0.04em;
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
}

.gpr-subview table td,
.est-subview table td,
.tab-content table td {
    padding-top: 0.95rem !important;
    padding-bottom: 0.95rem !important;
}

/* Titluri mari, clare și aerisite de lucrări (Semibold) */
.gpr-subview table td div[title],
.est-subview table td div[title] {
    font-size: 1.0625rem !important; /* 17px */
    font-weight: 600 !important;
    line-height: 1.45 !important;
}

/* Ridicarea fontului pentru sub-controale și carduri KPI (16px bază, 14px secundar) */
.crm-card p,
.crm-card .text-sm {
    font-size: 1rem;
}

.kpi-title {
    font-size: 0.9375rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ─── VARIANTA 2: CRISP EXECUTIVE CONTRAST (LIGHT MODE) ───────────────────── */
html:not(.dark) body {
    background-color: #eef2f6 !important; /* Gri arhitectural curat (#eef2f6): contrast ferm cu cardurile albe, elimină senzația de alb șters */
    color: #0f172a;
}

html:not(.dark) .card-elevated {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-top: 4px solid #059470;
    border-radius: 1.125rem;
    box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
}

html:not(.dark) table tbody tr:hover {
    background-color: rgba(5, 148, 112, 0.035);
}

html:not(.dark) th {
    color: #334155;
    font-weight: 600;
}



