/* NORTH admin — calm, legible, works on a phone at the reception desk. High contrast (text ≥ 7:1 on white):
   the owner found the earlier pale beige palette tiring to read. */
:root {
  --ink: #13100c; --ink-2: #2a231b; --paper: #efebe4; --surface: #ffffff; --surface-2: #e9e2d6;
  --fg: #15120e; --muted: #4f473d; --line: #d3c9b9; --line-strong: #9c8e7a;
  --gold: #d0a54f; --gold-ink: #6a4c14; --accent: #6a4c14;
  --ok: #1f6b35; --warn: #855300; --danger: #a12d12; --info: #1f528a;
  --radius: 10px; --shadow: 0 1px 2px rgba(19, 16, 12, .10), 0 10px 26px -14px rgba(19, 16, 12, .30);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--sans); color: var(--fg); background: var(--paper); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-ink); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.boot { display: grid; place-items: center; min-height: 100vh; }
.boot-word, .brand-word { font-family: var(--serif); letter-spacing: .34em; font-size: 1.4rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { height: 32px; width: auto; }
.login-screen { flex-direction: column; gap: 22px; }
.login-logo { width: 150px; height: auto; }
.brand-sub { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }

/* ---------- login ---------- */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; background: var(--ink); }
.login-card { width: min(400px, 100%); display: grid; gap: 14px; padding: 32px 28px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.login-card h1 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; margin-top: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 14px; background: var(--ink); color: #efe9df; overflow-y: auto; }
.side .brand { padding: 0 10px 8px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #f1ebe1; text-decoration: none; font-size: .92rem; font-weight: 500; }
.side-nav a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.side-nav a[aria-current] { background: rgba(208, 165, 79, .24); color: #fff; box-shadow: inset 3px 0 0 var(--gold); font-weight: 600; }
.nav-icon { width: 20px; text-align: center; color: var(--gold); }
.nav-badge { margin-inline-start: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #c9a55a; color: var(--ink); font-size: .74rem; font-weight: 700; text-align: center; }
.nav-badge[hidden] { display: none; }
.side-user { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.side-user .link { color: var(--gold); padding: 6px 0; }
.main { padding: 26px clamp(16px, 3vw, 36px) 60px; outline: none; min-width: 0; }
.view { display: grid; gap: 20px; max-width: 1400px; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--ink); color: #efe9df; }
  .topbar .icon-btn { color: #efe9df; border-color: rgba(255, 255, 255, .2); }
  .topbar-site { margin-inline-start: auto; color: var(--gold); font-size: .85rem; }
  .side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(280px, 86vw); transform: translateX(-105%); transition: transform .25s ease; }
  .nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .main { padding-top: 18px; }
  .topbar .brand { min-width: 0; }
}
@media (max-width: 420px) {
  .topbar .brand-sub, .topbar-site { display: none; }
  .boot-word, .brand-word { font-size: 1.15rem; letter-spacing: .26em; }
  .main { padding-inline: 12px; }
}

/* ---------- page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.2rem); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar > .input { width: auto; min-width: 140px; flex: 0 1 auto; }
.toolbar > input[type="search"].input { flex: 1 1 220px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 1rem; margin-bottom: 12px; }
.card h3 { font-size: .9rem; margin: 14px 0 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi dd { margin: 4px 0 0; font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi dd small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.banner { padding: 12px 16px; border-radius: var(--radius); background: #fbe8bf; border: 1px solid #d9ae55; border-inline-start: 4px solid #b9821b; color: var(--fg); }
.banner-info { background: #dde9f7; border-color: #93b4da; border-inline-start-color: var(--info); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .88rem; white-space: nowrap; }
.btn { color: var(--fg); }
.btn:hover { border-color: var(--fg); background: #f6f1e8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2f271d; border-color: #2f271d; color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger, .btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; }
.input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font: inherit; font-size: 16px; color: var(--fg); }
@media (min-width: 761px) { .input { font-size: .92rem; } }
textarea.input { min-height: 72px; resize: vertical; }
.field { display: grid; gap: 4px; min-width: 0; }
.field-label { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.field-hint { font-size: .76rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.form-error { color: var(--danger); font-size: .88rem; min-height: 1.2em; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { padding: 7px 12px; font-size: .84rem; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- tables & lists ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
tbody tr:hover { background: #f6f0e5; }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.list { display: grid; gap: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.empty { color: var(--muted); padding: 16px 0; }
.loading { display: flex; gap: 6px; padding: 30px; justify-content: center; }
.loading span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); animation: blink 1s infinite ease-in-out; }
.loading span:nth-child(2) { animation-delay: .15s; } .loading span:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.st-pending { background: #f8dc9f; color: #5c3a00; }
.st-confirmed { background: #c9dcf3; color: #143f6b; }
.st-arrived { background: #ddd0f2; color: #42276d; }
.st-progress { background: #c6e6d8; color: #164d3a; }
.st-done { background: #c8e6cc; color: #154d22; }
.st-cancelled { background: #f4cdbf; color: #7a230d; }
.st-noshow { background: #e0d8cc; color: #3d362d; }
.pay-unpaid { color: var(--danger); } .pay-paid { color: var(--ok); } .pay-partial { color: var(--warn); }

/* ---------- avatars (tier rings mirror the customer app) ---------- */
.av { --size: 36px; display: inline-grid; place-items: center; width: var(--size); height: var(--size); padding: calc(var(--size) * .06); border-radius: 50%; background: var(--line-strong); flex: none; }
.av-md { --size: 52px; } .av-lg { --size: 96px; }
.av-disc { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #e9e1d5; box-shadow: 0 0 0 2px var(--surface); }
.av-disc img, .av-disc svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.av-initials { font-family: var(--serif); font-size: calc(var(--size) * .36); color: #5b5247; }
.tier-bronze { --tier: #9A6B4A; } .tier-gold { --tier: #A8843F; } .tier-diamond { --tier: #7F97AC; }
.av.tier-bronze { background: conic-gradient(from 200deg, #7E5436, #C49A78, #8D603F, #B88866, #7E5436); }
.av.tier-gold { background: conic-gradient(from 200deg, #8F6E31, #E3C987, #B08C47, #D9BC78, #8F6E31); }
.av.tier-diamond { background: conic-gradient(from 200deg, #8EA3B6, #F3F7FA, #AFC1D0, #E2EAF1, #9AB0C3, #F7FAFC, #8EA3B6); }
.tier-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; border: 1px solid var(--tier, var(--line-strong)); color: var(--tier, var(--muted)); background: #fff; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--tier, var(--gold)); }

/* ---------- calendar ---------- */
.cal-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - 210px); }
.cal-grid { display: grid; position: relative; min-width: max-content; }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 8px 10px; font-size: .84rem; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 150px; }
.cal-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.cal-times { position: sticky; left: 0; z-index: 2; background: var(--surface); border-inline-end: 1px solid var(--line); }
.cal-time { font-size: .72rem; color: var(--muted); padding: 0 6px; text-align: end; font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-inline-end: 1px solid var(--line); min-width: 150px; }
.cal-slot { border-bottom: 1px dashed #e2d9cb; }
.cal-slot.hour { border-bottom: 1px solid var(--line); }
.cal-off { position: absolute; inset-inline: 0; background: repeating-linear-gradient(135deg, #f1ebe2, #f1ebe2 6px, #ebe3d7 6px, #ebe3d7 12px); pointer-events: none; }
.cal-leave { position: absolute; inset-inline: 2px; background: #f3e1da; border: 1px dashed #d8a796; border-radius: 6px; font-size: .74rem; color: #8b3a25; padding: 4px 6px; pointer-events: none; }
.cal-appt { position: absolute; inset-inline: 3px; border-radius: 6px; padding: 4px 6px; font-size: .76rem; line-height: 1.25; overflow: hidden; cursor: grab; border-inline-start: 4px solid var(--c, var(--gold)); background: color-mix(in srgb, var(--c, var(--gold)) 18%, #fff); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.cal-appt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt.is-cancelled { opacity: .45; text-decoration: line-through; cursor: default; }
.cal-appt.is-dragging { opacity: .6; cursor: grabbing; z-index: 5; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.cal-appt.is-new { outline: 2px solid #c9a55a; }
.cal-now { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-ghost { position: absolute; inset-inline: 3px; border: 2px dashed var(--ink); border-radius: 6px; pointer-events: none; z-index: 4; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.month-grid > div { background: var(--surface); min-height: 92px; padding: 8px; font-size: .82rem; }
.month-grid .dow { min-height: 0; background: var(--surface-2); font-weight: 600; text-align: center; font-size: .74rem; text-transform: uppercase; color: var(--muted); }
.month-grid .is-other { background: #f3eee6; color: var(--muted); }
.month-grid .is-today { box-shadow: inset 0 0 0 2px var(--gold); }
.month-grid button.day { width: 100%; text-align: start; display: grid; gap: 4px; }

/* ---------- charts ---------- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--gold); }
.chart .bar-2 { fill: var(--ink); }
.chart text { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.chart.is-narrow text { font-size: 15px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 8px; align-items: center; font-size: .86rem; padding: 4px 0; }
.hbar .track { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--gold); }

/* ---------- modal & toasts ---------- */
.modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); color: var(--fg); background: var(--surface); }
.modal-wide { width: min(920px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(22, 19, 15, .55); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: 18px; display: grid; gap: 14px; }
.toasts { position: fixed; z-index: 100; bottom: calc(16px + env(safe-area-inset-bottom)); right: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: .9rem; transition: opacity .4s, transform .4s; white-space: pre-line; }
.toast-error { background: var(--danger); }
.toast-info { background: #2c4a66; }
.toast.is-out { opacity: 0; transform: translateY(8px); }
.kv { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 8px; font-size: .84rem; }
.timeline li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .8rem; background: #fff; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; }
.slot-grid button { padding: 8px 4px; border: 1px solid var(--line-strong); border-radius: 6px; font-variant-numeric: tabular-nums; background: #fff; }
.slot-grid button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.schedule-day { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.interval { display: inline-flex; align-items: center; gap: 6px; margin: 0 8px 6px 0; }
.interval input { width: 104px; }
@media print { .side, .topbar, .toolbar { display: none !important; } .shell { display: block; } }

/* ---------- Salon OS ---------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.appbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 10px clamp(16px, 3vw, 36px); background: rgba(246, 242, 236, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.appbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.appbar-site { font-size: .85rem; color: var(--accent); white-space: nowrap; }
.gsearch { position: relative; flex: 1 1 420px; max-width: 560px; }
.gsearch .input { padding-inline-start: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236d6458' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 11px center; }
.gsearch-results { position: absolute; inset-inline: 0; top: calc(100% + 6px); z-index: 40; max-height: 60vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.gsearch-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); }
.gsearch-item:hover, .gsearch-item:focus-visible { background: #f3ecdf; }
.popover-wrap { position: relative; }
.popover { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 40; min-width: 200px; padding: 6px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.popover-wide { width: min(360px, calc(100vw - 32px)); }
.popover-title { padding: 6px 12px; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.popover-item { display: block; width: 100%; padding: 9px 14px; text-align: start; color: var(--fg); text-decoration: none; font-size: .9rem; }
.popover-item:hover { background: #f3ecdf; }
.alert-warn { border-inline-start: 3px solid var(--warn); }
.alert-info { border-inline-start: 3px solid var(--info); }
.alert-ok { border-inline-start: 3px solid var(--ok); }
.bell { position: relative; }
.bell .nav-badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; padding: 0 5px; font-size: .68rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.kpi-warn dd { color: var(--warn); }
.kpi-neg dd { color: var(--danger); }
.time-col { min-width: 3.2rem; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { padding: 9px 14px; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--ink); font-weight: 600; }
.tab-panel { display: grid; gap: 16px; min-width: 0; }
.input-sm { min-height: 32px; padding: 4px 8px; font-size: .85rem; }
.btn-lg { min-height: 50px; font-size: 1rem; }
tr.is-deleted td { color: var(--muted); text-decoration: line-through; }
tr.is-deleted td:last-child { text-decoration: none; }
.thumb { width: 48px; }
.thumb img, .thumb-ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); color: var(--gold-ink); font-family: var(--serif); }
.photo-slot { width: 100%; max-width: 280px; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); border: 1px dashed var(--line-strong); text-align: center; padding: 8px; }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.picker { position: relative; display: grid; gap: 6px; }
.picker-results .list-item { width: 100%; text-align: start; }

/* POS (adisyon) — 3 columns on desktop, 2 on tablet, stacked on phone */
.pos { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(320px, 1.35fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.pos-col { display: grid; gap: 10px; align-content: start; }
.pos-col h2 { margin-bottom: 0; }
.pos-list { display: grid; align-content: start; gap: 4px; max-height: calc(100vh - 330px); min-height: 200px; overflow-y: auto; padding-inline-end: 2px; }
.pos-group { margin-top: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pos-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; text-align: start; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: .88rem; }
.pos-item:hover:not(:disabled) { border-color: var(--ink); }
.pos-item:disabled, .pos-item.is-muted { opacity: .55; }
.pos-item small { color: var(--muted); }
.pos-item .grow { flex: 1; min-width: 0; }
.pos-item-pack { border-color: #b9d3be; background: #f2f8f3; }
.pos-customer { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: var(--surface-2); }
.pos-customer .grow { flex: 1; min-width: 0; }
.pos-lines { display: grid; }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pos-line-meta { margin-top: 4px; max-width: 200px; }
.pos-qty { display: inline-flex; align-items: center; gap: 6px; }
.pos-qty .icon-btn { width: 30px; height: 30px; }
.pos-amount { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.pos-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.pos-totals dd { margin: 0; text-align: end; }
.pos-grand { font-size: 1.25rem; font-weight: 700; padding-top: 6px; border-top: 1px solid var(--line); }
.pay-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.pay-remaining { padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.pay-remaining.is-ok { background: #c8e6cc; color: #154d22; }
.pay-remaining.is-warn { background: #f8dc9f; color: #5c3a00; }
@media (max-width: 1280px) { .pos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .pos > .pos-col:first-child { grid-column: 1 / -1; } .pos-list { max-height: 320px; } }
@media (max-width: 960px) { .appbar { position: static; } }
@media (max-width: 760px) {
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos-line { grid-template-columns: minmax(0, 1fr) auto; }
  .appbar { padding: 8px 12px; gap: 8px; }
  .appbar-site { display: none; }
  .gsearch { flex: 1 1 auto; min-width: 0; }
  .gsearch .input::placeholder { font-size: .9rem; }
}
@media print { .appbar, .no-print, .quick-actions, .tabs { display: none !important; } .pos-list { max-height: none; } }
.roles-matrix td.is-custom { background: #f8e3b4; }
.roles-matrix td:first-child { min-width: 220px; }
a.btn { text-decoration: none; color: var(--fg); }
a.btn-primary { color: #fff; }

/* ---------- kart terminali (POS) ---------- */
.pos-test { background: #fbe4d5; color: #8b3a25; letter-spacing: .04em; }
.pay-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pay-pos { display: inline-flex; gap: 6px; align-items: center; }
.pay-methods .chip:disabled { opacity: .5; cursor: not-allowed; }
.pos-pay { display: grid; gap: 14px; min-width: min(420px, 100%); }
.pos-pay-test { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #fdf1e8; color: #8b3a25; }
.pos-pay-state { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 8px 0; }
.pos-pay-state h3 { font-size: 1.2rem; }
.pos-pay-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-size: 1.6rem; font-weight: 700; background: var(--surface-2); }
.pos-pay-state.is-ok .pos-pay-icon { background: #e3efe3; color: var(--ok); }
.pos-pay-state.is-fail .pos-pay-icon { background: #f6e2dc; color: var(--danger); }
.pos-pay-state.is-warn .pos-pay-icon { background: #fbefd6; color: var(--warn); }
.pos-pay-state.is-wait .pos-pay-icon { border: 3px solid var(--line); border-top-color: var(--ink); background: transparent; animation: pos-spin 1s linear infinite; }
@keyframes pos-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pos-pay-state.is-wait .pos-pay-icon { animation: none; } }
.pos-pay-amount { display: grid; justify-items: center; gap: 2px; padding: 10px; border-radius: 8px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.pos-pay-amount b { font-size: 1.6rem; }
.pos-pay-ref { text-align: center; }
.pos-sim { border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.pos-sim summary { cursor: pointer; font-size: .82rem; color: #8b3a25; font-weight: 600; }
.pos-sim .toolbar { margin-top: 8px; flex-wrap: wrap; }
.device-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.device-grid dt { color: var(--muted); font-size: .85rem; }
.device-grid dd { margin: 0; }
@media (max-width: 640px) { .device-grid { grid-template-columns: 1fr; } .device-grid dd { margin-bottom: 6px; } }

/* ---------- iki adımlı doğrulama ---------- */
.login-card-wide { width: min(520px, 100%); }
.tf-step { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.tf-shield { color: var(--gold); }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; padding-block: 12px; }
.tf-setup { display: grid; gap: 14px; }
.tf-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: .9rem; }
.tf-qr { display: grid; justify-items: center; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tf-qr img { width: min(200px, 100%); height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.tf-qr details { width: 100%; text-align: center; }
.tf-secret { display: block; margin-top: 6px; padding: 8px; border-radius: 8px; background: var(--surface-2); font-size: .95rem; letter-spacing: .08em; word-break: break-all; user-select: all; }
.tf-recovery { display: grid; gap: 10px; }
.tf-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin: 0; padding: 14px 14px 14px 34px; border-radius: 10px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.tf-codes code { font-size: 1rem; letter-spacing: .06em; }
@media (max-width: 420px) { .login-card { padding: 24px 18px; } .tf-qr { padding: 10px; } .code-input { letter-spacing: .25em; } }

/* ---------- açık hesap · bahşiş ---------- */
.pay-remaining.is-debt { background: #fbe7dc; color: #8b3a25; }
.debt-box { display: grid; gap: 8px; padding: 10px 12px; border: 1px dashed #d8b49e; border-radius: 8px; background: #fdf6f1; }
.debt-box[hidden] { display: none; }
.debt-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.tip-list { margin: 0; padding-left: 18px; font-size: .86rem; color: var(--muted); }
.kpi-debt { cursor: pointer; }
.debt-card { display: grid; gap: 2px; text-decoration: none; color: inherit; border-left: 4px solid #a6452c; }
.debt-card strong { font-size: 1.6rem; color: #8b3a25; font-variant-numeric: tabular-nums; }

/* ---------- Salon OS as an installed app (PWA) ---------- */
.boot { gap: 14px; align-content: center; }
.boot-mark { width: 72px; height: 72px; border-radius: 16px; }
/* Fixed at the bottom (outside the page grid) while the device has no connection; data-changing requests are not sent. */
.offline-bar { position: fixed; inset: auto 0 0 0; z-index: 90; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #7a2e22; color: #fff; font-size: .9rem; line-height: 1.4; text-align: center; box-shadow: 0 -6px 18px rgba(0, 0, 0, .25); }
.offline-bar[hidden] { display: none; }
body.is-offline .main { padding-bottom: 72px; }
.install-link { display: block; margin-top: 6px; }
.install-steps { padding-inline-start: 20px; display: grid; gap: 8px; line-height: 1.5; }
/* Standalone app on iPhone: keep the last rows clear of the home indicator (the top bar already handles the notch). */
@media (display-mode: standalone) { .main { padding-bottom: max(24px, env(safe-area-inset-bottom)); } }

/* ---------- Phones and tablets (touch) ---------- */
/* Grid/flex children may shrink below their content: wide tables and the calendar scroll inside their own box,
   never the whole page sideways. */
.view > *, .grid > *, .card, .main-col { min-width: 0; }
@media (pointer: coarse) {
  /* finger-sized controls (Apple / Material guidance: ~44 px) */
  .btn, .btn-sm, .seg button, .chip, .tabs button, .icon-btn { min-height: 44px; }
  .icon-btn { min-width: 44px; }
  .input, select.input, .input-sm { min-height: 44px; }
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; }
  .chip { padding: 8px 14px; }
  .seg button { padding: 10px 14px; }
  .link, .page-head a[href^="#/"]:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
  a[href^="tel:"] { display: inline-flex; align-items: center; min-height: 44px; }
}
@media (max-width: 760px) {
  .kpi dt, th { font-size: .78rem; }
  .cal-time { font-size: .76rem; }
  .cal-wrap { max-height: calc(100dvh - 190px); }
}

/* Kampanya duyurusu (SMS / e-posta) */
.campaign-actions { flex-wrap: wrap; }
.broadcast { display: grid; gap: 12px; }
.broadcast .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.broadcast-history summary { cursor: pointer; font-weight: 600; }
.broadcast-list { margin: 8px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }

/* Güvenlik */
.security-steps { margin: 6px 0 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: .88rem; }
