/* EXTRACTED — do not edit by hand.
 * Source: design-system/design_system.md v53.31  →  assets/ds/components.css
 * Regenerate: php bin/ds-extract.php   ·   Verify: php bin/ds-extract.php --check */

/* BUTTONS — Exact Polaris match from constructed stylesheets */
.btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  gap:2px;
  padding:6px 12px;
  min-height:28px;
  border:none;
  border-radius:var(--radius);
  font-family:var(--font);
  font-size:13px;
  font-weight:550;
  line-height:20px;
  white-space:nowrap;
  cursor:pointer;
  user-select:none;
  vertical-align:middle;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizelegibility;
  -webkit-tap-highlight-color:transparent;
  text-decoration:none;
  outline:none;
  transition:background .08s,color .08s,box-shadow .08s
}
/* ── Primary ── */
/* Default: solid dark gray with gradient overlay + bevel shadow */
.btn-primary{
  background-color:var(--btn-primary-bg);
  background-image:linear-gradient(180deg,rgba(48,48,48,0) 63.53%,rgba(255,255,255,0.15) 100%);
  color:var(--btn-primary-text);
  box-shadow:0 -1px 0 0 #000 inset,0 0 0 0 transparent,0 0 0 1px rgba(0,0,0,.8),0 1px 0 0 rgba(255,255,255,.06) inset
}
/* Hover: darker base + same gradient */
.btn-primary:hover:not([disabled]){
  background-color:var(--btn-primary-bg-hover);
  background-image:linear-gradient(180deg,rgba(48,48,48,0) 63.53%,rgba(255,255,255,0.15) 100%);
  color:var(--btn-primary-text-hover);
  box-shadow:0 -1px 0 0 #000 inset,0 0 0 0 transparent,0 0 0 1px rgba(0,0,0,.8),0 1px 0 0 rgba(255,255,255,.06) inset
}
/* Active: strong inset shadow + muted text */
.btn-primary:active:not([disabled]){
  background-color:var(--btn-primary-bg-hover);
  background-image:linear-gradient(180deg,rgba(48,48,48,0) 63.53%,rgba(255,255,255,0.15) 100%);
  color:var(--btn-primary-text-active);
  box-shadow:0 3px 0 0 rgb(0,0,0) inset
}
/* Focus: blue outline ring */
.btn-primary:focus-visible:not([disabled]){
  background-color:var(--btn-primary-bg-hover);
  background-image:linear-gradient(180deg,rgba(48,48,48,0) 63.53%,rgba(255,255,255,0.15) 100%);
  color:var(--btn-primary-text-hover);
  outline:2px solid var(--btn-focus-ring);
  outline-offset:1px
}
/* ── Secondary / Outline ── Polaris secondary: white bg + 1px border shadow */
.btn-secondary,.btn-outline{
  background:rgba(255,255,255,1);
  color:rgba(48,48,48,1);
  box-shadow:0 0 0 1px rgba(0,0,0,0.13),0 1px 0 0 rgba(0,0,0,0.07),0 -1px 0 0 rgba(0,0,0,0.04) inset
}
.btn-secondary:hover:not([disabled]),.btn-outline:hover:not([disabled]){
  background:rgba(247,247,247,1);
  color:rgba(26,26,26,1);
  box-shadow:0 0 0 1px rgba(0,0,0,0.13),0 1px 1px 0 rgba(0,0,0,0.1),0 -1px 0 0 rgba(0,0,0,0.04) inset
}
.btn-secondary:active:not([disabled]),.btn-outline:active:not([disabled]){
  background:rgba(243,243,243,1);
  color:rgba(26,26,26,1);
  box-shadow:0 0 0 1px rgba(0,0,0,0.13),0 2px 0 0 rgba(0,0,0,0.07) inset
}
.btn-secondary:focus-visible:not([disabled]),.btn-outline:focus-visible:not([disabled]){
  background:rgba(247,247,247,1);
  outline:2px solid var(--btn-focus-ring);
  outline-offset:1px
}
/* ── Flat ── The gray-surface secondary: Polaris's page-header/toolbar action (the "All
   locations" picker). A gray fill one step darker than the gray surface it sits on, no border,
   no bevel — quiet at rest, but hover and press are FULL-STRENGTH, the same darken-then-
   pressed-inset feel as the raised buttons, so under the pointer it is unmistakably a button.
   Gray surfaces only (--surface: page headers, toolbars, banded areas). On a white card the
   borderless gray fill reads as a disabled control — there, .btn-secondary IS the quiet option.
   Fill ramp = Polaris --p-color-page-button-bg-fill / -hover / -active (#e3e3e3/#d4d4d4/#cccccc),
   carried by the --fill-tertiary tokens so dark mode needs no override. */
.btn-flat{
  background:var(--fill-tertiary);
  color:var(--foreground);
  box-shadow:none
}
.btn-flat:hover:not([disabled]){background:var(--fill-tertiary-hover)}
.btn-flat:active:not([disabled]){
  background:var(--fill-tertiary-active);
  box-shadow:0 2px 0 0 rgba(0,0,0,.07) inset
}
.btn-flat:focus-visible:not([disabled]){
  background:var(--fill-tertiary-hover);
  outline:2px solid var(--btn-focus-ring);
  outline-offset:1px
}
/* ── Ghost ── */
.btn-ghost{
  background:transparent;
  color:rgba(48,48,48,1);
  box-shadow:none
}
.btn-ghost:hover:not([disabled]){background:rgba(0,0,0,0.05);color:rgba(26,26,26,1)}
.btn-ghost:active:not([disabled]){background:rgba(0,0,0,0.08)}
.btn-ghost:focus-visible:not([disabled]){outline:2px solid var(--btn-focus-ring);outline-offset:1px}
/* ── Plain (link-style) ── */
.btn-plain{
  background:transparent;color:rgba(48,48,48,1);border:none;padding:0;min-height:auto;box-shadow:none;text-decoration:underline;text-decoration-color:transparent;font-weight:500
}
.btn-plain:hover:not([disabled]){text-decoration-color:currentColor;color:rgba(26,26,26,1)}
/* ── Destructive ── */
/* Destructive — subtle: white bg, red text + icon, no filled background */
.btn-destructive{
  background:rgba(255,255,255,1);
  color:var(--destructive);
  box-shadow:0 0 0 1px rgba(0,0,0,0.13),0 1px 0 0 rgba(0,0,0,0.07),0 -1px 0 0 rgba(0,0,0,0.04) inset
}
.btn-destructive:hover:not([disabled]){
  background:var(--destructive-surface);
  color:var(--destructive);
  box-shadow:0 0 0 1px var(--destructive-border),0 1px 1px 0 rgba(0,0,0,0.06)
}
.btn-destructive:active:not([disabled]){
  background:var(--destructive-surface);
  box-shadow:0 0 0 1px var(--destructive-border),0 2px 0 0 rgba(0,0,0,0.05) inset;
  color:var(--destructive)
}
.btn-destructive:focus-visible:not([disabled]){
  outline:2px solid var(--btn-focus-ring);
  outline-offset:1px
}
/* ── Sizes ── */
.btn-sm{min-height:28px;padding:4px 12px;font-size:12px;border-radius:calc(var(--radius) - 2px)}
/* Extra small — the Polaris "micro" size, for chrome that must fit inside a table row: bulk
   bars, inline toolbars. 24px on a fine pointer, 28px where the pointer is coarse, because a
   24px target is right for a cursor and too small for a thumb. Height comes out of the type,
   not a fudged padding: 16px line-height + 4px + 4px = 24. min-width matches min-height so an
   icon-only xs is square. A real size, drawn once — never squeeze .btn-sm with a height to fit. */
.btn-xs{min-height:28px;min-width:28px;padding:4px 12px;font-size:12px;line-height:16px;font-weight:550;gap:3px;border-radius:calc(var(--radius) - 2px)}
@media (hover) and (pointer:fine),(min-width:48em){
  .btn-xs{min-height:24px;min-width:24px;padding:4px 8px}
}
.btn-xs svg{width:9px;height:9px}
/* Extra extra small — 20px, one step below anything Polaris ships. It exists because our table
   rows are 35px where the admin's are around 40: chrome inside a row has to scale with the row,
   or the control fills the line instead of sitting in it. Same construction as .btn-xs with two
   pixels of padding instead of four — 16px line-height + 2 + 2 = 20 — so the type is unchanged
   and only the box tightens. 24px where the pointer is coarse, at which point a 20px target
   stops being reachable. Reach for it only inside a dense row; .btn-xs is the default for chrome. */
.btn-2xs{min-height:24px;min-width:24px;padding:4px 10px;font-size:12px;line-height:16px;font-weight:550;gap:3px;border-radius:calc(var(--radius) - 3px)}
@media (hover) and (pointer:fine),(min-width:48em){
  .btn-2xs{min-height:20px;min-width:20px;padding:2px 8px}
}
.btn-2xs svg{width:9px;height:9px}
.btn-lg{min-height:40px;padding:8px 20px;font-size:14px;border-radius:calc(var(--radius) + 2px)}
.btn-icon{width:28px;min-height:28px;padding:0}
/* The square partners track their text tier on BOTH pointer tiers — .btn-icon-sm pairs with
   .btn-xs (28 coarse / 24 fine) and .btn-icon-xs with .btn-2xs (24 coarse / 20 fine). Pinning
   them to the fine size alone made "square at the same size" true only with a mouse, and made
   the icon partner the one control in the ramp that ignored the input device. */
.btn-icon-sm{width:28px;min-height:28px;min-width:28px;padding:0;font-size:12px;border-radius:6px}
.btn-icon-xs{width:24px;min-height:24px;min-width:24px;padding:0;font-size:12px;border-radius:5px}
@media (hover) and (pointer:fine),(min-width:48em){
  .btn-icon-sm{width:24px;min-height:24px;min-width:24px}
  .btn-icon-xs{width:20px;min-height:20px;min-width:20px}
}

/* ── States ── */
.btn[disabled],.btn.loading{opacity:.5;cursor:not-allowed;pointer-events:none}
.btn .spin{animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
/* ── Groups ── */
.btn-group{display:flex}
.btn-group .btn:first-child{border-radius:var(--radius) 0 0 var(--radius)}
.btn-group .btn+.btn{margin-left:-1px}
.btn-group .btn:last-child{border-radius:0 var(--radius) var(--radius) 0}
.btn-group .btn:not(:first-child):not(:last-child){border-radius:0}
/* ── Dark mode ── */
.dark .btn-primary{
  background-color:var(--btn-primary-bg);
  background-image:linear-gradient(180deg,rgba(255,255,255,0) 63.53%,rgba(255,255,255,0.08) 100%);
  color:var(--btn-primary-text);
  box-shadow:0 -1px 0 0 rgba(0,0,0,.1) inset,0 0 0 1px rgba(255,255,255,.8),0 1px 0 0 rgba(255,255,255,.2) inset
}
.dark .btn-primary:hover:not([disabled]){
  background-color:var(--btn-primary-bg-hover);
  background-image:linear-gradient(180deg,rgba(255,255,255,0) 63.53%,rgba(255,255,255,0.08) 100%);
  color:var(--btn-primary-text-hover)
}
.dark .btn-primary:active:not([disabled]){
  color:rgba(48,48,48,1);
  box-shadow:0 3px 0 0 rgba(0,0,0,.15) inset
}
.dark .btn-secondary,.dark .btn-outline{
  background:rgba(38,38,38,1);
  color:rgba(235,235,235,1);
  box-shadow:0 0 0 1px rgba(255,255,255,0.13),0 1px 0 0 rgba(255,255,255,0.04)
}
.dark .btn-secondary:hover:not([disabled]),.dark .btn-outline:hover:not([disabled]){
  background:rgba(55,55,55,1);
  color:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,0.16),0 1px 1px 0 rgba(0,0,0,.2)
}
.dark .btn-ghost{color:rgba(220,220,220,1)}
.dark .btn-destructive{
  background:var(--surface);
  color:#f87171;
  box-shadow:0 0 0 1px rgba(255,255,255,0.1)
}
.dark .btn-destructive:hover:not([disabled]){
  background:rgba(60,20,20,1);
  color:#fca5a5;
  box-shadow:0 0 0 1px rgba(248,113,113,0.3)
}

.dark .btn-ghost:hover:not([disabled]){background:rgba(255,255,255,0.1);color:#fff}
.dark .btn-plain{color:rgba(180,180,180,1)}
.dark .btn-plain:hover:not([disabled]){color:#fff}
/* .btn-flat needs no dark rules — its fill (--fill-tertiary ramp) and text (--foreground)
   are tokens that already flip with the theme. */

/* Dark mode toggle fix */
.dark .toggle::after{background:var(--foreground);box-shadow:0 1px 3px rgba(0,0,0,.4)}
.dark .toggle.on::after{background:#0a0a0a}

.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:20px;font-size:11px;font-weight:500;border:1px solid transparent;white-space:nowrap}
.badge-default{background:var(--primary);color:var(--primary-foreground)}
.badge-secondary{background:var(--secondary);color:var(--foreground-subdued);border-color:var(--border)}
.badge-outline{background:transparent;color:var(--foreground-subdued);border-color:var(--border)}
.badge-success{background:var(--success-surface);color:var(--success-foreground);border-color:var(--success-border)}
.badge-warning{background:var(--warning-surface);color:var(--warning-foreground);border-color:var(--warning-border)}
.badge-destructive{background:var(--destructive-surface);color:var(--destructive-foreground);border-color:var(--destructive-border)}
.badge-info{background:var(--info-surface);color:var(--info-foreground);border-color:var(--info-border)}
.badge-dot::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block}

/* CARDS */
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);overflow:hidden;transition:background .2s,border-color .2s}
.card-header{padding:18px 20px 14px;border-bottom:1px solid var(--border-soft)}
.card-title{font-size:15px;font-weight:600;color:var(--foreground);letter-spacing:-.01em}
.card-desc{font-size:12.5px;color:var(--foreground-subdued);margin-top:2px}
.card-content{padding:var(--density-card-p) 20px}
.card-footer{padding:12px 20px;border-top:1px solid var(--border-soft);display:flex;justify-content:flex-end;gap:8px;background:var(--surface)}
.card-metric .card-content{padding:16px 20px 20px}
.metric-value{font-size:28px;font-weight:700;letter-spacing:-.03em;color:var(--foreground);font-family:var(--mono)}
.metric-label{font-size:12px;color:var(--foreground-subdued);margin-bottom:4px}
.metric-change{font-size:11.5px;color:var(--foreground-subdued);margin-top:4px}
.metric-change.up{color:var(--success)}
.metric-change.down{color:var(--destructive)}

/* FORMS */
.form-item{display:flex;flex-direction:column;gap:5px}
.form-label{font-size:13px;font-weight:500;color:var(--foreground)}
.form-label .optional{color:var(--foreground-subdued);font-weight:400}
.form-input,.form-textarea,.form-select{width:100%;padding:0 12px;height:var(--density-input-h);border:1px solid var(--border);border-radius:var(--radius);font-size:13px;font-family:var(--font);color:var(--foreground);background:var(--card);transition:border-color .15s,box-shadow .15s;outline:none}
.form-textarea{height:auto;padding:10px 12px;resize:none;min-height:90px}
.form-input:focus,.form-textarea:focus,.form-select:focus{border-color:var(--ring);box-shadow:0 0 0 3px rgba(0,0,0,.08)}
.dark .form-input:focus,.dark .form-textarea:focus{box-shadow:0 0 0 3px rgba(255,255,255,.08)}
.form-input.error{border-color:var(--destructive)}
.form-hint{font-size:11.5px;color:var(--foreground-subdued)}
.form-error{font-size:11.5px;color:var(--destructive)}
.input-prefix-wrap{position:relative}
.input-prefix-wrap .prefix{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--foreground-subdued);font-size:13px;pointer-events:none}
.input-prefix-wrap .form-input{padding-left:24px}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.check-row{display:flex;align-items:center;gap:8px;cursor:pointer}
.check-box{width:16px;height:16px;border:1.5px solid var(--border);border-radius:4px;background:var(--card);flex-shrink:0;cursor:pointer;appearance:none;-webkit-appearance:none;transition:all .15s}
.check-box:checked{background:var(--primary);border-color:var(--primary)}
.check-box:checked::after{content:'';width:9px;height:6px;border-left:2px solid var(--primary-foreground);border-bottom:2px solid var(--primary-foreground);transform:rotate(-45deg) translateY(-1px);display:block;margin:3px auto}
.switch-wrap{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius)}
.switch-label{font-size:13px;font-weight:500;color:var(--foreground)}
.switch-desc{font-size:11.5px;color:var(--foreground-subdued);margin-top:1px}
/* Switch. `border:none;padding:0` so it is identical whether authored as a <button> (correct,
   keyboard-operable) or a <div>. Never scale a switch with transform — use .toggle-sm. */
.toggle{position:relative;display:inline-block;width:38px;height:22px;background:var(--border);border:none;padding:0;border-radius:11px;cursor:pointer;transition:background .2s;flex-shrink:0;-webkit-appearance:none;appearance:none}
.toggle.on{background:var(--primary)}
.toggle::after{content:'';position:absolute;width:16px;height:16px;background:#fff;border-radius:50%;top:3px;left:3px;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.toggle.on::after{transform:translateX(16px)}
.toggle:focus-visible{outline:2px solid var(--btn-focus-ring);outline-offset:2px}
.toggle[disabled]{opacity:.5;cursor:not-allowed}
/* Checkbox painted for carriers that are not an <input> — menu rows where the row itself is
   the control. Identical box to .check-box: one checkbox appearance, two carriers. */
.check-box-visual{width:16px;height:16px;border:1.5px solid var(--border);border-radius:4px;background:var(--card);flex-shrink:0;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;color:transparent;transition:background .12s,border-color .12s}
.on>.check-box-visual,.check-box-visual.on{background:var(--primary);border-color:var(--primary);color:var(--primary-foreground)}
/* Small: for dense rows — menu rows, table toolbars, inline settings. Redrawn, not scaled. */
.toggle-sm{width:30px;height:18px;border-radius:9px}
.toggle-sm::after{width:12px;height:12px;top:3px;left:3px}
.toggle-sm.on::after{transform:translateX(12px)}

.tbl{width:100%;border-collapse:collapse}
.tbl th{padding:var(--density-table-py) 16px;text-align:left;font-size:12px;font-weight:500;color:var(--foreground-subdued);border-bottom:1px solid var(--border);background:var(--surface);white-space:nowrap}
.tbl th.right{text-align:right}
.tbl td{padding:var(--density-table-py) 16px;font-size:13px;color:var(--foreground);border-bottom:1px solid var(--border-soft)}
.tbl tr:last-child td{border-bottom:none}
.tbl tr:hover td{background:var(--accent)}
.tbl td.mono{font-family:var(--mono);font-size:12px;text-align:right}
.tbl-bordered td,.tbl-bordered th{border:1px solid var(--border)}
.tbl-striped tbody tr:nth-child(even) td{background:rgba(0,0,0,.02)}
.dark .tbl-striped tbody tr:nth-child(even) td{background:rgba(255,255,255,.02)}
.tbl-borderless td{border-bottom:none}
.tbl-search{padding:12px 16px;border-bottom:1px solid var(--border-soft);display:flex;align-items:center;gap:8px}
.tbl-search-input{width:240px;height:32px;padding:0 10px 0 32px;border:1px solid var(--border);border-radius:var(--radius);font-size:12.5px;font-family:var(--font);color:var(--foreground);background:var(--surface);outline:none}
.tbl-search-input:focus{border-color:var(--ring);background:var(--card)}
.tbl-footer{padding:10px 16px;border-top:1px solid var(--border-soft);display:flex;justify-content:space-between;align-items:center;background:var(--surface)}
.tbl-footer span{font-size:12px;color:var(--foreground-subdued)}

.alert{display:flex;gap:8px;padding:8px 12px;border-radius:var(--radius);border:1px solid transparent;font-size:13px;position:relative}
.alert-icon{flex-shrink:0;margin-top:1px}
.alert-title{font-weight:600;font-size:13px}
.alert-desc{font-size:12.5px;opacity:.85}
.alert-info{background:var(--info-surface);border-color:var(--info-border);color:var(--info-foreground)}
.alert-success{background:var(--success-surface);border-color:var(--success-border);color:var(--success-foreground)}
.alert-warning{background:var(--warning-surface);border-color:var(--warning-border);color:var(--warning-foreground)}
.alert-danger{background:var(--destructive-surface);border-color:var(--destructive-border);color:var(--destructive-foreground)}
.alert .alert-close{position:absolute;right:8px;top:8px;background:none;border:none;cursor:pointer;color:inherit;opacity:.5;padding:2px}
.alert .alert-close:hover{opacity:1}

#toast-container{position:fixed;bottom:20px;right:20px;z-index:9999;pointer-events:none}
.toast{display:flex;align-items:flex-start;gap:10px;padding:12px 16px;background:rgba(0,0,0,.88);color:#fff;border:1px solid rgba(255,255,255,.08);border-radius:var(--radius);font-size:13px;width:340px;box-shadow:0 8px 24px rgba(0,0,0,.3);backdrop-filter:blur(8px);pointer-events:auto;cursor:default;position:absolute;bottom:0;right:0;transition:transform .35s cubic-bezier(.2,.9,.3,1),opacity .35s ease;transform-origin:center bottom}
.toast-icon{flex-shrink:0}
.toast-icon.success{color:#4ade80}
.toast-icon.error{color:#f87171}
.toast-icon.warning{color:#fbbf24}
.toast-icon.info{color:#60a5fa}
.toast-body{flex:1;min-width:0}
.toast-title{font-weight:500}
.toast-desc{font-size:12px;opacity:.7;margin-top:1px}
.toast-undo{margin-left:auto;padding:4px 10px;background:rgba(255,255,255,.15);border-radius:4px;font-size:12px;font-weight:500;cursor:pointer;white-space:nowrap;flex-shrink:0;border:none;color:#fff;font-family:var(--font)}
.toast-undo:hover{background:rgba(255,255,255,.25)}
.toast-progress{position:absolute;bottom:0;left:0;right:0;height:2px;background:rgba(255,255,255,.1);border-radius:0 0 var(--radius) var(--radius);overflow:hidden}
.toast-progress-bar{height:100%;background:rgba(255,255,255,.4);animation:progressShrink 4s linear forwards}

.overlay{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;z-index:1000;animation:fadeIn .2s ease;backdrop-filter:blur(2px)}
.dark .overlay{background:rgba(0,0,0,.55)}
.modal{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-lg);width:480px;max-width:95vw;box-shadow:var(--shadow-lg);animation:scaleIn .2s ease}
.modal-header{padding:20px 20px 14px;border-bottom:1px solid var(--border-soft)}
.modal-title{font-size:16px;font-weight:600;color:var(--foreground)}
.modal-desc{font-size:13px;color:var(--foreground-subdued);margin-top:3px}
.modal-body{padding:20px}
.modal-footer{padding:12px 20px;border-top:1px solid var(--border-soft);display:flex;justify-content:flex-end;gap:8px;background:var(--surface);border-radius:0 0 var(--radius-lg) var(--radius-lg)}
.sheet-overlay{position:fixed;inset:0;background:rgba(0,0,0,.3);z-index:1000;animation:fadeIn .2s ease;backdrop-filter:blur(2px)}
.sheet{position:fixed;top:0;right:0;bottom:0;width:420px;max-width:95vw;background:var(--card);border-left:1px solid var(--border);box-shadow:-8px 0 32px rgba(0,0,0,.1);z-index:1001;display:flex;flex-direction:column;animation:slideLeft .25s ease}
.sheet-header{padding:20px;border-bottom:1px solid var(--border-soft)}
.sheet-title{font-size:16px;font-weight:600;color:var(--foreground)}
.sheet-desc{font-size:13px;color:var(--foreground-subdued);margin-top:3px}
.sheet-body{padding:20px;flex:1;overflow-y:auto}
.sheet-footer{padding:12px 20px;border-top:1px solid var(--border-soft);display:flex;justify-content:flex-end;gap:8px;background:var(--surface)}

.dropdown-wrap{position:relative;display:inline-flex}
.dropdown-menu{position:absolute;top:calc(100% + 4px);left:0;background:var(--card);border:1px solid var(--border);border-radius:8px;box-shadow:0 4px 16px rgba(0,0,0,.12),0 0 0 1px rgba(0,0,0,.05);min-width:180px;z-index:200;overflow:hidden;animation:scaleIn .12s ease;transform-origin:top left;padding:4px}
.dropdown-label{padding:6px 12px 4px;font-size:11px;font-weight:600;color:var(--foreground-subdued);text-transform:uppercase;letter-spacing:.04em}
.dropdown-item{display:flex;align-items:center;gap:8px;padding:7px 8px;font-size:13px;color:var(--foreground);cursor:pointer;transition:background .08s;border-radius:calc(var(--radius) - 2px);outline:none}
.dropdown-item:hover,.dropdown-item.kb-active{background:var(--accent)}
.dropdown-item.danger{color:var(--destructive)}
.dropdown-item.danger:hover{background:var(--destructive-surface)}
.dropdown-item.danger:hover,.dropdown-item.danger.kb-active{background:var(--destructive-surface)}
.dropdown-sep{height:1px;background:var(--border);margin:4px 0}

.tab-trigger{padding:9px 16px;font-size:13px;font-weight:500;color:var(--foreground-subdued);cursor:pointer;border:none;background:none;font-family:var(--font);border-bottom:2px solid transparent;margin-bottom:-1px;transition:all .12s}
.tab-trigger:hover{color:var(--foreground)}
.tab-trigger.active{color:var(--foreground);border-bottom-color:var(--primary)}
.tab-content{display:none}
.tab-content.active{display:block}

.search-overlay{position:fixed;inset:0;background:var(--search-overlay-bg);z-index:2000;display:flex;align-items:flex-start;justify-content:center;padding-top:min(20vh,140px);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);animation:fadeIn .15s ease}
.search-panel{background:var(--card);border:1px solid var(--border);border-radius:12px;width:640px;max-width:95vw;max-height:70vh;box-shadow:var(--shadow-lg);animation:scaleIn .15s ease;display:flex;flex-direction:column;overflow:hidden}
.search-input-wrap{display:flex;align-items:center;gap:8px;padding:0 16px;height:52px;border-bottom:1px solid var(--border-soft)}
.search-input-icon{color:var(--foreground-subdued);flex-shrink:0}
.search-scope-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:500;flex-shrink:0}
.search-scope-people{background:var(--info-surface);color:var(--info-foreground)}
.search-scope-actions{background:var(--warning-surface);color:var(--warning-foreground)}
.search-scope-pages{background:var(--secondary);color:var(--secondary-foreground)}
.search-input{flex:1;border:none;outline:none;background:transparent;font-size:16px;font-family:var(--font);color:var(--foreground);height:100%}
.search-input::placeholder{color:var(--foreground-disabled)}
.search-esc{padding:2px 6px;border-radius:4px;font-size:10px;font-weight:600;font-family:var(--mono);color:var(--foreground-disabled);border:1px solid var(--border);background:var(--surface);cursor:pointer;flex-shrink:0}
.search-results{overflow-y:auto;flex:1;padding:8px}
.search-section-label{font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--foreground-disabled);padding:8px 8px 4px}
.search-result{display:flex;align-items:center;gap:10px;padding:8px;border-radius:var(--radius);cursor:pointer;transition:background .08s;font-size:13px;color:var(--foreground)}
.search-result:hover,.search-result.active{background:var(--primary);color:var(--primary-foreground)}
.search-result.active .search-result-meta,.search-result:hover .search-result-meta{color:var(--primary-foreground);opacity:.7}
.search-result-meta{font-size:12px;color:var(--foreground-subdued);margin-left:auto;white-space:nowrap}
.search-result-icon{width:32px;height:32px;border-radius:var(--radius);background:var(--surface);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--foreground-subdued)}
.search-result.active .search-result-icon,.search-result:hover .search-result-icon{background:rgba(255,255,255,.15);color:var(--primary-foreground)}
.search-footer{padding:8px 16px;border-top:1px solid var(--border-soft);display:flex;gap:16px;font-size:11px;color:var(--foreground-disabled);background:var(--surface)}
.search-footer kbd{padding:1px 5px;border-radius:3px;border:1px solid var(--border);background:var(--card);font-family:var(--mono);font-size:10px}

.datepicker{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:16px;width:280px;box-shadow:0 4px 16px rgba(0,0,0,.08)}
.datepicker-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.datepicker-month{font-size:14px;font-weight:600}
.datepicker-nav{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;color:var(--foreground-subdued);border:none;background:none}
.datepicker-nav:hover{background:var(--accent);color:var(--foreground)}
.datepicker-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;text-align:center}
.datepicker-dow{font-size:11px;font-weight:600;color:var(--foreground-disabled);padding:4px 0;text-transform:uppercase}
.datepicker-day{font-size:13px;width:34px;height:34px;display:flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;color:var(--foreground);font-weight:450;margin:0 auto;border:none;background:none}
.datepicker-day:hover{background:var(--accent)}
.datepicker-day.today{font-weight:650;color:var(--foreground)}
.datepicker-day.selected{background:rgba(48,48,48,1);color:#fff;font-weight:600}
.datepicker-day.in-range{background:rgba(48,48,48,.08);border-radius:0}
.datepicker-day.range-start{background:rgba(48,48,48,1);color:#fff;border-radius:var(--radius) 0 0 var(--radius)}
.datepicker-day.range-end{background:rgba(48,48,48,1);color:#fff;border-radius:0 var(--radius) var(--radius) 0}
.datepicker-day.other-month{color:var(--foreground-disabled);opacity:.4}
.datepicker-day.disabled{opacity:.25;cursor:not-allowed;pointer-events:none}
.dark .datepicker-day.selected,.dark .datepicker-day.range-start,.dark .datepicker-day.range-end{background:rgba(255,255,255,.9);color:rgba(26,26,26,1)}
.dark .datepicker-day.in-range{background:rgba(255,255,255,.08)}
.datepicker-footer{display:flex;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}

.progress{height:8px;background:var(--border-soft);border-radius:4px;overflow:hidden;position:relative}
.progress-fill{height:100%;border-radius:4px;transition:width .4s ease}
.progress-fill.default{background:rgba(48,48,48,.75)}
.progress-fill.success{background:var(--success-fill)}
.progress-fill.warning{background:var(--warning-fill)}
.progress-fill.critical{background:var(--destructive)}
.dark .progress-fill.default{background:rgba(255,255,255,.65)}
.progress-sm{height:4px}
.progress-lg{height:12px;border-radius:6px}.progress-lg .progress-fill{border-radius:6px}
.progress-label{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px}
.progress-label-text{font-size:13px;font-weight:500}
.progress-label-value{font-size:13px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--foreground-subdued)}
.progress-group{margin-bottom:16px}
.progress-steps{display:flex;gap:4px}
.progress-step{flex:1;height:6px;border-radius:3px;background:var(--border-soft)}
.progress-step.filled{background:rgba(48,48,48,.75)}
.dark .progress-step.filled{background:rgba(255,255,255,.65)}
.progress-circular{position:relative;display:inline-flex;align-items:center;justify-content:center}
.progress-circular>svg{transform:rotate(-90deg)}
.progress-circular-label{position:absolute;font-size:13px;font-weight:650;font-variant-numeric:tabular-nums}

/* SKELETON */
/* The shape of an answer that has not arrived yet. Shape-typed, not pixel-typed. The doctrine promises "a skeleton matching the real content
   shape"; a skeleton whose height is typed in at the call site is a promise the real content is
   under no obligation to keep. Text shapes are in em so one class is right in a 13px cell and
   an 11px label alike. */
.skel{background:linear-gradient(90deg,var(--skel-base) 25%,var(--skel-shine) 50%,var(--skel-base) 75%);background-size:200% 100%;border-radius:var(--radius);animation:shimmer 1.5s infinite}
@keyframes shimmer{to{background-position:-200% 0}}
.skel-text{height:.62em;border-radius:3px}
.skel-title{height:.8em;border-radius:3px}
.skel-line{display:block;height:.62em;border-radius:3px}
.skel-line+.skel-line{margin-top:6px}
.skel-badge{height:22px;width:66px;border-radius:var(--radius)}
.skel-btn{height:28px;border-radius:calc(var(--radius) - 2px)}
.skel-chip{height:20px;width:54px;border-radius:var(--radius)}
.skel-sq{border-radius:6px}
.skel-w25{width:25%}.skel-w40{width:40%}.skel-w50{width:50%}.skel-w60{width:60%}.skel-w75{width:75%}.skel-w100{width:100%}
/* An animation clamped to .01ms freezes the shine band wherever it happened to be, which reads
   as a rendering fault. A flat fill is the honest reduced-motion answer. The global guard lives
   outside every build range, so the skeleton carries its own. */
@media(prefers-reduced-motion:reduce){.skel{animation:none;background-image:none;background:var(--skel-base)}}
/* EMPTY STATE */
.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:48px 24px}
.empty-icon{width:56px;height:56px;border-radius:50%;background:var(--surface);display:flex;align-items:center;justify-content:center;margin-bottom:16px;border:1px solid var(--border)}
.empty-title{font-size:15px;font-weight:600;margin-bottom:6px;color:var(--foreground)}
.empty-desc{font-size:13px;color:var(--foreground-subdued);max-width:280px;margin-bottom:20px}
/* AVATAR */
.avatar{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;font-weight:600;line-height:1;position:relative;background:var(--muted);color:var(--muted-foreground);user-select:none}
.avatar-xs{width:20px;height:20px;font-size:8px}.avatar-sm{width:24px;height:24px;font-size:9px}.avatar-md{width:32px;height:32px;font-size:12px}.avatar-lg{width:40px;height:40px;font-size:14px}.avatar-xl{width:64px;height:64px;font-size:20px}.avatar-2xl{width:96px;height:96px;font-size:28px}
.avatar-square{border-radius:var(--radius)!important}.avatar-circle{border-radius:50%!important}
.avatar img{width:100%;height:100%;object-fit:cover}
.avatar-deactivated{filter:grayscale(1);opacity:.7}
.avatar-pending{border:2px dashed var(--border)!important}
.avatar-presence{position:absolute;bottom:-1px;right:-1px;width:10px;height:10px;border-radius:50%;border:2px solid var(--card)}
.avatar-presence-online{background:#4ade80}.avatar-presence-away{background:#fbbf24}.avatar-presence-busy{background:#f87171}.avatar-presence-offline{background:#d1d5db}
.avatar-group{display:flex}.avatar-group>*{margin-left:-8px;border:2px solid var(--card)}.avatar-group>*:first-child{margin-left:0}
.avatar-overflow{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--muted);font-size:10px;font-weight:600;color:var(--foreground-subdued);border:2px solid var(--card)}
/* THUMBNAIL — an image of a THING. For an image of a person, use .avatar.
   The difference is the empty state, and it is not cosmetic: an empty .avatar falls back to
   initials, because a person always has a name. A product may genuinely have no image, so an
   empty .thumb falls back to a glyph and is a finished state rather than a gap. It is also
   always square-ish and never overlapped in a group — you can recognise a face from a sliver,
   but half a product is not a product. Sizes deliberately match the .avatar ladder so the two
   line up when they share a row. */
.thumb{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;flex-shrink:0;overflow:hidden;line-height:0;user-select:none;background:var(--surface);color:var(--foreground-disabled);border:1px solid var(--border-soft);border-radius:6px}
.thumb-xs{width:20px;height:20px;border-radius:4px}
.thumb-sm{width:24px;height:24px;border-radius:4px}
.thumb-lg{width:40px;height:40px;border-radius:6px}
.thumb-xl{width:64px;height:64px;border-radius:var(--radius)}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
/* A src that 404s leaves an alt-text stub inside a rounded box, which reads as a broken layout
   rather than a missing picture. Drop the img and show the placeholder the empty state uses. */
.thumb-broken{border-style:dashed}
/* PERSON CARD */
