/*
 * doc-settings.css — "מסמכים" (js/screens/quotes.js: the kinds of document,
 * the tools) and Documents → settings (js/screens/doc-settings.js).
 * `tally:documents`, 2026-10-25. Colours only through tokens, so every design
 * (C, M, M · בצבע) in light and dark follows.
 */

/* ---- The documents screen -------------------------------------------------- */

.docs-head .catalog__lede { margin: 10px 0 18px; }
.docs-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.docs-tool { inline-size: auto; min-block-size: 38px; padding-inline: 14px; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 6px; }
.docs-ic { display: inline-flex; }
.docs-ic svg { inline-size: 18px; block-size: 18px; }

/* The kinds of document: the same air above as below (2026-10-25, Almon). */
.docs-types { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px; margin-block: 22px; scrollbar-width: none; }
.docs-type { flex: none; display: flex; align-items: center; gap: 12px; min-inline-size: 190px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 0; background: var(--surface-strong); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.docs-type.is-selected { box-shadow: inset 0 0 0 2px var(--accent); }
html[data-design="etched"] .docs-type.is-selected { box-shadow: var(--clear-ring); }
.docs-type__ic { inline-size: 38px; block-size: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.docs-type__tx { display: flex; flex-direction: column; }
.docs-type__n { font-weight: 700; font-size: 0.9375rem; }
.docs-type__c { color: var(--text-muted); font-size: 0.75rem; }
.docs-search { margin-block-end: 16px; }
.docs-type--soon { cursor: default; background: transparent; box-shadow: inset 0 0 0 1px dashed var(--border); border: 1px dashed color-mix(in srgb, var(--text-muted) 40%, transparent); opacity: .75; }

.quotes-row__sent { display: inline-block; margin-inline-start: 8px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--pos) 13%, transparent);
  color: var(--pos); font-size: 0.6875rem; font-weight: 700; vertical-align: 1px; }

/* ---- Documents → settings ---------------------------------------------------------- */

.ds-head { margin-block-end: 6px; }
.ds-head .state-note { margin: 4px 0 0; }
.ds-jump { position: sticky; inset-block-start: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding-block: 8px; margin-block-end: 6px; scrollbar-width: none;
  background: none; }
@media (max-width: 1023px) { .ds-jump { position: static; background: none; } } /* nothing fixed at the top on phones */
.ds-jump__a { flex: none; border: 0; border-radius: 999px; padding: 6px 13px; background: var(--surface-strong); -webkit-backdrop-filter: var(--surface-blur); backdrop-filter: var(--surface-blur); box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.ds-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-block-start: 60px; }
.ds-note { margin: -6px 0 0; color: var(--text-muted); font-size: 0.8125rem; }
.ds-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ds-row--end { justify-content: flex-end; }
.ds-row--end .btn { inline-size: auto; padding-inline: 22px; }
.ds-small { inline-size: auto; min-block-size: 38px; padding-inline: 14px; font-size: 0.875rem; }
.ds-danger { background: transparent; color: var(--neg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--neg) 35%, transparent); }
.ds-split { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 640px) { .ds-split { grid-template-columns: 1fr; } }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ds-warn { margin: -6px 0 0; color: var(--neg); font-size: 0.8125rem; font-weight: 600; }
.ds-warn[hidden] { display: none; }
.ds-seg { max-inline-size: 280px; }

/* Logo and signature (2026-10-25: the picture is exactly as tall as the two
   choices beside it; a logo fills its frame; the whole signature shows). */
.ds-sub { display: flex; flex-direction: column; gap: 10px; }
.ds-sub + .ds-sub { padding-block-start: 16px; border-block-start: 1px solid var(--border); }
.ds-sub .ds-note { margin: -4px 0 0; }
.ds-logo-row { --pic: 132px; display: grid; grid-template-columns: var(--pic) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.ds-asset__pic { position: relative; padding: 0; border: 0; cursor: pointer; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--border);
  display: grid; place-items: center; overflow: hidden; font: inherit; transition: box-shadow .15s ease; }
@media (hover: hover) { .ds-asset__pic:hover { box-shadow: inset 0 0 0 2px var(--accent); } }
.ds-asset__pic--logo { inline-size: var(--pic); block-size: var(--pic); }
.ds-asset__pic img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: contain; }
.ds-asset__pic--sig { inline-size: min(100%, 340px); aspect-ratio: 3 / 1; }
.ds-asset__pic--sig img { padding: 10px 14px; box-sizing: border-box; }
.ds-asset__none { color: #9aa0aa; font-size: 0.875rem; font-weight: 600; }
.ds-choices { display: grid; grid-template-rows: 1fr 1fr; gap: 8px; }
.ds-choice { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 14px; border: 0; border-radius: 14px; text-align: start; cursor: pointer;
  background: var(--surface-strong); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); font: inherit; min-inline-size: 0; }
.ds-choice.is-on { box-shadow: inset 0 0 0 2px var(--accent); }
html[data-design="etched"] .ds-choice.is-on { box-shadow: var(--clear-ring); }
.ds-choice__t { font-weight: 700; font-size: 0.875rem; }
.ds-choice__s { color: var(--text-muted); font-size: 0.75rem; }
@media (min-width: 720px) { .ds-logo-row { --pic: 148px; max-inline-size: 560px; } }

/* Saved-by-itself mark at the end of a field's label line */
.ds-section .field { position: relative; }
.ds-saved { display: none; position: absolute; inset-block-start: 1px; inset-inline-end: 4px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.toggle-row > .ds-saved { position: static; margin-inline-start: auto; }
.ds-saved.is-busy, .ds-saved.is-ok, .ds-saved.is-bad { display: inline-block; }
.ds-saved.is-ok { color: var(--pos); }
.ds-saved.is-bad { color: var(--neg); }

/* Cutting and centring a logo */
.ds-crop-card { inline-size: min(440px, 100%); }
.ds-crop { position: relative; inline-size: min(100%, 320px); aspect-ratio: 1; margin-inline: auto; overflow: hidden; border-radius: 18px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--border); touch-action: none; cursor: grab; direction: ltr; }
.ds-crop:active { cursor: grabbing; }
.ds-crop__img { position: absolute; inset-block-start: 0; inset-inline-start: 0; max-inline-size: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; opacity: 0; }
.ds-crop.is-ready .ds-crop__img { opacity: 1; }
.ds-crop__grid { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(0,0,0,.08) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(0,0,0,.08) 0 calc(66.66% + .5px), transparent 0),
              linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(0,0,0,.08) 0 calc(33.33% + .5px), transparent 0 calc(66.66% - .5px), rgba(0,0,0,.08) 0 calc(66.66% + .5px), transparent 0); }
.ds-crop__zoomrow { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-weight: 700; direction: ltr; }
.ds-crop__zoom { flex: 1; accent-color: var(--accent); }
.ds-row--center { justify-content: center; }

/* The signature pad */
.ds-pad-card { inline-size: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; }
.ds-pad-card .confirm-sheet__body { margin: 0; }
.ds-pad-wrap { position: relative; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.ds-pad { display: block; inline-size: 100%; aspect-ratio: 5 / 2; touch-action: none; cursor: crosshair; position: relative; z-index: 1; }
.ds-pad-line { position: absolute; inset-inline: 8%; inset-block-end: 24%; border-block-end: 1px dashed #c3c8d2; pointer-events: none; }

/* The five designs as live miniatures */
.ds-designs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.ds-design { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 0; border-radius: 18px; cursor: pointer; text-align: start;
  background: var(--surface-strong); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); font: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.ds-design:hover { transform: translateY(-2px); }
.ds-design.is-on { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-sm); }
html[data-design="etched"] .ds-design.is-on { box-shadow: var(--clear-ring), var(--shadow-sm); }
.ds-design__paper { display: block; block-size: 250px; overflow: hidden; border-radius: 10px; background: #fff; pointer-events: none; }
.ds-mini .qdoc { box-shadow: none; border-radius: 0; }
.ds-design__name { display: flex; flex-direction: column; }
.ds-design__name b { font-size: 0.9375rem; }
.ds-design__name small { color: var(--text-muted); font-size: 0.75rem; }
.ds-design__on { position: absolute; inset-block-start: 16px; inset-inline-end: 16px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: 0.6875rem; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .ds-design { transition: none; } .ds-design:hover { transform: none; } }

/* `tally:invoices` — badges on invoice rows in the documents list. */
.quotes-row__badges { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-inline-start: 8px; vertical-align: middle; }
.doc-badge { padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--text-muted) 13%, transparent); color: var(--text-muted); font-size: 0.6875rem; font-weight: 700; white-space: nowrap; }
.doc-badge.is-ok { background: color-mix(in srgb, var(--pos) 13%, transparent); color: var(--pos); }
.doc-badge.is-late { background: color-mix(in srgb, var(--neg) 12%, transparent); color: var(--neg); }
.doc-badge.is-warn { background: color-mix(in srgb, var(--amber) 15%, transparent); color: var(--amber); }

/* `tally:ita` — Documents → settings → Tax Authority. */
.ds-ita-status { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.ds-ita-dot { flex: none; inline-size: 10px; block-size: 10px; margin-block-start: 6px; border-radius: 50%; background: var(--text-muted); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-muted) 18%, transparent); }
.ds-ita-dot.is-on { background: var(--pos); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pos) 18%, transparent); }
.ds-ita-status p { margin-block-start: 2px; }
.ds-ita-steps { margin: 12px 0; padding-inline-start: 20px; color: var(--text-muted); font-size: 0.8125rem; line-height: 1.7; }
