/* Binary Technologies admin — app UI. Brand: deep indigo, white, cyan (from the website). */

:root {
  --ink: #15163a;
  --ink-2: #3a3c66;
  --muted: #6e7196;
  --line: #e3e5f1;
  --line-2: #d3d6e8;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --indigo: #24255e;
  --indigo-deep: #121335;
  --indigo-ink: #2f3178;
  --violet: #8f7dff;
  --cyan: #4cc9e6;
  --cyan-ink: #0b7f9c;
  --cyan-soft: #e3f7fc;
  --green: #12805c; --green-soft: #e2f5ee;
  --amber: #a35c00; --amber-soft: #fdf1df;
  --red: #c2283f; --red-soft: #fde8eb;
  --blue: #2f55c9; --blue-soft: #e7edff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(21, 22, 58, .05), 0 4px 18px rgba(21, 22, 58, .05);
  --shadow-lg: 0 20px 60px rgba(18, 19, 53, .28);
  --display: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --arabic: "IBM Plex Sans Arabic", "Geeza Pro", sans-serif;
  --sidebar: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--display); -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: var(--indigo-ink); text-decoration: none; }
a:hover { color: var(--cyan-ink); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pre { white-space: pre-line; }
.nowrap { white-space: nowrap; }
.num { text-align: right; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.danger-text { color: var(--red); }
.icon { flex: none; }
[hidden] { display: none !important; }

/* ---------- form controls ---------- */
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 9px 11px; width: 100%; min-width: 0;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(76, 201, 230, .22);
}
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-2); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input.num { text-align: right; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field__hint { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.field__hint.ok { color: var(--green); }
.inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.inline-field input { width: auto; }
.form-error { color: var(--red); font-size: 13px; font-weight: 500; margin-right: auto; }

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 14px/1 var(--display); padding: 10px 15px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  color: var(--ink); background: var(--surface);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--indigo); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--indigo-ink); color: #fff; }
.btn--ghost { border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover:not(:disabled) { border-color: var(--indigo-ink); color: var(--indigo-ink); }
.btn--danger-ghost { border-color: transparent; color: var(--red); background: transparent; }
.btn--danger-ghost:hover { background: var(--red-soft); }
.btn--sm { padding: 7px 11px; font-size: 13px; }
.btn--lg { padding: 13px 18px; font-size: 15px; }
.btn--block { width: 100%; justify-content: flex-start; }
.btn--block .icon:last-child:not(:first-child) { margin-left: auto; }
.signin .btn--block { justify-content: center; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0;
  font: 600 13px var(--display); color: var(--cyan-ink); cursor: pointer;
}
.link-btn:hover { color: var(--indigo-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 13px var(--display); text-transform: capitalize; padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.chip:hover:not(:disabled) { border-color: var(--indigo-ink); }
.chip.is-on { background: var(--indigo); border-color: var(--indigo); color: #fff; }

.badge {
  display: inline-block; font: 600 11px/1 var(--display); text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 8px; border-radius: 6px; vertical-align: middle;
}
.badge--grey { background: #eceef6; color: var(--ink-2); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--red { background: var(--red-soft); color: var(--red); }

/* ---------- shell ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; padding: 20px 14px 14px;
  background: radial-gradient(120% 60% at 0% 0%, #2a2b70 0%, var(--indigo-deep) 60%);
  color: #c9cbef; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; color: #fff; }
.brand:hover { color: #fff; }
.brand img { border-radius: 9px; }
.brand__type { display: flex; flex-direction: column; line-height: 1.05; }
.brand__type strong { font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.brand__type span { font-size: 9.5px; letter-spacing: .26em; opacity: .7; margin-top: 3px; }
.brand--dark { color: var(--indigo); }
.brand--dark:hover { color: var(--indigo); }
.brand--sm { padding: 0; }
.brand--sm .brand__type strong { font-size: 13px; }
.brand--sm .brand__type span { font-size: 8px; }

.nav-group { margin-bottom: 14px; }
.nav-group__title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #8487bd; padding: 6px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  color: #c9cbef; font-weight: 500; font-size: 14px;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: rgba(76, 201, 230, .14); color: #fff; box-shadow: inset 2px 0 0 var(--cyan); }
.nav-link.is-active .icon { color: var(--cyan); }
.sidebar__user {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar__user strong { display: block; color: #fff; font-size: 13.5px; }
.sidebar__user .small { color: #8f92c4; }
.sidebar__user .icon-btn { color: #9a9dd0; }
.sidebar__user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--violet), var(--cyan)); color: #fff; font-weight: 700; font-size: 13px;
}

.main { margin-left: var(--sidebar); min-width: 0; }
.topbar { display: none; }
.scrim { display: none; }

.page { max-width: 1240px; margin: 0 auto; padding: 30px clamp(16px, 3vw, 40px) 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 27px; font-weight: 700; }
.page-head__sub { margin: 4px 0 0; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.section-title { font-size: 16px; margin: 28px 0 12px; }

/* ---------- cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.pad { padding: 18px 20px; }
.card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.stack { display: flex; flex-direction: column; gap: 10px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.table th.num { text-align: right; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th { border-top: 1px solid var(--line-2); border-bottom: 0; color: var(--ink); font-size: 13px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #f6f8ff; }
.row-actions { white-space: nowrap; text-align: right; width: 1%; }
.row-actions .icon-btn { opacity: .55; }
tr:hover .row-actions .icon-btn { opacity: 1; }

.empty { text-align: center; padding: 50px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); }
.empty__bits { font-size: 12px; letter-spacing: .4em; color: var(--cyan); margin-bottom: 10px; }
.empty h3 { font-size: 17px; margin-bottom: 6px; }
.empty p { color: var(--muted); margin: 0 0 16px; }
.error-box { background: var(--red-soft); color: var(--red); padding: 14px 16px; border-radius: var(--radius-sm); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.spinner {
  width: 28px; height: 28px; margin: 60px auto; border-radius: 50%;
  border: 3px solid var(--line-2); border-top-color: var(--cyan); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot, .boot-error { min-height: 100vh; display: grid; place-items: center; }

/* ---------- dashboard ---------- */
.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick__btn {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  transition: border-color .15s, transform .15s;
}
.quick__btn:hover { border-color: var(--cyan); color: var(--ink); transform: translateY(-1px); }
.quick__btn strong { display: block; font-size: 13.5px; line-height: 1.25; }
.quick__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--cyan-soft); color: var(--cyan-ink); flex: none; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats--stack { grid-template-columns: 1fr; margin: 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.stat strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; }
.stat em { font-style: normal; }
.stat--accent { background: linear-gradient(135deg, var(--indigo) 0%, #33358a 100%); border-color: var(--indigo); color: #fff; }
.stat--accent > span, .stat--accent em { color: #b9bbec; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: flex; align-items: center; gap: 12px; padding: 10px 2px; color: var(--ink); }
.recent a:hover { color: var(--indigo-ink); }
.recent__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--bg); color: var(--indigo-ink); flex: none; }
.recent__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.recent__main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent__amt { font-size: 13.5px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; }
.chart__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.chart__bar { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--cyan), #6c8cf0); }
.chart__lbl { font-size: 10.5px; color: var(--muted); }

.onboarding h2 { font-size: 18px; margin-bottom: 8px; }
.onboarding ol { margin: 0; padding-left: 20px; line-height: 2; }

/* ---------- detail page ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 9px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-weight: 600; font-size: 13px; }
.kv dd { margin: 0; }

/* ---------- document editor ---------- */
.editor-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.editor-bottom { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; margin-top: 16px; align-items: start; }

.lines { --cols: 34px minmax(220px, 1fr) 76px 80px 110px 74px 70px 120px 100px; }

.lines__head, .lines__row { display: grid; grid-template-columns: var(--cols); gap: 8px; align-items: start; padding: 0 14px; }
.lines__head.lines--plain, .lines__row.lines--plain { grid-template-columns: 34px minmax(220px, 1fr) 80px 80px minmax(150px, 220px) 100px; }
.lines__section {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--cyan-soft); color: var(--cyan-ink);
}
.lines__section input { font-weight: 700; color: var(--indigo); background: #fff; }
.lines__serial textarea { min-height: 38px; field-sizing: content; max-height: 200px; font-size: 13px; }
.lines__head {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  padding-top: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.lines__row { padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.lines__row input, .lines__row textarea { padding: 8px 9px; }
.lines__no { padding-top: 9px; color: var(--muted); font-size: 13px; }
.lines__amt { padding-top: 9px; font-weight: 600; }
.lines__tools { display: flex; gap: 0; justify-content: flex-end; padding-top: 2px; }
.lines__tools .icon-btn { width: 28px; height: 30px; }
.lines__desc textarea { min-height: 38px; field-sizing: content; max-height: 220px; }
.lines__foot { display: flex; align-items: center; gap: 14px; padding: 12px 14px; flex-wrap: wrap; }

.combo { position: relative; }
.combo__list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 5px;
  list-style: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(21, 22, 58, .16); max-height: 300px; overflow-y: auto;
}
.combo__list li { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.combo__list li.is-active { background: var(--cyan-soft); }
.combo__row { display: flex; justify-content: space-between; gap: 12px; }

.totals-card .tot-input { width: 140px; }
.tot-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.tot-row--grand { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 17px; }
.sticky-save {
  position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 12px;
  margin: 18px -12px 0; padding: 12px; background: rgba(244, 245, 251, .9); backdrop-filter: blur(8px);
}

/* ---------- document view ---------- */
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.paper-scroll { overflow-x: auto; padding-bottom: 6px; }
.view-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.pay-list, .rel-list, .user-list { list-style: none; margin: 10px 0 0; padding: 0; }
.pay-list li, .user-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.user-list li { justify-content: flex-start; }
.user-list { margin: 0 0 12px; }
.user-list li:first-child { border-top: 0; }
.rel-list li a { display: flex; flex-direction: column; padding: 7px 0; }
.rel-list li + li { border-top: 1px solid var(--line); }

/* ---------- settings ---------- */
.settings { display: flex; flex-direction: column; gap: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.settings-grid form .btn { margin-top: 14px; }
.settings-grid .form-error { margin-top: 10px; }

/* ---------- modal & toasts ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(12, 13, 38, .5); backdrop-filter: blur(3px); animation: fade .15s ease;
}
.modal {
  width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease;
}
.modal--wide { max-width: 900px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal__head h2 { font-size: 19px; }
.modal__body { padding: 18px 22px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toasts { position: fixed; z-index: 200; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--indigo-deep); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: pop .2s ease; max-width: min(90vw, 480px); }
.toast--err { background: var(--red); }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.signin__art { position: relative; overflow: hidden; background: radial-gradient(90% 70% at 30% 30%, #2f3190 0%, var(--indigo-deep) 70%); }
.signin__bits {
  position: absolute; inset: -20px; font-size: 22px; line-height: 1.6; letter-spacing: .5em; word-break: break-all;
  color: rgba(201, 189, 255, .14);
  mask-image: radial-gradient(circle at 40% 40%, #000 0%, transparent 70%);
}
.signin__card { align-self: center; justify-self: center; width: 100%; max-width: 400px; padding: 32px 24px; display: flex; flex-direction: column; gap: 14px; }
.signin__card .brand { padding: 0 0 18px; }
.signin__card h1 { font-size: 26px; }
.signin__card > p { margin: -6px 0 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .view-grid { grid-template-columns: 1fr; }
  .view-side { position: static; }
  .lines { --cols: 30px minmax(180px, 1fr) 64px 70px 96px 64px 60px 104px 92px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .25s ease, visibility 0s .25s; }
  .menu-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-lg); transition: transform .25s ease; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(12, 13, 38, .4); }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30;
    padding: 10px 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .page { padding-top: 20px; }
  .editor-top, .editor-bottom, .dash-grid, .detail-grid { grid-template-columns: 1fr; }
  .signin { grid-template-columns: 1fr; }
  .signin__art { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* line items become stacked cards */
  .lines__head { display: none; }
  .lines__row, .lines__row.lines--plain {
    grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px; position: relative;
  }
  .lines__no { position: absolute; top: 6px; left: 14px; padding: 0; font-size: 11px; }
  .lines__desc { grid-column: 1 / -1; margin-top: 12px; }
  .lines__amt { grid-column: span 2; text-align: left; }
  .lines__tools { grid-column: span 2; }
  .lines__row input::placeholder { color: var(--muted); }
}
@media (max-width: 600px) {
  .page-head h1 { font-size: 22px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-5 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .hide-sm { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .table td, .table th { padding: 10px; }
  .clip { max-width: 160px; }
  .lines__row, .lines__row.lines--plain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lines__cell { display: block; min-width: 0; }
.lines__mlabel { display: none; }
@media (max-width: 900px) {
  .lines__mlabel { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
  .lines__amt, .lines__tools { align-self: end; }
}
@media (max-width: 600px) {
  .lines__amt, .lines__tools { grid-column: span 1; }
}

@media (max-width: 900px) {
  .lines__serial { grid-column: 1 / -1; }
}
.num-grid { display: grid; grid-template-columns: 150px minmax(0, 1fr) 120px 150px; gap: 8px 14px; align-items: center; margin-top: 12px; }
@media (max-width: 700px) {
  .num-grid { grid-template-columns: 1fr 1fr; }
  .num-grid > .field__label { display: none; }
  .num-grid > strong { grid-column: 1 / -1; margin-top: 8px; }
}
