/* ==========================================================================
   Health 360 ERP — new design (v2) component styles
   Ant Design structure and density, recoloured from the logo:
   slate-blue #2C5C7C (brand-700) + cyan #0CC0E8 (accent-500).

   Every component selector is scoped under `.ui` (set on <body>) so it wins
   over Tailwind's preflight, which the CDN injects after this file. Tailwind
   utilities (loaded from the same theme) handle layout; these classes handle
   the look of each component. See templates/v2/README.md.
   ========================================================================== */

:root {
  --brand-50: #F2F7FA; --brand-100: #E2EDF3; --brand-200: #C3DBE7; --brand-300: #97BFD3;
  --brand-400: #659EBA; --brand-500: #4380A0; --brand-600: #356887; --brand-700: #2C5C7C;
  --brand-800: #244B66; --brand-900: #1E3E54; --brand-950: #132836;
  --accent-50: #EAFAFF; --accent-100: #D0F4FD; --accent-200: #A6EBFB; --accent-300: #6CDEF8;
  --accent-400: #2ECDF1; --accent-500: #0CC0E8; --accent-600: #04A5CE; --accent-700: #0A7A9C;
  --accent-800: #10627E; --accent-900: #12516A;
  --ink-0: #FFFFFF; --ink-50: #F7F9FA; --ink-100: #F0F3F5; --ink-200: #E7ECF0; --ink-300: #D3DBE1;
  --ink-400: #A8B4BD; --ink-500: #7F8E99; --ink-600: #5A6B75; --ink-700: #3E4E58; --ink-800: #28353D;
  --ink-900: #16232B;

  --success: #389E0D; --success-bg: #F6FFED; --success-line: #B7EB8F;
  --warning: #D48806; --warning-bg: #FFFBE6; --warning-line: #FFE58F;
  --danger: #CF1322;  --danger-bg: #FFF1F0;  --danger-line: #FFCCC7;
  --info: #0A7A9C;    --info-bg: #EAFAFF;    --info-line: #A6EBFB;
  --processing: #531DAB; --processing-bg: #F9F0FF; --processing-line: #D3ADF7;
  --attention: #D46B08;  --attention-bg: #FFF7E6;  --attention-line: #FFD591;
  --neutral: #5A6B75; --neutral-bg: #F7F9FA; --neutral-line: #D3DBE1;
  --brandtone: #2C5C7C; --brandtone-bg: #F2F7FA; --brandtone-line: #C3DBE7;

  --page-bg: #F5F7F9;
  --sider-bg: #14303F;
  --sider-w: 224px;
  --sider-w-collapsed: 56px;
  --topbar-h: 52px;
  --radius: 6px;
  --shadow-overlay: 0 6px 16px rgba(22, 35, 43, .12);
  --shadow-popover: 0 2px 8px rgba(22, 35, 43, .10);
  --focus-ring: 0 0 0 2px rgba(44, 92, 124, .18);
  --font: "IBM Plex Sans", "Noto Kufi Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Kufi Arabic", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- base ---------- */
html.ui-root { background: var(--page-bg); }
body.ui {
  margin: 0; min-height: 100vh; background: var(--page-bg); color: var(--ink-900);
  font-family: var(--font); font-size: 13px; line-height: 20px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.ui a { color: var(--accent-700); text-decoration: none; }
.ui a:hover { color: #0C9CC4; }
.ui a.link-plain, .ui a.link-plain:hover { color: inherit; }
.ui ::selection { background: var(--accent-100); }
.ui :focus-visible { outline: 2px solid var(--accent-600); outline-offset: 1px; }
.ui ::-webkit-scrollbar { width: 8px; height: 8px; }
.ui ::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 8px; }
.ui ::-webkit-scrollbar-track { background: transparent; }
:where(.ui) [x-cloak] { display: none !important; }
.ui .tnum { font-variant-numeric: tabular-nums; }
.ui .mono { font-family: var(--font-mono); }
.ui .muted { color: var(--ink-600); }
.ui .meta { font-size: 11px; line-height: 16px; color: var(--ink-500); }
.ui .text-ok { color: var(--success); } .ui .text-bad { color: var(--danger); }
.ui .text-warn { color: var(--warning); } .ui .text-busy { color: var(--processing); }
.ui .text-attn { color: var(--attention); } .ui .text-info { color: var(--info); }
/* Arabic data in the English UI: dir="auto" on the text-only element. Short
   Arabic labels inside LTR cards stay left-aligned; paragraphs align right. */
.ui .ar-inline[dir="auto"] { text-align: left; unicode-bidi: plaintext; }
.ui .ar-block[dir="auto"] { unicode-bidi: plaintext; text-align: start; }

/* ---------- app shell ---------- */
.ui .sider { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sider-w); flex-direction: column; background: var(--sider-bg); border-right: 1px solid var(--sider-bg); transition: width .18s ease; } :where(.ui) .sider { display: flex; }
.ui .sider-head { align-items: center; gap: 9px; height: var(--topbar-h); padding: 0 14px; flex: 0 0 auto; border-bottom: 1px solid rgba(255, 255, 255, .08); } :where(.ui) .sider-head { display: flex; }
.ui .sider-mark { align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 6px; background: rgba(12, 192, 232, .14); } :where(.ui) .sider-mark { display: inline-flex; }
.ui .sider-mark img { width: 20px; height: 20px; object-fit: contain; }
.ui .sider-word { min-width: 0; line-height: 1.2; }
.ui .sider-word b { font-size: 13px; font-weight: 600; color: #fff; letter-spacing: -0.01em; } :where(.ui) .sider-word b { display: block; }
.ui .sider-word span { font-size: 9.5px; color: rgba(255, 255, 255, .5); letter-spacing: .04em; } :where(.ui) .sider-word span { display: block; }
.ui .sider-nav { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
.ui .sider-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); }
.ui .nav-group { margin-bottom: 6px; }
.ui .nav-group-label { padding: 8px 16px 4px; font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .35); white-space: nowrap; }
.ui .nav-item { align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 14px 0 16px; border: 0; border-left: 2px solid transparent; background: transparent; color: rgba(255, 255, 255, .72); font-size: 12.5px; text-align: left; white-space: nowrap; transition: background .12s, color .12s; } :where(.ui) .nav-item { display: flex; }
.ui a.nav-item, .ui a.nav-item:hover { color: rgba(255, 255, 255, .72); }
.ui .nav-item:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.ui .nav-item i { width: 18px; flex: 0 0 auto; font-size: 12.5px; text-align: center; color: rgba(255, 255, 255, .55); }
.ui .nav-item .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ui .nav-item.is-active, .ui a.nav-item.is-active { background: rgba(12, 192, 232, .12); border-left-color: var(--accent-500); color: #fff; font-weight: 500; }
.ui .nav-item.is-active i { color: var(--accent-500); }
.ui .nav-badge { padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; font-variant-numeric: tabular-nums; }
.ui .sider-foot { align-items: center; gap: 10px; flex: 0 0 auto; height: 38px; padding: 0 16px; border: 0; border-top: 1px solid rgba(255, 255, 255, .08); background: transparent; color: rgba(255, 255, 255, .55); font-size: 12px; cursor: pointer; } :where(.ui) .sider-foot { display: flex; }
.ui .sider-foot:hover { color: #fff; }

.ui .shell-main { min-height: 100vh; flex-direction: column; padding-left: var(--sider-w); transition: padding-left .18s ease; } :where(.ui) .shell-main { display: flex; }
.ui.sider-collapsed .sider { width: var(--sider-w-collapsed); }
.ui.sider-collapsed .shell-main { padding-left: var(--sider-w-collapsed); }
:where(.ui).sider-collapsed .sider .nav-label, :where(.ui).sider-collapsed .sider .nav-group-label, :where(.ui).sider-collapsed .sider .sider-word, :where(.ui).sider-collapsed .sider .sider-foot span { display: none; }
.ui.sider-collapsed .sider .nav-item { padding: 0 0 0 17px; }
.ui.sider-collapsed .sider .nav-badge { position: absolute; left: 32px; margin-top: -14px; font-size: 9px; padding: 0 4px; }
.ui.sider-collapsed .sider .nav-item { position: relative; }
.ui.sider-collapsed .sider .sider-head { padding: 0 15px; }

.ui .topbar { position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 16px; background: #fff; border-bottom: 1px solid var(--ink-200); } :where(.ui) .topbar { display: flex; }
.ui .crumbs { align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: var(--ink-500); white-space: nowrap; } :where(.ui) .crumbs { display: flex; }
.ui .crumbs a { color: var(--ink-500); }
.ui .crumbs a:hover { color: var(--brand-700); }
.ui .crumbs .sep { color: var(--ink-300); }
.ui .crumbs .current { color: var(--ink-900); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.ui .topbar-search { align-items: center; gap: 7px; width: 300px; height: 30px; margin-left: 12px; padding: 0 10px; border: 1px solid var(--ink-200); border-radius: 6px; background: var(--ink-50); color: var(--ink-400); font-size: 12px; cursor: text; } :where(.ui) .topbar-search { display: flex; }
.ui .topbar-search:hover { border-color: var(--ink-300); }
.ui .kbd { margin-left: auto; padding: 1px 4px; border: 1px solid var(--ink-200); border-radius: 3px; background: #fff; font-size: 9.5px; color: var(--ink-500); font-family: var(--font); }
.ui .topbar-btn { position: relative; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--ink-200); border-radius: 6px; background: #fff; color: var(--ink-600); cursor: pointer; } :where(.ui) .topbar-btn { display: inline-flex; }
.ui .topbar-btn:hover { border-color: var(--brand-700); color: var(--brand-700); }
.ui .bell-badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 9.5px; line-height: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.ui .user-chip { align-items: center; gap: 7px; height: 30px; padding: 0 8px 0 4px; border: 1px solid var(--ink-200); border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; color: var(--ink-900); } :where(.ui) .user-chip { display: flex; }
.ui .user-chip:hover { border-color: var(--ink-300); }
.ui .page-scroll { flex: 1; min-width: 0; }

.ui .drawer-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(22, 35, 43, .45); }
.ui .mobile-drawer { position: fixed; inset: 0 auto 0 0; z-index: 61; width: 290px; max-width: 86vw; flex-direction: column; background: var(--sider-bg); transition: transform .18s ease; } :where(.ui) .mobile-drawer { display: flex; }
.ui .mobile-drawer .nav-item { height: 44px; font-size: 13px; }
.ui .bottom-tabs { position: fixed; inset: auto 0 0 0; z-index: 35; height: 58px; padding-bottom: env(safe-area-inset-bottom, 0); background: #fff; border-top: 1px solid var(--ink-200); } :where(.ui) .bottom-tabs { display: flex; }
.ui .bottom-tab { flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-top: 2px solid transparent; color: var(--ink-500); font-size: 9.5px; } :where(.ui) .bottom-tab { display: flex; }
.ui a.bottom-tab:hover { color: var(--brand-700); }
.ui .bottom-tab i { font-size: 15px; }
.ui .bottom-tab.is-active { color: var(--brand-700); font-weight: 600; border-top-color: var(--brand-700); }

@media (max-width: 1023px) {
  :where(.ui) .sider { display: none; }
  .ui .shell-main, .ui.sider-collapsed .shell-main { padding-left: 0; }
  .ui .topbar { padding: 0 12px; gap: 10px; height: 50px; }
}
@media (max-width: 767px) {
  .ui.has-bottom-tabs .page-scroll { padding-bottom: 64px; }
}

/* ---------- page scaffolding ---------- */
.ui .page { padding: 18px 20px 40px; }
.ui .page-narrow { max-width: 980px; }
.ui .page-form { max-width: 1040px; }
.ui .page-head { flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; } :where(.ui) .page-head { display: flex; }
.ui .page-head > .grow { flex: 1 1 260px; min-width: 0; }
.ui .page-title { margin: 0 0 2px; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-900); }
.ui .page-sub { margin: 0; font-size: 12px; line-height: 18px; color: var(--ink-600); }
.ui .page-actions { flex-wrap: wrap; align-items: center; gap: 8px; } :where(.ui) .page-actions { display: flex; }
.ui .back-link { align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; color: var(--accent-700); } :where(.ui) .back-link { display: inline-flex; }
.ui .back-link i { font-size: 10px; }
.ui .section-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.ui .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.ui .tz-note { font-size: 11px; color: var(--ink-500); }
.ui .divider { height: 1px; background: var(--ink-100); border: 0; margin: 12px 0; }
@media (max-width: 767px) { .ui .page { padding: 12px 12px 32px; } .ui .page-title { font-size: 18px; } }

/* ---------- buttons ---------- */
.ui .btn { align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--ink-300); border-radius: 6px; background: #fff; color: var(--ink-700); font-size: 13px; font-weight: 400; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; user-select: none; transition: background .12s, border-color .12s, color .12s; } :where(.ui) .btn { display: inline-flex; }
.ui .btn i { font-size: 11px; }
.ui a.btn { color: var(--ink-700); }
.ui .btn:hover, .ui a.btn:hover { border-color: var(--brand-700); color: var(--brand-700); }
.ui .btn-primary, .ui a.btn-primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; font-weight: 500; }
.ui .btn-primary:hover, .ui a.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.ui .btn-dashed { border-style: dashed; }
.ui .btn-text, .ui a.btn-text { border-color: transparent; background: transparent; color: var(--accent-700); padding: 0 10px; }
.ui .btn-text:hover, .ui a.btn-text:hover { background: var(--accent-50); border-color: transparent; color: var(--accent-700); }
.ui .btn-ghost, .ui a.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-600); }
.ui .btn-ghost:hover, .ui a.btn-ghost:hover { background: var(--ink-100); border-color: transparent; color: var(--ink-900); }
.ui .btn-danger, .ui a.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.ui .btn-danger:hover, .ui a.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.ui .btn-danger-solid, .ui a.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 500; }
.ui .btn-danger-solid:hover { background: #A8071A; border-color: #A8071A; color: #fff; }
.ui .btn-success, .ui a.btn-success { background: var(--success); border-color: var(--success); color: #fff; font-weight: 500; }
.ui .btn-success:hover { background: #237804; border-color: #237804; color: #fff; }
.ui .btn-outline-brand, .ui a.btn-outline-brand { border-color: var(--brand-700); color: var(--brand-700); background: #fff; }
.ui .btn-outline-brand:hover { background: var(--brand-50); }
.ui .btn-whatsapp, .ui a.btn-whatsapp { border-color: #25D366; color: #128C7E; background: #fff; }
.ui .btn-whatsapp:hover, .ui a.btn-whatsapp:hover { background: #F0FFF5; border-color: #25D366; color: #128C7E; }
.ui .btn-icon { width: 32px; padding: 0; }
.ui .btn-sm { height: 24px; padding: 0 8px; font-size: 11px; border-radius: 4px; gap: 5px; }
.ui .btn-sm i { font-size: 10px; }
.ui .btn-sm.btn-icon { width: 24px; padding: 0; }
.ui .btn-md { height: 28px; padding: 0 12px; font-size: 12px; }
.ui .btn-md.btn-icon { width: 28px; padding: 0; }
.ui .btn-lg { height: 36px; padding: 0 16px; font-size: 13px; }
.ui .btn-block { width: 100%; } :where(.ui) .btn-block { display: flex; }
.ui .btn[disabled], .ui .btn.is-disabled, .ui .btn[aria-disabled="true"] { background: var(--ink-50) !important; border-color: var(--ink-200) !important; color: var(--ink-400) !important; cursor: not-allowed; }
.ui .btn.is-loading { opacity: .75; cursor: progress; pointer-events: none; }
:where(.ui) .btn-group { display: inline-flex; }
.ui .btn-group > .btn { border-radius: 0; margin-left: -1px; }
.ui .btn-group > .btn:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.ui .btn-group > .btn:last-child { border-radius: 0 6px 6px 0; }
.ui .btn-group > .btn.is-active { background: var(--brand-50); border-color: var(--brand-700); color: var(--brand-700); z-index: 1; font-weight: 500; }
@media (max-width: 767px) { .ui .btn-touch { height: 38px; } }

/* ---------- forms ---------- */
.ui .field { font-size: 12px; min-width: 0; } :where(.ui) .field { display: block; }
.ui .field-label { margin-bottom: 4px; color: var(--ink-700); font-size: 12px; line-height: 18px; } :where(.ui) .field-label { display: block; }
.ui .req { color: var(--danger); margin-right: 2px; }
.ui .field-help { margin-top: 3px; font-size: 11px; line-height: 16px; color: var(--ink-500); } :where(.ui) .field-help { display: block; }
.ui .field-error { margin-top: 3px; font-size: 11px; line-height: 16px; color: var(--danger); } :where(.ui) .field-error { display: block; }
.ui .field-error::before { content: "\f06a"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-right: 4px; }
.ui .input, .ui .select, .ui .textarea { height: 32px; padding: 0 10px; border: 1px solid var(--ink-300); border-radius: 6px; background: #fff; color: var(--ink-900); font-size: 13px; line-height: 20px; font-family: inherit; transition: border-color .12s, box-shadow .12s; appearance: none; -webkit-appearance: none; } :where(.ui) .input, :where(.ui) .select, :where(.ui) .textarea { display: block; width: 100%; }
.ui .input::placeholder, .ui .textarea::placeholder { color: var(--ink-400); }
.ui .input:hover, .ui .select:hover, .ui .textarea:hover { border-color: var(--brand-400); }
.ui .input:focus, .ui .select:focus, .ui .textarea:focus { outline: none; border-color: var(--brand-700); box-shadow: var(--focus-ring); }
.ui .textarea { height: auto; min-height: 64px; padding: 6px 10px; resize: vertical; }
.ui .select { padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23A8B4BD' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 10px 6px; cursor: pointer; }
.ui .select[multiple] { height: auto; min-height: 96px; padding: 4px; background-image: none; }
.ui .input-sm, .ui .select-sm { height: 28px; font-size: 12px; }
.ui .input-lg { height: 34px; }
.ui .input[readonly], .ui .input:disabled, .ui .select:disabled, .ui .textarea:disabled, .ui .textarea[readonly] { background: var(--ink-50); color: var(--ink-600); cursor: not-allowed; }
.ui .is-invalid, .ui .input.is-invalid, .ui .select.is-invalid, .ui .textarea.is-invalid { border-color: var(--danger); }
.ui .is-invalid:focus { box-shadow: 0 0 0 2px rgba(207, 19, 34, .12); }
.ui .input[type="date"], .ui .input[type="datetime-local"], .ui .input[type="month"], .ui .input[type="time"] { font-variant-numeric: tabular-nums; }
.ui .input[type="file"] { height: auto; padding: 5px 6px; font-size: 12px; }
.ui .input-group { height: 32px; border: 1px solid var(--ink-300); border-radius: 6px; overflow: hidden; background: #fff; } :where(.ui) .input-group { display: flex; }
.ui .input-group:focus-within { border-color: var(--brand-700); box-shadow: var(--focus-ring); }
.ui .input-group .input, .ui .input-group .select { height: 30px; border: 0; border-radius: 0; box-shadow: none; flex: 1; min-width: 0; }
.ui .input-group .addon { align-items: center; padding: 0 8px; background: var(--ink-50); color: var(--ink-600); font-size: 12px; white-space: nowrap; } :where(.ui) .input-group .addon { display: flex; }
.ui .input-group .addon:first-child { border-right: 1px solid var(--ink-200); }
.ui .input-group .addon:last-child { border-left: 1px solid var(--ink-200); }
.ui .input-group .addon-btn { border: 0; background: transparent; padding: 0 10px; color: var(--ink-500); cursor: pointer; }
.ui .input-search { position: relative; }
.ui .input-search > i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ink-400); pointer-events: none; }
.ui .input-search > .input { padding-left: 28px; }
.ui .money-input { text-align: right; font-variant-numeric: tabular-nums; }
.ui .check { align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-800); cursor: pointer; } :where(.ui) .check { display: inline-flex; }
.ui .check input[type="checkbox"], .ui .check input[type="radio"],
.ui input.checkbox, .ui input.radio { width: 15px; height: 15px; margin: 0; accent-color: var(--brand-700); cursor: pointer; flex: 0 0 auto; }
.ui .switch { position: relative; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; } :where(.ui) .switch { display: inline-flex; }
.ui .switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ui .switch .track { width: 30px; height: 17px; padding: 2px; border-radius: 99px; background: var(--ink-300); transition: background .12s; flex: 0 0 auto; } :where(.ui) .switch .track { display: inline-flex; }
.ui .switch .track::after { content: ""; width: 13px; height: 13px; border-radius: 99px; background: #fff; transition: transform .12s; }
.ui .switch input:checked + .track { background: var(--brand-700); }
.ui .switch input:checked + .track::after { transform: translateX(13px); }
.ui .switch input:focus-visible + .track { box-shadow: var(--focus-ring); }
.ui .choice { padding: 8px 10px; border: 1px solid var(--ink-300); border-radius: 6px; background: #fff; cursor: pointer; transition: border-color .12s, background .12s; } :where(.ui) .choice { display: block; }
.ui .choice:hover { border-color: var(--brand-400); }
.ui .choice.is-active, .ui .choice:has(input:checked) { border-color: var(--brand-700); background: var(--brand-50); }
.ui .choice-title { font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.ui .choice-desc { font-size: 11px; line-height: 16px; color: var(--ink-600); }
.ui .choice input[type="radio"], .ui .choice input[type="checkbox"] { accent-color: var(--brand-700); }
.ui .choice.tone-danger-active:has(input:checked) { border-color: var(--danger-line); background: var(--danger-bg); }
.ui .dropzone { padding: 14px; border: 1px dashed var(--ink-300); border-radius: 6px; text-align: center; color: var(--ink-600); background: #fff; cursor: pointer; transition: border-color .12s, background .12s; }
.ui .dropzone:hover, .ui .dropzone.is-over { border-color: var(--brand-700); background: var(--brand-50); }
.ui .dropzone i { font-size: 18px; color: var(--ink-400); }
.ui .form-card { background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; }
.ui .form-section { padding: 16px; border-bottom: 1px solid var(--ink-100); }
.ui .form-section:last-of-type { border-bottom: 0; }
.ui .form-section-title { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.ui .form-section-sub { margin: -8px 0 12px; font-size: 11.5px; color: var(--ink-500); }
.ui .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; } :where(.ui) .form-grid { display: grid; }
.ui .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; } :where(.ui) .form-grid-3 { display: grid; }
.ui .form-grid .span-2, .ui .form-grid-3 .span-2 { grid-column: span 2; }
.ui .form-grid .span-all, .ui .form-grid-3 .span-all { grid-column: 1 / -1; }
@media (max-width: 767px) { .ui .form-grid, .ui .form-grid-3 { grid-template-columns: minmax(0, 1fr); } .ui .form-grid .span-2, .ui .form-grid-3 .span-2 { grid-column: auto; } }
.ui .form-foot { position: sticky; bottom: 0; z-index: 5; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--ink-200); background: var(--ink-50); border-radius: 0 0 6px 6px; } :where(.ui) .form-foot { display: flex; }

/* ---------- tags, chips, pills ---------- */
.ui .tag { align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--neutral-line); border-radius: 2px; background: var(--neutral-bg); color: var(--neutral); font-size: 11px; line-height: 16px; font-weight: 400; white-space: nowrap; vertical-align: middle; } :where(.ui) .tag { display: inline-flex; }
.ui .tag-sm { padding: 0 5px; font-size: 10.5px; }
.ui .tag i { font-size: 9px; }
.ui .tone-success { color: var(--success); background: var(--success-bg); border-color: var(--success-line); }
.ui .tone-warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-line); }
.ui .tone-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-line); }
.ui .tone-info { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.ui .tone-processing { color: var(--processing); background: var(--processing-bg); border-color: var(--processing-line); }
.ui .tone-attention { color: var(--attention); background: var(--attention-bg); border-color: var(--attention-line); }
.ui .tone-neutral { color: var(--neutral); background: var(--neutral-bg); border-color: var(--neutral-line); }
.ui .tone-brand { color: var(--brandtone); background: var(--brandtone-bg); border-color: var(--brandtone-line); }
.ui .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--ink-400); flex: 0 0 auto; } :where(.ui) .dot { display: inline-block; }
.ui .dot.tone-success { background: var(--success); } .ui .dot.tone-warning { background: var(--warning); }
.ui .dot.tone-danger { background: var(--danger); } .ui .dot.tone-info { background: var(--accent-500); }
.ui .dot.tone-processing { background: var(--processing); } .ui .dot.tone-attention { background: var(--attention); }
.ui .dot.tone-neutral { background: var(--ink-400); } .ui .dot.tone-brand { background: var(--brand-700); }
.ui .dot-unread { width: 6px; height: 6px; border-radius: 99px; background: var(--accent-500); flex: 0 0 auto; }
.ui .chip { align-items: center; gap: 6px; padding: 2px 6px 2px 8px; border: 1px solid var(--brand-200); border-radius: 4px; background: var(--brand-50); color: var(--brand-700); font-size: 11px; line-height: 16px; white-space: nowrap; } :where(.ui) .chip { display: inline-flex; }
.ui a.chip:hover { color: var(--brand-900); border-color: var(--brand-400); }
.ui .chip i { font-size: 9px; }
.ui .pill { align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 1px solid var(--ink-300); border-radius: 99px; background: #fff; color: var(--ink-700); font-size: 12px; white-space: nowrap; cursor: pointer; } :where(.ui) .pill { display: inline-flex; }
.ui a.pill { color: var(--ink-700); }
.ui .pill:hover { border-color: var(--brand-700); color: var(--brand-700); }
.ui .pill.is-active, .ui a.pill.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.ui .pill .count { padding: 0 5px; border-radius: 99px; background: var(--ink-100); color: var(--ink-500); font-size: 10px; line-height: 16px; font-variant-numeric: tabular-nums; }
.ui .pill.is-active .count { background: rgba(255, 255, 255, .2); color: #fff; }
.ui .count-badge { padding: 0 5px; border-radius: 99px; background: var(--ink-100); color: var(--ink-500); font-size: 10px; line-height: 16px; font-variant-numeric: tabular-nums; } :where(.ui) .count-badge { display: inline-block; }
.ui .status-pill { align-items: center; height: 28px; padding: 0 11px; border: 1px solid currentColor; border-radius: 99px; background: #fff; font-size: 12px; cursor: pointer; } :where(.ui) .status-pill { display: inline-flex; }
.ui .status-pill.is-active { font-weight: 600; }

/* ---------- cards, stats, key/value ---------- */
.ui .card { background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; min-width: 0; }
.ui .card-head { align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ink-100); } :where(.ui) .card-head { display: flex; }
.ui .card-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-900); align-items: center; gap: 8px; min-width: 0; } :where(.ui) .card-title { display: flex; }
.ui .card-title i { font-size: 12px; color: var(--ink-500); }
.ui .card-body { padding: 14px; }
.ui .card-body-tight { padding: 10px 14px; }
.ui .card-foot { padding: 9px 14px; border-top: 1px solid var(--ink-100); font-size: 12px; }
.ui .card-list > * + * { border-top: 1px solid var(--ink-100); }
.ui .card-row { align-items: center; gap: 10px; padding: 9px 14px; } :where(.ui) .card-row { display: flex; }
.ui a.card-row { color: inherit; }
.ui a.card-row:hover { background: var(--ink-50); color: inherit; }
/* A row that opens a dialog (e.g. the Zoho booking queue). */
.ui .card-row.row-open { cursor: pointer; }
.ui .card-row.row-open:hover { background: var(--ink-50); }
.ui .stat { position: relative; padding: 10px 12px; background: #fff; border: 1px solid var(--ink-200); border-top: 2px solid var(--ink-300); border-radius: 6px; min-width: 0; color: inherit; } :where(.ui) .stat { display: block; }
.ui a.stat { color: inherit; }
.ui a.stat:hover { border-color: var(--brand-300); border-top-color: inherit; color: inherit; }
.ui .stat.tone-success { border-top-color: var(--success-line); } .ui .stat.tone-warning { border-top-color: var(--warning-line); }
.ui .stat.tone-danger { border-top-color: var(--danger-line); } .ui .stat.tone-info { border-top-color: var(--info-line); }
.ui .stat.tone-processing { border-top-color: var(--processing-line); } .ui .stat.tone-attention { border-top-color: var(--attention-line); }
.ui .stat.tone-neutral { border-top-color: var(--neutral-line); } .ui .stat.tone-brand { border-top-color: var(--brandtone-line); }
.ui .stat { background: #fff; color: var(--ink-900); }
.ui .stat-label { align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; line-height: 16px; color: var(--ink-600); } :where(.ui) .stat-label { display: flex; }
.ui .stat-label i { color: var(--ink-400); font-size: 11px; }
.ui .stat-value { margin-top: 4px; font-size: 18px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--ink-900); }
.ui .stat-value .unit { font-size: 12px; font-weight: 500; color: var(--ink-500); margin-left: 3px; letter-spacing: 0; }
.ui .stat-sub { font-size: 10.5px; line-height: 16px; color: var(--ink-500); }
.ui .stat.stat-lg .stat-value { font-size: 22px; line-height: 28px; letter-spacing: -0.02em; }
.ui .stat.stat-left { border-top-width: 1px; border-top-color: var(--ink-200); border-left: 3px solid var(--ink-300); }
.ui .stat.stat-left.tone-success { border-left-color: var(--success); } .ui .stat.stat-left.tone-warning { border-left-color: var(--warning); }
.ui .stat.stat-left.tone-danger { border-left-color: var(--danger); } .ui .stat.stat-left.tone-info { border-left-color: var(--accent-700); }
.ui .stat.stat-left.tone-processing { border-left-color: var(--processing); } .ui .stat.stat-left.tone-attention { border-left-color: var(--attention); }
.ui .stat.stat-left.tone-brand { border-left-color: var(--brand-700); } .ui .stat.stat-left.tone-neutral { border-left-color: var(--ink-400); }
.ui .stat-value.tone-success, .ui .v-success { color: var(--success); } .ui .stat-value.tone-danger, .ui .v-danger { color: var(--danger); }
.ui .stat-value.tone-warning, .ui .v-warning { color: var(--warning); } .ui .stat-value.tone-processing, .ui .v-processing { color: var(--processing); }
.ui .stat-value.tone-attention, .ui .v-attention { color: var(--attention); } .ui .stat-value.tone-info, .ui .v-info { color: var(--info); }
.ui .stat-value.tone-brand, .ui .v-brand { color: var(--brand-700); }
.ui .stat-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; } :where(.ui) .stat-strip { display: grid; }
.ui .stat-chip { align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; font-size: 11px; } :where(.ui) .stat-chip { display: inline-flex; }
.ui .kv { grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 7px 12px; font-size: 12.5px; } :where(.ui) .kv { display: grid; }
.ui .kv dt { color: var(--ink-500); font-size: 12px; }
.ui .kv dd { margin: 0; color: var(--ink-900); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
/* A value with its own copy icon: always there, and it comes forward on hover. */
.ui .kv dd.kv-copy { align-items: flex-start; gap: 2px; } :where(.ui) .kv dd.kv-copy { display: flex; }
.ui .kv dd.kv-copy > span { min-width: 0; overflow-wrap: anywhere; }
.ui .kv dd.kv-copy > .btn { flex: none; color: var(--ink-400); opacity: .75; transition: opacity .12s, color .12s; }
.ui .kv dd.kv-copy:hover > .btn, .ui .kv dd.kv-copy > .btn:focus-visible { opacity: 1; color: var(--ink-700); }
.ui .kv-stack { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px 14px; } :where(.ui) .kv-stack { display: grid; }
.ui .kv-stack > div > .k { font-size: 11px; color: var(--ink-500); }
.ui .kv-stack > div > .v { margin-top: 1px; font-size: 12.5px; font-weight: 500; color: var(--ink-900); overflow-wrap: anywhere; }
.ui .facts { flex-wrap: wrap; gap: 6px 22px; } :where(.ui) .facts { display: flex; }
.ui .facts > div { min-width: 0; }
.ui .facts .k { font-size: 11px; color: var(--ink-500); }
.ui .facts .v { font-size: 12.5px; font-weight: 500; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.ui .bar-track { height: 6px; border-radius: 99px; background: var(--ink-100); overflow: hidden; } :where(.ui) .bar-track { display: block; }
.ui .bar-fill { height: 100%; border-radius: 99px; background: var(--brand-700); } :where(.ui) .bar-fill { display: block; }
.ui .bar-fill.tone-success { background: var(--success); } .ui .bar-fill.tone-warning { background: var(--warning); }
.ui .bar-fill.tone-danger { background: var(--danger); } .ui .bar-fill.tone-info { background: var(--accent-500); }
.ui .bar-fill.tone-processing { background: var(--processing); } .ui .bar-fill.tone-attention { background: var(--attention); }
.ui .bar-fill.tone-neutral { background: var(--ink-400); }

/* ---------- tables ---------- */
.ui .table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ui .table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 18px; color: var(--ink-900); }
.ui .table th { position: sticky; top: 0; z-index: 1; padding: 7px 10px; background: var(--ink-50); border-bottom: 1px solid var(--ink-200); color: var(--ink-700); font-size: 11.5px; font-weight: 500; text-align: left; white-space: nowrap; }
.ui .table th a { color: var(--ink-700); }
.ui .table th a:hover { color: var(--brand-700); }
.ui .table th .sort { margin-left: 4px; font-size: 9px; color: var(--ink-400); }
.ui .table th .sort.is-on { color: var(--brand-700); }
.ui .table td { padding: 7px 10px; vertical-align: middle; border-top: 1px solid var(--ink-100); }
.ui .table tbody tr:first-child td { border-top: 0; }
.ui .table tbody tr:hover td { background: #FAFCFD; }
.ui .table tr[data-href], .ui .table tr[data-transfer] { cursor: pointer; }
.ui .table tr.is-selected td { background: #FAFCFD; }

/* The row you opened last, marked on the way back (h360.js: markOpenedRow).
   The flash plays once; the tint stays so the row is still findable after it. */
.ui .table tbody tr.is-back-row td { background: var(--accent-50); animation: h360-back-row 1.4s ease-out 1; }
.ui .table tbody tr.is-back-row:hover td { background: var(--accent-50); }
.ui .table tbody tr.is-back-row td:first-child { box-shadow: inset 2px 0 0 var(--accent-500); }
.ui .mcard.is-back-row, .ui .card.is-back-row, .ui li.is-back-row { border-color: var(--accent-300); background: var(--accent-50); animation: h360-back-row 1.4s ease-out 1; }
@keyframes h360-back-row {
  0%, 30% { background-color: var(--accent-100); }
  100% { background-color: var(--accent-50); }
}
@media (prefers-reduced-motion: reduce) { .ui .table tbody tr.is-back-row td, .ui .mcard.is-back-row, .ui .card.is-back-row, .ui li.is-back-row { animation: none; } }
.ui .table .num, .ui .table td.num, .ui .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui .table .strong { font-weight: 600; }
.ui .table .nowrap { white-space: nowrap; }
.ui .table .cell-main { font-weight: 500; }
.ui .table .cell-sub { margin-top: 1px; font-size: 11px; line-height: 15px; color: var(--ink-500); font-weight: 400; }
.ui .table .col-check { width: 34px; }
.ui .table .col-actions { width: 1%; white-space: nowrap; text-align: right; }
.ui .table-compact td, .ui .table-compact th { padding: 5px 8px; }
.ui .table-comfy td { padding: 10px 12px; }
.ui .table-bordered { border: 1px solid var(--ink-200); border-radius: 6px; overflow: hidden; }
.ui .table tfoot td { background: var(--ink-50); font-weight: 600; border-top: 1px solid var(--ink-200); }
.ui .row-actions { align-items: center; gap: 4px; } :where(.ui) .row-actions { display: inline-flex; }
.ui .list-card { background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; overflow: hidden; }
.ui .list-toolbar { flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ink-100); } :where(.ui) .list-toolbar { display: flex; }
.ui .list-toolbar .grow { flex: 1; }
.ui .list-chips { flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--ink-100); background: #fff; } :where(.ui) .list-chips { display: flex; }
.ui .list-footer { flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-top: 1px solid var(--ink-100); font-size: 11px; color: var(--ink-500); font-variant-numeric: tabular-nums; } :where(.ui) .list-footer { display: flex; }
.ui .bulkbar { flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 7px 10px; border: 1px solid var(--brand-200); border-radius: 6px; background: var(--brand-50); font-size: 12px; color: var(--brand-700); } :where(.ui) .bulkbar { display: flex; }
.ui .mcard-list { gap: 8px; padding: 10px; } :where(.ui) .mcard-list { display: grid; }
.ui .mcard { padding: 11px 12px; background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; color: inherit; } :where(.ui) .mcard { display: block; }
.ui a.mcard, .ui a.mcard:hover { color: inherit; }
.ui .mcard-foot { align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--ink-50); font-size: 11.5px; color: var(--ink-600); } :where(.ui) .mcard-foot { display: flex; }

/* ---------- empty / loading / error ---------- */
.ui .empty { padding: 28px 14px; text-align: center; }
.ui .empty > i { font-size: 20px; color: var(--ink-400); }
.ui .empty-title { margin-top: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-900); }
.ui .empty-text { margin-top: 2px; font-size: 11.5px; color: var(--ink-500); }
.ui .empty .btn { margin-top: 10px; }
.ui .skeleton { height: 10px; border-radius: 3px; background: linear-gradient(90deg, var(--ink-100), var(--ink-200), var(--ink-100)); background-size: 260px 100%; animation: h360-shimmer 1.2s linear infinite; } :where(.ui) .skeleton { display: block; }
@keyframes h360-shimmer { 0% { background-position: -200px 0; } 100% { background-position: 260px 0; } }
.ui .spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 99px; animation: h360-spin .7s linear infinite; vertical-align: -2px; } :where(.ui) .spinner { display: inline-block; }
@keyframes h360-spin { to { transform: rotate(360deg); } }

/* ---------- alerts & toasts ---------- */
.ui .alert { align-items: flex-start; gap: 8px; padding: 9px 11px; border: 1px solid var(--info-line); border-radius: 6px; background: var(--info-bg); font-size: 12px; line-height: 18px; color: var(--ink-900); } :where(.ui) .alert { display: flex; }
.ui .alert > i { margin-top: 2px; color: var(--info); }
.ui .alert .alert-title { font-weight: 500; }
.ui .alert .alert-text { color: var(--ink-600); }
.ui .alert.tone-success { background: var(--success-bg); border-color: var(--success-line); color: var(--ink-900); } .ui .alert.tone-success > i { color: var(--success); }
.ui .alert.tone-warning { background: var(--warning-bg); border-color: var(--warning-line); color: var(--ink-900); } .ui .alert.tone-warning > i { color: var(--warning); }
.ui .alert.tone-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--ink-900); } .ui .alert.tone-danger > i { color: var(--danger); }
.ui .alert.tone-info { background: var(--info-bg); border-color: var(--info-line); color: var(--ink-900); }
.ui .alert.tone-neutral { background: var(--ink-50); border-color: var(--ink-200); color: var(--ink-900); } .ui .alert.tone-neutral > i { color: var(--ink-500); }
.ui .alert.tone-processing { background: var(--processing-bg); border-color: var(--processing-line); color: var(--ink-900); } .ui .alert.tone-processing > i { color: var(--processing); }
.ui .alert.tone-brand { background: var(--brand-50); border-color: var(--brand-200); color: var(--ink-900); } .ui .alert.tone-brand > i { color: var(--brand-700); }
.ui .alert .alert-close { margin-left: auto; border: 0; background: none; color: var(--ink-400); cursor: pointer; padding: 0 2px; }
.ui .toasts { position: fixed; top: 60px; right: 16px; z-index: 90; gap: 8px; width: min(360px, calc(100vw - 32px)); } :where(.ui) .toasts { display: grid; }
.ui .toast { box-shadow: var(--shadow-overlay); background: #fff; }
.ui .banner { flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--processing-line); border-radius: 6px; background: var(--processing-bg); font-size: 12.5px; } :where(.ui) .banner { display: flex; }

/* ---------- overlays ---------- */
.ui .menu { position: absolute; z-index: 50; min-width: 180px; padding: 4px; background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; box-shadow: var(--shadow-overlay); }
.ui .menu-right { right: 0; } .ui .menu-left { left: 0; }
.ui .menu-item { align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-900); font-size: 12px; line-height: 18px; text-align: left; white-space: nowrap; cursor: pointer; } :where(.ui) .menu-item { display: flex; }
.ui a.menu-item { color: var(--ink-900); }
.ui .menu-item:hover, .ui a.menu-item:hover { background: var(--brand-50); color: var(--ink-900); }
.ui .menu-item i { width: 14px; font-size: 11px; color: var(--ink-500); text-align: center; }
.ui .menu-item.danger, .ui a.menu-item.danger { color: var(--danger); }
.ui .menu-item.danger i { color: var(--danger); }
.ui .menu-item.is-disabled, .ui .menu-item[disabled] { color: var(--ink-400); cursor: not-allowed; background: transparent; }
.ui .menu-sep { height: 1px; margin: 4px 0; background: var(--ink-100); }
.ui .menu-head { padding: 6px 8px; font-size: 11px; color: var(--ink-500); }
.ui .popover { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; box-shadow: var(--shadow-overlay); }
.ui .modal-scrim { position: fixed; inset: 0; z-index: 80; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; background: rgba(22, 35, 43, .45); overflow-y: auto; overscroll-behavior: contain; } :where(.ui) .modal-scrim { display: flex; }
/* While an overlay is open the page under it does not scroll (H360.lockScroll). */
html.is-locked, html.is-locked body { overflow: hidden; }
.ui .modal { width: 100%; max-width: 520px; background: #fff; border: 1px solid var(--ink-200); border-radius: 8px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.ui .modal-sm { max-width: 400px; } .ui .modal-lg { max-width: 720px; } .ui .modal-xl { max-width: 960px; }
.ui .modal-head { align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--ink-100); } :where(.ui) .modal-head { display: flex; }
.ui .modal-title { margin: 0; font-size: 13px; font-weight: 600; }
.ui .modal-close { border: 0; background: none; color: var(--ink-400); font-size: 13px; cursor: pointer; width: 24px; height: 24px; border-radius: 4px; }
.ui .modal-close:hover { background: var(--ink-100); color: var(--ink-700); }
.ui .modal-body { padding: 14px; font-size: 12.5px; color: var(--ink-700); }
.ui .modal-foot { justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--ink-100); background: var(--ink-50); } :where(.ui) .modal-foot { display: flex; }
.ui .confirm { gap: 10px; padding: 16px; } :where(.ui) .confirm { display: flex; }
.ui .confirm > i { margin-top: 2px; color: var(--warning); font-size: 15px; }
.ui .confirm.is-danger > i { color: var(--danger); }
.ui .drawer { position: fixed; inset: 0 0 0 auto; z-index: 81; width: min(380px, 92vw); flex-direction: column; background: #fff; border-left: 1px solid var(--ink-200); box-shadow: var(--shadow-overlay); } :where(.ui) .drawer { display: flex; }
.ui .drawer-body { flex: 1; overflow-y: auto; padding: 14px; gap: 12px; align-content: start; } :where(.ui) .drawer-body { display: grid; }
.ui .lightbox { position: fixed; inset: 0; z-index: 95; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 18, 23, .85); } :where(.ui) .lightbox { display: flex; }
.ui .lightbox img, .ui .lightbox video { max-width: 100%; max-height: 90vh; border-radius: 6px; }

/* ---------- tabs & segmented ---------- */
.ui .tabs { align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--ink-200); overflow-x: auto; scrollbar-width: none; } :where(.ui) .tabs { display: flex; }
:where(.ui) .tabs::-webkit-scrollbar { display: none; }
.ui .tab { align-items: center; gap: 5px; padding: 7px 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-600); font-size: 12.5px; white-space: nowrap; cursor: pointer; } :where(.ui) .tab { display: inline-flex; }
.ui a.tab { color: var(--ink-600); }
.ui .tab:hover, .ui a.tab:hover { color: var(--brand-700); }
.ui .tab.is-active, .ui a.tab.is-active { border-bottom-color: var(--brand-700); color: var(--brand-700); font-weight: 600; }
.ui .tab .count-badge { font-weight: 400; }
.ui .tab.is-active .count-badge { background: var(--brand-100); color: var(--brand-700); }
.ui .segmented { padding: 2px; gap: 2px; background: var(--ink-100); border-radius: 6px; } :where(.ui) .segmented { display: inline-flex; }
.ui .segmented > * { align-items: center; gap: 5px; height: 24px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--ink-600); font-size: 12px; cursor: pointer; white-space: nowrap; } :where(.ui) .segmented > * { display: inline-flex; }
.ui .segmented > a { color: var(--ink-600); }
.ui .segmented > .is-active, .ui .segmented > a.is-active { background: #fff; color: var(--ink-900); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 35, 43, .10); }

/* ---------- timeline, comments, attachments ---------- */
.ui .timeline { gap: 10px; } :where(.ui) .timeline { display: grid; }
.ui .tl-item { gap: 10px; } :where(.ui) .tl-item { display: flex; }
.ui .tl-node { align-items: center; justify-content: center; width: 24px; height: 24px; flex: 0 0 auto; border: 1px solid var(--neutral-line); border-radius: 99px; background: var(--neutral-bg); color: var(--neutral); font-size: 10px; } :where(.ui) .tl-node { display: inline-flex; }
.ui .tl-card { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--ink-200); border-left: 2px solid var(--ink-400); border-radius: 6px; background: #fff; }
.ui .tl-card.tone-success { border-left-color: var(--success); } .ui .tl-card.tone-warning { border-left-color: var(--warning); }
.ui .tl-card.tone-danger { border-left-color: var(--danger); } .ui .tl-card.tone-info { border-left-color: var(--accent-700); }
.ui .tl-card.tone-processing { border-left-color: var(--processing); } .ui .tl-card.tone-attention { border-left-color: var(--attention); }
.ui .tl-card.tone-brand { border-left-color: var(--brand-700); } .ui .tl-card.tone-neutral { border-left-color: var(--ink-400); }
.ui .tl-card { background: #fff; color: var(--ink-900); }
.ui .tl-title { font-size: 12.5px; font-weight: 500; }
.ui .tl-desc { margin-top: 2px; font-size: 12px; color: var(--ink-700); }
.ui .tl-when { margin-top: 3px; font-size: 11px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.ui .activity { gap: 12px; } :where(.ui) .activity { display: grid; }
.ui .activity-item { gap: 8px; font-size: 12px; } :where(.ui) .activity-item { display: flex; }
.ui .activity-icon { align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: var(--brand-50); color: var(--brand-700); font-size: 9px; } :where(.ui) .activity-icon { display: inline-flex; }
.ui .comment { gap: 8px; } :where(.ui) .comment { display: flex; }
.ui .comment-body { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--ink-200); border-radius: 6px; background: #fff; }
.ui .comment-meta { align-items: center; gap: 6px; font-size: 11px; color: var(--ink-500); } :where(.ui) .comment-meta { display: flex; }
.ui .comment-text { margin-top: 3px; font-size: 12.5px; line-height: 1.55; color: var(--ink-900); overflow-wrap: anywhere; white-space: pre-line; }
.ui .comment-text p { margin: 0 0 6px; } .ui .comment-text p:last-child { margin-bottom: 0; }
.ui .mention { color: var(--accent-700); font-weight: 500; }
.ui .attachment { align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--ink-100); border-radius: 4px; font-size: 11px; color: var(--ink-600); } :where(.ui) .attachment { display: flex; }
.ui .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; } :where(.ui) .thumb-grid { display: grid; }
.ui .thumb { position: relative; aspect-ratio: 4 / 3; border: 1px solid var(--ink-200); border-radius: 6px; overflow: hidden; background: var(--ink-50); } :where(.ui) .thumb { display: block; }
.ui .thumb img, .ui .thumb video { width: 100%; height: 100%; object-fit: cover; }
.ui .thumb-meta { padding: 5px 7px; font-size: 11px; color: var(--ink-600); }

/* ---------- stepper ---------- */
.ui .steps { flex-wrap: wrap; align-items: center; gap: 8px 6px; } :where(.ui) .steps { display: flex; }
.ui .step { align-items: center; gap: 6px; } :where(.ui) .step { display: flex; }
.ui .step-dot { align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: var(--ink-100); color: var(--ink-500); font-size: 11px; font-weight: 600; } :where(.ui) .step-dot { display: inline-flex; }
.ui .step.is-done .step-dot { background: var(--brand-700); color: #fff; }
.ui .step.is-current .step-dot { width: 26px; height: 26px; background: var(--accent-700); color: #fff; }
.ui .step-label { font-size: 11px; color: var(--ink-500); white-space: nowrap; }
.ui .step.is-current .step-label { color: var(--ink-900); font-weight: 600; }
.ui .step-bar { flex: 1; min-width: 8px; height: 2px; background: var(--ink-200); }
.ui .step.is-done + .step-bar, .ui .step-bar.is-done { background: var(--brand-700); }

/* ---------- people & doctors ---------- */
.ui .avatar { align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 99px; background: var(--brand-100); color: var(--brand-700); font-size: 12px; font-weight: 600; line-height: 1; } :where(.ui) .avatar { display: inline-flex; }
.ui .avatar-sm { width: 22px; height: 22px; font-size: 10px; }
.ui .avatar-xs { width: 20px; height: 20px; font-size: 9.5px; }
.ui .avatar-lg { width: 40px; height: 40px; font-size: 15px; }
.ui .avatar-solid { background: var(--brand-700); color: #fff; }
.ui .avatar-photo { object-fit: cover; background: var(--ink-100); }
.ui .person { align-items: center; gap: 8px; min-width: 0; } :where(.ui) .person { display: flex; }
.ui .person-name { font-size: 12.5px; font-weight: 500; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui .person-sub { font-size: 11px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui .doc-mark { align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 6px; background: var(--accent-50); color: var(--accent-700); font-size: 11px; } :where(.ui) .doc-mark { display: inline-flex; }
.ui .hero-mark { align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: 8px; background: var(--accent-50); color: var(--accent-700); font-size: 18px; } :where(.ui) .hero-mark { display: inline-flex; }

/* ---------- command palette ---------- */
.ui .palette { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--ink-200); border-radius: 8px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.ui .palette-input { align-items: center; gap: 8px; padding: 0 12px; height: 46px; border-bottom: 1px solid var(--ink-100); } :where(.ui) .palette-input { display: flex; }
.ui .palette-input input { flex: 1; min-width: 0; height: 44px; border: 0; outline: none; font-size: 14px; background: transparent; }
.ui .palette-results { max-height: 60vh; overflow-y: auto; padding: 4px; }
.ui .palette-group { padding: 8px 8px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.ui .palette-item { align-items: center; gap: 10px; padding: 7px 8px; border-radius: 4px; color: var(--ink-900); cursor: pointer; } :where(.ui) .palette-item { display: flex; }
.ui a.palette-item { color: var(--ink-900); }
.ui .palette-item.is-active, .ui .palette-item:hover { background: var(--brand-50); color: var(--ink-900); }

/* ---------- login ---------- */
.ui .auth-wrap { min-height: 100vh; align-items: center; justify-content: center; padding: 40px 20px; background: var(--brand-50); } :where(.ui) .auth-wrap { display: flex; }
.ui .auth-card { padding: 22px; background: #fff; border: 1px solid var(--ink-200); border-radius: 8px; }

/* ---------- print ---------- */
@media print {
  :where(.ui) .sider, :where(.ui) .topbar, :where(.ui) .bottom-tabs, :where(.ui) .toasts, :where(.ui) .no-print { display: none !important; }
  .ui .shell-main { padding-left: 0 !important; }
  body.ui { background: #fff; }
  .ui .page { padding: 0; }
  .ui .card, .ui .list-card { border-color: #D3DBE1; }
}

/* ---------- additions (16 Sep) ---------- */
.ui .btn-text[disabled], .ui .btn-ghost[disabled], .ui .btn-text.is-disabled, .ui .btn-ghost.is-disabled { background: transparent !important; border-color: transparent !important; }
.ui .alert.tone-attention { background: var(--attention-bg); border-color: var(--attention-line); color: var(--ink-900); } .ui .alert.tone-attention > i { color: var(--attention); }
.ui .code-block { margin: 0; padding: 12px 14px; border-radius: 6px; background: var(--ink-900); color: #D3DBE1; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; white-space: pre; overflow: auto; max-height: 480px; }
.ui .json-block { margin: 0; padding: 10px 12px; border: 1px solid var(--ink-200); border-radius: 6px; background: var(--ink-50); color: var(--ink-800); font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; max-height: 480px; }
.ui .code-wrap { position: relative; }
.ui .code-wrap > .code-copy { position: absolute; top: 6px; right: 6px; }
@media (max-width: 639px) { .ui .page-actions { width: 100%; } }
@media (max-width: 639px) { .ui .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Choice tiles with a meaning: <label class="choice choice-danger"> turns red when its input is checked. */
.ui .choice-success:has(input:checked), .ui .choice-success.is-active { border-color: var(--success-line); background: var(--success-bg); }
.ui .choice-info:has(input:checked), .ui .choice-info.is-active { border-color: var(--info-line); background: var(--info-bg); }
.ui .choice-processing:has(input:checked), .ui .choice-processing.is-active { border-color: var(--processing-line); background: var(--processing-bg); }
.ui .choice-warning:has(input:checked), .ui .choice-warning.is-active { border-color: var(--warning-line); background: var(--warning-bg); }
.ui .choice-danger:has(input:checked), .ui .choice-danger.is-active { border-color: var(--danger-line); background: var(--danger-bg); }
/* Purple outline button (e.g. "Schedule callback") and a bulk bar that sits outside a list card. */
.ui .btn-processing, .ui a.btn-processing { border-color: var(--processing); color: var(--processing); background: #fff; }
.ui .btn-processing:hover, .ui a.btn-processing:hover { background: var(--processing-bg); border-color: var(--processing); color: var(--processing); }
.ui .bulkbar.bulkbar-flush { margin: 0 0 10px; }
/* Status pills with a tone: outlined in the tone, tinted when active (issue / request / CRM status rows). */
.ui .status-pill[class*="tone-"] { background: #fff; }
.ui .status-pill.is-active.tone-success { background: var(--success-bg); } .ui .status-pill.is-active.tone-warning { background: var(--warning-bg); }
.ui .status-pill.is-active.tone-danger { background: var(--danger-bg); } .ui .status-pill.is-active.tone-info { background: var(--info-bg); }
.ui .status-pill.is-active.tone-processing { background: var(--processing-bg); } .ui .status-pill.is-active.tone-attention { background: var(--attention-bg); }
.ui .status-pill.is-active.tone-neutral { background: var(--neutral-bg); } .ui .status-pill.is-active.tone-brand { background: var(--brandtone-bg); }
.ui .choice-attention:has(input:checked), .ui .choice-attention.is-active { border-color: var(--attention-line); background: var(--attention-bg); }
/* Anchored elements clear the sticky top bar when scrolled to. */
.ui [id] { scroll-margin-top: 64px; }
.ui .code-block.is-wrapped { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- live list refresh (search as you type) ---------- */
.ui .is-refreshing > *:not(.list-toolbar) { opacity: .5; transition: opacity .12s; }
.ui .list-card.is-refreshing .list-toolbar { position: relative; }
.ui .list-card.is-refreshing .list-toolbar::after { content: ''; position: absolute; bottom: -1px; height: 2px; background: var(--brand-500); animation: h360-sweep 1.1s ease-in-out infinite; }
@keyframes h360-sweep { 0% { left: 0; width: 8%; } 50% { left: 40%; width: 35%; } 100% { left: 100%; width: 8%; } }
@media (prefers-reduced-motion: reduce) { .ui .list-card.is-refreshing .list-toolbar::after { animation: none; left: 0; width: 100%; opacity: .5; } }

/* ---------- searchable dropdown (progressive enhancement of a <select>) ---------- */
.ui .ss { position: relative; display: inline-block; max-width: 100%; }
.ui .ss-full { display: block; width: 100%; }
.ui .ss-btn { display: flex; align-items: center; gap: 6px; width: 100%; height: 30px; padding: 0 26px 0 10px; border: 1px solid var(--ink-300); border-radius: 6px; background: #fff; font-size: 12.5px; color: var(--ink-900); text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ui .ss-btn:hover { border-color: var(--brand-400); }
.ui .ss-btn:focus-visible, .ui .ss.is-open > .ss-btn { outline: none; border-color: var(--brand-700); box-shadow: 0 0 0 2px var(--brand-100); }
.ui .ss-btn > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui .ss-btn.is-empty > span { color: var(--ink-500); }
.ui .ss-btn.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg); }
.ui .ss-btn > i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font-size: 9px; color: var(--ink-400); pointer-events: none; }
.ui .ss-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 100%; max-width: min(420px, 90vw); background: #fff; border: 1px solid var(--ink-200); border-radius: 6px; box-shadow: var(--shadow-overlay, 0 6px 16px rgba(22,35,43,.12)); overflow: hidden; }
.ui .ss-pop.is-above { top: auto; bottom: calc(100% + 4px); }
.ui .ss-search { padding: 6px; border-bottom: 1px solid var(--ink-100); }
.ui .ss-search > input { width: 100%; height: 28px; padding: 0 8px; border: 1px solid var(--ink-300); border-radius: 5px; font-size: 12.5px; }
.ui .ss-search > input:focus { outline: none; border-color: var(--brand-700); }
.ui .ss-list { max-height: 240px; overflow-y: auto; padding: 4px; }
.ui .ss-opt { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border-radius: 5px; font-size: 12.5px; color: var(--ink-800); text-align: left; cursor: pointer; }
.ui .ss-opt:hover, .ui .ss-opt.is-active { background: var(--ink-50); }
.ui .ss-opt.is-selected { color: var(--brand-700); font-weight: 500; }
.ui .ss-opt > i { width: 11px; font-size: 10px; }
.ui .ss-group { padding: 6px 8px 2px; font-size: 10.5px; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .03em; }
.ui .ss-none { padding: 10px; font-size: 12px; color: var(--ink-500); text-align: center; }
.ui select.ss-native { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- the doctor's apps and their versions ---------- */
.ui .apps-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ui .app-tile { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border: 1px solid var(--ink-300); border-radius: 6px; background: #fff; cursor: pointer; transition: border-color .12s, background .12s; }
.ui .app-tile:hover { border-color: var(--brand-400); }
.ui .app-tile.is-on { border-color: var(--brand-700); background: var(--brand-50); }
.ui .app-tile .app-name { font-size: 12.5px; font-weight: 500; color: var(--ink-800); }
.ui .app-tile .app-version { flex: 1 0 100%; height: 26px; font-size: 12px; cursor: text; }
.ui .app-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* ---------- profile photo picker ---------- */
.ui .photo-field { display: flex; align-items: center; gap: 12px; }
.ui .photo-preview { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; flex: 0 0 auto; overflow: hidden; border-radius: 99px; background: var(--brand-100); color: var(--brand-700); font-size: 22px; font-weight: 600; }
.ui .photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.ui .photo-field .field-help { display: block; margin-top: 4px; }
