:root {
  --bg: #10161c;
  --card: #1b242d;
  --card-2: #24303b;
  --ink: #f4f7fb;
  --muted: #93a3b1;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #6eb6ff;
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.screen.lock {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.screen.lock .topbar { flex: none; }
.screen {
  min-height: 100%;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(110, 182, 255, 0.16), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(18, 138, 120, 0.12), transparent 50%),
    var(--bg);
}

.session {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.panel {
  width: min(440px, 100%);
  background: #16202a;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 26px 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
.panel h1 { margin: 0 0 8px; }
.lead { margin: 0 0 16px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select, .line input {
  background: #121a22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  color: white;
}
.field input:focus, .field select:focus, .field textarea:focus,
.toolbar input:focus, .toolbar select:focus, .line input:focus {
  outline: 2px solid rgba(110, 182, 255, 0.45);
  border-color: transparent;
}
.login-error { color: #ff8b86; margin: 0 0 12px; }
.access-slip {
  background: #16324a;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.access-slip strong { display: block; margin-bottom: 8px; }
.access-slip p { margin: 0 0 4px; }

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px 20px;
  background: rgba(14, 20, 26, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.field input, .field textarea, .suggest { scroll-margin-top: 92px; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.brand strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #8ec8ff, #2f6fbe);
  box-shadow: 0 8px 16px rgba(47, 111, 190, 0.35);
}
.mark svg { width: 22px; height: 22px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.spacer { flex: 1; }
.page { padding: 26px 22px 40px; max-width: 1180px; margin: 0 auto; }
.page.home { max-width: 1040px; margin: 0 auto; }

.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: -0.03em; }
.page-head p { margin: 0; color: var(--muted); }

.home-copy { margin-bottom: 22px; }
.kicker {
  margin: 0 0 6px;
  color: #8ec8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.home-copy h1 { margin: 0 0 6px; font-size: 36px; letter-spacing: -0.04em; }
.home-copy p { margin: 0; color: var(--muted); font-size: 16px; }

.btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 13px;
  background: #3a4653;
  color: white;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.btn-accent { background: #1d6f9a; }
.btn-green { background: #1f9d57; }
.btn-blue { background: #2d7edb; }
.btn-orange { background: #d06a1a; }
.btn-red { background: #c2453a; }
.btn-purple { background: #8a4fbf; }
.btn-teal { background: #128a78; }

.menu-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}
.tile {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 176px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  color: white;
  text-align: left;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.18), transparent 46%),
    var(--tone);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.tile:nth-child(4) { grid-column: 2 / span 2; }
.tile:nth-child(5) { grid-column: 4 / span 2; }
.tile:nth-child(6) { grid-column: 3 / span 2; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 20px 34px rgba(0, 0, 0, 0.32); }
.tile strong { font-size: 22px; letter-spacing: -0.03em; }
.tile span { color: rgba(255, 255, 255, 0.86); font-size: 14px; line-height: 1.35; }
.tile em {
  margin-top: auto;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}
.ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}
.ico svg { width: 22px; height: 22px; fill: none; stroke: white; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tone-stock { --tone: #2b6ed4; }
.tone-clients { --tone: #7a45b8; }
.tone-suppliers { --tone: #0f8b79; }
.tone-doc { --tone: #d06a1a; }
.tone-history, .tone-board { --tone: #3e5680; }
.tone-access { --tone: #8a4fbf; }
.chart {
  display: flex;
  align-items: stretch;
  gap: 6px;
  height: 280px;
  padding: 12px 12px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.chart div { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.chart em { font-style: normal; font-size: 11px; font-weight: 800; min-height: 16px; margin-bottom: 4px; text-align: center; white-space: nowrap; }
.chart .plot { flex: 1; width: 100%; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.chart i { display: block; width: 100%; max-width: 36px; border-radius: 8px 8px 3px 3px; background: linear-gradient(#9ed0ff, #2d6ed4); }
.chart .lbl { margin-top: 6px; color: var(--muted); font-size: 11px; }
.client-box { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.client-box .names { flex: 1; display: grid; gap: 8px; }
.client-box .btn { margin-bottom: 2px; white-space: nowrap; }
.piece { margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #151d26; }
.piece-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.7fr) minmax(0, 0.7fr) minmax(0, 0.55fr); gap: 8px; margin-top: 8px; }
.piece-grid .field input { min-width: 0; width: 100%; }
.suggest { list-style: none; margin: 6px 0 0; padding: 4px; background: #101820; border: 1px solid var(--line); border-radius: 12px; }
.suggest button { width: 100%; text-align: left; background: transparent; color: inherit; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.suggest button:hover { background: #243140; }
.sheet-actions { position: static; }
input[readonly] { opacity: 0.85; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 12px; margin-bottom: 16px; }
.stats div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
}
.stats strong { display: block; font-size: 26px; letter-spacing: -0.04em; }
.stats span { color: var(--muted); font-size: 13px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.grow { flex: 1; min-width: 180px; }

.table-wrap {
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; background: #202a34; position: sticky; top: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.03); }
tr.low td { background: rgba(231, 76, 60, 0.14); }
td.ref { font-weight: 700; }
td.qty { font-variant-numeric: tabular-nums; font-weight: 700; }
.row-actions { display: flex; gap: 6px; }
.empty { color: var(--muted); padding: 18px; }

/* Stock page — look Gestok Python */
.screen:has(.stock-page) {
  background: #1e272e;
}
.topbar.stock-topbar {
  background: #1e272e;
  border-bottom: 1px solid #2f3640;
  min-height: 64px;
  padding: 12px 28px;
}
.stock-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: #353b48;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 10px 14px 10px 10px;
}
.stock-menu-ico {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #2f3640;
  font-size: 16px;
}
.stock-status {
  margin: 0;
  color: #7f8fa6;
  font-size: 13px;
  font-weight: 600;
}
.stock-gear {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #353b48;
  color: #fff;
  font-size: 20px;
}
.page.stock-page {
  max-width: none;
  padding: 8px 28px 28px;
  background: #1e272e;
}
.stock-search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.stock-search {
  position: relative;
  flex: 1 1 280px;
  min-width: 220px;
}
.stock-search-ico {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #74b9ff;
  font-size: 18px;
  pointer-events: none;
}
.stock-search input {
  width: 100%;
  background: #252d38;
  border: 1px solid #4b7bec;
  border-radius: 8px;
  padding: 12px 14px 12px 40px;
  color: #eaf0f6;
}
.stock-search input:focus {
  outline: 2px solid rgba(75, 123, 236, 0.35);
}
.stock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.btn-stock-add { background: #3498db; }
.btn-stock-forfait { background: #6c5ce7; }
.btn-stock-hist { background: #4b6584; }
.btn-stock-recv { background: #1abc9c; }
.btn-stock-alert { background: #f39c12; }
.stock-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.stock-filter-label {
  color: #a4b0be;
  font-size: 13px;
  font-weight: 750;
}
.stock-chip {
  border: 0;
  border-radius: 8px;
  padding: 7px 14px;
  background: #353b48;
  color: #d0d8e0;
  font-weight: 750;
}
.stock-chip.on {
  background: #4b7bec;
  color: #fff;
}
.stock-value {
  margin: 0;
  color: #74b9ff;
  font-size: 18px;
  font-weight: 800;
}
.stock-table {
  background: #1e272e;
  border: 1px solid #2f3640;
  border-radius: 8px;
  min-height: 280px;
}
.stock-table table {
  table-layout: fixed;
  width: 100%;
}
.stock-table th,
.stock-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stock-table th:nth-child(1),
.stock-table td:nth-child(1) { width: 12%; }
.stock-table th:nth-child(2),
.stock-table td:nth-child(2) { width: 28%; }
.stock-table th:nth-child(3),
.stock-table td:nth-child(3) { width: 8%; text-align: center; }
.stock-table th:nth-child(4),
.stock-table td:nth-child(4) { width: 14%; }
.stock-table th:nth-child(5),
.stock-table td:nth-child(5) { width: 14%; }
.stock-table th:nth-child(6),
.stock-table td:nth-child(6) { width: 12%; text-align: right; }
.stock-table th:nth-child(7),
.stock-table td:nth-child(7) { width: 12%; text-align: center; }
.stock-table th {
  background: #252d38;
  color: #d0d8e0;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.stock-table td {
  color: #c0c0c0;
  border-bottom-color: #2a323c;
}
.stock-table td.price { color: #dfe6ee; font-variant-numeric: tabular-nums; }
.stock-table td.status { white-space: nowrap; }
.stock-table tr.stock-row { cursor: pointer; }
.stock-table tbody tr.stock-row:hover td { background: rgba(75, 123, 236, 0.08); }
.stock-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 12, 16, 0.62);
  display: grid;
  place-items: center;
  padding: 24px;
}
.stock-modal-card {
  width: min(820px, 100%);
  max-height: min(80vh, 720px);
  overflow: auto;
  background: #2f3640;
  border: 1px solid #3d4654;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}
.stock-modal-card.slim { width: min(480px, 100%); }
.stock-modal-card h2 { margin: 0 0 6px; color: #74b9ff; }
.stock-modal-card .lead { margin-bottom: 14px; }
.stock-modal-card .actions { display: flex; gap: 8px; margin-top: 14px; }

.article-modal { z-index: 50; }
.article-card {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  background: #1a1f26;
  border: 1px solid #2f3640;
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.55);
}
.article-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.article-card-head h2 {
  margin: 0;
  color: #eaf0f6;
  font-size: 20px;
}
.article-card .field {
  color: #8b98a8;
  font-size: 11px;
  letter-spacing: 0.07em;
}
.article-card .field input,
.article-card .field select,
.article-card .field textarea {
  background: #12171d;
  border: 1px solid #2a323c;
  border-radius: 10px;
  color: #eef3f8;
  padding: 11px 12px;
}
.article-card .field input:focus,
.article-card .field select:focus,
.article-card .field textarea:focus {
  outline: 2px solid rgba(52, 152, 219, 0.35);
  border-color: #3498db;
}
.article-card .field textarea {
  resize: vertical;
  min-height: 72px;
}
.article-grid { gap: 12px 14px; margin-bottom: 4px; }
.article-grid .full { grid-column: 1 / -1; }

.directory-page .directory-table th,
.directory-page .directory-table td {
  text-align: left;
}
.directory-page .directory-table th:nth-child(1),
.directory-page .directory-table td:nth-child(1) { width: 18%; text-align: left; }
.directory-page .directory-table th:nth-child(2),
.directory-page .directory-table td:nth-child(2) { width: 16%; text-align: left; }
.directory-page .directory-table th:nth-child(3),
.directory-page .directory-table td:nth-child(3) { width: 16%; text-align: left; }
.directory-page .directory-table th:nth-child(4),
.directory-page .directory-table td:nth-child(4) { width: 22%; text-align: left; }
.directory-page .directory-table th:nth-child(5),
.directory-page .directory-table td:nth-child(5) { width: 28%; text-align: left; }
.directory-page .history-table th:nth-child(1),
.directory-page .history-table td:nth-child(1) { width: 14%; }
.directory-page .history-table th:nth-child(2),
.directory-page .history-table td:nth-child(2) { width: 14%; }
.directory-page .history-table th:nth-child(3),
.directory-page .history-table td:nth-child(3) { width: 22%; }
.directory-page .history-table th:nth-child(4),
.directory-page .history-table td:nth-child(4) { width: 14%; text-align: right; }
.directory-page .history-table th:nth-child(5),
.directory-page .history-table td:nth-child(5) { width: 14%; text-align: center; }
.directory-page .history-table th:nth-child(6),
.directory-page .history-table td:nth-child(6) { width: 12%; text-align: center; }
.directory-row { cursor: pointer; }
.directory-row:hover td { background: rgba(108, 92, 231, 0.12); }
.directory-card {
  background: #252d38;
  border: 1px solid #2f3640;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.directory-card h2 {
  margin: 0 0 6px;
  color: #eaf0f6;
  font-size: 20px;
}
.directory-card .lead {
  margin: 0 0 12px;
  color: #8b98a8;
}
.screen:has(.directory-page) {
  background: #1e272e;
}
.article-card .actions {
  margin-top: 16px;
  padding-top: 4px;
}
.article-card .btn-green {
  background: #27ae60;
  min-width: 120px;
}
.article-card .btn:not(.btn-green):not(.btn-red) {
  background: #353b48;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
.pill-ok { background: rgba(31, 157, 87, 0.18); color: #7ddea8; }
.pill-wait { background: rgba(208, 106, 26, 0.2); color: #ffc089; }
.pill-no { background: rgba(194, 69, 58, 0.2); color: #ffaaa4; }
.pill-inf { background: rgba(110, 182, 255, 0.16); color: #b7dbff; }

.page.fit { max-width: 1180px; padding: 14px 22px 18px; }
.fit-grid { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 16px; align-items: start; }
.fit-grid > * { min-width: 0; }
.fit .field { margin-bottom: 8px; }
.fit textarea { min-height: 52px; resize: vertical; }
.fit .client-box { margin-bottom: 8px; }
.fit .piece { margin-bottom: 8px; }
.fit-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 4px; }
.fit-foot .total { margin: 0; }
.composer { width: min(860px, 100%); margin-bottom: 18px; }
.composer h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.03em; }
.archive { margin-top: 28px; }
.archive h2 { margin: 0 0 10px; font-size: 22px; }
.form-card {
  width: min(760px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}
.form-card .actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lines { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.line { display: grid; grid-template-columns: 1.2fr 1.4fr 70px 110px auto; gap: 6px; }
.total {
  display: flex;
  justify-content: flex-end;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 14px;
}
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.doc-row { cursor: pointer; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 2px 0; }
.sheet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 8px;
  margin-bottom: 16px;
}
.sheet h2 { margin: 0 0 6px; }
.sheet p { margin: 0 0 6px; }
.or-label {
  margin: 0;
  color: #8ec8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.or-value { margin: 0 0 8px; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; }
.or-value.muted { color: var(--muted); font-size: 22px; }
.sums { margin: 12px 0; }

.page.gst {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gst-title { color: #dfe6e9; font-size: 18px; font-weight: 800; letter-spacing: 0.04em; margin: 0 0 12px; }
.gst-create { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.gst-wide {
  border: 0;
  border-radius: 6px;
  min-height: 48px;
  color: white;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}
.gst-wide.blue { background: #3498db; }
.gst-wide.orange { background: #e67e22; }
.gst-wide:hover { filter: brightness(1.06); }
.gst-box {
  background: #2f3640;
  border-radius: 4px;
  padding: 14px 16px 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gst-box h2 { margin: 0 0 12px; color: #e67e22; font-size: 15px; letter-spacing: 0.01em; }
.gst-search {
  width: 100%;
  margin-bottom: 12px;
  background: #353b48;
  border: 0;
  border-radius: 4px;
  color: white;
  padding: 12px 14px;
}
.gst-table { flex: 1; min-height: 0; overflow: auto; background: transparent; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 2px; }
.gst-table th, .gst-table td { text-align: center; background: transparent; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.gst-table th { position: sticky; top: 0; z-index: 1; color: #dfe6e9; font-size: 13px; letter-spacing: 0; text-transform: none; background: #2f3640; }
.gst-table tr.is-selected td { background: rgba(52, 152, 219, 0.28); }
.gst-bar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.gst-status {
  border: 0;
  background: transparent;
  color: #dfe6e9;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gst-status:hover { background: rgba(255, 255, 255, 0.08); }
.gst-act {
  border: 0;
  border-radius: 6px;
  min-height: 52px;
  color: white;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.gst-act.slate { background: #57606f; }
.gst-act.blue { background: #2980b9; }
.gst-act.purple { background: #9b59b6; }
.gst-act.orange { background: #d35400; }
.gst-act.teal { background: #16a085; }
.gst-act.red { background: #c0392b; }
.gst-act.green { background: #27ae60; }
.gst-act.amber { background: #e67e22; }
.gst-act.on { outline: 2px solid white; }
.gst-del {
  border: 0;
  background: #c0392b;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}
.gst-del:hover { filter: brightness(1.08); }
.profile-page { overflow: hidden; }
.profile-box { overflow: hidden; min-height: 0; }
.profile-box h2 { flex: none; margin-bottom: 6px; }
.profile-lead { margin: 0 0 10px; color: #b2bec3; font-size: 13px; flex: none; }
.profile-form {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  flex: none;
}
.profile-page .field { margin-bottom: 0; }
.profile-page .field input { padding: 9px 11px; }
.profile-wide { grid-column: 1 / -1; }
.brand-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.brand-card {
  background: #353b48;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.brand-card strong { color: #dfe6e9; font-size: 14px; flex: none; }
.brand-card p { margin: 0; color: #b2bec3; font-size: 12px; flex: none; }
.brand-empty {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #2f3640;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #95a5a6;
  font-size: 13px;
}
.brand-img {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: none;
  object-fit: contain;
  background: white;
  border-radius: 6px;
  padding: 8px;
}
.brand-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: none; }
.brand-file { display: inline-flex; align-items: center; margin: 0; }
.profile-foot { display: flex; justify-content: flex-start; flex: none; }
.page.ledger, .page.sheet-page { max-width: 1360px; }
.ledger td.meta { vertical-align: top; background: #182430; }
.ledger tr.bundle td { border-top: 14px solid #10161c; }
.paper {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
}
.paper.tone-devis { box-shadow: inset 4px 0 0 #2d7edb; }
.paper.tone-facture { box-shadow: inset 4px 0 0 #1f9d57; }
.paper.tone-fiche { box-shadow: inset 4px 0 0 #d06a1a; }
.paper.tone-ticket { box-shadow: inset 4px 0 0 #8a4fbf; }
.paper-top { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; margin-bottom: 16px; }
.paper-top h1 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
.paper-top p { margin: 4px 0 0; color: var(--muted); }
.or-box {
  margin-left: auto;
  min-width: 180px;
  background: #121a22;
  border-radius: 14px;
  padding: 12px 14px;
}
.or-box span { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.or-box strong { display: block; margin-top: 4px; font-size: 22px; }
.or-box strong.muted { color: var(--muted); font-size: 16px; }
.paper-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.paper-grid section { background: #121a22; border-radius: 14px; padding: 14px 16px; }
.paper-grid h2 { margin: 0 0 8px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.paper-grid p { margin: 0 0 4px; }
.paper-grid .big { font-size: 18px; font-weight: 700; }
.totals { width: min(380px, 100%); margin: 14px 0 0 auto; }
.totals p { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.totals .grand { border-bottom: 0; font-size: 20px; }

.page.ed {
  max-width: none;
  width: 100%;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.page.ed form { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.ed-head, .ed-foot { flex: none; display: flex; align-items: center; gap: 10px; }
.ed-head strong { letter-spacing: 0.04em; font-size: 15px; }
.ed-back {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #dfe6e9;
  font-weight: 700;
}
.ed-panel {
  background: #2f3640;
  border-radius: 4px;
  padding: 12px 14px;
}
.ed-panel label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: #dfe6e9; }
.ed-panel input, .ed-panel select, .ed-panel textarea {
  background: #353b48;
  border: 0;
  border-radius: 4px;
  color: white;
  padding: 8px 10px;
  min-width: 0;
}
.ed-meta, .ed-client, .ed-entry { display: grid; gap: 10px; align-items: end; }
.ed-meta { grid-template-columns: 180px 140px 180px 1fr; }
.ed-check { flex-direction: row !important; align-items: center; gap: 8px; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.ed-check input { width: 16px; height: 16px; }
.ed-hint { margin: 8px 0; color: #b2bec3; font-size: 12px; }
.ed-hint button { background: transparent; border: 0; color: #74b9ff; font-weight: 700; padding: 0; }
.ed-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.ed-duo span { color: #e67e22; }
.ed-client { grid-template-columns: 1fr 1fr 1.4fr 1fr auto; margin-top: 10px; }
.ed-client-btn, .ed-add, .ed-del, .ed-save, .ed-pdf {
  border: 0;
  border-radius: 4px;
  color: white;
  font-weight: 800;
  min-height: 36px;
  padding: 0 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ed-client-btn, .ed-add, .ed-save { background: #27ae60; }
.ed-client-btn.is-done, .client-box .is-done {
  background: #57606f;
  cursor: default;
  opacity: 0.95;
}
.ed-desc { margin-top: 10px; }
.ed-lines { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-lines h2 { margin: 0 0 10px; color: #1abc9c; font-size: 14px; letter-spacing: 0.02em; }
.ed-entry { grid-template-columns: 180px 1fr 80px 110px auto; }
.ed-lines .gst-table { margin-top: 8px; }
.ed-foot { margin-top: 8px; }
.ed-del { background: #e74c3c; }
.ed-pdf { background: #2980b9; }
.ed-total { margin: 0 0 0 auto; font-size: 18px; font-weight: 800; }
.ed-total small { font-size: 13px; font-weight: 600; color: #dfe6e9; }
.ed-mode {
  background: #353b48;
  color: white;
  border: 0;
  border-radius: 4px;
  min-height: 36px;
  padding: 0 8px;
}
.book { margin-top: 28px; }
.book h2 { margin: 0 0 8px; }
.book-note { margin: 0 0 12px; max-width: 820px; color: var(--muted); font-size: 14px; }
.book-tools { align-items: end; }
.book-tools .field { margin: 0; min-width: 120px; }
.book-total { font-weight: 800; }
.book select { background: #24303b; color: white; border: 0; border-radius: 8px; padding: 8px; }
.page.ed .login-error { margin: 0; }

@media (max-width: 900px) {
  .menu-grid { grid-template-columns: 1fr; }
  .tile, .tile:nth-child(4), .tile:nth-child(5), .tile:nth-child(6) { grid-column: auto; min-height: 148px; }
  .home-copy h1 { font-size: 30px; }
  .stats { grid-template-columns: 1fr; }
  .grid-2, .line, .paper-grid, .piece-grid, .fit-grid { grid-template-columns: 1fr; }
  .client-box { flex-direction: column; align-items: stretch; }
  .gst-create, .gst-bar, .ed-meta, .ed-duo, .ed-client, .ed-entry,
  .profile-grid, .brand-row { grid-template-columns: 1fr 1fr; }
  .ed-foot { flex-wrap: wrap; }
  .ed-total { margin-left: 0; }
  .or-box { margin-left: 0; }
  .topbar { flex-wrap: wrap; }
}

/* Site public Gestok (même structure que Planningo) */
.site {
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(41, 128, 185, 0.18), transparent 60%),
    #e8eef4;
  color: #12202b;
}
.site-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 28px;
  background: #1b242d;
  color: #f4f7f8;
}
.site-brand {
  border: 0;
  background: transparent;
  color: #f4f7f8;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.site-nav { display: flex; gap: 4px; }
.site-nav button {
  border: 0;
  background: transparent;
  color: #d5e2ea;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
}
.site-nav button.on { background: rgba(255, 255, 255, 0.12); color: #fff; }
.site-back {
  margin-left: auto;
  color: #d5e2ea;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.site-enter {
  margin-left: 12px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: #2980b9;
  color: #f4fffc;
  font-weight: 700;
}
.site-enter.on { background: #f4f7f8; color: #1b242d; }
.site-body { width: min(1040px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 36px; }
.site-legal {
  margin-top: 28px;
  padding: 28px 24px 32px;
  background: #1b242d;
  color: #d5e2ea;
  text-align: center;
}
.site-legal p { margin: 0 auto; max-width: 680px; font-size: 14px; line-height: 1.5; }
.site-legal p + p { margin-top: 6px; }
.site-legal strong { color: #f4f7f8; }
.site-kicker {
  margin: 0 0 10px;
  color: #2980b9;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site-hero h1 { margin: 0 0 14px; max-width: 16em; font-size: 44px; line-height: 1.08; color: #12202b; }
.site-hero p { margin: 0; max-width: 640px; color: #4d6270; line-height: 1.55; font-size: 18px; }
.site-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.site-cta, .site-ghost {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}
.site-cta { background: #2980b9; color: #f4fffc; }
.site-ghost { background: transparent; color: #1b242d; box-shadow: inset 0 0 0 1.5px #1b242d; }
.site-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.site-points li {
  background: #fff;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 28px rgba(18, 48, 68, 0.06);
}
.site-points strong { display: block; margin-bottom: 6px; color: #12202b; }
.site-points span { color: #4d6270; line-height: 1.45; }
.site-shot {
  margin: 22px 0 0;
  padding: 12px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(18, 48, 68, 0.08);
}
.site-shot img { display: block; width: 100%; height: auto; border-radius: 14px; }
.site-shot figcaption { margin: 10px 6px 2px; color: #4d6270; font-size: 14px; }
.site-show { margin-top: 52px; }
.site-show header {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 16px;
}
.site-show h2 { margin: 0; font-size: 32px; line-height: 1.15; color: #12202b; }
.site-show header > p { margin: 0; color: #4d6270; line-height: 1.55; }
.site-show .site-shot { margin-top: 0; }
.site-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 28px;
  align-items: center;
  margin-top: 28px;
}
.site-split .site-shot { margin: 0; }
.site-split h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.15; color: #12202b; }
.site-split p { margin: 0; color: #4d6270; line-height: 1.55; }
.site-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}
.site-steps li {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 10px 28px rgba(18, 48, 68, 0.06);
}
.site-steps b {
  display: block;
  margin-bottom: 10px;
  color: #2980b9;
  font-size: 13px;
  letter-spacing: 0.06em;
}
.site-steps strong { display: block; margin-bottom: 6px; color: #12202b; }
.site-steps span { color: #4d6270; line-height: 1.45; }
.site-note { margin: 28px 0 0; color: #4d6270; line-height: 1.5; }
.site-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.site-features article {
  background: #fff;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 28px rgba(18, 48, 68, 0.06);
}
.site-features h2 { margin: 0 0 8px; font-size: 18px; color: #12202b; }
.site-features p { margin: 0; color: #4d6270; line-height: 1.5; }
.site-offers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.site .offer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(18, 48, 68, 0.06);
}
.site .offer.featured { background: #1b242d; color: #f4f7f8; }
.site .offer.featured p { color: #d5e2ea; }
.site .offer h2 { margin: 0; font-size: 32px; }
.site .offer p { margin: 0; color: #4d6270; line-height: 1.5; }
.site .offer .site-cta { margin-top: 8px; }
.site .offer.featured .site-cta { background: #2980b9; color: #f4fffc; }
.site .offer.on { outline: 2px solid #2980b9; }
.site .offer-badge {
  margin: 0;
  color: #2980b9;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site .offer.featured .offer-badge { color: #7ec8f0; }
.site .offer-badge.quiet { color: #4d6270; }
.site-cta:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.site-order {
  position: relative;
  width: min(520px, 100%);
  margin: 22px auto 0;
  padding: 22px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(18, 48, 68, 0.08);
}
.site-order h2 { margin: 0 0 6px; color: #12202b; }
.site-order > p { margin: 0 0 14px; color: #4d6270; }
.site-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.site-ok {
  margin: 22px 0 0;
  padding: 18px 20px;
  background: #fff;
  border-radius: 16px;
  color: #2980b9;
  font-weight: 700;
}
.site-login { display: grid; place-items: center; padding-top: 24px; }
.site .panel {
  background: #fff;
  border: 1px solid #d5e2ea;
  box-shadow: 0 18px 40px rgba(18, 48, 68, 0.08);
  color: #12202b;
}
.site .panel h1 { color: #12202b; }
.site .lead { color: #4d6270; }
.site .field { color: #4d6270; }
.site .field input, .site .field textarea {
  background: #e7eef2;
  color: #12202b;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
}
.site .field textarea { resize: vertical; min-height: 72px; }
.site .btn-accent { background: #2980b9; color: #fff; border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 700; }
.site .login-error { color: #b42318; }

@media (max-width: 800px) {
  .site-bar { flex-wrap: wrap; padding: 12px 16px; }
  .site-nav { order: 3; width: 100%; }
  .site-hero h1 { font-size: 32px; }
  .site-points, .site-features, .site-offers, .site-show header, .site-split, .site-steps { grid-template-columns: 1fr; }
}
