/* Shared components used by every workspace. Solid fills, thin borders, restrained shadows. */

/* Buttons */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: .86rem; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
.btn:hover { border-color: var(--c); color: var(--d); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0) scale(.98); box-shadow: none; transition-duration: .08s; }
.btn .icon { transition: transform .35s var(--ease-out); }
.btn:hover .icon { transform: translateX(2px) rotate(-6deg); }
/* A light sweep crosses filled buttons on hover. */
.btn-primary::before, .btn-cyan::before, .btn-deep::before { content: ''; position: absolute; z-index: -1; top: 0; left: -70%; width: 45%; height: 100%; background: linear-gradient(115deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-20deg); transition: left .7s var(--ease-out); pointer-events: none; }
.btn-primary:hover::before, .btn-cyan:hover::before, .btn-deep:hover::before { left: 130%; }
.btn-primary:hover, .btn-cyan:hover, .btn-deep:hover { box-shadow: 0 10px 24px -10px rgba(5, 62, 145, .65); }
.btn-ghost:hover, .btn-sm:hover { box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--p); border-color: var(--p); color: #fff; }
.btn-primary:hover { background: var(--d); border-color: var(--d); color: #fff; }
.btn-cyan { background: var(--c); border-color: var(--c); color: #fff; }
.btn-cyan:hover { background: var(--p); border-color: var(--p); color: #fff; }
.btn-deep { background: var(--d); border-color: var(--d); color: #fff; }
.btn-deep:hover { background: var(--p); border-color: var(--p); color: #fff; }
.btn-soft { background: var(--ice); border-color: var(--ice); color: var(--d); }
.btn-soft:hover { background: var(--sky); border-color: var(--sky); color: var(--ink); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--pale); border-color: transparent; color: var(--p); }
.btn-sm { height: 30px; padding: 0 10px; font-size: .8rem; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: .95rem; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; border: 0; background: transparent; color: var(--ink-2); position: relative; transition: background var(--t-fast), color var(--t-fast), transform .3s var(--ease-out); }
.icon-btn:active { transform: scale(.9); }
.icon-btn:hover { background: var(--pale); color: var(--p); }
/* Busy buttons: same size, label hidden, three bubbles fill in turn beside a short status word,
   and a thin line runs along the bottom edge. Works for .btn, .pill, .btn-google and any button. */
.is-busy:is(button, .btn, .pill, .btn-google) { pointer-events: none; position: relative; overflow: hidden; color: transparent !important; transform: none !important; box-shadow: none !important; cursor: progress; }
.is-busy:is(button, .btn, .pill, .btn-google) > :not(.btn-busy) { visibility: hidden; }
.btn-busy { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 9px; color: var(--busy-ink, currentColor); font-size: .82em; font-weight: 700; letter-spacing: .02em; white-space: nowrap; animation: fade .18s both; }
.btn-busy .bb-dots { display: inline-flex; gap: 4px; }
.btn-busy .bb-dots i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; background: transparent; animation: bubbleFill 1.05s ease-in-out infinite; }
.btn-busy .bb-dots i:nth-child(2) { animation-delay: .15s; }
.btn-busy .bb-dots i:nth-child(3) { animation-delay: .3s; }
.btn-busy .bb-label { overflow: hidden; text-overflow: ellipsis; }
.btn-busy .bb-label::after { content: '…'; }
.btn-busy.compact .bb-label { display: none; }
.btn-busy::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 38%; border-radius: 2px; background: currentColor; opacity: .55; animation: busyLine 1.3s cubic-bezier(.45, 0, .2, 1) infinite; }
@keyframes bubbleFill {
  0%, 100% { background: transparent; transform: scale(.85); opacity: .55; }
  40% { background: currentColor; transform: scale(1.12); opacity: 1; }
  70% { background: currentColor; transform: scale(1); opacity: .9; }
}
@keyframes busyLine { 0% { transform: translateX(-100%); } 100% { transform: translateX(265%); } }
@media (prefers-reduced-motion: reduce) { .btn-busy .bb-dots i { animation: breathe 1.4s ease-in-out infinite !important; animation-duration: 1.4s !important; } }
.btn.saved { animation: pop .3s var(--ease); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line-2); min-height: 46px; }
.card-head h3 { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.card-head h3 .icon { color: var(--c); }
.card-body { padding: 16px; }
.card-flush .card-body { padding: 0; }
.card-hover { transition: border-color var(--t), box-shadow var(--t); }
.card-hover:hover { border-color: var(--sky); box-shadow: var(--shadow-2); text-decoration: none; }
.panel-soft { background: var(--pale); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 14px 16px; }

/* Page head */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { display: flex; align-items: center; gap: 11px; }
.page-head .lede { color: var(--ink-3); margin-top: 3px; max-width: 80ch; font-size: .88rem; }
.page-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--ice); color: var(--p); }
.page-icon .icon { width: 19px; height: 19px; }

/* Stat tiles: compact, horizontal */
.stat { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); min-height: 76px; color: inherit; transition: transform var(--t) var(--ease-out), box-shadow var(--t), border-color var(--t); }
a.stat:hover { border-color: var(--sky); text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-2); }
a.stat:hover .stat-label .icon { transform: scale(1.15) rotate(-6deg); }
.stat-label .icon { transition: transform .35s var(--ease-out); }
.stat-label { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-label .icon { width: 15px; height: 15px; color: var(--c); }
.stat-value { font-size: 1.45rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.2; }
.stat-hint { color: var(--ink-3); font-size: .76rem; margin-top: 1px; }
.stat.tone-bad .stat-value { color: var(--bad); }
.stat.tone-ok .stat-value { color: var(--ok); }
.stat.tone-warn .stat-value { color: var(--warn); }
.stat.tone-ok, .stat.tone-bad, .stat.tone-warn { background: var(--surface); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font-size: .72rem; font-weight: 700; white-space: nowrap; background: var(--mute-bg); color: var(--mute); letter-spacing: .01em; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-mute { background: var(--mute-bg); color: var(--mute); }
.tone-brand { background: var(--p); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; font-weight: 600; color: var(--ink-2); transition: all var(--t-fast); }
button.chip:hover, .chip.active { border-color: var(--c); color: var(--d); background: var(--ice); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; flex: none; background: var(--ice); color: var(--d); font-weight: 700; font-size: .78rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; border-radius: 10px; font-size: 1.1rem; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px 14px; }
.field { grid-column: span 12; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 640px) { .span-2, .span-3, .span-4, .span-6, .span-8 { grid-column: span 12; } }
.field > label, .label { font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.field .req { color: var(--bad); }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 11px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--white); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.select[multiple] { min-height: 110px; padding: 4px; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--p); box-shadow: var(--ring); }
.input[readonly] { background: var(--pale); color: var(--ink-2); }
.invalid .input, .invalid .select, .invalid .textarea { border-color: var(--bad); background: var(--bad-bg); }
.field-error { color: var(--bad); font-size: .74rem; font-weight: 600; }
.hint { color: var(--ink-3); font-size: .74rem; }
.form-section { grid-column: span 12; display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--d); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.form-section::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 600; font-size: .86rem; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--p); flex: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; max-height: 190px; overflow-y: auto; background: var(--white); }
.checks .check { font-size: .82rem; }
.lines { display: flex; flex-direction: column; gap: 7px; }
.line-row { display: grid; gap: 8px; align-items: center; grid-template-columns: var(--cols, 1fr) 34px; }
.line-head { font-size: .7rem; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 640px) { .line-row { grid-template-columns: 1fr 34px !important; padding-bottom: 8px; border-bottom: 1px dashed var(--line); } .line-row > :not(:last-child) { grid-column: 1; } .line-row > :last-child { grid-row: 1; grid-column: 2; } .line-head { display: none; } }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 36px; }
.search-xl .input { min-height: 46px; font-size: 1rem; padding-left: 42px; border-width: 1.5px; }
.search-xl .icon { left: 14px; width: 19px; height: 19px; color: var(--p); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: var(--white); }
.seg button, .seg label { border: 0; background: none; padding: 7px 14px; font-weight: 700; font-size: .82rem; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg > * + * { border-left: 1px solid var(--line) !important; }
.seg .active, .seg input:checked + span { background: var(--p); color: #fff; }
.seg label { padding: 0; } .seg label span { padding: 7px 14px; display: inline-flex; gap: 7px; align-items: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table th { text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 9px 14px; background: var(--pale); border-bottom: 1px solid var(--line-2); white-space: nowrap; user-select: none; }
.table th[data-sort] { cursor: pointer; } .table th[data-sort]:hover { color: var(--p); }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: .86rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--pale); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: .8rem; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .select, .toolbar .input { width: auto; min-width: 140px; }
.cell-main { font-weight: 700; } .cell-sub { color: var(--ink-3); font-size: .76rem; }
@media (max-width: 760px) { .hide-sm { display: none; } }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.tab { border: 0; background: transparent; padding: 9px 14px; font-weight: 700; font-size: .84rem; color: var(--ink-3); white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--t-fast), border-color var(--t-fast); }
.tab:hover { color: var(--p); }
.tab.active { color: var(--p); border-bottom-color: var(--p); }
.tab .count { font-size: .7rem; padding: 0 6px; border-radius: 4px; background: var(--ice); color: var(--d); }

/* Empty / loading / alerts */
.empty { display: grid; justify-items: center; gap: 6px; padding: 32px 20px; text-align: center; color: var(--ink-3); }
.empty .empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--ice); color: var(--p); }
.empty .empty-icon .icon { width: 22px; height: 22px; }
.empty h3 { color: var(--ink); }
.loading { display: grid; place-items: center; padding: 40px; }
.spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--ice); border-top-color: var(--p); animation: spin .7s linear infinite; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); font-size: .85rem; font-weight: 600; border: 1px solid transparent; }
.alert.tone-info { border-color: var(--sky); }
.alert .icon { margin-top: 2px; }

/* Key/value lists and timelines */
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 6px 14px; font-size: .86rem; }
.kv dt { color: var(--ink-3); font-weight: 600; } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.timeline { position: relative; display: flex; flex-direction: column; gap: 12px; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c); }
.tl-meta { color: var(--ink-3); font-size: .76rem; font-weight: 600; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); transition: background var(--t-fast); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover { background: var(--pale); text-decoration: none; }
button.list-item { width: 100%; border-inline: 0; border-top: 0; background: none; text-align: left; }
.list-item.active { background: var(--ice); }

/* Bars (lightweight charts) */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 12px; align-items: center; font-size: .84rem; }
.bar-track { height: 8px; border-radius: 4px; background: var(--ice); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--p); min-width: 2px; transform-origin: left; animation: grow .6s var(--ease) both; }
.bar-row:nth-child(even) .bar-fill { background: var(--c); }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(6, 10, 30, .5); animation: fade .16s both; }
.modal { width: min(100%, 600px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); border: 1px solid var(--line-2); animation: pop .2s var(--ease) both; }
.modal-backdrop.closing { animation: fade .14s reverse both; }
.modal-backdrop.closing .modal { animation: pop .14s var(--ease) reverse both; }
.modal.sm { width: min(100%, 440px); } .modal.lg { width: min(100%, 880px); } .modal.xl { width: min(100%, 1120px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 1.05rem; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--line-2); background: var(--pale); border-radius: 0 0 var(--r-xl) var(--r-xl); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* Toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(400px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r); background: var(--white); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-3); font-weight: 600; font-size: .86rem; animation: toastIn .4s var(--ease-out) both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }
.toast .icon { margin-top: 2px; color: var(--p); }
.toast.bad .icon { color: var(--bad); }
.toast.ok .icon { color: var(--ok); }

/* Popover menu */
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 250px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); animation: rise .16s var(--ease) both; transform-origin: top right; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font-weight: 600; color: var(--ink-2); text-align: left; }
.menu-item:hover { background: var(--pale); color: var(--p); text-decoration: none; }

/* ── Queue tickets: compact cards in a responsive grid ─────────────────── */
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 10px; }
.tk { position: relative; display: grid; grid-template-columns: 78px minmax(0, 1fr); background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--t-fast), box-shadow var(--t-fast); animation: rise .22s var(--ease) both; }
.tk:hover { border-color: var(--sky); box-shadow: var(--shadow-2); }
.tk-num { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 8px 4px; background: var(--p); color: #fff; position: relative; }
.tk-num::after { content: ''; position: absolute; right: -1px; top: 6px; bottom: 6px; border-right: 2px dashed #fff; opacity: .55; }
.tk-num small { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.tk-num b { font-size: 1.12rem; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; line-height: 1.1; text-align: center; }
.tk-body { padding: 8px 10px 8px 12px; display: grid; gap: 1px; min-width: 0; }
.tk-name { font-weight: 700; font-size: .86rem; display: flex; align-items: center; gap: 6px; min-width: 0; }
.tk-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-meta { font-size: .74rem; color: var(--ink-3); display: flex; gap: 4px 10px; flex-wrap: wrap; }
.tk-meta .icon { width: 12px; height: 12px; }
.tk-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.tk-foot { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tk-foot .icon-btn { width: 26px; height: 26px; }
.tk-foot .icon-btn .icon { width: 14px; height: 14px; }
.tk.s-called .tk-num, .tk.s-serving .tk-num { background: var(--d); }
.tk.s-served .tk-num { background: var(--sky); color: var(--ink); }
.tk.s-served .tk-num::after { border-color: var(--ink); opacity: .3; }
.tk.s-skipped .tk-num, .tk.s-cancelled .tk-num { background: var(--mute-bg); color: var(--mute); }
.tk.priority { border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.tk.priority .tk-num { background: var(--bad); }
.tk-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.tk-filters .select, .tk-filters .input { width: auto; min-width: 150px; }

/* Ticket preview (wide, horizontal) */
.tk-preview { display: grid; grid-template-columns: 150px minmax(0, 1fr) 112px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--white); animation: pop .25s var(--ease) both; }
.tk-preview .tk-num { padding: 14px 8px; }
.tk-preview .tk-num b { font-size: 1.9rem; }
.tk-preview .tk-num small { font-size: .66rem; }
.tk-preview .kvs { padding: 12px 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; align-content: center; }
.tk-preview .kvs div { min-width: 0; } .tk-preview .kvs span { display: block; font-size: .66rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.tk-preview .kvs b { font-size: .88rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-preview .qr { padding: 10px; display: grid; place-items: center; border-left: 1px dashed var(--line); background: var(--pale); }
.tk-preview .qr svg { width: 92px; height: 92px; }
@media (max-width: 620px) { .tk-preview { grid-template-columns: 1fr; } .tk-preview .qr { border-left: 0; border-top: 1px dashed var(--line); } .tk-preview .tk-num::after { display: none; } }

/* ── Onboarding (reception) ─────────────────────────────────────────────── */
.steps-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 14px; }
.steps-bar div { display: flex; align-items: center; gap: 9px; padding: 10px 14px; font-weight: 700; font-size: .82rem; color: var(--ink-3); border-right: 1px solid var(--line-2); transition: background var(--t), color var(--t); }
.steps-bar div:last-child { border-right: 0; }
.steps-bar i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--sky); font-style: normal; font-size: .72rem; flex: none; }
.steps-bar .on { background: var(--ice); color: var(--d); } .steps-bar .on i { background: var(--p); border-color: var(--p); color: #fff; }
.steps-bar .done { color: var(--d); } .steps-bar .done i { background: var(--sky); border-color: var(--sky); color: var(--d); }
@media (max-width: 760px) { .steps-bar { grid-template-columns: repeat(2, 1fr); } .steps-bar div { border-bottom: 1px solid var(--line-2); } }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--white); width: 100%; text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
.pick:hover { border-color: var(--c); background: var(--pale); }
.pick.selected { border-color: var(--p); background: var(--ice); }
.pick-list { display: grid; gap: 6px; }
.selected-patient { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r); background: var(--ice); border: 1px solid var(--sky); }

/* ── Organisation ───────────────────────────────────────────────────────── */
.dept-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease-out); }
.dept-card:hover { box-shadow: var(--shadow-2); border-color: var(--sky); transform: translateY(-3px); }
.dept-card .counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.dept-card .counts div { background: var(--pale); padding: 6px 4px; text-align: center; }
.dept-card .counts b { display: block; font-size: 1rem; } .dept-card .counts span { font-size: .64rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.org-group { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.org-group h5 { margin: 0; padding: 7px 12px; background: var(--pale); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--d); display: flex; justify-content: space-between; }
.org-person { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--line-2); font-size: .84rem; }
.org-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--p); color: #fff; border-radius: var(--r); }
.org-head .avatar { background: #fff; color: var(--p); }
.profile-head { display: flex; gap: 16px; align-items: center; padding: 16px; background: var(--white); border: 1px solid var(--line-2); border-radius: var(--r-lg); }

/* Saved feedback */
.saved-flash { animation: savedFlash 1s var(--ease); }
@keyframes savedFlash { 0% { box-shadow: 0 0 0 0 rgba(5, 62, 145, .45); } 100% { box-shadow: 0 0 0 12px rgba(5, 62, 145, 0); } }

/* Password field with show / hide */
.pw-wrap { position: relative; display: flex; }
.pw-wrap .input { width: 100%; padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); transition: color var(--t-fast), background var(--t-fast); }
.pw-eye:hover { color: var(--p); background: var(--pale); }
.pw-eye[aria-pressed="true"] { color: var(--p); }
.pw-eye .icon { width: 18px; height: 18px; }

/* Continue with Google */
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); font-weight: 700; font-size: .92rem; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t) var(--ease-out); }
.btn-google:hover { border-color: var(--c); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn-google svg { width: 20px; height: 20px; flex: none; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; color: var(--ink-3); font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.pw-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; margin-top: 6px; font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.pw-rules span::before { content: '○ '; }
.pw-rules span.ok { color: var(--ok); }
.pw-rules span.ok::before { content: '● '; }
