/* ============================================================
   Gestion — distribution management
   Warm, refined, spacious "fresh market" system
   ============================================================ */

:root {
  --bg: #FAF6EF;
  --bg-2: #F3ECE0;
  --surface: #FFFFFF;
  --surface-2: #FBF7F0;
  --ink: #1E1B16;
  --text: #2B2620;
  --text-soft: #6E6557;
  --muted: #9A9081;
  --line: #ECE4D6;
  --line-strong: #DDD3C2;

  --primary: #1E7A4A;
  --primary-strong: #14552F;
  --primary-soft: #E4F2EA;
  --primary-tint: #F1F8F3;

  --accent: #E0611C;
  --accent-strong: #B94A12;
  --accent-soft: #FCE9DB;

  --danger: #C03A28;
  --danger-soft: #F9E5E1;
  --warn: #B5810F;
  --warn-soft: #FBF1D8;
  --info: #2C6DAE;
  --info-soft: #E5EFF8;
  --violet: #6A53B8;
  --violet-soft: #ECE7F8;
  --teal: #157E78;
  --teal-soft: #DEF1EF;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow-xs: 0 1px 2px rgba(30,27,22,.05);
  --shadow-sm: 0 2px 6px -2px rgba(30,27,22,.10);
  --shadow: 0 6px 18px -10px rgba(30,27,22,.22), 0 2px 6px -3px rgba(30,27,22,.10);
  --shadow-lg: 0 32px 70px -28px rgba(30,27,22,.40);

  --font-head: 'Bricolage Grotesque', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --sidebar-w: 274px;
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(circle at 6% 2%, rgba(224,97,28,.045), transparent 30%),
    radial-gradient(circle at 96% 0%, rgba(30,122,74,.055), transparent 36%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.012em; color: var(--ink); line-height: 1.18; }
small { font-size: .82em; }
::selection { background: var(--primary-soft); }

/* ───────────── Shell ───────────── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong));
  color: #fff; display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 21px;
  box-shadow: 0 6px 14px -6px rgba(20,85,47,.6);
}
.brand .name { font-family: var(--font-head); font-weight: 700; font-size: 20px; color: var(--ink); line-height: 1.1; }
.brand .role { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav .section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 16px 12px 7px;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s; position: relative;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--primary-tint); color: var(--primary-strong); }
.nav a.active .ico { color: var(--primary); }
.nav a .ico { width: 19px; height: 19px; flex-shrink: 0; color: var(--muted); transition: color .15s; }
.nav a .badge-new {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}

.spacer { flex: 1; }
.user-box {
  margin-top: 18px; padding: 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
}
.user-box .who { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.user-box .fico {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary-strong);
  display: grid; place-items: center; font-weight: 700; font-family: var(--font-head);
}
.user-box .name { font-weight: 700; font-size: 14px; color: var(--ink); }
.user-box .role { font-size: 12px; color: var(--muted); }

/* ───────────── Main ───────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 34px; border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.topbar h1 { font-size: 25px; margin-top: 2px; }
.topbar .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.mobile-toggle { display: none; }

.content { padding: 34px 40px; width: 100%; }

.section-title {
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft);
  margin: 6px 0 14px;
}

/* ───────────── Cards ───────────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card.mb, .mb { margin-bottom: 22px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px 26px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 17px; }
.card-body { padding: 24px 26px; }

/* ───────────── Stat tiles ───────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-xs);
  transition: transform .16s, box-shadow .16s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .corner { position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: var(--line-strong); }
.stat.accent .corner { background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }
.stat.warn .corner { background: var(--warn); }
.stat.flag .corner { background: var(--danger); }
.stat:not(.accent):not(.warn):not(.flag) .corner { background: linear-gradient(90deg, var(--primary), var(--primary-strong)); }
.stat .label { font-size: 12.5px; color: var(--text-soft); font-weight: 600; margin-bottom: 9px; }
.stat .value { font-family: var(--font-head); font-weight: 700; font-size: 30px; color: var(--ink); line-height: 1; letter-spacing: -.02em; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ───────────── Tables ───────────── */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  text-align: left; padding: 13px 20px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2);
}
tbody td { padding: 16px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
th.right, td.right { text-align: right; }
td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
td.muted { color: var(--text-soft); }
.nowrap { white-space: nowrap; }
.ref { display: inline-block; white-space: nowrap; font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--primary-strong); background: var(--primary-soft); padding: 3px 9px; border-radius: 7px; }

/* ───────────── Buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  padding: 11px 18px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  cursor: pointer; transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap; line-height: 1; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px -10px rgba(20,85,47,.7); }
.btn-primary:hover { background: var(--primary-strong); color: #fff; box-shadow: 0 10px 22px -10px rgba(20,85,47,.8); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 8px 18px -10px rgba(185,74,18,.7); }
.btn-accent:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ───────────── Badges ───────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  white-space: nowrap; line-height: 1.4;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.gray { background: var(--bg-2); color: var(--text-soft); }
.st-pending { background: var(--warn-soft); color: var(--warn); }
.st-confirmed { background: var(--info-soft); color: var(--info); }
.st-processing { background: var(--violet-soft); color: var(--violet); }
.st-shipped { background: var(--teal-soft); color: var(--teal); }
.st-delivered { background: var(--primary-soft); color: var(--primary-strong); }
.st-completed { background: var(--primary); color: #fff; }
.st-completed .dot { background: #fff; }
.st-cancelled { background: var(--danger-soft); color: var(--danger); }

/* ───────────── Forms ───────────── */
.field { margin-bottom: 17px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 7px; }
.field .hint, .hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .hint { display: block; margin-top: 6px; }
input[type=text], input[type=password], input[type=tel], input[type=number],
input[type=email], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: 14.5px; color: var(--text);
  padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-tint);
}
textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9081' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ───────────── Checkboxes ───────────── */
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text); padding: 9px 0; cursor: pointer; user-select: none; }
.check input[type=checkbox] { width: 19px; height: 19px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.check .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.check-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px 15px; background: var(--surface); }
dialog .grid-2 { margin-top: 4px; }

/* ───────────── Helpers / misc ───────────── */
.muted { color: var(--muted); }
.lead { font-size: 16px; color: var(--text-soft); }
.actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.help-note {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--info-soft); color: #2a4a66;
  border: 1px solid #cfe0ee; border-radius: var(--radius);
  padding: 15px 18px; margin-bottom: 22px; font-size: 14px; line-height: 1.55;
}
.help-note svg { color: var(--info); }
.help-note.accent { background: var(--accent-soft); color: #7a3a14; border-color: #f3d3bd; }
.help-note.accent svg { color: var(--accent); }
.help-note a { color: inherit; text-decoration: underline; font-weight: 600; }

.empty { text-align: center; padding: 54px 28px; }
.empty .ic { font-size: 46px; margin-bottom: 14px; }
.empty h3 { font-size: 19px; margin-bottom: 7px; }
.empty p { color: var(--text-soft); max-width: 420px; margin: 0 auto 18px; }

/* ───────────── Dashboard columns ───────────── */
.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
.settings-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }

/* ───────────── Bar chart ───────────── */
.barchart { display: flex; align-items: flex-end; gap: 7px; height: 180px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.bar-track { width: 100%; height: 100%; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; background: linear-gradient(180deg, var(--primary), var(--primary-strong)); border-radius: 7px 7px 3px 3px; min-height: 3px; transition: height .4s cubic-bezier(.2,.8,.2,1); }
.bar-x { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ───────────── Lock + upload (invoices) ───────────── */
.lock-panel {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 30px 24px; text-align: center; color: var(--text-soft);
}
.lock-panel .lk { font-size: 34px; margin-bottom: 10px; opacity: .8; }
.lock-panel h3 { font-size: 17px; margin-bottom: 5px; color: var(--text); }

.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 16px; background: var(--surface-2);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.dropzone input[type=file] { flex: 1; min-width: 200px; font-size: 13.5px; }
.dropzone input[type=file]::file-selector-button {
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  padding: 8px 13px; margin-right: 12px; border-radius: var(--radius-xs);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer;
}

.invoice-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--primary-soft); color: var(--primary-strong);
  border-radius: var(--radius-sm); padding: 9px 14px; font-weight: 600; font-size: 13.5px;
}

/* ───────────── Detail (key/value) ───────────── */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.kv { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kv .v { font-size: 15px; color: var(--text); font-weight: 500; }

/* ───────────── Filter bar ───────────── */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filterbar a {
  padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--text-soft);
}
.filterbar a:hover { border-color: var(--line-strong); color: var(--text); }
.filterbar a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ───────────── Product cards (agent / manager) ───────────── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }
.prod {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-xs);
  transition: transform .16s, box-shadow .16s; display: flex; flex-direction: column;
}
.prod:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.prod.is-new { border-color: var(--accent-soft); }
.prod h3 { font-size: 18px; margin-bottom: 8px; }
.prod .price { font-family: var(--font-head); font-weight: 700; font-size: 21px; color: var(--primary-strong); }
.prod .price small { font-size: 13px; color: var(--muted); font-weight: 600; }
.prod .desc { font-size: 13.5px; color: var(--text-soft); margin: 10px 0 16px; flex: 1; }
.prod .new-tag {
  position: absolute; top: 14px; right: 14px; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; padding: 3px 9px; border-radius: 999px;
}
.prod.sold-out { opacity: .74; }
.prod.sold-out h3 { color: var(--text-soft); }

/* ───────────── Flashes ───────────── */
.flashes { position: fixed; top: 18px; right: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.flash {
  padding: 13px 17px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); animation: slideIn .3s ease;
}
.flash.success { background: var(--primary-soft); color: var(--primary-strong); border-color: #bfe2cd; }
.flash.error { background: var(--danger-soft); color: var(--danger); border-color: #f0cdc6; }
.flash.info { background: var(--info-soft); color: var(--info); border-color: #cfe0ee; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ───────────── Dialogs ───────────── */
dialog {
  border: none; border-radius: var(--radius-lg); padding: 0; max-width: 540px; width: 92%;
  box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface);
}
dialog::backdrop { background: rgba(30,27,22,.5); backdrop-filter: blur(3px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-size: 19px; }
.dlg-body { padding: 24px 26px; max-height: 64vh; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 26px; border-top: 1px solid var(--line); background: var(--surface-2); }
.close-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.close-x:hover { color: var(--text); }

/* ───────────── Auth pages ───────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 40px 36px; width: 100%; max-width: 430px;
}
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 28px; }
.auth-logo {
  width: 58px; height: 58px; border-radius: 17px; margin-bottom: 16px;
  background: linear-gradient(145deg, var(--primary), var(--primary-strong)); color: #fff;
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 28px;
  box-shadow: 0 10px 22px -10px rgba(20,85,47,.7);
}
.auth-brand h1 { font-size: 25px; }
.auth-brand .lead { font-size: 14.5px; margin-top: 4px; }
.code-input input {
  text-align: center; font-family: var(--font-mono); font-size: 21px; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 600; padding: 15px;
}
.code-pill { font-family: var(--font-mono); font-weight: 600; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: .92em; }
.auth-foot { text-align: center; margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.auth-foot a { font-weight: 600; }

/* ───────────── Responsive ───────────── */
.scrim { display: none; }
@media (max-width: 940px) {
  .dash-cols, .settings-cols, .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(30,27,22,.45); z-index: 50; }
  .mobile-toggle {
    display: inline-grid; place-items: center; width: 42px; height: 42px;
    border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong);
    background: var(--surface); cursor: pointer; color: var(--text);
  }
  .topbar { padding: 16px 18px; }
  .topbar h1 { font-size: 21px; }
  .content { padding: 20px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .card-head, .card-body { padding-left: 18px; padding-right: 18px; }
}

/* ───────────── New order-status badges ───────────── */
.st-awaiting_validation { background: var(--warn-soft); color: var(--warn); }
.st-validated { background: var(--info-soft); color: var(--info); }
.st-released { background: var(--primary); color: #fff; }
.st-released .dot { background: #fff; }

/* ───────────── Price editor + timeline + price tag ───────────── */
.price-tag { font-family: var(--font-head); font-weight: 700; color: var(--primary-strong); font-size: 17px; }
.price-tag small { font-size: 12px; color: var(--muted); font-weight: 600; }
.price-set { display: flex; gap: 8px; align-items: center; }
.price-set input { max-width: 130px; padding: 8px 11px; font-size: 13.5px; }
.wholesale { font-size: 13px; color: var(--text-soft); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.tl-row:last-child { border-bottom: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; background: var(--line-strong); }
.tl-row.done .tl-dot { background: var(--primary); }
.tl-row .tl-k { font-weight: 600; font-size: 14px; color: var(--text); }
.tl-row .tl-v { font-size: 12.5px; color: var(--muted); }

/* ───────────── Multi-item order builder ───────────── */
.order-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; background: var(--surface-2); }
.order-item .oi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.order-item .oi-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; font-family: var(--font-head); }
.order-item .oi-title { font-weight: 600; font-size: 14px; color: var(--text); }
.order-item .field:last-child { margin-bottom: 0; }
.add-item-row { margin: 4px 0 6px; }

/* ═══════════ Spacing pass — roomier, less compact, eye-friendly ═══════════ */
/* Wider breathing room between columns + taller rows */
thead th { padding: 16px 28px; letter-spacing: .06em; }
tbody td { padding: 20px 28px; line-height: 1.5; }
tbody td .hint { margin-top: 3px; }

/* a touch more air between table rows via cell separation */
table { border-spacing: 0; }
tbody tr td { border-bottom: 1px solid var(--line); }

/* Cards & sections get more padding and separation */
.card-head { padding: 22px 28px; }
.card-body { padding: 26px 28px; }
.card.mb, .mb { margin-bottom: 26px; }
.section-title { margin: 14px 0 16px; }

/* Stat tiles: more gap + internal padding */
.stat-grid { gap: 18px; margin-bottom: 28px; }
.stat { padding: 22px 24px; }

/* Detail key/value rows: more vertical rhythm */
.kv { padding: 14px 0; }

/* Dashboard panels list rows breathe more */
.between { gap: 16px; }

/* Filter bar + actions spacing */
.filterbar { gap: 10px; margin-bottom: 24px; }
.actions { gap: 9px; }

/* Forms: a bit more space between fields */
.field { margin-bottom: 20px; }
.grid-2 { gap: 18px; }

/* Wider content column so tables aren't cramped on big screens */
:root { --maxw: 1240px; }

@media (max-width: 860px) {
  thead th { padding: 13px 16px; }
  tbody td { padding: 15px 16px; }
  .card-head, .card-body { padding-left: 18px; padding-right: 18px; }
}

/* ═══════════ Language switcher ═══════════ */
.lang-switch { display: inline-flex; border: 1.5px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 7px 12px; font-size: 12.5px; font-weight: 700; color: var(--text-soft); border-right: 1px solid var(--line); line-height: 1; }
.lang-switch a:last-child { border-right: none; }
.lang-switch a:hover { background: var(--surface-2); color: var(--text); }
.lang-switch a.active { background: var(--primary); color: #fff; }
.auth-lang { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.auth-lang a { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 4px 9px; border-radius: 999px; }
.auth-lang a.active { background: var(--primary-soft); color: var(--primary-strong); }
.auth-tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: var(--radius-sm); margin-bottom: 22px; }
.auth-tab { flex: 1; border: none; background: transparent; font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--muted); padding: 10px 8px; border-radius: 10px; cursor: pointer; transition: background .12s, color .12s; }
.auth-tab:hover { color: var(--text); }
.auth-tab.active { background: var(--surface); color: var(--primary-strong); box-shadow: 0 2px 8px -3px rgba(0,0,0,.22); }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.cred-card { background: var(--primary-soft); border: 1px solid var(--primary); border-radius: var(--radius-md); padding: 16px 18px; margin-bottom: 20px; }
.cred-card h3 { font-size: 15px; color: var(--primary-strong); margin-bottom: 10px; }
.cred-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.cred-row .k { color: var(--text-soft); min-width: 92px; font-weight: 600; }
.cred-row code { font-family: var(--font-mono); background: var(--surface); padding: 4px 9px; border-radius: 6px; border: 1px solid var(--line); word-break: break-all; }

/* ═══════════ RTL (Arabic) ═══════════ */
[dir="rtl"] body { direction: rtl; }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--line); }
[dir="rtl"] .nav a .badge-new { margin-left: 0; margin-right: auto; }
[dir="rtl"] thead th { text-align: right; }
[dir="rtl"] tbody td { text-align: right; }
[dir="rtl"] th.right, [dir="rtl"] td.right { text-align: left; }
[dir="rtl"] .actions { margin-left: 0; margin-right: auto; }
[dir="rtl"] .topbar .actions { margin-right: auto; margin-left: 0; }
[dir="rtl"] .between { flex-direction: row-reverse; }
[dir="rtl"] .flashes { right: auto; left: 18px; }
[dir="rtl"] .stat .corner { left: auto; right: 0; }
[dir="rtl"] select { background-position: left 12px center; padding-right: 14px; padding-left: 38px; }
[dir="rtl"] .dlg-foot { flex-direction: row-reverse; }
[dir="rtl"] .user-box .who { flex-direction: row-reverse; text-align: right; }
