/* =====================
   THEME VARIABLES
===================== */
:root {
  /* Default - Dark Blue (actual) */
  --bg-primary: #123456;
  --bg-card: #111827;
  --bg-input: #020617;
  --border-color: #1f2937;
  --text-primary: #e5e7eb;
  --text-secondary: #94a3b8;
  --text-heading: #f9fafb;
  --accent: #60a5fa;
  --accent-hover: #3b82f6;
  --topbar-bg: rgba(15,23,42,.92);
}

/* Dark Green Theme */
[data-theme="green"] {
  --bg-primary: #0f2419;
  --bg-card: #132a1c;
  --bg-input: #0a1810;
  --border-color: #1e3a2a;
  --text-primary: #d1fae5;
  --text-secondary: #6ee7b7;
  --text-heading: #ecfdf5;
  --accent: #34d399;
  --accent-hover: #10b981;
  --topbar-bg: rgba(15,42,28,.92);
}

/* Dark Purple Theme */
[data-theme="purple"] {
  --bg-primary: #1e1b2e;
  --bg-card: #252238;
  --bg-input: #13111d;
  --border-color: #3b3456;
  --text-primary: #e9e5ff;
  --text-secondary: #a5b4fc;
  --text-heading: #f5f3ff;
  --accent: #a78bfa;
  --accent-hover: #8b5cf6;
  --topbar-bg: rgba(37,34,56,.92);
}

/* Dark Red Theme */
[data-theme="red"] {
  --bg-primary: #1f1315;
  --bg-card: #2a1a1c;
  --bg-input: #150d0e;
  --border-color: #4a2528;
  --text-primary: #fecdd3;
  --text-secondary: #fda4af;
  --text-heading: #fff1f2;
  --accent: #fb7185;
  --accent-hover: #f43f5e;
  --topbar-bg: rgba(42,26,28,.92);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-heading: #0f172a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --topbar-bg: rgba(255,255,255,.92);
}

/* Ocean Theme */
[data-theme="ocean"] {
  --bg-primary: #0c1929;
  --bg-card: #112240;
  --bg-input: #0a1628;
  --border-color: #1e3a5f;
  --text-primary: #ccd6f6;
  --text-secondary: #8892b0;
  --text-heading: #e6f1ff;
  --accent: #64ffda;
  --accent-hover: #4cd9b4;
  --topbar-bg: rgba(17,34,64,.92);
}

/* Sunset Theme */
[data-theme="sunset"] {
  --bg-primary: #1a0f0f;
  --bg-card: #2d1810;
  --bg-input: #150c0c;
  --border-color: #4a2c1a;
  --text-primary: #ffe4d6;
  --text-secondary: #ffb088;
  --text-heading: #fff5f0;
  --accent: #ff6b35;
  --accent-hover: #e85a2a;
  --topbar-bg: rgba(45,24,16,.92);
}

/* Mint Theme */
[data-theme="mint"] {
  --bg-primary: #0d1912;
  --bg-card: #142318;
  --bg-input: #0a120d;
  --border-color: #2a4a35;
  --text-primary: #d1fae5;
  --text-secondary: #86efac;
  --text-heading: #ecfdf5;
  --accent: #4ade80;
  --accent-hover: #22c55e;
  --topbar-bg: rgba(20,35,24,.92);
}

/* Gold Theme */
[data-theme="gold"] {
  --bg-primary: #1a1608;
  --bg-card: #28220d;
  --bg-input: #121005;
  --border-color: #4a3f15;
  --text-primary: #fef9c3;
  --text-secondary: #fde047;
  --text-heading: #fefce8;
  --accent: #eab308;
  --accent-hover: #ca8a04;
  --topbar-bg: rgba(40,34,13,.92);
}

/* Slate Theme */
[data-theme="slate"] {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #0c1322;
  --border-color: #334155;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-heading: #f8fafc;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --topbar-bg: rgba(30,41,59,.92);
}
/* Corporate Blue (Pro) */
[data-theme="corporate"] {
  --bg-primary: #1e3a5f;
  --bg-card: #264a73;
  --bg-input: #1a3352;
  --border-color: #3d6a99;
  --text-primary: #ffffff;
  --text-secondary: #b8d4f0;
  --text-heading: #ffffff;
  --accent: #4da6ff;
  --accent-hover: #2196f3;
  --topbar-bg: rgba(30,58,95,.95);
}

/* Fresh Green (Modern) */
[data-theme="fresh"] {
  --bg-primary: #1a3d2e;
  --bg-card: #225540;
  --bg-input: #153328;
  --border-color: #2d7a5a;
  --text-primary: #ffffff;
  --text-secondary: #a8e6cf;
  --text-heading: #ffffff;
  --accent: #00e676;
  --accent-hover: #00c853;
  --topbar-bg: rgba(26,61,46,.95);
}

/* Royal Purple (Elegant) */
[data-theme="royal"] {
  --bg-primary: #2d1f47;
  --bg-card: #3d2a5f;
  --bg-input: #251a3a;
  --border-color: #5a3d8a;
  --text-primary: #ffffff;
  --text-secondary: #d4b8ff;
  --text-heading: #ffffff;
  --accent: #b388ff;
  --accent-hover: #9c64ff;
  --topbar-bg: rgba(45,31,71,.95);
}

/* Warm Orange (Energetic) */
[data-theme="warm"] {
  --bg-primary: #2d1f10;
  --bg-card: #3d2a15;
  --bg-input: #251a0d;
  --border-color: #5a3d1a;
  --text-primary: #ffffff;
  --text-secondary: #ffcc80;
  --text-heading: #ffffff;
  --accent: #ff9800;
  --accent-hover: #f57c00;
  --topbar-bg: rgba(45,31,16,.95);
}

/* Clean Light (Profesional zi) */
[data-theme="clean"] {
  --bg-primary: #ffffff;
  --bg-card: #f8fafc;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-heading: #0f172a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --topbar-bg: rgba(255,255,255,.98);
}



/* =====================
   BASE
===================== */
body{
  font-family:system-ui,Segoe UI,Arial;
  font-size:16px;
  line-height:1.5;
  margin:0;
  background:var(--bg-primary);
  color:var(--text-primary);
  transition: background 0.3s, color 0.3s;
}
a{color:inherit;text-decoration:none}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 16px;
  border-bottom:1px solid var(--border-color);
  position:sticky;
  top:0;
  background:var(--topbar-bg);
  backdrop-filter: blur(6px);
}
.brand{font-weight:800}
nav{display:flex;gap:10px;align-items:center}
.container{
  max-width:1100px;
  margin:18px auto;
  padding:0 16px
}
h1{margin:8px 0 14px;color:var(--text-heading)}
h2{color:var(--text-heading)}

/* =====================
   CARDS & BUTTONS
===================== */
.card{
  background:var(--bg-card);
  border:1px solid var(--border-color);
  border-radius:14px;
  padding:16px;
  margin:12px 0;
  transition: background 0.3s, border-color 0.3s;
}
.btn{
  background:var(--accent);
  color:#07101f;
  padding:8px 12px;
  border-radius:10px;
  border:0;
  font-weight:700;
  cursor:pointer;
  transition: background 0.2s;
}
.btn:hover{background:var(--accent-hover)}

/* =====================
   FILTERS & INPUTS
===================== */
.filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px
}
input,select,textarea{
  width:100%;
  padding:10px;
  border-radius:10px;
  border:1px solid var(--border-color);
  background:var(--bg-input);
  color:var(--text-primary);
  transition: background 0.3s, border-color 0.3s;
}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--accent);
}

/* =====================
   TABLE
===================== */
.table{
  border:1px solid var(--border-color);
  border-radius:14px;
  overflow:hidden
}
.row{
  display:grid;
  grid-template-columns:
    160px
    260px
    1fr
    140px
    140px
    180px;
  gap:14px;
  padding:10px 12px;
  border-top:1px solid var(--border-color);
  align-items:center;
}
.row:hover{background:rgba(255,255,255,.04)}
.head{
  background:rgba(255,255,255,.04);
  border-top:0;
  color:var(--text-secondary);
  font-size:14px;
  text-transform:uppercase
}

/* =====================
   CELL STRUCTURE
===================== */
.cell{
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.primary{
  font-weight:600;
  line-height:1.25;
}
.secondary{
  font-size:13px;
  color:var(--text-secondary);
  line-height:1.15;
}
.nowrap{white-space:nowrap}
.product{white-space:normal;word-break:break-word}
.inline-muted{
  font-size:13px;
  color:var(--text-secondary);
  margin-left:6px;
  white-space:nowrap;
}
.cell.date{text-align:left}

/* =====================
   BADGES
===================== */
.badge{
  padding:4px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  background:var(--border-color);
}
.status{
  padding:4px 10px;
  border-radius:999px;
  font-size:13px;
  font-weight:700;
  display:inline-block;
}
.status-Preluat{background:#2563eb}
.status-În\ diagnostic{background:#facc15;color:#000}
.status-În\ lucru{background:#fb923c}
.status-Așteaptă\ piese{background:#ef4444}
.status-Trimite\ la\ furnizor{background:#7c3aed}
.status-Finalizat{background:#22c55e}
.status-Predat{background:#6b7280}

/* =====================
   DASHBOARD KPI
===================== */
.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
  margin-bottom:16px;
}
.kpi{font-size:13px;color:var(--text-secondary)}
.val{font-size:36px;font-weight:800;margin-top:6px}

/* =====================
   THEME SELECTOR
===================== */
.theme-selector {
  display: flex;
  gap: 6px;
  align-items: center;
}
.theme-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.theme-btn:hover {
  transform: scale(1.15);
}
.theme-btn.active {
  border-color: white;
}
.theme-btn[data-theme="default"] { background: linear-gradient(135deg, #123456, #60a5fa); }
.theme-btn[data-theme="green"] { background: linear-gradient(135deg, #0f2419, #34d399); }
.theme-btn[data-theme="purple"] { background: linear-gradient(135deg, #1e1b2e, #a78bfa); }
.theme-btn[data-theme="red"] { background: linear-gradient(135deg, #1f1315, #fb7185); }
.theme-btn[data-theme="light"] { background: linear-gradient(135deg, #f1f5f9, #3b82f6); }
.theme-btn[data-theme="ocean"] { background: linear-gradient(135deg, #0c1929, #64ffda); }
.theme-btn[data-theme="sunset"] { background: linear-gradient(135deg, #1a0f0f, #ff6b35); }
.theme-btn[data-theme="mint"] { background: linear-gradient(135deg, #0d1912, #4ade80); }
.theme-btn[data-theme="gold"] { background: linear-gradient(135deg, #1a1608, #eab308); }
.theme-btn[data-theme="slate"] { background: linear-gradient(135deg, #0f172a, #38bdf8); }
.theme-btn[data-theme="corporate"] { background: linear-gradient(135deg, #1e3a5f, #4da6ff); }
.theme-btn[data-theme="fresh"] { background: linear-gradient(135deg, #1a3d2e, #00e676); }
.theme-btn[data-theme="royal"] { background: linear-gradient(135deg, #2d1f47, #b388ff); }
.theme-btn[data-theme="warm"] { background: linear-gradient(135deg, #2d1f10, #ff9800); }
.theme-btn[data-theme="clean"] { background: linear-gradient(135deg, #ffffff, #3b82f6); border: 1px solid #e2e8f0; }

/* ========== TEMA DEVIZ GREEN (Light) ========== */
[data-theme="deviz"] {
  --bg-primary: #f5f5dc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border-color: #c6d4c6;
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-heading: #1a202c;
  --accent: #228b22;
  --accent-hover: #1e7b1e;
  --topbar-bg: linear-gradient(135deg, #228b22, #2e7d32);
}

[data-theme="deviz"] .topbar {
  background: linear-gradient(135deg, #228b22, #2e7d32);
  border-bottom: 1px solid #1e7b1e;
}

[data-theme="deviz"] .btn {
  background: #228b22;
  color: #ffffff;
}

[data-theme="deviz"] .btn:hover {
  background: #1e7b1e;
}

[data-theme="deviz"] .card {
  background: #ffffff;
  border: 1px solid #c6d4c6;
  box-shadow: 0 2px 8px rgba(34, 139, 34, 0.1);
}

[data-theme="deviz"] .table .row.head {
  background: #e8f5e9;
  color: #1b5e20;
}

[data-theme="deviz"] .table .row:hover {
  background: #f1f8e9;
}

[data-theme="deviz"] .status {
  color: #ffffff;
}

/* Deviz - bare progres si KPI garantii */
[data-theme="deviz"] .card .card {
  background: #e8f5e9 !important;
  border: 1px solid #c6d4c6;
}

[data-theme="deviz"] div[style*="background: #1f2937"] {
  background: #c6d4c6 !important;
}

[data-theme="deviz"] div[style*="background: #1a2332"] {
  background: #e8f5e9 !important;
  border: 1px solid #c6d4c6;
}

/* ========== TEMA NEXUS BLUE (Light) ========== */
[data-theme="nexus"] {
  --bg-primary: #e8f4fc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border-color: #90caf9;
  --text-primary: #1a237e;
  --text-secondary: #5c6bc0;
  --text-heading: #0d47a1;
  --accent: #1565c0;
  --accent-hover: #0d47a1;
  --topbar-bg: linear-gradient(135deg, #1565c0, #0d47a1);
}

[data-theme="nexus"] .topbar {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  border-bottom: 1px solid #0d47a1;
}

[data-theme="nexus"] .btn {
  background: #1565c0;
  color: #ffffff;
}

[data-theme="nexus"] .btn:hover {
  background: #0d47a1;
}

[data-theme="nexus"] .card {
  background: #ffffff;
  border: 1px solid #90caf9;
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
}

[data-theme="nexus"] .table .row.head {
  background: #e3f2fd;
  color: #0d47a1;
}

[data-theme="nexus"] .table .row:hover {
  background: #bbdefb;
}

[data-theme="nexus"] .status {
  color: #ffffff;
}

/* Nexus - bare progres si KPI garantii */
[data-theme="nexus"] .card .card {
  background: #e3f2fd !important;
  border: 1px solid #90caf9;
}

[data-theme="nexus"] div[style*="background: #1f2937"] {
  background: #bbdefb !important;
}

[data-theme="nexus"] div[style*="background: #1a2332"] {
  background: #e3f2fd !important;
  border: 1px solid #90caf9;
}

/* ========== TEMA ERP CLASSIC (Light) ========== */
[data-theme="erp"] {
  --bg-primary: #eceff1;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border-color: #b0bec5;
  --text-primary: #37474f;
  --text-secondary: #607d8b;
  --text-heading: #263238;
  --accent: #455a64;
  --accent-hover: #37474f;
  --topbar-bg: linear-gradient(135deg, #546e7a, #455a64);
}

[data-theme="erp"] .topbar {
  background: linear-gradient(135deg, #546e7a, #455a64);
  border-bottom: 1px solid #37474f;
}

[data-theme="erp"] .btn {
  background: #455a64;
  color: #ffffff;
}

[data-theme="erp"] .btn:hover {
  background: #37474f;
}

[data-theme="erp"] .card {
  background: #ffffff;
  border: 1px solid #b0bec5;
  box-shadow: 0 2px 8px rgba(69, 90, 100, 0.1);
}

[data-theme="erp"] .table .row.head {
  background: #cfd8dc;
  color: #263238;
}

[data-theme="erp"] .table .row:hover {
  background: #eceff1;
}

[data-theme="erp"] .status {
  color: #ffffff;
}

/* ERP - bare progres si KPI garantii */
[data-theme="erp"] .card .card {
  background: #cfd8dc !important;
  border: 1px solid #b0bec5;
}

[data-theme="erp"] div[style*="background: #1f2937"] {
  background: #b0bec5 !important;
}

[data-theme="erp"] div[style*="background: #1a2332"] {
  background: #cfd8dc !important;
  border: 1px solid #b0bec5;
}

/* ========== TEMA TECH GRAY (Light) ========== */
[data-theme="tech"] {
  --bg-primary: #f5f5f5;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border-color: #e0e0e0;
  --text-primary: #212121;
  --text-secondary: #757575;
  --text-heading: #000000;
  --accent: #616161;
  --accent-hover: #424242;
  --topbar-bg: linear-gradient(135deg, #616161, #424242);
}

[data-theme="tech"] .topbar {
  background: linear-gradient(135deg, #616161, #424242);
  border-bottom: 1px solid #424242;
}

[data-theme="tech"] .btn {
  background: #616161;
  color: #ffffff;
}

[data-theme="tech"] .btn:hover {
  background: #424242;
}

[data-theme="tech"] .card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="tech"] .table .row.head {
  background: #eeeeee;
  color: #212121;
}

[data-theme="tech"] .table .row:hover {
  background: #f5f5f5;
}

[data-theme="tech"] .status {
  color: #ffffff;
}

/* Tech - bare progres si KPI garantii */
[data-theme="tech"] .card .card {
  background: #eeeeee !important;
  border: 1px solid #e0e0e0;
}

[data-theme="tech"] div[style*="background: #1f2937"] {
  background: #e0e0e0 !important;
}

[data-theme="tech"] div[style*="background: #1a2332"] {
  background: #eeeeee !important;
  border: 1px solid #e0e0e0;
}

/* ========== BUTOANE SELECTOR TEME NOI ========== */
.theme-btn[data-theme="deviz"] {
  background: linear-gradient(135deg, #228b22, #f5f5dc);
  border: 2px solid #228b22;
}

.theme-btn[data-theme="nexus"] {
  background: linear-gradient(135deg, #1565c0, #e8f4fc);
  border: 2px solid #1565c0;
}

.theme-btn[data-theme="erp"] {
  background: linear-gradient(135deg, #546e7a, #eceff1);
  border: 2px solid #546e7a;
}

.theme-btn[data-theme="tech"] {
  background: linear-gradient(135deg, #616161, #f5f5f5);
  border: 2px solid #616161;
}