/* ==========================================================================
   ADCleaning – interfață administrativă
   Desktop-first, fără framework CSS. Organizare: tokens → bază → layout →
   componente → utilitare → responsive.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
/* Paleta este preluată din identitatea vizuală de pe adcleaning.md:
   navy închis pentru suprafețele întunecate, albastru viu pentru accente,
   fundaluri albastru-deschis. Auriul #f5b942 al site-ului este folosit doar
   ca accent secundar (evidențieri), nu pentru text — nu are contrast suficient. */
:root {
  --brand-900: #0a1628;  /* navy – sidebar, ecran de login */
  --brand-700: #183763;  /* navy mediu – titluri, sume */
  --brand-600: #2f76cb;  /* albastru principal – butoane, stări active */
  --brand-500: #3a82d4;
  --brand-400: #5b9be5;
  --brand-100: #ebf4ff;  /* fundal albastru-deschis */
  --brand-050: #f7fbff;

  --accent: #f5b942;     /* auriul din identitate – accent secundar */
  --accent-bg: #fef6e4;

  --ink-900: #12263f;
  --ink-800: #1e3450;
  --ink-700: #35506f;
  --ink-500: #5b6f8c;
  --ink-400: #8095b0;
  --ink-300: #b4c4d8;
  --ink-200: #dce5ef;
  --ink-100: #edf2f8;
  --ink-050: #f4f6fa;

  --success: #17794f;
  --success-bg: #e5f5ed;
  --warning: #9a6206;
  --warning-bg: #fdf2dd;
  --danger: #b3261e;
  --danger-bg: #fdeceb;
  --info: #1f5fb0;
  --info-bg: #ebf4ff;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(16, 35, 60, .07);
  --shadow: 0 2px 8px rgba(16, 35, 60, .08), 0 1px 2px rgba(16, 35, 60, .05);
  --shadow-lg: 0 12px 32px rgba(16, 35, 60, .16);

  --sidebar-w: 250px;
  --topbar-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* --- Reset / bază -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Atributul `hidden` trebuie să învingă orice `display` declarat mai jos
   (`.field` este flex, `.dropdown__menu` este block etc.). Fără `!important`,
   regulile de componentă au prioritate față de `[hidden]` din browser și
   elementul rămâne vizibil. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-800);
  background: var(--ink-050);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.3; color: var(--ink-900); }
h1 { font-size: 19px; }
h2 { font-size: 17px; }
p { margin: 0 0 .5rem; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
svg { flex: none; }

.icon { width: 18px; height: 18px; }

/* --- Layout -------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-w);
}

.app-content {
  flex: 1;
  padding: 22px 26px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1560px;
  width: 100%;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 26px 20px;
  color: var(--ink-400);
  font-size: 12px;
  border-top: 1px solid var(--ink-200);
}

/* --- Sidebar ------------------------------------------------------------- */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--brand-900);
  color: #c5daf2;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 22px;
  z-index: 40;
}

.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }

.sidebar__logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .5px;
}

.sidebar__name { display: flex; flex-direction: column; line-height: 1.25; }
.sidebar__name strong { color: #fff; font-size: 15px; }
.sidebar__name small { color: #7e9bc4; font-size: 11px; }

.sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar__link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: #a9c0de;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar__link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar__link.is-active { background: var(--brand-600); color: #fff; }

.sidebar__actions { padding: 0 2px; }
.sidebar__foot { padding: 0 8px; color: #4e6e9b; font-size: 11px; }

/* --- Topbar -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink-200);
}

.topbar__title { flex: 1; min-width: 0; }
.topbar__title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar__toggle {
  display: none;
  background: none; border: 0; padding: 6px; cursor: pointer;
  color: var(--ink-700); border-radius: var(--radius-sm);
}

.topbar__search {
  position: relative;
  display: flex; align-items: center;
  width: 300px;
}
.topbar__search .icon { position: absolute; left: 11px; color: var(--ink-400); width: 16px; height: 16px; }
.topbar__search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: var(--ink-050);
  font: inherit; font-size: 13px;
  color: var(--ink-800);
}
.topbar__search input:focus {
  outline: none; background: #fff;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}

/* --- Chip utilizator + dropdown ------------------------------------------ */
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 9px 5px 5px;
  background: none; border: 1px solid transparent; border-radius: 999px;
  cursor: pointer; font: inherit; color: inherit;
}
.user-chip:hover { background: var(--ink-100); }

.avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-600); color: #fff;
  font-size: 12px; font-weight: 600;
}

.user-chip__meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.user-chip__meta strong { font-size: 13px; }
.user-chip__meta small { font-size: 11px; color: var(--ink-400); }

.dropdown { position: relative; }

.dropdown__menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 230px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  z-index: 50;
}
.dropdown__menu--right { right: 0; left: auto; }
.dropdown__menu[hidden] { display: none; }
.dropdown__form { margin: 0; }

.dropdown__header {
  padding: 9px 11px; margin-bottom: 4px;
  border-bottom: 1px solid var(--ink-100);
  display: flex; flex-direction: column;
}
.dropdown__header small { color: var(--ink-400); font-size: 12px; }

.dropdown__item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 11px;
  border: 0; border-radius: var(--radius-sm);
  background: none; font: inherit; text-align: left;
  color: var(--ink-700); cursor: pointer;
}
.dropdown__item:hover { background: var(--ink-100); }
.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger:hover { background: var(--danger-bg); }
.dropdown__item.is-disabled { opacity: .45; pointer-events: none; }

/* Meniu lat, pentru alegerea șablonului de contract. */
.dropdown__menu--wide { min-width: 320px; }

.dropdown__item--stacked {
  flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 9px 11px;
}
.dropdown__item-title {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-weight: 500; color: var(--ink-800);
}
.dropdown__item--stacked small { font-size: 11.5px; line-height: 1.4; }

/* --- Butoane ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit; font-weight: 500; font-size: 13px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:disabled, .btn.is-loading { opacity: .6; cursor: not-allowed; }

.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-700); }

.btn--ghost { background: #fff; border-color: var(--ink-200); color: var(--ink-700); }
.btn--ghost:hover:not(:disabled) { background: var(--ink-050); border-color: var(--ink-300); }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover:not(:disabled) { background: #12633f; }

.btn--danger-ghost { background: #fff; border-color: var(--ink-200); color: var(--danger); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--danger-bg); border-color: #f0c4c1; }

.btn--block { width: 100%; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--lg { padding: 11px 18px; font-size: 14px; }

.btn-icon {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink-500); cursor: pointer;
}
.btn-icon:hover { background: var(--ink-100); color: var(--ink-800); }
.btn-icon--danger:hover { background: var(--danger-bg); color: var(--danger); }

.link { color: var(--brand-600); font-weight: 500; }
.link:hover { color: var(--brand-700); text-decoration: underline; }

/* --- Card ---------------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--ink-100);
}
.card__title { font-size: 14px; font-weight: 600; }
.card > .form-grid, .card > .totals, .card > .notes, .card > .inline-form { padding: 16px; }
.card > .detail-list { padding: 6px 16px 12px; }
.card > .doc-list, .card > .timeline, .card > .mini-list { padding: 8px 16px 14px; }
.card > .empty { padding: 26px 16px; }

.stack { display: flex; flex-direction: column; gap: 18px; }

/* --- Grid ---------------------------------------------------------------- */
.grid { display: grid; gap: 18px; align-items: start; }
.grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); }
.grid--1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- Toolbar / filtre ---------------------------------------------------- */
.toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.toolbar__filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; flex: 1; }

.segmented {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
.segmented__item {
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-500);
}
.segmented__item:hover { background: var(--ink-100); color: var(--ink-800); }
.segmented__item.is-active { background: var(--brand-600); color: #fff; }

/* --- Formulare ----------------------------------------------------------- */
.form { display: block; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field--grow { flex: 1; min-width: 220px; }
.field--inline { flex-direction: column; gap: 4px; }
.field--inline > span { font-size: 11.5px; color: var(--ink-500); font-weight: 500; }

.field > label, .field__label {
  font-size: 12.5px; font-weight: 500; color: var(--ink-700);
}
.field__hint { font-size: 11.5px; color: var(--ink-400); }
.req { color: var(--danger); }

.input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit; font-size: 13.5px;
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.input:disabled { background: var(--ink-050); color: var(--ink-400); }
.input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2361707f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

textarea.input { resize: vertical; min-height: 74px; line-height: 1.5; }

.input--num { text-align: right; font-variant-numeric: tabular-nums; }
.input--sub { margin-top: 5px; font-size: 12.5px; padding: 6px 9px; color: var(--ink-500); }

.field__with-action { position: relative; display: flex; }
.field__action {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 4px 7px;
  font: inherit; font-size: 12px; color: var(--brand-600);
  cursor: pointer; border-radius: 4px;
}
.field__action:hover { background: var(--brand-100); }

.inline-form { display: flex; gap: 9px; align-items: center; }
.inline-form .input { flex: 1; }

.form-actions { display: flex; flex-direction: column; gap: 9px; }
.form-actions--sticky { position: sticky; top: calc(var(--topbar-h) + 18px); }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card__body {
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.radio-card__body strong { font-size: 13px; }
.radio-card__body small { font-size: 11.5px; color: var(--ink-400); }
.radio-card__body .icon { color: var(--ink-400); }
.radio-card:hover .radio-card__body { border-color: var(--ink-300); }
.radio-card input:checked + .radio-card__body {
  border-color: var(--brand-500);
  background: var(--brand-050);
}
.radio-card input:checked + .radio-card__body .icon { color: var(--brand-600); }
.radio-card input:focus-visible + .radio-card__body { box-shadow: 0 0 0 3px var(--brand-100); }

/* --- Tabele -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.table th {
  text-align: left;
  padding: 9px 14px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--ink-400);
  background: var(--ink-050);
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
}

.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table--hover tbody tr:hover { background: var(--brand-050); }
.table--hover tbody tr[data-href] { cursor: pointer; }
.table--compact td { padding: 8px 14px; }

.table tfoot td {
  padding: 7px 14px;
  border-bottom: 0;
  color: var(--ink-500);
}
.table tfoot tr:first-child td { border-top: 1px solid var(--ink-200); padding-top: 11px; }
.table__grand td {
  font-size: 15px; font-weight: 700; color: var(--ink-900);
  border-top: 1px solid var(--ink-200);
  padding-top: 11px; padding-bottom: 13px;
}

/* Layout fix: coloanele cu lățime declarată o păstrează, iar coloana
   „Serviciu” (fără lățime) primește tot spațiul rămas. */
.table--items { table-layout: fixed; min-width: 700px; }
.table--items th { padding-left: 8px; padding-right: 8px; }
.table--items td { padding: 8px 6px; vertical-align: top; }
.table--items td:first-child, .table--items th:first-child { padding-left: 14px; }
.table--items td:last-child, .table--items th:last-child { padding-right: 14px; }
.table--items .input { padding-left: 8px; padding-right: 8px; }
.item-row__index { color: var(--ink-400); padding-top: 16px !important; font-size: 12px; }
.item-row__total { display: inline-block; padding-top: 9px; font-weight: 600; font-variant-numeric: tabular-nums; }

.row--alert { background: #fffaf5; }
.row--alert:hover { background: #fff4e9 !important; }

.table-summary {
  padding: 10px 16px;
  background: var(--ink-050);
  border-bottom: 1px solid var(--ink-100);
  font-size: 13px; color: var(--ink-500);
}

.cell-main { display: flex; align-items: center; gap: 10px; }
.cell-main__avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 11.5px; font-weight: 600;
}
.cell-main span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.cell-main small { font-size: 11.5px; }

.items-empty { padding: 20px 16px; text-align: center; color: var(--ink-400); font-size: 13px; }

/* --- Badge / dot --------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge--neutral { background: var(--ink-100); color: var(--ink-600, var(--ink-500)); }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger  { background: var(--danger-bg);  color: var(--danger); }
.badge--info    { background: var(--info-bg);    color: var(--info); }
.badge--brand   { background: var(--brand-100);  color: var(--brand-700); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.dot--success { background: var(--success); }
.dot--warning { background: var(--warning); }
.dot--danger { background: var(--danger); }

/* --- Statistici ---------------------------------------------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  display: flex; flex-direction: column; gap: 3px;
  position: relative;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
a.stat:hover { box-shadow: var(--shadow); border-color: var(--ink-300); transform: translateY(-1px); }

.stat__icon {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--ink-100); color: var(--ink-500);
}
.stat--brand .stat__icon { background: var(--brand-100); color: var(--brand-600); }
/* Singurul loc unde apare auriul din identitate: fundal de pictogramă, cu
   text în varianta închisă, ca să rămână lizibil. */
.stat--accent .stat__icon { background: var(--accent-bg); color: var(--warning); }
.stat--accent { border-color: #f2ddb0; }

.stat__label { font-size: 12.5px; color: var(--ink-500); font-weight: 500; }
.stat__value { font-size: 27px; font-weight: 700; line-height: 1.15; color: var(--ink-900); }
.stat__value--money { font-size: 21px; }
.stat__meta { font-size: 12px; color: var(--ink-400); }

/* --- Grafic venituri ----------------------------------------------------- */
.chart {
  display: flex; align-items: flex-end; gap: 8px;
  height: 210px;
  padding: 18px 16px 8px;
}
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 6px; }
.chart__bar {
  width: 100%;
  min-height: 3px;
  margin-top: auto;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--brand-400), var(--brand-600));
  transition: opacity .15s;
}
.chart__col:hover .chart__bar { opacity: .8; }
.chart__label { font-size: 11px; color: var(--ink-400); }

/* --- Liste --------------------------------------------------------------- */
.mini-list { display: flex; flex-direction: column; }
.mini-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink-100);
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { display: flex; flex-direction: column; line-height: 1.3; }
.mini-list small { color: var(--ink-400); font-size: 12px; }

.detail-list { display: flex; flex-direction: column; }
.detail-list > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--ink-100);
}
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--ink-500); font-size: 12.5px; flex: none; }
.detail-list dd { text-align: right; font-weight: 500; min-width: 0; word-break: break-word; }
.detail-list__grand dd { font-size: 16px; font-weight: 700; color: var(--brand-700); }

.doc-list { display: flex; flex-direction: column; }
.doc-list__item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--ink-100);
}
.doc-list__item:last-child { border-bottom: 0; }
.doc-list__item.is-missing { opacity: .6; }

.doc-list__icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  background: var(--info-bg); color: var(--info);
}
.doc-list__icon--pdf { background: var(--danger-bg); color: var(--danger); }

.doc-list__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-list__meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list__meta small { color: var(--ink-400); font-size: 11.5px; }
.doc-list__actions { display: flex; align-items: center; gap: 2px; }
.doc-list__actions form { margin: 0; }

.upload-form { margin: 0; }
.upload-form label { cursor: pointer; margin: 0; }

/* --- Pagina Șabloane ----------------------------------------------------- */
.doc-list--templates .doc-list__item { align-items: flex-start; padding: 12px 0; }
.doc-list--templates .doc-list__meta strong {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; white-space: normal;
}
.doc-list--templates .doc-list__meta small { white-space: normal; }
.doc-list--templates .doc-list__actions { align-items: center; gap: 5px; }
.doc-list--templates .doc-list__actions form { margin: 0; }

.template-edit {
  padding: 14px;
  margin-bottom: 10px;
  background: var(--ink-050);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
}

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand-600); }

.tag-help { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.tag-help p { font-size: 12.5px; margin: 0; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-cloud code {
  padding: 2px 7px;
  background: var(--brand-100);
  color: var(--brand-700);
  border-radius: 4px;
  font-family: var(--font-mono); font-size: 11.5px;
}
.tag-help code { font-family: var(--font-mono); font-size: 11.5px; }

/* --- Timeline ------------------------------------------------------------ */
.timeline { display: flex; flex-direction: column; }
.timeline__item { position: relative; display: flex; gap: 12px; padding: 9px 0 9px 4px; }
.timeline__item::before {
  content: ""; position: absolute; left: 8px; top: 22px; bottom: -9px;
  width: 1px; background: var(--ink-200);
}
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  width: 9px; height: 9px; flex: none; margin-top: 6px; margin-left: 4px;
  border-radius: 50%; background: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.timeline__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.timeline__body strong { font-size: 13px; }
.timeline__body p { font-size: 12.5px; color: var(--ink-500); margin: 0; }
.timeline__body small { font-size: 11.5px; }
.timeline--compact .timeline__item { padding: 7px 0 7px 4px; }

/* --- Totaluri ------------------------------------------------------------ */
.totals { display: flex; flex-direction: column; gap: 9px; }
.totals__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.totals__row span, .totals__row label { color: var(--ink-500); }
.totals__row strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals__row--input .input { width: 130px; }
.totals__row--grand {
  margin-top: 5px; padding-top: 11px;
  border-top: 1px solid var(--ink-200);
}
.totals__row--grand span { color: var(--ink-800); font-weight: 600; }
.totals__row--grand strong { font-size: 20px; color: var(--brand-700); }
.totals__hint { font-size: 11.5px; color: var(--ink-400); margin-top: 3px; }

/* --- Alerte -------------------------------------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 13.5px;
}
.alert p { margin: 0; }
.alert .icon { margin-top: 1px; }
.alert--success { background: var(--success-bg); border-color: #bfe3d1; color: var(--success); }
.alert--danger  { background: var(--danger-bg);  border-color: #f2c9c6; color: var(--danger); }
.alert--warning { background: var(--warning-bg); border-color: #ecd7a8; color: var(--warning); }
.alert--info    { background: var(--info-bg);    border-color: #c6ddf5; color: var(--info); }

.alert__close {
  margin-left: auto; background: none; border: 0; padding: 2px;
  color: inherit; opacity: .6; cursor: pointer;
}
.alert__close:hover { opacity: 1; }

/* --- Header de pagină ---------------------------------------------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.page-head__main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.page-head__main h2 { font-size: 21px; }

.page-head__avatar {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-100); color: var(--brand-700);
  font-size: 15px; font-weight: 700;
}

.page-head__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin: 3px 0 0; }
.page-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-head__actions form { margin: 0; }

/* --- Stare goală --------------------------------------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 34px 16px;
  color: var(--ink-400); text-align: center;
}
.empty .icon { width: 30px; height: 30px; opacity: .55; }
.empty p { font-size: 13.5px; margin: 0; }

/* --- Paginare ------------------------------------------------------------ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--ink-100);
}
.pagination__info { font-size: 12.5px; color: var(--ink-500); margin: 0; }
.pagination__list { display: flex; align-items: center; gap: 3px; }
.pagination__link {
  display: grid; place-items: center;
  min-width: 32px; height: 32px; padding: 0 9px;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--ink-700); background: #fff;
}
.pagination__link:hover { background: var(--ink-050); }
.pagination__link.is-current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination__link.is-disabled { opacity: .4; pointer-events: none; }
.pagination__gap { padding: 0 5px; color: var(--ink-400); }

/* --- Login --------------------------------------------------------------- */
.body-centered { background: var(--brand-900); min-height: 100vh; display: grid; }

.login {
  display: grid;
  grid-template-columns: minmax(360px, 440px) 1fr;
  min-height: 100vh;
  width: 100%;
}

.login__panel {
  background: #fff;
  padding: 46px 46px;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}

.login__brand { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.login__brand h1 { font-size: 23px; }
.login__brand p { color: var(--ink-400); font-size: 13px; margin: 0; }
.login__logo {
  width: 48px; height: 48px; margin-bottom: 10px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-700));
  color: #fff; font-weight: 700;
}

.login__form { display: flex; flex-direction: column; gap: 15px; }
.login__note { font-size: 12px; color: var(--ink-400); margin: 0; }

.login__aside {
  background: radial-gradient(circle at 30% 20%, var(--brand-700), var(--brand-900) 70%);
  display: grid; place-items: center; padding: 46px; color: #c5daf2;
}
.login__aside-content { max-width: 420px; }
.login__aside h2 { color: #fff; font-size: 26px; line-height: 1.28; margin-bottom: 18px; }
.login__aside ul { display: flex; flex-direction: column; gap: 11px; }
.login__aside li { position: relative; padding-left: 26px; font-size: 14px; }
.login__aside li::before {
  content: ""; position: absolute; left: 0; top: 8px;
  width: 14px; height: 3px; border-radius: 2px; background: var(--brand-400);
}

/* --- Pagină de eroare ---------------------------------------------------- */
.error-page {
  display: flex; flex-direction: column; align-items: center; gap: 11px;
  padding: 70px 20px; text-align: center;
}
.error-page__code { font-size: 60px; font-weight: 700; color: var(--ink-300); margin: 0; line-height: 1; }
.error-page__message { color: var(--ink-500); max-width: 560px; }
.error-page__actions { display: flex; gap: 9px; margin-top: 9px; }
.error-page__details { margin-top: 22px; max-width: 90vw; text-align: left; }
.error-page__details pre {
  overflow: auto; padding: 14px;
  background: var(--ink-900); color: #eaf3ff;
  border-radius: var(--radius); font-family: var(--font-mono); font-size: 12px;
}

/* --- Diverse ------------------------------------------------------------- */
.notes { padding: 16px; white-space: pre-wrap; font-size: 13.5px; color: var(--ink-700); }
.muted { color: var(--ink-400); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.scrim {
  position: fixed; inset: 0;
  background: rgba(15, 23, 32, .45);
  z-index: 35;
}
.scrim[hidden] { display: none; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--2-1 { grid-template-columns: minmax(0, 1fr); }
  .form-actions--sticky { position: static; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: none; }
  .app-main { margin-left: 0; }
  .topbar__toggle { display: grid; place-items: center; }
  .topbar__search { display: none; }
  .grid--1-1 { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: 1fr; }
  .login__aside { display: none; }
  .login__panel { padding: 34px 26px; }
}

@media (max-width: 640px) {
  .app-content { padding: 16px 14px 30px; }
  .topbar { padding: 0 14px; }
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .radio-cards { grid-template-columns: 1fr; }
  .user-chip__meta { display: none; }
  .page-head__actions { width: 100%; }
}

@media print {
  .sidebar, .topbar, .app-footer, .page-head__actions, .toolbar { display: none !important; }
  .app-main { margin-left: 0; }
  .card { border: 0; box-shadow: none; }
}
