/* GestiunePro — stiluri comune (tematizate prin variabile CSS) */

/* === PALETĂ LIGHT (default) === */
:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f3f4f6;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-soft: #f3f4f6;
  --accent: #89b4fa;
  --accent-contrast: #10121f;
  --accent-soft: #89b4fa15;
  --topbar-bg: #1a1a2e;
  --topbar-text: #cdd6f4;
  --topbar-btn: #3a3a5e;
  --topbar-btn-border: #4a4a6e;
  --topbar-btn-hover: #4a4a6e;
  --topbar-dd-bg: #1e2040;
  --topbar-dd-border: #3a3a5e;
  --topbar-dd-hover: #2a2a4e;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #a6adc8;
  --sidebar-title: #585b70;
  --sidebar-hover: #2a2a4e;
  --primary-btn-bg: #1a1a2e;
  --primary-btn-text: #ffffff;
  --primary-btn-hover: #2a2a4e;
  --input-bg: #ffffff;
  --shadow: rgba(0,0,0,0.08);
  --shadow-strong: rgba(0,0,0,0.18);
  --magazin-bg: #a6e3a120;
  --magazin-text: #40a02b;
  /* tinte de alertă/info + text pe ele */
  --tint-amber: #fff7ed;
  --tint-blue: #f0f9ff;
  --tint-indigo: #eff6ff;
  --tint-red: #fee2e2;
  --tint-green: #f0fdf4;
  --on-amber: #b45309;
  --on-red: #991b1b;
}

/* === PALETĂ DARK (selectabilă din meniul utilizatorului) === */
:root[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #18233b;
  --surface-3: #243349;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-soft: #243349;
  --accent: #38bdf8;
  --accent-contrast: #06121f;
  --accent-soft: #38bdf820;
  --topbar-bg: #0b1120;
  --topbar-text: #e2e8f0;
  --topbar-btn: #1e293b;
  --topbar-btn-border: #334155;
  --topbar-btn-hover: #243349;
  --topbar-dd-bg: #0f172a;
  --topbar-dd-border: #334155;
  --topbar-dd-hover: #1e293b;
  --sidebar-bg: #0b1120;
  --sidebar-text: #cbd5e1;
  --sidebar-title: #64748b;
  --sidebar-hover: #1e293b;
  --primary-btn-bg: #38bdf8;
  --primary-btn-text: #06121f;
  --primary-btn-hover: #5cc8fb;
  --input-bg: #1e293b;
  --shadow: rgba(0,0,0,0.4);
  --shadow-strong: rgba(0,0,0,0.55);
  --magazin-bg: #14532d;
  --magazin-text: #4ade80;
  --tint-amber: #2a1f0f;
  --tint-blue: #0c2233;
  --tint-indigo: #1a1f33;
  --tint-red: #2e1416;
  --tint-green: #0f2a1a;
  --on-amber: #fcd34d;
  --on-red: #fca5a5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', -apple-system, sans-serif; background: var(--bg); color: var(--text); }

/* === AUTH PAGES (centered card) === */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a2a4e 100%);
}
.auth-card {
  background: var(--surface); border-radius: 16px; padding: 40px; width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); color: var(--text);
}
.auth-logo { text-align: center; font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.auth-logo span { color: var(--accent); font-weight: 300; }
.auth-subtitle { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.auth-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.auth-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* Inputurile text/number/select/textarea urmează tema (dark/light) dacă nu au fundal inline.
   În light, --input-bg = alb → aspect neschimbat. În dark devin lizibile (fundal închis + text deschis). */
input[type="text"], input[type="number"], input[type="password"], input[type="email"],
input[type="date"], input[type="search"], input[type="tel"], input:not([type]), select, textarea {
  background: var(--input-bg);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.7; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; transition: border-color 0.15s;
  background: var(--input-bg); color: var(--text);
}
.field input:focus { border-color: var(--accent); }
.field input.token-input { font-family: 'SF Mono', Consolas, monospace; font-size: 13px; letter-spacing: 0.5px; }

.btn-primary {
  width: 100%; padding: 12px; border-radius: 8px; border: none; cursor: pointer;
  background: var(--primary-btn-bg); color: var(--primary-btn-text); font-size: 14px; font-weight: 600;
  transition: background 0.2s; font-family: inherit;
}
.btn-primary:hover { background: var(--primary-btn-hover); }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.alert {
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: none;
}
.alert.show { display: block; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* === APP LAYOUT === */
.app-topbar {
  background: var(--topbar-bg); color: var(--topbar-text); padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.app-logo { font-size: 16px; font-weight: 700; color: var(--accent); }
.app-logo span { color: var(--topbar-text); font-weight: 300; }
.app-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; flex-wrap: wrap; }

/* Taburi de navigație în bară (POS / Dashboard / Admin / Vânzare-Istoric) */
.view-tab { background: var(--topbar-btn); border: 1px solid var(--topbar-btn-border); color: var(--topbar-text); padding: 5px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit; }
.view-tab:hover { background: var(--topbar-btn-hover); color: #fff; }
.view-tab.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 600; }

/* Acțiuni rapide pe bară (text pe 2 rânduri, ținte mari) */
.pos-action {
  background: var(--topbar-btn); color: var(--topbar-text); border: 1px solid var(--topbar-btn-border);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; line-height: 1.15;
  cursor: pointer; text-decoration: none; text-align: center;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 96px; min-height: 44px;
}
.pos-action .pa-ic { font-size: 15px; margin-bottom: 2px; }
.pos-action:hover { background: var(--topbar-btn-hover); color: #fff; }
/* Buton activ — varianta B: indicator clar „ești pe aceasta pagina" */
.pos-action.active {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15) inset, 0 2px 8px rgba(0,0,0,0.15);
  position: relative;
}
.pos-action.active::after {
  /* Mic indicator triunghiular jos — ca un „pin" că ești pe aceasta pagina */
  content: '';
  position: absolute;
  bottom: -5px; left: 50%; transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--accent);
}
.pos-action.active:hover { background: var(--accent); color: var(--accent-contrast, #fff); }
.app-magazin { background: var(--magazin-bg); color: var(--magazin-text); padding: 4px 10px; border-radius: 6px; }
.app-user { color: var(--topbar-text); }
.app-logout {
  background: var(--topbar-btn); color: var(--topbar-text); border: 1px solid var(--topbar-btn-border);
  padding: 5px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.app-logout:hover { background: var(--topbar-btn-hover); color: white; }

/* === NAV DROPDOWN (meniu ⋯) === */
.nav-more { position: relative; }
.nav-more-dd {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--topbar-dd-bg); border: 1px solid var(--topbar-dd-border); border-radius: 10px;
  padding: 6px; min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45); z-index: 200;
  display: none;
}
.nav-more-dd.open { display: block; }
.nav-more-dd a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; color: var(--topbar-text); text-decoration: none;
  border-radius: 7px; font-size: 13px; white-space: nowrap; transition: background 0.1s;
}
.nav-more-dd a:hover { background: var(--topbar-dd-hover); color: white; }

/* === ACTIONS DROPDOWN (light, pentru card-header) === */
.actions-dd {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 6px; min-width: 210px;
  box-shadow: 0 8px 20px var(--shadow-strong); z-index: 200;
  display: none;
}
.actions-dd.open { display: block; }
.actions-dd button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; background: none; border: none; border-radius: 7px;
  font-size: 13px; font-family: inherit; color: var(--text);
  text-align: left; cursor: pointer; white-space: nowrap;
}
.actions-dd button:hover { background: var(--surface-3); }

/* === USER MENU BUTTON === */
.user-menu-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--topbar-btn); color: var(--topbar-text);
  border: 1px solid var(--topbar-btn-border); border-radius: 20px;
  padding: 5px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all 0.15s; white-space: nowrap;
}
.user-menu-btn:hover { background: var(--topbar-btn-hover); color: white; }

/* === CLOPOȚEL NOTIFICĂRI (tip Facebook) === */
.notif-bell-wrap { position: relative; }
.notif-bell-btn {
  background: var(--topbar-btn); color: var(--topbar-text); border: 1px solid var(--topbar-btn-border);
  border-radius: 50%; width: 34px; height: 34px; cursor: pointer;
  font-size: 15px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; position: relative;
}
.notif-bell-btn:hover { background: var(--topbar-btn-hover); color: white; }
.notif-bell-count {
  position: absolute; top: -4px; right: -4px;
  background: #d20f39; color: white; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid var(--topbar-bg);
}
.notif-bell-count.portocaliu { background: #e8590c; }
.notif-dd {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: 340px; max-height: 420px; overflow-y: auto;
  box-shadow: 0 12px 32px var(--shadow-strong); z-index: 300; display: none;
}
.notif-dd.open { display: block; }
.notif-dd-head { padding: 12px 16px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.notif-item {
  display: block; padding: 11px 16px; border-bottom: 1px solid var(--border-soft);
  text-decoration: none; color: var(--text); font-size: 13px; cursor: pointer;
  border-left: 3px solid transparent; transition: background 0.1s;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.verde { border-left-color: #40a02b; }
.notif-item.portocaliu { border-left-color: #e8590c; }
.notif-item.rosu { border-left-color: #d20f39; }
.notif-item .t { font-weight: 600; }
.notif-item .d { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { padding: 28px; text-align: center; color: var(--text-muted); font-size: 13px; }

.app-tabs {
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 24px;
  display: flex; gap: 4px;
}
.app-tab {
  padding: 14px 20px; font-size: 15px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; border-bottom: 2px solid transparent; transition: all 0.15s;
}
.app-tab:hover { color: var(--text); }
.app-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* === DASHBOARD === */
.page-content { padding: 24px; max-width: 1400px; margin: 0 auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--surface); border-radius: 12px; padding: 20px;
  border: 1px solid var(--border); border-top: 3px solid var(--accent);
}
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.kpi-value { font-size: 28px; font-weight: 700; margin: 8px 0 4px; }
.kpi-sub { font-size: 12px; color: var(--text-muted); }
.kpi-accent-green { border-top-color: #a6e3a1; }
.kpi-accent-red { border-top-color: #f38ba8; }
.kpi-accent-yellow { border-top-color: #fab387; }

.card {
  background: var(--surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 16px;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 14px; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
/* Aliniere unitară (cerere user 2026-06-11): antete + celule CENTRATE peste tot — vizual ordonat.
   Excepții: .num rămâne la DREAPTA (cifrele se compară pe verticală); celulele cu text-align
   inline (ex. coloana de nume din grila de program, notele late) își păstrează alinierea. */
thead th {
  padding: 8px 10px; text-align: center; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border-soft);
}
tbody td { padding: 9px 10px; font-size: 13px; border-bottom: 1px solid var(--border-soft); text-align: center; }
tbody tr:hover { background: var(--surface-2); }
/* Coloane numerice: cap + valori aliniate la DREAPTA, peste tot (înainte regula exista doar
   în unele pagini — în admin/dashboard clasa nu făcea nimic și cifrele rămâneau la stânga). */
th.num, td.num { text-align: right; }

.pill { display: inline-flex; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-green  { background: #a6e3a120; color: #40a02b; }
.pill-yellow { background: #fab38720; color: #df8e1d; }
.pill-red    { background: #f38ba820; color: #d20f39; }
.pill-blue   { background: #89b4fa22; color: #1d4ed8; }
.pill-orange { background: #f9844a22; color: #c2410c; }
.pill-purple { background: #c084fc22; color: #7c3aed; }
.pill-teal   { background: #5eead422; color: #0d9488; }
.pill-rose   { background: #fda4af22; color: #be123c; }
.pill-amber  { background: #fcd34d22; color: #b45309; }
.pill-cyan   { background: #67e8f922; color: #0891b2; }
.pill-lime   { background: #bef26422; color: #4d7c0f; }
.pill-gray   { background: #9ca3af20; color: #4b5563; }

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

/* === ADMIN LAYOUT === */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; height: calc(100vh - 50px); overflow: hidden; }
.admin-sidebar { background: var(--sidebar-bg); color: var(--topbar-text); padding: 16px 0; overflow-y: auto; }
.admin-side-title { padding: 8px 20px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--sidebar-title); margin-top: 10px; }
.admin-side-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px;
  cursor: pointer; color: var(--sidebar-text); font-size: 14px; text-decoration: none;
  border-left: 3px solid transparent; transition: all 0.15s;
}
.admin-side-link:hover { background: var(--sidebar-hover); color: white; }
.admin-side-link.active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }

.admin-content { overflow-y: auto; padding: 24px; background: var(--bg); }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section h2 { font-size: 20px; margin-bottom: 4px; }
.admin-section .subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

.btn-sm {
  padding: 5px 12px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; color: var(--text);
}
.btn-sm:hover { background: var(--surface-2); }
.btn-sm.active { background: var(--accent); color: var(--accent-contrast, #fff); border-color: var(--accent); font-weight: 600; }
.btn-sm.active:hover { background: var(--accent); color: var(--accent-contrast, #fff); }
.btn-primary-sm {
  padding: 6px 14px; border-radius: 6px; border: none; background: var(--primary-btn-bg); color: var(--primary-btn-text);
  cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit;
}
.btn-primary-sm:hover { background: var(--primary-btn-hover); }
.btn-danger-sm { background: #f38ba8; color: white; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; }
.btn-danger-sm:hover { background: #d20f39; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); color: var(--text); border-radius: 12px; padding: 24px; min-width: 420px; max-width: 540px; max-height: 90vh; overflow-y: auto; }
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal-token-display { background: #1a1a2e; color: #a6e3a1; padding: 14px; border-radius: 8px; font-family: monospace; font-size: 12px; word-break: break-all; margin: 12px 0; }

/* ===== Cod produs — mare, clar, monospace în TOATE tabelele ============= */
/* Codul e principalul reper la alegerea produsului: îl scoatem în evidență   */
/* peste tot (înlocuiește „pill-ul" mic gri). !important ca să bată stilurile  */
/* inline de pe <code> (font-size:11px, background gri).                       */
table code {
  font-size: 13.5px !important;
  font-weight: 800 !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text);
  letter-spacing: .4px;
}
