/* Admin panel + master cabinet (tokens in theme.css). Same type scale, colours
   and components as the booking page, tuned for denser working screens. */

body { background: var(--bg); font-size: 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; }
.muted { color: var(--ink-2); }
.hint { font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.eyebrow { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-bottom: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.error-text { color: var(--danger); font-size: 13px; }
.error-text:empty { display: none; }

/* ---------- app bar (admin) ---------- */
.app-bar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.app-bar-inner { max-width: 1120px; margin: 0 auto; padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 20px; }
.app-title { font-weight: 600; font-size: 15px; white-space: nowrap; display: flex; align-items: baseline; gap: 8px; }
.app-title small { font-weight: 400; font-size: 13px; color: var(--ink-3); }
.app-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav button {
  border: 0; background: transparent; padding: 0 10px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; position: relative; transition: color .15s;
}
.app-nav button:hover { color: var(--ink); }
.app-nav button[aria-current="page"] { color: var(--ink); }
.app-nav button[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); }
.app-actions { display: flex; gap: 8px; align-items: center; }
/* When the sections don't fit (long company name, Spanish or Arabic labels),
   the buttons lose their labels first, then the sections get their own row. */
.app-bar.compact .app-actions .lbl { display: none; }
.app-bar.stacked .app-bar-inner { flex-wrap: wrap; height: auto; gap: 0 12px; padding-top: 8px; }
.app-bar.stacked .app-title { flex: 1; min-width: 0; }
.app-bar.stacked .app-nav { order: 3; flex-basis: 100%; height: 44px; margin: 0 -12px; padding: 0 4px; }

.page { display: none; }
.page.active { display: block; animation: fade .18s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13.5px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-desc { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.card-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.saved { font-size: 13px; color: var(--ink-3); }

/* ---------- KPI strip ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 16px; }
.kpi { padding: 16px 18px; border-inline-start: 1px solid var(--line); min-width: 0; }
.kpi:first-child { border-inline-start: 0; }
.kpi-label { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-inline-start: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; background: var(--surface); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:disabled { background: var(--brand); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn svg.i { width: 16px; height: 16px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* Toggle chips (modes, weekdays, periods, tabs in the master cabinet). */
.pill {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; user-select: none; transition: background .15s, color .15s, border-color .15s;
}
.pill:hover { color: var(--ink); border-color: var(--ink-3); }
.pill.selected { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* ---------- inputs ---------- */
input, select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 80px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
select { appearance: none; padding-inline-end: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868692' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input[type="checkbox"] { width: 16px; height: 16px; padding: 0; accent-color: var(--brand); box-shadow: none; }
input[type="color"] { width: 44px; padding: 3px; cursor: pointer; }
input[type="file"] { height: auto; border: 0; padding: 0; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
label.row { font-weight: 400; margin: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.field-row:first-child { border-top: 0; padding-top: 0; }
.field-row span { color: var(--ink); }
.field-row small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 10px 16px; align-items: center; font-size: 14px; }
.filter-row select, .filter-row input { width: auto; min-width: 150px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-inline-start: 0; }
th:last-child, td:last-child { padding-inline-end: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row-link { cursor: pointer; }
.row-link:focus-visible { outline-offset: -3px; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--ink); }
.nowrap { white-space: nowrap; }

/* ---------- status & tags ---------- */
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-inline-end: 8px; vertical-align: 1px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.urgent-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--warning); background: var(--warning-soft); border-radius: 5px; padding: 1px 6px; margin-inline-end: 6px; vertical-align: 1px; }
.prio { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-inline-start: 8px; font-variant-numeric: tabular-nums; }
.pool-chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 6px; margin: 2px 0; margin-inline-end: 4px; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; border: 1px solid transparent; }
.pool-chip:hover { border-color: currentColor; }
.pool-chip.free { background: var(--positive-soft); color: var(--positive); }
.pool-chip.partial { background: var(--warning-soft); color: var(--warning); }
.pool-chip.full { background: var(--surface-2); color: var(--ink-3); }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin-inline-start: 12px; }
.notice { background: var(--surface-2); color: var(--ink-2); border-radius: var(--r); padding: 12px 14px; font-size: 13.5px; line-height: 1.45; }

/* ---------- lists ---------- */
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; }
.list-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.stat-row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.stat-row:first-child { border-top: 0; }
.bar-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; border-radius: 3px; background: var(--brand); }
.notif { padding: 12px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; white-space: pre-line; }
.notif:first-child { border-top: 0; padding-top: 0; }
.notif .meta { color: var(--ink-3); font-size: 12px; margin-bottom: 2px; white-space: normal; }
.kv { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; }
.kv .k { color: var(--ink-3); }
.thumbs img { max-width: 140px; max-height: 110px; border-radius: var(--r-sm); margin: 4px 0 0; margin-inline-end: 6px; border: 1px solid var(--line); }
.invite-text { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; max-height: 240px; overflow: auto; }
.field-editor { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.field-editor input, .field-editor select { height: 34px; font-size: 13.5px; }
.field-editor .actions .btn { width: 30px; padding: 0; }
.mode-hint { font-size: 13px; color: var(--ink-2); margin-top: 12px; line-height: 1.5; }

/* ---------- leads ---------- */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.lead-row.is-done > div:first-child { opacity: .55; }
.lead-actions { flex-wrap: nowrap; }

/* ---------- services: list ---------- */
.services-msg { display: block; margin: -8px 0 12px; }
.services-msg:empty { display: none; }
.svc-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.svc-ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex-shrink: 0; }
.svc-ico svg.i { width: 18px; height: 18px; }
.svc-row.is-off .svc-main { opacity: .55; }
.svc-actions { flex-wrap: nowrap; }
.svc-actions .btn-ghost { width: 30px; padding: 0; font-size: 14px; }
.tag-off { height: 20px; margin-inline-start: 8px; background: var(--surface-2); color: var(--ink-3); }

/* ---------- services: editor ---------- */
.editor { max-width: 800px; }
.editor-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.editor-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.lang-tabs .pill { gap: 6px; }
.pill-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--warning-soft); color: var(--warning); font-size: 11px; font-weight: 600; }
.pill.selected .pill-count { background: rgba(255, 255, 255, .25); color: inherit; }
.preview-line { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.editor-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: 16px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); }
.editor-bar .error-text { flex-basis: 100%; }
.num-in { max-width: 120px; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-choice { width: 40px; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; transition: border-color .15s, color .15s; }
.icon-choice:hover { border-color: var(--ink-3); color: var(--ink); }
.icon-choice.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); color: var(--ink); }
.icon-choice svg.i { width: 20px; height: 20px; }
.mode-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mode-card { text-align: start; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); padding: 12px 14px; transition: border-color .15s; }
.mode-card:hover { border-color: var(--ink-3); }
.mode-card.selected { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.mode-card-title { font-weight: 600; font-size: 14px; color: var(--ink); }
.mode-card-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.q-editor { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.q-head { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.q-head select { height: 34px; font-size: 13.5px; }
.q-num { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; display: grid; place-items: center; flex-shrink: 0; }
.q-actions { margin-inline-start: auto; flex-wrap: nowrap; }
.q-actions .btn, .opt-actions .btn { width: 30px; padding: 0; font-size: 14px; }
.opt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); }
.opt-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt-actions { flex-wrap: nowrap; align-self: start; }
.opt-nums { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; grid-column: 1 / -1; }
.opt-row input, .opt-row select, .opt-nums input, .opt-nums select { height: 34px; font-size: 13.5px; }
.opt-nums .num-in { max-width: 104px; }
.mini { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.cond { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cond select { height: 34px; font-size: 13.5px; }
@media (max-width: 640px) {
  .mode-cards { grid-template-columns: minmax(0, 1fr); }
  .svc-row, .lead-row { flex-wrap: wrap; }
  .svc-actions, .lead-actions { width: 100%; }
  .svc-actions .btn:not(.btn-ghost), .lead-actions .btn { flex: 1; }
  .editor-bar { bottom: 8px; }
}

/* ---------- website button & links ---------- */
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 64px; background: var(--surface-2); }
.hint code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.link-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- WhatsApp: delivery status, conversation ---------- */
.msg-status { display: inline-block; margin-inline-start: 8px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 18px; background: var(--surface-2); color: var(--ink-3); vertical-align: 1px; }
.msg-status.st-ok { background: var(--positive-soft); color: var(--positive); }
.msg-status.st-sent { background: var(--surface-2); color: var(--ink-2); }
.msg-status.st-fail { background: var(--danger-soft); color: var(--danger); }
.msg-status.st-in { background: var(--warning-soft); color: var(--warning); }
.notif-in { background: color-mix(in srgb, var(--warning-soft) 45%, transparent); margin: 0 -20px; padding-inline-start: 20px; padding-inline-end: 20px; }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.bubble { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; white-space: pre-line; background: var(--surface-2); }
.bubble.out { align-self: flex-end; background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.bubble.in { align-self: flex-start; border: 1px solid var(--line); background: var(--surface); }
.thanks-preview { max-width: 440px; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); overflow-wrap: anywhere; }
.bubble-meta { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; white-space: normal; }
.steps-list { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.5; }
.steps-list li { margin-bottom: 4px; }
.wa-templates { font-size: 13px; }
.wa-templates td, .wa-templates th { padding: 6px 8px; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(18, 18, 22, .38); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; animation: fade .15s var(--ease); }
.modal-card { width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 24px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h3 { font-size: 17px; letter-spacing: -0.015em; }
.modal-x { width: 32px; height: 32px; border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink-3); display: grid; place-items: center; margin: -4px 0 0; margin-inline-end: -8px; }
.modal-x:hover { background: var(--surface-2); color: var(--ink); }
@media (max-width: 560px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-card { max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------- master cabinet ---------- */
.m-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 64px; }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.m-head select { width: auto; height: 32px; font-size: 13px; }
.m-hello { font-size: 22px; letter-spacing: -0.02em; margin: 2px 0 20px; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-3); border-radius: var(--r); padding: 3px; gap: 3px; margin-bottom: 16px; }
.tabs .pill { justify-content: center; border: 0; background: transparent; height: 34px; border-radius: calc(var(--r) - 3px); color: var(--ink-2); }
.tabs .pill.selected { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 18, 22, .08); }
.section-title { font-size: 13px; font-weight: 500; color: var(--ink-3); margin: 8px 0 -2px; }
.setup-card h3 { font-size: 15px; margin-bottom: 8px; }
.steps { margin: 8px 0 4px; padding-inline-start: 20px; font-size: 14px; line-height: 1.55; }
.steps li { margin-bottom: 4px; }
.oem-tips { margin-top: 12px; }
.oem-tips summary { font-size: 13.5px; cursor: pointer; color: var(--ink-2); margin-bottom: 6px; }
.offer-card { border-color: var(--line-strong); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head { font-size: 12px; color: var(--ink-3); text-align: center; padding: 2px 0 4px; }
.cal-cell { min-height: 46px; border-radius: var(--r-sm); background: transparent; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; transition: background .15s; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.empty { cursor: default; background: transparent; }
.cal-cell.today .cal-num { color: var(--brand); font-weight: 700; }
.cal-cell.selected { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.cal-num { font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.cal-dot.completed { background: var(--positive); }
.cal-dot.in_progress { background: var(--warning); }
.cal-dot.assigned { background: var(--brand); }
.legend-chip .cal-dot { margin-inline-end: 2px; }
.big-number { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.report-field.missing { outline: 2px solid var(--danger); outline-offset: 6px; border-radius: var(--r-sm); }
.checklist-item { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.checkbox { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; font-size: 12px; }
.checkbox.done { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.thumb-wrap { position: relative; display: inline-block; }
.thumb-del { position: absolute; top: 6px; inset-inline-end: 12px; width: 22px; height: 22px; border-radius: 50%; font-size: 14px; line-height: 1; background: rgba(18, 18, 22, .72); color: #fff; border: none; }
.empty-state { text-align: center; color: var(--ink-3); font-size: 13.5px; padding: 20px; }

@media (max-width: 640px) {
  .wrap { padding: 16px 16px 48px; }
  .app-bar-inner { flex-wrap: wrap; height: auto; gap: 0 12px; padding: 8px 12px 0; }
  .app-title { flex: 1; min-width: 0; }
  .app-title small { display: none; }
  .app-nav { order: 3; flex-basis: 100%; height: 44px; margin: 0 -12px; padding: 0 4px; }
  .app-actions .lbl { display: none; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .field-row { grid-template-columns: minmax(0, 1fr) 96px; }
}

/* Equipment (models the company sells) */
.eq-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.eq-thumb { width: 40px; height: 40px; flex: none; border-radius: 8px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); }
tr.muted td { color: var(--ink-3); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid > [hidden] { display: none; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.order-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 1px 6px; margin-inline-end: 6px; vertical-align: 1px; }

/* The admin panel's language switch (RU / EN) in the header. */
.lang-select { width: auto; height: 36px; padding-block: 0; padding-inline: 10px 28px; font-size: 13px; }

/* ---------- first setup (a company that signed up on the platform) ---------- */
.setup-banner { background: var(--warning-soft); border-bottom: 1px solid var(--line); }
.setup-banner-inner { max-width: 1120px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--warning); flex-wrap: wrap; }
.setup { position: fixed; inset: 0; z-index: 45; background: var(--bg); overflow-y: auto; }
.setup-top { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; z-index: 1; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.setup-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); padding-block: 4px; padding-inline: 4px 10px; border-radius: 999px; white-space: nowrap; }
.setup-steps li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.setup-steps li.done b { background: var(--positive-soft); color: var(--positive); }
.setup-steps li.now { color: var(--ink); background: var(--surface-2); }
.setup-steps li.now b { background: var(--brand); color: var(--brand-ink); }
.setup-body { max-width: 640px; margin: 0 auto; padding: 32px 20px 48px; }
.setup-body h2 { font-size: 24px; letter-spacing: -0.02em; }
.setup-lead { color: var(--ink-2); font-size: 14.5px; margin: 6px 0 20px; line-height: 1.5; }
.setup-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.setup-card-grid .wide { grid-column: 1 / -1; }
.setup-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.setup-nav .btn { height: 42px; min-width: 110px; font-size: 14.5px; }
.setup-nav .error-text { flex: 1; text-align: center; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; }
.swatch.selected { box-shadow: 0 0 0 2px var(--ink); }
.setup-svc { display: grid; grid-template-columns: auto minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.setup-svc:first-child { border-top: 0; padding-top: 0; }
.setup-svc .name { font-weight: 500; font-size: 14px; }
.setup-svc .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.setup-svc.off .name { color: var(--ink-3); }
.money-in { display: flex; align-items: center; gap: 6px; }
.setup-opt { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.money-in span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.setup-windows { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.setup-windows span { font-size: 13px; background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-variant-numeric: tabular-nums; }
.setup-master { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.setup-master:first-child { border-top: 0; padding-top: 0; }
.setup-master .link { grid-column: 1 / -1; display: flex; gap: 8px; }
.setup-master .link input { font-size: 12.5px; color: var(--ink-2); }
.setup-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px auto; gap: 8px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.setup-done-link { display: flex; gap: 8px; }
.setup-done-link input { font-weight: 500; }
.setup-list { margin: 16px 0 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
@media (max-width: 640px) {
  .setup-steps li span { display: none; }
  .setup-steps li, .setup-steps li.now { padding: 4px; }
  .setup-body { padding-top: 20px; }
  .setup-card-grid { grid-template-columns: 1fr; }
  .setup-svc { grid-template-columns: auto minmax(0, 1fr); }
  .setup-svc .money-in { grid-column: 2; }
  .setup-opt { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .setup-opt .money-in { grid-column: auto; }
  .setup-add { grid-template-columns: 1fr 1fr; }
  .setup-add .btn { grid-column: 1 / -1; }
}

/* Arabic (right to left): the select arrow on the left, an Arabic typeface;
   phone numbers and e-mail addresses stay left to right. */
[dir="rtl"] select { background-position: left 10px center; }
[dir="rtl"] body, [dir="rtl"] button, [dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select { font-family: 'IBM Plex Sans Arabic', var(--font); }
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[inputmode="tel"] { direction: ltr; text-align: right; }
