/* ============================================================
   WM API Admin — design system (Vercel / shadcn inspired)
   Neutral palette, single accent, hairline borders, soft shadows.
   ============================================================ */

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 6%;
  --card: 0 0% 100%;
  --card-muted: 240 20% 99%;
  --muted: 240 5% 96%;
  --muted-foreground: 240 4% 44%;
  --border: 240 6% 90%;
  --input: 240 6% 88%;
  --ring: 240 5% 65%;
  --primary: 240 9% 10%;
  --primary-foreground: 0 0% 98%;
  --accent: 221 83% 53%;
  --accent-foreground: 0 0% 100%;
  --accent-strong: 224 76% 48%;
  --success-strong: 142 70% 35%;
  --danger-strong: 0 72% 38%;
  --status-foreground: 0 0% 100%;
  --warning-strong: 32 81% 34%;

  --success: 142 71% 29%; --success-bg: 143 64% 94%;
  --warning: 32 81% 34%;  --warning-bg: 45 93% 91%;
  --danger: 0 72% 45%;    --danger-bg: 0 86% 96%;
  --info: 201 90% 32%;    --info-bg: 201 94% 94%;
  --neutral: 240 5% 34%;  --neutral-bg: 240 5% 94%;

  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .07), 0 1px 2px -1px rgb(0 0 0 / .07);
  --shadow-md: 0 8px 24px -6px rgb(0 0 0 / .12), 0 2px 6px -2px rgb(0 0 0 / .08);
  --sidebar-w: 165px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --table-font-size: 10px;
  --table-header-size: 9px;
  --table-cell-size: 10px;
  --table-cell-line-height: 18px;
  --table-cell-padding-y: 3px;
  --table-cell-padding-x: 5px;
}

html[data-theme="dark"] {
  --background: 240 10% 5%;
  --foreground: 0 0% 96%;
  --card: 240 9% 8%;
  --card-muted: 240 8% 10%;
  --muted: 240 6% 14%;
  --muted-foreground: 240 5% 60%;
  --border: 240 5% 17%;
  --input: 240 5% 20%;
  --ring: 240 5% 40%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 9% 10%;
  --accent: 217 91% 60%;

  --success: 142 60% 62%; --success-bg: 142 40% 14%;
  --warning: 41 90% 62%;  --warning-bg: 38 45% 14%;
  --danger: 0 84% 68%;    --danger-bg: 0 50% 15%;
  --info: 200 90% 66%;    --info-bg: 200 60% 14%;
  --neutral: 240 5% 68%;  --neutral-bg: 240 5% 18%;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .4);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / .5);
  --shadow-md: 0 12px 32px -8px rgb(0 0 0 / .6);
}

* { box-sizing: border-box; border-color: hsl(var(--border)); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.006em;
}
a { color: hsl(var(--foreground)); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: 20px; }
h2 { font-size: 14px; font-weight: 600; }
small { font-size: 12px; }
.muted { color: hsl(var(--muted-foreground)); }
::selection { background: hsl(var(--accent) / .2); }

* { scrollbar-width: thin; scrollbar-color: hsl(var(--border)) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 12px;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  overflow-y: auto; overscroll-behavior: contain; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: hsl(var(--accent)); color: hsl(var(--accent-foreground));
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: -.04em;
  box-shadow: var(--shadow-sm);
}
.brand strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.brand small { display: block; color: hsl(var(--muted-foreground)); font-size: 11px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-group { display: flex; flex-direction: column; gap: var(--sidebar-group-gap); margin-bottom: var(--sidebar-group-margin); }
.nav-label {
  font-size: var(--sidebar-label-font); font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: hsl(var(--muted-foreground)); padding: 12px 10px 4px; opacity: .8;
}
nav a, .nav-group a {
  display: flex; align-items: center; gap: var(--sidebar-gap);
  padding: var(--sidebar-row) 10px; border-radius: 7px;
  color: hsl(var(--sidebar-text)); font-size: var(--sidebar-font); font-weight: var(--sidebar-weight);
  transition: background .12s, color .12s; white-space: nowrap;
}
nav a:hover, .nav-group a:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
nav a.active, .nav-group a.active { background: hsl(var(--accent) / .10); color: hsl(var(--foreground)); font-weight: 600; }
.nav-ico { width: 17px; height: 17px; display: inline-grid; place-items: center; font-size: var(--sidebar-icon); color: hsl(var(--accent)); opacity: .78; flex-shrink: 0; }
.nav-ico .fa-solid { transform: scale(.86); transform-origin: center; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: hsl(var(--danger)); color: hsl(var(--status-foreground)); font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.logout { margin-top: auto; padding-top: 8px; }
.logout button { width: 100%; }

/* ---------------- Main / Topbar ---------------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 60px; padding: 0 28px;
  background: hsl(var(--background) / .8); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid hsl(var(--border));
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-left h1 { font-size: 17px; }
.topbar-left p { margin: 0; font-size: 12px; color: hsl(var(--muted-foreground)); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.content { padding: 20px 20px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--muted-foreground)); cursor: pointer;
  display: inline-grid; place-items: center; font-size: 15px;
  transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.notif-dot {
  position: absolute; top: -5px; right: -5px;
  background: hsl(var(--danger)); color: hsl(var(--status-foreground)); font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center;
  padding: 0 4px; border: 2px solid hsl(var(--background));
}
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 3px 10px 3px 3px;
  border: 1px solid hsl(var(--border)); border-radius: 999px; background: hsl(var(--card));
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: grid; place-items: center; font-weight: 700; font-size: 11px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta strong { font-size: 12.5px; font-weight: 600; }
.user-meta small { color: hsl(var(--muted-foreground)); font-size: 10.5px; }

/* ---------------- Cards / panels ---------------- */
.panel, .token-box, .login-panel, .metric, .muted-box {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
}
.panel { padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.panel.narrow { max-width: 560px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 14px; }
.panel-head a { font-size: 13px; color: hsl(var(--muted-foreground)); font-weight: 500; }
.panel-head a:hover { color: hsl(var(--foreground)); }

/* ---------------- Buttons ---------------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--foreground)); font-family: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, opacity .12s, box-shadow .12s;
}
button:hover, .button:hover { background: hsl(var(--muted)); }
.button.primary, button.primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.button.primary:hover, button.primary:hover { opacity: .9; }
.button.danger, button.danger { background: hsl(var(--danger)); color: hsl(var(--status-foreground)); border-color: hsl(var(--danger)); }
.button.danger:hover { opacity: .9; }
.button.ghost { background: transparent; border-color: transparent; }
.button.ghost:hover { background: hsl(var(--muted)); }
.button.sm, button.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
button:focus-visible, .button:focus-visible { outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / .4); }
.btn-action {
  display: inline-flex; align-items: center; justify-content: center;
  height: 24px; padding: 0 10px; border-radius: 20px;
  border: none; font-size: 11px; font-weight: 600; letter-spacing: .03em;
  cursor: pointer; white-space: nowrap; font-family: inherit; text-decoration: none;
  transition: opacity .15s, transform .1s;
}
.btn-action:hover { opacity: .82; transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }
.btn-action.send { background: hsl(var(--accent)); color: hsl(var(--status-foreground)); }
.btn-action.edit { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.btn-action.del  { background: hsl(var(--danger-bg)); color: hsl(var(--danger)); }
.btn-action:focus-visible { outline: 2px solid hsl(var(--accent)); outline-offset: 2px; }

/* ---------------- Forms ---------------- */
.form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: hsl(var(--foreground)); }
input, select, textarea {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid hsl(var(--input)); border-radius: 8px;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  font: inherit; font-size: 13.5px; transition: border-color .12s, box-shadow .12s;
}
select { cursor: pointer; -webkit-appearance: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, hsl(var(--muted-foreground)) 50%), linear-gradient(135deg, hsl(var(--muted-foreground)) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
textarea { height: auto; min-height: 240px; padding: 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: hsl(var(--accent)); box-shadow: 0 0 0 3px hsl(var(--accent) / .15); }
input::placeholder, textarea::placeholder { color: hsl(var(--muted-foreground)); }
input[type="radio"] {
  width: 16px; height: 16px; min-width: 16px; padding: 0; flex: none;
  accent-color: hsl(var(--accent)); cursor: pointer;
}
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 15px; height: 15px; min-width: 15px; padding: 0; margin: 0;
  display: inline-grid; place-content: center; flex: none;
  border: 1px solid hsl(var(--input)); border-radius: 5px;
  background: hsl(var(--card)); color: hsl(var(--primary-foreground));
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgb(0 0 0 / .04);
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .12s ease;
}
input[type="checkbox"]::before {
  content: "";
  width: 7px; height: 4px;
  border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg) scale(0); transform-origin: center;
  transition: transform .12s ease;
}
input[type="checkbox"]:hover {
  border-color: hsl(var(--accent));
  box-shadow: 0 0 0 3px hsl(var(--accent) / .10);
}
input[type="checkbox"]:checked {
  background: hsl(var(--accent)); border-color: hsl(var(--accent));
  box-shadow: 0 2px 5px hsl(var(--accent) / .22);
}
input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }
input[type="checkbox"]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px hsl(var(--ring) / .35);
}
input[type="checkbox"]:active { transform: scale(.92); }
input[type="checkbox"]:disabled { opacity: .55; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.icon-action { width: 26px; height: 26px; padding: 4px; display: inline-flex; align-items: center; justify-content: center; }
.icon-action svg { width: 14px; height: 14px; display: block; }
.icon-action svg { display: none; }

/* ---------------- Tables ---------------- */
table { width: 100%; border-collapse: collapse; font-size: var(--table-font-size); }
thead th {
  text-align: left; font-size: var(--table-header-size); font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); padding: var(--table-cell-padding-y) var(--table-cell-padding-x); line-height: var(--table-cell-line-height); border-bottom: 1px solid hsl(var(--border)); white-space: nowrap;
}
tbody td { padding: var(--table-cell-padding-y) var(--table-cell-padding-x); line-height: var(--table-cell-line-height); font-size: var(--table-cell-size); border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: hsl(var(--muted) / .5); }
tfoot th { padding: var(--table-cell-padding-y) var(--table-cell-padding-x); font-size: var(--table-cell-size); border-top: 1px solid hsl(var(--border)); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: hsl(var(--foreground)); }
tr.clickable { cursor: pointer; }

.details { display: grid; grid-template-columns: 150px 1fr; gap: 10px 14px; font-size: 13.5px; }
dt { color: hsl(var(--muted-foreground)); font-weight: 500; }
dd { margin: 0; overflow-wrap: anywhere; }

pre {
  background: hsl(var(--muted)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border)); padding: 14px; border-radius: 8px;
  overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; margin: 0;
}
code { font-family: var(--mono); font-size: 12.5px; background: hsl(var(--muted)); padding: 1px 5px; border-radius: 5px; }
tr.row-outbound { background: hsl(var(--success-bg)) !important; font-weight: 600; }
tr.row-outbound td { color: hsl(var(--foreground)) !important; }
tr.row-outbound code { background: hsl(var(--success) / .25) !important; color: hsl(var(--foreground)) !important; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: -.01em;
  background: hsl(var(--neutral-bg)); color: hsl(var(--neutral));
  border: 1px solid hsl(var(--neutral) / .18); text-transform: capitalize;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.success, .badge.accepted, .badge.completed, .badge.paid, .badge.good2go, .badge.done, .badge.validat { background: hsl(var(--success-bg)); color: hsl(var(--success)); border-color: hsl(var(--success) / .2); }
.badge.pending, .badge.processing, .badge.validating, .badge.retry_scheduled, .badge.overdue, .badge.sent, .badge.se_trimite { background: hsl(var(--warning-bg)); color: hsl(var(--warning)); border-color: hsl(var(--warning) / .2); }
.badge.danger, .badge.failed, .badge.rejected, .badge.cancelled, .badge.error, .badge.critical { background: hsl(var(--danger-bg)); color: hsl(var(--danger)); border-color: hsl(var(--danger) / .2); }
.badge.online { background: hsl(var(--success-bg)); color: hsl(var(--success)); border-color: hsl(var(--success) / .2); }
.badge.offline { background: hsl(var(--danger-bg)); color: hsl(var(--danger)); border-color: hsl(var(--danger) / .2); }
.badge.received, .badge.draft, .badge.info, .badge.in_procesare { background: hsl(var(--info-bg)); color: hsl(var(--info)); border-color: hsl(var(--info) / .2); }

/* ---------------- App modal (overlay) ---------------- */
/* Ascuns implicit — JS-ul il face vizibil cu style.display='block'. Fara asta,
   scheletul modalului se randa inline in pagina (arata ca HTML neformatat). */
.app-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  background: hsl(0 0% 0% / .55);
  padding: 24px; overflow-y: auto;
}
.app-modal > .panel,
.app-modal > div {
  max-width: 960px; margin: 24px auto;
  max-height: calc(100vh - 48px); overflow: auto;
}

/* ---------------- KPI cards ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: box-shadow .15s; }
.kpi:hover { box-shadow: var(--shadow); }
.kpi .k-label { color: hsl(var(--muted-foreground)); font-size: 11.5px; font-weight: 550; }
.kpi .k-value { font-size: 27px; font-weight: 680; letter-spacing: -.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { color: hsl(var(--muted-foreground)); font-size: 12px; margin-top: 3px; }
.kpi.accent .k-value { color: hsl(var(--accent)); }
.kpi.good .k-value { color: hsl(var(--success)); }
.kpi.bad .k-value { color: hsl(var(--danger)); }

.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px; }
.metric span { color: hsl(var(--muted-foreground)); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.metric strong { display: block; font-size: 26px; font-weight: 650; margin-top: 6px; }

/* ---------------- Chart ---------------- */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 168px; padding: 24px 4px 4px; }
.chart .bar { flex: 1; min-height: 4px; border-radius: 6px 6px 3px 3px; position: relative; background: linear-gradient(180deg, hsl(var(--accent)), hsl(var(--accent) / .35)); transition: filter .15s; }
.chart .bar:hover { filter: brightness(1.1); }
.chart .bar b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10.5px; font-weight: 600; color: hsl(var(--muted-foreground)); }
.chart .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: hsl(var(--muted-foreground)); }

/* ---------------- DataTable ---------------- */
.dt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.dt-toolbar input:not([type="checkbox"]):not([type="radio"]), .dt-toolbar select { height: 36px; width: auto; min-width: 160px; }
.dt-toolbar .grow { flex: 1; min-width: 220px; }
.dt-empty, .dt-loading { text-align: center; color: hsl(var(--muted-foreground)); padding: 32px 12px !important; }
.dt-filter-row th { padding: 4px 6px !important; background: hsl(var(--muted) / 0.4); }
.dt-filter-row .dtf { width: 100%; min-width: 0; height: 28px; padding: 2px 6px; font-size: 12px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--card)); color: hsl(var(--foreground)); box-sizing: border-box; }
.dt-filter-row .dtf:focus { outline: none; border-color: hsl(var(--primary)); }
.dt-filter-row .dtf-range { display: flex; flex-direction: column; gap: 3px; }
/* Icon PDF (Font Awesome) din coloana Facturi PDF. */
.facturi-pdf-action { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.facturi-pdf-icon { font-size: 18px; line-height: 1; color: #dc2626; }
.facturi-pdf-action:hover .facturi-pdf-icon { color: #b91c1c; }
.facturi-courier-logo { width: 24px; height: 18px; object-fit: contain; vertical-align: middle; }
.facturi-courier-fallback { font-size: 16px; }
.dt-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.dt-per-page { display: flex; align-items: center; gap: 3px; }
.dt-per-page span { font-size: 12px; color: hsl(var(--muted-foreground)); margin-right: 4px; white-space: nowrap; }
.dt-per-page button { min-width: 32px; height: 28px; padding: 0 7px; border-radius: 6px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: 12px; cursor: pointer; }
.dt-per-page button:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.dt-per-page button.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); font-weight: 600; }
[data-dt-pager] { display: flex; gap: 4px; }
.page-btn { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 7px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--foreground)); font-size: 13px; cursor: pointer; }
.page-btn:hover:not(:disabled) { background: hsl(var(--muted)); }
.page-btn.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.page-btn:disabled { opacity: .4; cursor: default; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid hsl(var(--border)); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a, .tabs button { height: auto; padding: 9px 14px; border: none; background: none; border-radius: 0; color: hsl(var(--muted-foreground)); font-weight: 550; font-size: 13.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover, .tabs button:hover { color: hsl(var(--foreground)); background: none; }
.tabs a.active, .tabs button.active { color: hsl(var(--foreground)); border-bottom-color: hsl(var(--primary)); }

/* ---------------- Timeline ---------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 24px; border-left: 2px solid hsl(var(--border)); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 11px; height: 11px; border-radius: 50%; background: hsl(var(--accent)); border: 2px solid hsl(var(--card)); }
.timeline .t-time { color: hsl(var(--muted-foreground)); font-size: 12px; margin-top: 2px; }

/* ---------------- Toast ---------------- */
.toast-host { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast { min-width: 240px; max-width: 380px; padding: 12px 16px; border-radius: 10px; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: var(--shadow-md); font-size: 13.5px; font-weight: 550; opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .22s, transform .22s; }
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.success { border-left: 3px solid hsl(var(--success)); }
.toast.error { border-left: 3px solid hsl(var(--danger)); }
.toast.info { border-left: 3px solid hsl(var(--accent)); }

/* ---------------- Misc ---------------- */
.grid.two { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.grid.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form { display: inline; }
.muted-box { padding: 12px 14px; color: hsl(var(--muted-foreground)); font-size: 13px; line-height: 1.55; }
.diff-hi { background: hsl(var(--warning-bg)); color: hsl(var(--warning)); padding: 1px 7px; border-radius: 6px; font-weight: 600; }
.empty-state { text-align: center; padding: 44px 20px; color: hsl(var(--muted-foreground)); }
.skeleton { background: linear-gradient(90deg, hsl(var(--muted)), hsl(var(--border)), hsl(var(--muted))); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: 6px; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.error-page { max-width: 460px; margin: 14vh auto; text-align: center; }
.error-code { font-size: 90px; font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(180deg, hsl(var(--foreground)), hsl(var(--muted-foreground))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h2 { margin: 8px 0; font-size: 20px; }
.error-page .button { margin-top: 18px; }

.token-box { padding: 16px; margin-bottom: 18px; }
.token-box code, .token-box pre { display: block; background: hsl(var(--muted)); padding: 12px; border-radius: 8px; word-break: break-all; margin-top: 8px; }
.log-viewer pre { white-space: pre-wrap; margin-bottom: 8px; }
.alert { background: hsl(var(--danger-bg)); color: hsl(var(--danger)); border: 1px solid hsl(var(--danger) / .25); padding: 10px 14px; border-radius: 8px; font-size: 13px; font-weight: 550; margin-bottom: 4px; }

.tf-section { margin-bottom: 16px; }
.tf-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); font-weight: 600; margin-bottom: 8px; }
.tf-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.tf-table { width: 100%; }
.tf-token-row { display: grid; grid-template-columns: 1fr 1fr 90px 90px 40px; gap: 8px; margin-bottom: 8px; }
.col-narrow { max-width: 120px; }

/* ---------------- Login ---------------- */
.auth-body { background:
  radial-gradient(1200px 600px at 100% -10%, hsl(var(--accent) / .08), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, hsl(var(--accent) / .06), transparent 55%),
  hsl(var(--background)); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: 100%; max-width: 400px; padding: 32px; box-shadow: var(--shadow-md); }
.login-brand { justify-content: center; margin-bottom: 22px; padding: 0; }
.login-panel .form { margin-top: 6px; }
.login-panel button.primary { width: 100%; height: 40px; margin-top: 4px; }

/* ---------------- Invoice ---------------- */
.invoice-doc { background: hsl(var(--card)); color: hsl(var(--foreground)); max-width: 820px; margin: 0 auto; padding: 44px; border: 1px solid hsl(var(--border)); border-radius: 12px; box-shadow: var(--shadow); }
.invoice-doc table { min-width: 0; }
.invoice-doc thead th { color: hsl(var(--muted-foreground)); }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.invoice-totals { margin-left: auto; width: 300px; }
.invoice-totals .row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.invoice-totals .grand { font-size: 18px; font-weight: 700; border-top: 2px solid hsl(var(--foreground)); padding-top: 8px; margin-top: 4px; }

@media print {
  .sidebar, .topbar, .toast-host, .no-print { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  body { background: hsl(var(--card)); }
  .invoice-doc { box-shadow: none; border: none; padding: 0; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px; }
  #sidebar-toggle { display: inline-grid; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .user-meta { display: none; }
}
@media (min-width: 961px) { #sidebar-toggle { display: none; } }

/* ============================================================
   Appearance menu (topbar) + segmented control
   ============================================================ */
.appearance { position: relative; }
.appearance-menu {
  position: absolute; right: 0; top: 44px; z-index: 60;
  width: 230px; padding: 12px; border-radius: 12px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); box-shadow: var(--shadow-md);
}
.appearance-menu[hidden] { display: none; }
.am-title { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: hsl(var(--muted-foreground)); margin: 4px 2px 6px; }
.am-title:not(:first-child) { margin-top: 12px; }
.seg { display: flex; gap: 3px; padding: 3px; background: hsl(var(--muted)); border-radius: 9px; }
.seg button {
  flex: 1; height: 32px; padding: 0; border: none; border-radius: 6px;
  background: transparent; color: hsl(var(--muted-foreground)); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.seg button:hover { color: hsl(var(--foreground)); background: transparent; }
.seg button.active { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--shadow-sm); }

/* Theme-specific layout profiles are installed separately. */


/* ---------------- Global behavior helpers ---------------- */
[hidden] { display: none !important; }
.ob-panel { display: none; }
.ob-panel.active { display: block; }
.appearance-menu[hidden] { display: none; }
.gest-dropdown { display: none; }
.gest-dropdown.open { display: block; }

/* Keep runtime layout generic; pages must use the shared design system. */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-title { margin: 0; font-size: 20px; font-weight: 600; }
.page-subtitle { color: hsl(var(--muted-foreground)); }
.panel-spaced { margin-bottom: 18px; }
.panel-body { padding: 20px; }
.table-responsive { overflow-x: auto; }
.table-scroll { max-height: 65vh; overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Shared semantic states for server-rendered and dynamic cells. */
.theme-ok { color: hsl(var(--success)) !important; }
.theme-error { color: hsl(var(--danger)) !important; }
.theme-warning { color: hsl(var(--warning)) !important; }
.theme-info { color: hsl(var(--info)) !important; }
.theme-neutral { color: hsl(var(--muted-foreground)) !important; }
.strong { font-weight: 700; }
.mono { font-family: var(--mono); }
.cell-stack { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }


/* Header controls use icon-only actions and the shared theme tokens. */
.topbar-right > .icon-btn,
.topbar-right .appearance > .icon-btn {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: hsl(var(--muted-foreground));
  box-shadow: none; font-size: 14px;
}
.topbar-right > .icon-btn > i,
.topbar-right .appearance > .icon-btn > i { transform: scale(.88); opacity: .82; }
.topbar-right > .icon-btn:hover,
.topbar-right .appearance > .icon-btn:hover {
  background: transparent; color: hsl(var(--accent));
}
.topbar-right > a.icon-btn { position: relative; }
.topbar-user-icon {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  color: hsl(var(--muted-foreground)); font-size: 14px;
}
.topbar-user-icon > i { transform: scale(.88); opacity: .82; }
.topbar-user-icon:hover { color: hsl(var(--accent)); }

/* Centered AutoFLOW wordmark for the shared application header. */
.topbar-brand {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: min(320px, 38vw); height: 54px; pointer-events: none;
}
.topbar-brand-image { display: none; width: 100%; height: 100%; object-fit: contain; }
html[data-skin="shadcn"][data-theme="light"] .brand-standard-light,
html[data-skin="violet-flow"][data-theme="light"] .brand-violet-light,
html[data-skin="green-flow"][data-theme="light"] .brand-green-light,
html[data-skin="orange-flow"][data-theme="light"] .brand-orange-light,
html[data-skin="shadcn"][data-theme="dark"] .brand-standard-dark,
html[data-skin="violet-flow"][data-theme="dark"] .brand-violet-dark,
html[data-skin="green-flow"][data-theme="dark"] .brand-green-dark,
html[data-skin="orange-flow"][data-theme="dark"] .brand-orange-dark { display: block; }
@media (max-width: 700px) {
  .topbar-brand { width: 210px; height: 46px; }
  .topbar-left h1, .topbar-left p { display: none; }
}

/* Built-in visual skins. Components consume the same global tokens. */
html[data-skin="violet-flow"] {
  --accent: 267 83% 66%; --accent-strong: 263 84% 58%;
  --info: 190 92% 52%; --info-bg: 190 80% 94%;
  --success: 153 62% 39%; --success-bg: 153 56% 94%;
}
html[data-theme="dark"][data-skin="violet-flow"] {
  --background: 235 43% 6%; --foreground: 230 33% 97%;
  --card: 232 36% 10%; --card-muted: 233 35% 8%;
  --muted: 232 27% 16%; --muted-foreground: 228 18% 68%;
  --border: 232 28% 22%; --input: 232 26% 25%; --ring: 267 83% 66%;
  --primary: 267 83% 66%; --primary-foreground: 235 43% 6%;
  --warning: 42 92% 62%; --warning-bg: 42 42% 15%;
  --danger: 0 82% 68%; --danger-bg: 0 48% 15%;
  --info-bg: 190 48% 14%; --success-bg: 153 36% 14%;
}
html[data-skin="green-flow"] {
  --accent: 158 66% 38%; --accent-strong: 158 70% 31%;
  --info: 173 52% 36%; --info-bg: 166 48% 94%;
  --success: 158 66% 35%; --success-bg: 153 51% 93%;
}
html[data-theme="dark"][data-skin="green-flow"] {
  --background: 160 24% 7%; --foreground: 150 20% 96%;
  --card: 160 22% 10%; --card-muted: 160 25% 8%;
  --muted: 160 18% 16%; --muted-foreground: 155 12% 67%;
  --border: 160 18% 22%; --input: 160 18% 25%; --ring: 158 66% 48%;
  --primary: 158 66% 48%; --primary-foreground: 160 24% 7%;
  --warning: 42 90% 62%; --warning-bg: 42 40% 15%;
  --danger: 0 76% 65%; --danger-bg: 0 44% 15%;
  --info-bg: 173 34% 14%; --success-bg: 153 34% 14%;
}
html[data-skin="orange-flow"] {
  --accent: 29 93% 52%; --accent-strong: 25 91% 44%;
  --info: 202 74% 47%; --info-bg: 202 78% 94%;
  --success: 158 58% 38%; --success-bg: 153 51% 93%;
}
html[data-theme="dark"][data-skin="orange-flow"] {
  --background: 220 18% 6%; --foreground: 220 20% 96%;
  --card: 220 17% 10%; --card-muted: 220 18% 8%;
  --muted: 220 14% 16%; --muted-foreground: 220 10% 66%;
  --border: 220 14% 22%; --input: 220 14% 25%; --ring: 29 93% 52%;
  --primary: 29 93% 52%; --primary-foreground: 220 18% 6%;
  --warning: 42 92% 61%; --warning-bg: 42 40% 15%;
  --danger: 0 80% 66%; --danger-bg: 0 45% 15%;
  --info-bg: 202 34% 14%; --success-bg: 153 34% 14%;
}


/* Theme configurator uses the same global tokens as the rest of the admin UI. */
.theme-config-form { max-width: 980px; }
.theme-config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.theme-config-group { display: grid; align-content: start; gap: 12px; padding: 16px; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); }
.theme-config-group h2 { margin: 0; font-size: 14px; font-weight: 600; }
.theme-config-group label { display: grid; gap: 6px; color: hsl(var(--foreground)); font-size: 12px; }
.theme-config-group input[type="color"] { width: 52px; height: 30px; padding: 2px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--input)); cursor: pointer; }
.theme-config-group input[type="range"] { width: 100%; height: 4px; padding: 0; accent-color: hsl(var(--accent)); cursor: pointer; }
.theme-config-group output, .theme-config-group code { color: hsl(var(--muted-foreground)); font-size: 11px; }
.theme-config-group code { width: max-content; padding: 2px 6px; border-radius: 4px; background: hsl(var(--muted)); }
.theme-config-preview { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; padding: 10px; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); background: hsl(var(--muted)); }
.theme-config-preview p { grid-column: 1 / -1; margin: 2px 0 0; color: hsl(var(--muted-foreground)); font-size: 11px; line-height: 1.45; }
.theme-preview-swatch { width: 24px; height: 24px; border-radius: 50%; background: hsl(var(--accent)); box-shadow: 0 0 0 3px hsl(var(--background)); }
.theme-config-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
@media (max-width: 900px) { .theme-config-grid { grid-template-columns: 1fr; } }

/* Compact worker windows on the Status page. */
.worker-monitors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 12px 0 16px; }
.worker-monitor { min-width: 0; overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: var(--shadow-sm); }
.wm-head { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 10px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }
.wm-lights { display: inline-flex; gap: 4px; }
.wm-lights i { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--muted-foreground) / .45); }
.wm-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: hsl(var(--foreground)); font-size: 11px; font-weight: 600; }
.wm-title > i { margin-right: 4px; color: hsl(var(--accent)); font-size: 11px; }
.wm-dot { width: 7px; height: 7px; margin-left: auto; flex: 0 0 auto; border-radius: 50%; background: hsl(var(--success)); box-shadow: 0 0 0 3px hsl(var(--success) / .12); }
.wm-dot.stale { background: hsl(var(--warning)); box-shadow: 0 0 0 3px hsl(var(--warning) / .12); }
.wm-dot.dead { background: hsl(var(--danger)); box-shadow: 0 0 0 3px hsl(var(--danger) / .12); }
.wm-body { position: relative; height: 142px; padding: 8px 10px; background: hsl(var(--background)); }
.wm-out { height: 100%; margin: 0; overflow: auto; color: hsl(var(--muted-foreground)); font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; }
.wm-caret { display: none; }
@media (max-width: 900px) { .worker-monitors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .worker-monitors { grid-template-columns: 1fr; } }

/* Compact sync log window on Stocuri. */
.stocuri-log-window { margin-top: 12px; overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); box-shadow: var(--shadow-sm); }
.stocuri-log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; padding: 7px 10px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }
.stocuri-log-title { color: hsl(var(--foreground)); font-size: 11px; font-weight: 600; }
.stocuri-log-title > i { margin-right: 5px; color: hsl(var(--accent)); font-size: 11px; }
.stocuri-log-actions { display: flex; align-items: center; gap: 8px; color: hsl(var(--muted-foreground)); font-size: 11px; }
.stocuri-log-actions label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stocuri-log-body { height: 150px; padding: 8px 10px; overflow: auto; background: hsl(var(--background)); color: hsl(var(--muted-foreground)); font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-width: thin; }
.stocuri-log-body > div { min-height: 15px; }
.stocuri-log-foot { min-height: 25px; padding: 5px 10px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 10px; }
@media (max-width: 620px) { .stocuri-log-head { align-items: flex-start; flex-direction: column; } .stocuri-log-actions { flex-wrap: wrap; } }

/* ---------------- Stocuri ---------------- */
.stocuri-page-head { align-items: flex-end; margin-bottom: 14px; }
.stocuri-page-head h1 { font-size: 20px; }
.stocuri-page-subtitle { margin: 3px 0 0; color: hsl(var(--muted-foreground)); font-size: 12px; }
.stocuri-panel { padding: 14px 16px; margin-bottom: 14px; }
.stocuri-panel > .panel-head { margin-bottom: 10px; }
.stocuri-panel > .panel-head > div { display: flex; align-items: center; gap: 14px; }
.stocuri-panel > .panel-head > div > div { display: flex; align-items: center; gap: 8px; }
.stocuri-panel > .panel-head > div > div > span { color: hsl(var(--muted-foreground)); font-size: 11px; }
.stocuri-panel > .panel-head > div > div > span:first-child { color: hsl(var(--foreground)); font-weight: 600; }
.stocuri-panel > div > div:first-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stocuri-panel .cron-btn { height: 28px; padding: 0 9px; font-size: 11px; }
.stocuri-server-panel { padding: 14px 16px; margin-bottom: 14px; }
.stocuri-server-panel > .panel-head { padding-bottom: 10px; margin-bottom: 0; border-bottom: 1px solid hsl(var(--border)); }
.stocuri-server-panel > .panel-head h2 { font-size: 14px; }
.stocuri-server-panel > .panel-head small { display: block; margin-top: 2px; color: hsl(var(--muted-foreground)); font: 10px var(--mono); }
.gestiuni-block { padding: 12px 0 14px; border-bottom: 1px solid hsl(var(--border)); }
.gestiuni-block:last-child { border-bottom: 0; padding-bottom: 2px; }
.gestiuni-block > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gestiuni-block code { min-width: 82px; padding: 4px 8px; border: 1px solid hsl(var(--border)); border-radius: 6px; background: hsl(var(--muted)); color: hsl(var(--foreground)); font: 600 11px var(--mono); }
.gest-select { position: relative; min-width: 230px; }
.gest-select-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 30px; padding: 0 9px; border: 1px solid hsl(var(--input)); border-radius: 7px; background: hsl(var(--background)); color: hsl(var(--foreground)); cursor: pointer; font-size: 11px; }
.gest-select-box:hover { border-color: hsl(var(--accent)); }
.gest-select-box > span:last-child { color: hsl(var(--muted-foreground)); font-size: 13px; }
.gest-dropdown { position: fixed; display: none; z-index: 100; max-height: 340px; overflow: auto; padding: 8px; border: 1px solid hsl(var(--border)); border-radius: 9px; background: hsl(var(--card)); box-shadow: var(--shadow-md); }
.gest-dropdown.open { display: block; }
.gest-dropdown > div:first-child { position: sticky; top: -8px; z-index: 1; padding-bottom: 7px; background: hsl(var(--card)); }
.gest-dropdown input[type=text] { height: 30px; margin-bottom: 7px; font-size: 12px; }
.gest-dropdown > div:first-child > div { display: flex; gap: 5px; }
.gest-dropdown .button.sm { height: 26px; font-size: 11px; }
.gest-opt { display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 4px 7px; border-radius: 6px; cursor: pointer; font-size: 11px; }
.gest-opt:hover, .gest-opt.selected { background: hsl(var(--accent) / .10); }
.gest-opt input { width: 13px; height: 13px; margin: 0; accent-color: hsl(var(--accent)); }
.gest-opt label { display: block; flex: 1; margin: 0; cursor: pointer; font-size: 11px; font-weight: 450; }
.gestiuni-block > div:first-child > .button { height: 30px; font-size: 11px; }
.gest-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 12px; }
.gest-card { min-width: 0; padding: 10px 11px; border: 1px solid hsl(var(--border)); border-radius: 8px; background: hsl(var(--card-muted)); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.gest-card:hover { border-color: hsl(var(--accent)); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.gest-card.is-hidden { display: none; }
.gest-card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: hsl(var(--foreground)); font-size: 11px; font-weight: 600; }
.gest-card-stats { display: flex; gap: 24px; margin-top: 9px; }
.gest-card-val, .gest-card-sub { color: hsl(var(--foreground)); font-size: 16px; font-weight: 650; line-height: 1.1; }
.gest-card-sub { font-size: 13px; }
.gest-card-lbl { margin-top: 3px; color: hsl(var(--muted-foreground)); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.gest-card-at { margin-top: 9px; color: hsl(var(--muted-foreground)); font: 9px var(--mono); }
.gest-nosel { margin: 10px 0 0; color: hsl(var(--muted-foreground)); font-size: 11px; }
#gest-modal-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px; background: hsl(var(--foreground) / .28); backdrop-filter: blur(5px); }
#gest-modal-overlay > div { display: flex; flex-direction: column; width: min(860px, 100%); max-height: min(680px, 90vh); overflow: hidden; border: 1px solid hsl(var(--border)); border-radius: 10px; background: hsl(var(--card)); box-shadow: var(--shadow-md); }
#gest-modal-overlay > div > div:first-child { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid hsl(var(--border)); }
#gest-modal-title { font-size: 13px; font-weight: 650; }
#gest-modal-sub { margin-top: 2px; color: hsl(var(--muted-foreground)); font-size: 10px; }
#gest-modal-overlay > div > div:nth-child(2) { padding: 10px 14px; }
#gest-modal-overlay > div > div:nth-child(3) { min-height: 0; overflow: auto; padding: 0 14px 12px; }
#gest-modal-overlay table { width: 100%; border-collapse: collapse; font-size: 11px; }
#gest-modal-overlay th { position: sticky; top: 0; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); font-size: 10px; text-align: left; }
#gest-modal-overlay th, #gest-modal-overlay td { padding: 6px 8px; border-bottom: 1px solid hsl(var(--border)); }
#gest-modal-footer { padding: 8px 14px; border-top: 1px solid hsl(var(--border)); color: hsl(var(--muted-foreground)); font-size: 10px; }
@media (max-width: 700px) {
  .stocuri-panel > .panel-head > div { align-items: flex-start; flex-direction: column; gap: 6px; }
  .gestiuni-block > div:first-child { align-items: stretch; flex-direction: column; }
  .gest-select { width: 100%; }
  .gest-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gest-id { margin-left: 4px; color: hsl(var(--muted-foreground)); font: 10px var(--mono); font-weight: 500; }
.stocuri-page-head { flex-wrap: wrap; }
.stocuri-page-head { justify-content: flex-start; }
.stocuri-worker-open { margin-left: 0; border: 0; outline: 0; background: transparent; box-shadow: none; padding: 0; }
.stocuri-worker-modal { width: min(1180px, calc(100% - 32px)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: var(--shadow-md); padding: 0; }
.stocuri-worker-modal::backdrop { background: hsl(var(--foreground) / .28); backdrop-filter: blur(5px); }
.stocuri-worker-modal .worker-settings-dialog { padding: 16px; }
.stocuri-worker-modal .modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid hsl(var(--border)); }
.stocuri-worker-modal .modal-head h2 { margin: 0; font-size: 15px; }
.stocuri-worker-modal .modal-head p { margin: 3px 0 0; font-size: 11px; }
.worker-settings-form { display: grid; gap: 14px; padding-top: 14px; }
.worker-setting-toggle { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border: 1px solid hsl(var(--border)); border-radius: 7px; background: hsl(var(--muted)); font-size: 12px; }
.worker-setting-toggle input { width: 15px; height: 15px; }
.worker-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.worker-settings-grid label { gap: 5px; font-size: 11px; }
.worker-settings-grid input { height: 32px; font-size: 12px; }
.worker-settings-grid small { color: hsl(var(--muted-foreground)); font-size: 10px; line-height: 1.3; }
.stocuri-worker-modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
@media (max-width: 620px) { .worker-settings-grid { grid-template-columns: 1fr; } .stocuri-worker-open { margin-left: 0; } }


.stocuri-firma-data-panel { overflow: hidden; }
.stocuri-firma-table-wrap { overflow: auto; max-height: 62vh; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); }
.stocuri-firma-table { min-width: 1100px; }
.stocuri-firma-table th { white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.stocuri-firma-table th button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: inherit; padding: 0; cursor: pointer; white-space: nowrap; }
.stocuri-firma-table th button span { color: hsl(var(--primary)); margin-left: 3px; }
.stocuri-firma-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }


.stocuri-firma-search-row th { padding: 6px 8px; background: hsl(var(--card)); }
.stocuri-firma-search-row input[type="search"] { width: 100%; min-width: 240px; }
.stocuri-firma-table th button,
.stocuri-firma-table th button:hover,
.stocuri-firma-table th button:focus { display: inline; border: 0 !important; outline: 0 !important; background: transparent !important; box-shadow: none !important; color: inherit !important; font: inherit; padding: 0 !important; cursor: pointer; white-space: nowrap; }
.stocuri-firma-pagination { justify-content: flex-end; }
.stocuri-firma-pagination > span:first-child { margin-right: auto; }
.stocuri-firma-pagination label { display: inline-flex; align-items: center; gap: 6px; }
.stocuri-firma-table th[data-stoc-col] { cursor: grab; }
.stocuri-firma-table th[data-stoc-col]:active { cursor: grabbing; }
.stocuri-firma-table th.stoc-col-dragging { opacity: .45; }
.stocuri-firma-table th.stoc-col-drag-over { box-shadow: inset 3px 0 0 hsl(var(--primary)); }


.stocuri-firma-data-panel > .panel-head { position: relative; }
.stocuri-columns-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px; padding: 10px; display: grid; gap: 7px; border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); background: hsl(var(--card)); box-shadow: var(--shadow-md); font-size: 11px; }
.stocuri-columns-menu[hidden] { display: none; }
.stocuri-columns-menu strong { font-size: 11px; }
.stocuri-columns-menu label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
