/* ========== FerNet – מערכת ניהול עסק ========== */
:root {
  --green: #18803C;
  --green-dark: #11632E;
  --green-bright: #3CC46A;
  --black: #111111;
  --bg: #F3F5F3;
  --surface: #FFFFFF;
  --subtle: #F8FAF8;
  --border: #E2E6E2;
  --input: #C9CFC9;
  --text: #111111;
  --muted: #555555;
  --late-bg: #FDE8E8; --late-fg: #B42318;
  --soon-bg: #FFF1E0; --soon-fg: #9A3412;
  --ok-bg: #E6F4EA;   --ok-fg: #11632E;
  --note-payment: #FFE27A;
  --note-project: #BFE0FF;
  --note-general: #FFD3E0;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Heebo', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
h1, h2, h3 { margin: 0; }
.icon { flex: none; }
.muted { color: var(--muted); }
.ltr { direction: ltr; unicode-bidi: plaintext; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 0 0 240px; background: var(--black); color: #fff; padding: 28px 18px; display: flex; flex-direction: column; gap: 6px; }
.content { flex: 999 1 560px; min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.content.flush { padding: 0; gap: 0; }

.brand { padding: 0 10px 4px; font-size: 30px; font-weight: 800; letter-spacing: -.5px; direction: ltr; text-align: right; color: #fff; }
.brand span { color: var(--green-bright); }
.brand-sub { padding: 0 10px 24px; font-size: 13px; color: #BDBDBD; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 10px; color: #fff; font-size: 15px; }
.nav-item:hover { background: #222; color: #fff; }
.nav-item.active { background: var(--green); font-weight: 500; }
.nav-count { margin-inline-start: auto; background: var(--green-bright); color: var(--black); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.nav-count.warn { background: #C2410C; color: #fff; }
.side-user { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #2A2A2A; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.side-user form { margin-inline-start: auto; }
.side-user button { background: none; border: 0; color: #BDBDBD; cursor: pointer; padding: 6px; display: flex; }
.side-user button:hover { color: #fff; }

@media (max-width: 900px) {
  .sidebar { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; }
  .brand-sub { display: none; }
  .brand { padding: 0 8px; font-size: 24px; }
  .side-user { margin-top: 0; border: 0; padding: 0 8px; }
  .content { padding: 20px 16px; }
}

/* ---------- Typography / header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 30px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.back { font-size: 14px; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 10px; font: inherit; font-weight: 500; font-size: 15px; cursor: pointer; border: 1.5px solid transparent; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--black); border-color: var(--black); }
.btn-secondary:hover { background: #f2f2f2; color: var(--black); }
.btn-dark { background: var(--black); color: #fff; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-danger { background: #fff; color: var(--late-fg); border-color: var(--late-fg); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-soft { background: var(--ok-bg); color: var(--green-dark); border: 1px solid var(--green); font-weight: 700; }
.btn-soft:hover { background: #d6eedd; color: var(--green-dark); }
.icon-btn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--input); background: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #333; padding: 0; }
.icon-btn:hover { background: var(--subtle); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--green); cursor: pointer; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { font-size: 19px; font-weight: 700; }
.card-head a { font-size: 14px; font-weight: 500; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.col-side { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { color: inherit; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--muted); font-size: 14px; }
.kpi .value { font-size: 34px; font-weight: 800; }
.kpi .sub { color: var(--muted); font-size: 13px; }
.kpi.late .value { color: var(--late-fg); }
.kpi.pay .value { color: var(--soon-fg); }

/* ---------- Badges / tags ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.late { background: var(--late-bg); color: var(--late-fg); }
.badge.soon { background: var(--soon-bg); color: var(--soon-fg); }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.off { background: #EEE; color: #444; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #F0F0F0; font-size: 12px; font-weight: 500; color: #222; white-space: nowrap; }
.tag.dark { background: var(--black); color: #fff; }
.tag .dot { width: 8px; height: 8px; border-radius: 2px; }
.type-payment { color: #B45309; font-weight: 700; }
.type-project { color: #1D4ED8; font-weight: 700; }
.type-general { color: #444; font-weight: 700; }

.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--black); }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; font-weight: 800; }
.avatars { display: flex; gap: 4px; }

/* ---------- Chips (filters) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .lbl { font-size: 13px; color: #444; margin-inline-end: 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500; border: 1px solid var(--input); background: #fff; color: #222; cursor: pointer; }
.chip:hover { color: #222; border-color: #999; }
.chip.on { background: var(--black); color: #fff; border-color: var(--black); }
.chip .sq { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check input:checked + .chip { background: var(--black); color: #fff; border-color: var(--black); }
.chip-check input:focus-visible + .chip { outline: 2px solid var(--green); outline-offset: 2px; }

.seg { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; }
.seg a, .seg button { flex: 1; min-height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 14px; color: #333; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.seg .on { background: #fff; font-weight: 700; color: var(--black); }
.seg.dark .on { background: var(--black); color: #fff; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.form-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .form-grid.c2, .form-grid.c3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .input {
  min-height: 46px; padding: 0 14px; border: 1px solid var(--input); border-radius: 10px; font: inherit; font-size: 15px; font-weight: 400; background: #fff; color: var(--text); width: 100%;
}
.field textarea, textarea.input { padding: 12px 14px; resize: vertical; min-height: 92px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
.field.stage select { border: 1.5px solid var(--green); background: var(--ok-bg); color: var(--green-dark); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.field-validation-error, .validation-summary-errors { color: var(--late-fg); font-size: 13px; font-weight: 500; }
.validation-summary-errors ul { margin: 0; padding-inline-start: 18px; }
.validation-summary-valid { display: none; }
.input-validation-error { border-color: var(--late-fg) !important; }
.form-actions { display: flex; gap: 12px; padding-top: 6px; }
.form-card { max-width: 760px; }

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filters .field { flex: 1 1 160px; }
.filters .field.grow { flex: 3 1 260px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: right; color: var(--muted); font-size: 13px; font-weight: 500; padding: 12px 14px; background: var(--subtle); white-space: nowrap; }
table.grid td { padding: 12px 14px; border-top: 1px solid #EEF1EE; vertical-align: middle; }
table.grid tr:hover td { background: #FBFCFB; }
table.grid .strong { font-weight: 700; }
table.grid .sub { font-size: 12px; color: var(--muted); }
table.grid .notes { max-width: 240px; font-size: 13px; color: #333; }
table.grid a.row-link { color: var(--text); font-weight: 700; }
table.mini th { background: none; padding: 10px 8px; border-bottom: 1px solid var(--border); }
table.mini td { padding: 12px 8px; }
.row-actions { display: flex; gap: 8px; align-items: center; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

details.pop { position: relative; }
details.pop > summary { list-style: none; }
details.pop > summary::-webkit-details-marker { display: none; }
details.pop .pop-body { position: absolute; inset-inline-end: 0; top: 44px; z-index: 20; width: 300px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: 10px; }

/* ---------- Lists ---------- */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #EEF1EE; }
.list-row:first-of-type { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-size: 15px; font-weight: 500; }
.list-row .meta { font-size: 13px; color: var(--muted); }
.list-row form { display: flex; }
.done-btn { width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid #555; background: #fff; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: transparent; }
.done-btn:hover { border-color: var(--green); color: var(--green); background: var(--ok-bg); }

.timeline { list-style: none; margin: 8px 0 0; padding: 0; border-inline-start: 2px solid #D5DED5; }
.timeline li { position: relative; padding: 0 22px 18px 0; }
.timeline li::before { content: ""; position: absolute; right: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .stage { font-size: 13px; font-weight: 700; color: var(--green-dark); }
.timeline .text { font-size: 14px; white-space: pre-line; }

/* ---------- Client header ---------- */
.client-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between; }
.client-id { display: flex; gap: 18px; align-items: center; }
.client-mark { width: 64px; height: 64px; border-radius: 16px; background: var(--black); color: var(--green-bright); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; flex: none; }
.client-id h1 { font-size: 28px; font-weight: 800; }
.client-meta { margin-top: 4px; font-size: 14px; color: #444; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.client-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.client-controls { display: flex; flex-direction: column; gap: 10px; min-width: 240px; }

/* ---------- Tasks app bar ---------- */
.appbar { background: #fff; border-bottom: 1px solid var(--border); padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.appbar h1 { font-size: 22px; font-weight: 800; margin-inline-end: 8px; }
.appbar .search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; background: var(--bg); border-radius: 10px; color: var(--muted); }
.appbar .search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; }
.appbar .search input:focus { outline: none; }
.filterbar { background: var(--subtle); border-bottom: 1px solid var(--border); padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.filterbar .divider { width: 1px; height: 28px; background: var(--input); }
.done-toggle { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--green); background: var(--ok-bg); color: var(--green-dark); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.done-toggle.on { background: var(--black); border-color: var(--black); color: #fff; }

/* ---------- Board + sticky notes ---------- */
.board-wrap { position: relative; flex: 1; }
.board { padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 30px;
  background-image: radial-gradient(#D9DED9 1px, transparent 1px); background-size: 18px 18px; min-height: 100%; }
.board-col { display: flex; flex-direction: column; gap: 18px; border-radius: 14px; transition: background .15s; padding: 4px 4px 10px; }
.board-col.drag-over { background: rgba(24,128,60,.08); outline: 2px dashed var(--green); outline-offset: 6px; }
.col-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.col-head h2 { font-size: 16px; font-weight: 700; flex: 1; }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.col-head .count { font-size: 13px; font-weight: 700; color: var(--muted); }
.note-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 18px; align-items: start; }
@media (max-width: 1500px) { .note-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .note-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px)  { .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px)  { .note-grid { grid-template-columns: 1fr; } }
.lane-empty { grid-column: 1 / -1; padding: 22px; text-align: center; color: var(--muted); border: 2px dashed #C9CFC9; border-radius: 12px; background: rgba(255,255,255,.6); font-size: 14px; }

/* פתק קומפקטי */
.note { position: relative; padding: 16px 14px 10px; border-radius: 3px 3px 3px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 8px 14px -6px rgba(0,0,0,.22); display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: transform .15s, box-shadow .15s; min-height: 128px; }
.note::before { content: ""; position: absolute; top: -8px; left: 50%; width: 56px; height: 16px; transform: translateX(-50%) rotate(-2deg); background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.06); }
.note.payment { background: var(--note-payment); }
.note.project { background: var(--note-project); }
.note.general { background: var(--note-general); }
.note-grid .note:nth-of-type(6n+1) { transform: rotate(-1.2deg); }
.note-grid .note:nth-of-type(6n+2) { transform: rotate(1deg); }
.note-grid .note:nth-of-type(6n+3) { transform: rotate(-.5deg); }
.note-grid .note:nth-of-type(6n+4) { transform: rotate(1.4deg); }
.note-grid .note:nth-of-type(6n+5) { transform: rotate(-.9deg); }
.note-grid .note:nth-of-type(6n+6) { transform: rotate(.6deg); }
.note-grid .note:hover, .note:focus-visible { transform: rotate(0) translateY(-2px) scale(1.02); box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 14px 24px -8px rgba(0,0,0,.3); outline: none; z-index: 2; }
.note.dragging { opacity: .45; }
.note-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.note-type { font-size: 11px; font-weight: 800; letter-spacing: .3px; color: #222; }
.note-urgent { font-size: 11px; font-weight: 800; color: #fff; background: var(--late-fg); border-radius: 6px; padding: 0 7px; }
.note-title { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-link { font-size: 12px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-amount { font-size: 14px; font-weight: 800; }
.note-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,.18); }
.note-foot .due { font-size: 12px; font-weight: 500; color: #333; }
.note-foot .due.late { color: var(--late-fg); font-weight: 700; }
.note .avatar { width: 26px; height: 26px; font-size: 11px; border: 2px solid #fff; }
.note-more { display: none; }

/* פתק מוגדל */
.note-modal { position: fixed; inset: 0; z-index: 200; background: rgba(17,17,17,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.note-modal .note.big { width: min(560px, 100%); max-height: 90vh; overflow-y: auto; transform: none !important; cursor: default; padding: 30px 28px 22px; gap: 10px; border-radius: 4px 4px 4px 22px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.note-modal .note.big::before { width: 90px; height: 22px; top: -11px; }
.note.big .note-type { font-size: 13px; }
.note.big .note-urgent { font-size: 13px; padding: 1px 9px; }
.note.big .note-title { font-size: 24px; -webkit-line-clamp: unset; display: block; }
.note.big .note-link { font-size: 15px; white-space: normal; }
.note.big .note-amount { font-size: 20px; }
.note.big .note-foot .due { font-size: 14px; }
.note.big .avatar { width: 32px; height: 32px; font-size: 13px; }
.note.big .note-more { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; border-top: 1px dashed rgba(0,0,0,.18); }
.note-more dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.note-more dt { color: #444; }
.note-more dd { margin: 0; font-weight: 500; }
.note-more dd a { color: var(--text); text-decoration: underline; }
.note-notes { background: rgba(255,255,255,.55); border-radius: 10px; padding: 12px 14px; font-size: 14px; white-space: pre-line; }
.note-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.note-actions form { display: flex; }
.note-close { position: absolute; top: 10px; left: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.7); cursor: pointer; display: flex; align-items: center; justify-content: center; color: #111; }
.note-close:hover { background: #fff; }

.legend { padding: 0 32px 24px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: #444; align-items: center; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-inline-end: 6px; }
.legend .end { margin-inline-start: auto; }

/* ---------- Completed panel ---------- */
.done-overlay { position: absolute; inset: 0; background: rgba(17,17,17,.4); z-index: 30; }
.done-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(420px, 100%); background: #fff; z-index: 31; padding: 24px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
.done-panel .ph { display: flex; justify-content: space-between; align-items: center; }
.done-panel h2 { font-size: 20px; font-weight: 800; }
.done-item { display: flex; flex-direction: column; gap: 10px; }
.done-item .note { min-height: 0; }
.done-item .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
body:not(.show-done) .done-overlay, body:not(.show-done) .done-panel { display: none; }

/* ---------- Task form ---------- */
.dialog { max-width: 680px; margin: 0 auto; width: 100%; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.12); border: 1px solid var(--border); }
.dialog-head { background: var(--black); color: #fff; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; }
.dialog-head h1 { font-size: 22px; font-weight: 700; }
.dialog-head a { color: #fff; display: flex; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: 10px; }
.dialog-body { padding: 26px 28px; display: flex; flex-direction: column; gap: 20px; }
.dialog-foot { padding: 18px 28px; border-top: 1px solid var(--border); background: var(--subtle); display: flex; gap: 12px; align-items: center; }
.dialog-foot .spacer { flex: 1; }
.type-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-pick label { position: relative; cursor: pointer; }
.type-pick input { position: absolute; opacity: 0; }
.type-pick .opt { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--input); }
.type-pick .opt b { font-size: 15px; }
.type-pick .opt span { font-size: 12px; color: var(--muted); font-weight: 400; }
.type-pick input:checked + .opt { background: var(--ok-bg); border: 2px solid var(--green); color: var(--green-dark); }
.type-pick input:focus-visible + .opt { outline: 2px solid var(--green); outline-offset: 2px; }
.pay-box { background: #FFF7ED; border: 1px solid #FBD5A8; border-radius: 12px; padding: 16px; }
fieldset.plain { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.plain legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 8px; }

/* ---------- Settings ---------- */
.person { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid #EEF1EE; }
.person .grow { flex: 1 1 200px; }
.person .name { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.person .role { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #F0F0F0; color: #333; }
.person .flags { display: flex; gap: 14px; font-size: 13px; color: #444; }
.person.inactive { opacity: .55; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--input); }
.swatches input:checked + span { box-shadow: 0 0 0 3px var(--black); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { min-height: 38px; flex: 1 1 140px; }
.inline-form input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--input); border-radius: 8px; background: #fff; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid #EEF1EE; }
.set-row .grow { flex: 1; font-size: 15px; font-weight: 500; }
.set-row .sq { width: 14px; height: 14px; border-radius: 4px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 24px; left: 24px; z-index: 100; background: var(--black); color: #fff; padding: 14px 20px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); font-weight: 500; transition: opacity .4s; }
.toast.fade { opacity: 0; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--black); }
.login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 36px 32px; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand { color: var(--black); padding: 0; text-align: center; font-size: 40px; }
.login-card .brand-sub { padding: 0; text-align: center; color: var(--muted); margin-top: -12px; }

/* ---------- Drag reorder (stages) ---------- */
.sortable .set-row { background: #fff; }
.drag-handle { cursor: grab; color: #888; display: flex; padding: 4px; border-radius: 6px; }
.drag-handle:hover { background: var(--subtle); color: #333; }
.set-row.dragging { opacity: .4; }
.set-row.drop-before { box-shadow: 0 -3px 0 var(--green) inset; }
.sortable.saving { opacity: .6; pointer-events: none; }

/* ---------- Auth / MFA ---------- */
.login-card.wide { max-width: 560px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-title { font-size: 22px; font-weight: 800; text-align: center; }
.auth-note { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.auth-alt { margin: 0; font-size: 14px; text-align: center; color: var(--muted); }
.otp-input { text-align: center !important; font-size: 26px !important; letter-spacing: 8px; font-weight: 700 !important; font-variant-numeric: tabular-nums; }
.mfa-steps { margin: 0; padding: 0 22px 0 0; display: flex; flex-direction: column; gap: 18px; }
.mfa-steps li { display: flex; flex-direction: column; gap: 6px; }
.mfa-steps li::marker { font-weight: 800; color: var(--green); }
.mfa-steps li > span { font-size: 14px; color: var(--muted); }
.qr-box { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; background: var(--subtle); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.qr-box img { background: #fff; border-radius: 8px; image-rendering: pixelated; }
.qr-box .manual { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.qr-box code { font-size: 16px; font-weight: 700; color: var(--text); background: #fff; border: 1px dashed var(--input); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.codes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.codes code { display: block; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 1px; background: var(--subtle); border: 1px solid var(--border); border-radius: 8px; padding: 10px; }
.side-me { display: flex; align-items: center; gap: 10px; color: #fff; }
.side-me:hover { color: var(--green-bright); }
@media print { .login-page { background: #fff; } .form-actions, .btn { display: none !important; } }
