/* shadcn-style component library — extracted from _components_css.py (PUB-452 P3). */
/* ═══════════════════════════════════════════════════════════════════════
   SHADCN-INSPIRED COMPONENT LIBRARY  —  etermax-mcp
   All classes prefixed with `shd-` to avoid collisions.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── 1. Button ───────────────────────────────────────────────────────── */
.shd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; white-space: nowrap; font-weight: 500;
  border-radius: var(--radius-sm); font-family: var(--font);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; line-height: 1.25;
  outline: none;
}
.shd-btn:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.shd-btn:disabled, .shd-btn[disabled] { opacity: 0.5; pointer-events: none; }
.shd-btn svg { flex-shrink: 0; }

/* variants */
.shd-btn-default  { background: var(--accent); color: #fff; }
.shd-btn-default:hover { background: var(--accent-hover); }

.shd-btn-destructive  { background: var(--danger); color: #fff; }
.shd-btn-destructive:hover { opacity: 0.9; }

.shd-btn-outline  { border-color: var(--border); background: var(--bg); color: var(--text); }
.shd-btn-outline:hover { background: var(--bg-secondary); }

.shd-btn-secondary  { background: var(--bg-secondary); color: var(--text); }
.shd-btn-secondary:hover { opacity: 0.85; }

.shd-btn-ghost  { background: transparent; color: var(--text); }
.shd-btn-ghost:hover { background: var(--bg-secondary); }

.shd-btn-link  { background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.shd-btn-link:hover { text-decoration: underline; opacity: 0.85; }

/* sizes */
.shd-btn-xs  { height: 1.75rem; padding: 0 0.5rem; font-size: 0.6875rem; }
.shd-btn-sm  { height: 2rem;    padding: 0 0.75rem; font-size: 0.75rem; }
.shd-btn-md  { height: 2.25rem; padding: 0 1rem;    font-size: 0.8125rem; }
.shd-btn-lg  { height: 2.75rem; padding: 0 1.5rem;  font-size: 0.875rem; }
.shd-btn-icon { height: 2.25rem; width: 2.25rem; padding: 0; }
.shd-btn-icon-sm { height: 2rem; width: 2rem; padding: 0; }
.shd-btn-icon-lg { height: 2.75rem; width: 2.75rem; padding: 0; }

/* ── 2. Badge ────────────────────────────────────────────────────────── */
.shd-badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  border-radius: 999px; font-weight: 600; font-family: var(--font);
  padding: 0.125rem 0.625rem; font-size: 0.6875rem;
  line-height: 1.4; border: 1px solid transparent;
  white-space: nowrap; transition: background 0.15s;
}
.shd-badge-default    { background: var(--accent); color: #fff; }
.shd-badge-secondary  { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border); }
.shd-badge-destructive { background: var(--danger); color: #fff; }
.shd-badge-outline    { background: transparent; color: var(--text); border-color: var(--border); }
.shd-badge-success    { background: var(--success-subtle); color: var(--success); }
.shd-badge-warning    { background: var(--warning-subtle); color: var(--warning); }

/* ── 3. Card ─────────────────────────────────────────────────────────── */
.shd-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.shd-card-sm { padding: 0; }
.shd-card-header {
  display: flex; flex-direction: column; gap: 0.375rem;
  padding: 1.25rem 1.25rem 0;
}
.shd-card-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem;
}
.shd-card-title { font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.shd-card-description { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.5; }
.shd-card-action { flex-shrink: 0; }
.shd-card-content { padding: 1.25rem; }
.shd-card-header + .shd-card-content { padding-top: 0.75rem; }
.shd-card-footer {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
}

/* ── 4. Table ────────────────────────────────────────────────────────── */
.shd-table-wrap {
  width: 100%; overflow-x: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.shd-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.8125rem; font-family: var(--font);
  caption-side: bottom;
}
.shd-table caption {
  padding: 0.75rem 1rem; color: var(--text-muted);
  font-size: 0.8125rem; text-align: left;
}
.shd-table thead { background: var(--bg-secondary); }
.shd-table th {
  padding: 0.625rem 1rem; text-align: left; font-weight: 600;
  color: var(--text-muted); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.shd-table td {
  padding: 0.625rem 1rem; color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.shd-table tbody tr:last-child td { border-bottom: none; }
.shd-table tbody tr:hover { background: var(--bg-secondary); }
.shd-table tfoot { background: var(--bg-secondary); font-weight: 600; }
.shd-table tfoot td { border-bottom: none; border-top: 1px solid var(--border); }
.shd-table .text-right { text-align: right; }
.shd-table .text-center { text-align: center; }

/* ── 5. Tabs ─────────────────────────────────────────────────────────── */
.shd-tabs {}
.shd-tabs-list {
  display: inline-flex; align-items: center; gap: 0.25rem;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  padding: 0.25rem;
}
.shd-tabs-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.375rem; padding: 0.375rem 0.875rem;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 0.8125rem; font-weight: 500; font-family: var(--font);
  color: var(--text-muted); background: transparent;
  border: none; cursor: pointer; transition: all 0.15s;
  white-space: nowrap;
}
.shd-tabs-trigger:hover { color: var(--text); }
.shd-tabs-trigger.active {
  background: var(--bg-card); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.shd-tabs-content { display: none; padding-top: 1rem; }
.shd-tabs-content.active { display: block; }

/* line variant */
.shd-tabs-list-line {
  display: inline-flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--border);
  background: transparent; padding: 0; border-radius: 0;
}
.shd-tabs-list-line .shd-tabs-trigger {
  border-radius: 0; padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.shd-tabs-list-line .shd-tabs-trigger.active {
  border-bottom-color: var(--accent); color: var(--text);
  background: transparent; box-shadow: none;
}

/* ── 6. Alert ────────────────────────────────────────────────────────── */
.shd-alert {
  display: flex; gap: 0.75rem; padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font);
}
.shd-alert-icon { flex-shrink: 0; margin-top: 1px; }
.shd-alert-body { flex: 1; min-width: 0; }
.shd-alert-title { font-weight: 600; font-size: 0.875rem; color: var(--text); line-height: 1.4; }
.shd-alert-description { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; line-height: 1.5; }
.shd-alert-default { border-color: var(--border); background: var(--bg-card); }
.shd-alert-destructive { border-color: var(--danger); background: var(--danger-subtle); }
.shd-alert-destructive .shd-alert-title { color: var(--danger); }
.shd-alert-destructive .shd-alert-icon { color: var(--danger); }
.shd-alert-success { border-color: var(--success); background: var(--success-subtle); }
.shd-alert-success .shd-alert-title { color: var(--success); }
.shd-alert-warning { border-color: var(--warning); background: var(--warning-subtle); }
.shd-alert-warning .shd-alert-title { color: var(--warning); }
.shd-alert-warning .shd-alert-icon { color: var(--warning); }
.shd-alert-info { border-color: var(--accent); background: var(--accent-subtle); }
.shd-alert-info .shd-alert-title { color: var(--accent); }
.shd-alert-info .shd-alert-icon { color: var(--accent); }
.shd-alert-success .shd-alert-icon { color: var(--success); }

/* ── 6b. Banner (page-level announcement) ────────────────────────────── */
.shd-banner {
  display: flex; gap: 1rem; padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font);
  position: relative;
  overflow: hidden;
}
.shd-banner::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: var(--radius) 0 0 var(--radius);
}
.shd-banner-icon { flex-shrink: 0; margin-top: 2px; }
.shd-banner-body { flex: 1; min-width: 0; }
.shd-banner-title { font-weight: 700; font-size: 0.9375rem; line-height: 1.4; }
.shd-banner-description { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.375rem; line-height: 1.5; }
.shd-banner-action { margin-top: 0.75rem; }
.shd-banner-default { background: var(--bg-card); box-shadow: var(--shadow-md); }
.shd-banner-default::before { background: var(--border); }
.shd-banner-destructive { background: var(--danger-subtle); box-shadow: var(--shadow-md); }
.shd-banner-destructive::before { background: var(--danger); }
.shd-banner-destructive .shd-banner-title { color: var(--danger); }
.shd-banner-destructive .shd-banner-icon { color: var(--danger); }
.shd-banner-success { background: var(--success-subtle); box-shadow: var(--shadow-md); }
.shd-banner-success::before { background: var(--success); }
.shd-banner-success .shd-banner-title { color: var(--success); }
.shd-banner-success .shd-banner-icon { color: var(--success); }
.shd-banner-warning { background: var(--warning-subtle); box-shadow: var(--shadow-md); }
.shd-banner-warning::before { background: var(--warning); }
.shd-banner-warning .shd-banner-title { color: var(--warning); }
.shd-banner-warning .shd-banner-icon { color: var(--warning); }
.shd-banner-info { background: var(--accent-subtle); box-shadow: var(--shadow-md); }
.shd-banner-info::before { background: var(--accent); }
.shd-banner-info .shd-banner-title { color: var(--accent); }
.shd-banner-info .shd-banner-icon { color: var(--accent); }

/* ── 7. Toast (Sonner-style) ─────────────────────────────────────────── */
.shd-toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 9999; pointer-events: none;
}
.shd-toast {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1rem; min-width: 280px; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  font-family: var(--font); pointer-events: auto;
  transform: translateX(120%); opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
}
.shd-toast.shd-toast-visible { transform: translateX(0); opacity: 1; }
.shd-toast-icon { flex-shrink: 0; margin-top: 1px; }
.shd-toast-body { flex: 1; min-width: 0; }
.shd-toast-title { font-weight: 600; font-size: 0.8125rem; color: var(--text); }
.shd-toast-description { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.shd-toast-close {
  flex-shrink: 0; background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0.125rem; margin-top: -0.125rem;
}
.shd-toast-close:hover { color: var(--text); }
.shd-toast-success .shd-toast-icon { color: var(--success); }
.shd-toast-error .shd-toast-icon { color: var(--danger); }

/* ── 8. Tooltip ──────────────────────────────────────────────────────── */
.shd-tooltip-wrap { position: relative; display: inline-flex; }
.shd-tooltip {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%) scale(0.96); opacity: 0;
  padding: 0.375rem 0.75rem; border-radius: var(--radius-sm);
  background: var(--text); color: var(--bg);
  font-size: 0.75rem; font-weight: 500; font-family: var(--font);
  white-space: nowrap; pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 50;
}
.shd-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--text);
}
.shd-tooltip-wrap:hover .shd-tooltip,
.shd-tooltip-wrap:focus-within .shd-tooltip {
  opacity: 1; transform: translateX(-50%) scale(1);
}
/* side variants */
.shd-tooltip-bottom {
  bottom: auto; top: calc(100% + 6px);
}
.shd-tooltip-bottom::after {
  top: auto; bottom: 100%;
  border-top-color: transparent; border-bottom-color: var(--text);
}
.shd-tooltip-left {
  bottom: auto; top: 50%; left: auto; right: calc(100% + 6px);
  transform: translateY(-50%) scale(0.96);
}
.shd-tooltip-wrap:hover .shd-tooltip-left { transform: translateY(-50%) scale(1); }
.shd-tooltip-left::after {
  top: 50%; left: 100%; bottom: auto;
  transform: translateY(-50%) translateX(0);
  border-top-color: transparent; border-left-color: var(--text);
}
.shd-tooltip-right {
  bottom: auto; top: 50%; left: calc(100% + 6px);
  transform: translateY(-50%) scale(0.96);
}
.shd-tooltip-wrap:hover .shd-tooltip-right { transform: translateY(-50%) scale(1); }
.shd-tooltip-right::after {
  top: 50%; right: 100%; left: auto; bottom: auto;
  transform: translateY(-50%) translateX(0);
  border-top-color: transparent; border-right-color: var(--text);
}

/* ── 9. Separator ────────────────────────────────────────────────────── */
.shd-separator {
  border: none; background: var(--border);
}
.shd-separator-h { height: 1px; width: 100%; }
.shd-separator-v { width: 1px; height: 100%; display: inline-block; vertical-align: middle; }

/* ── 10. Toggle ──────────────────────────────────────────────────────── */
.shd-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); font-family: var(--font);
  font-weight: 500; cursor: pointer; transition: all 0.15s;
  border: 1px solid transparent; background: transparent;
  color: var(--text-muted);
}
.shd-toggle:hover { background: var(--bg-secondary); color: var(--text); }
.shd-toggle.active { background: var(--bg-secondary); color: var(--text); }
.shd-toggle-outline { border-color: var(--border); }
.shd-toggle-outline.active { background: var(--bg-secondary); }
.shd-toggle-sm { height: 2rem; padding: 0 0.5rem; font-size: 0.75rem; }
.shd-toggle-md { height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.shd-toggle-lg { height: 2.75rem; padding: 0 1rem; font-size: 0.875rem; }
.shd-toggle:disabled { opacity: 0.5; pointer-events: none; }

/* ── 11. Input ───────────────────────────────────────────────────────── */
.shd-input {
  display: flex; width: 100%; height: 2.25rem;
  padding: 0.375rem 0.75rem; font-size: 0.8125rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-family: var(--font); transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.shd-input::placeholder { color: var(--text-muted); }
.shd-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,179,116,0.15); }
.shd-input:disabled { opacity: 0.5; cursor: not-allowed; }
.shd-input[aria-invalid="true"] { border-color: var(--danger); }
.shd-input-sm { height: 2rem; font-size: 0.75rem; padding: 0.25rem 0.625rem; }
.shd-input-lg { height: 2.75rem; font-size: 0.875rem; padding: 0.5rem 1rem; }

.shd-input-group {
  display: flex; align-items: stretch;
}
.shd-input-group .shd-input { border-radius: 0; }
.shd-input-group .shd-input:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.shd-input-group .shd-input:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.shd-input-addon {
  display: flex; align-items: center; padding: 0 0.75rem;
  background: var(--bg-secondary); border: 1px solid var(--border);
  font-size: 0.8125rem; color: var(--text-muted);
  white-space: nowrap;
}
.shd-input-addon:first-child { border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.shd-input-addon:last-child { border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── 12. Textarea ────────────────────────────────────────────────────── */
.shd-textarea {
  display: flex; width: 100%; min-height: 5rem;
  padding: 0.5rem 0.75rem; font-size: 0.8125rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-family: var(--font); transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; resize: vertical;
}
.shd-textarea::placeholder { color: var(--text-muted); }
.shd-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,179,116,0.15); }
.shd-textarea:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 13. Label ───────────────────────────────────────────────────────── */
.shd-label {
  font-size: 0.8125rem; font-weight: 500; color: var(--text);
  font-family: var(--font); line-height: 1;
}

/* ── 14. Select ──────────────────────────────────────────────────────── */
.shd-select-wrap { position: relative; display: inline-flex; }
.shd-select {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; height: 2.25rem; padding: 0.375rem 0.75rem;
  font-size: 0.8125rem; font-family: var(--font);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  cursor: pointer; outline: none; min-width: 140px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2rem;
}
.shd-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,179,116,0.15); }
.shd-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 15. Checkbox ────────────────────────────────────────────────────── */
.shd-checkbox-wrap { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.shd-checkbox {
  width: 1rem; height: 1rem; border: 1px solid var(--border);
  border-radius: 3px; background: var(--bg); cursor: pointer;
  appearance: none; display: grid; place-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.shd-checkbox:checked {
  background: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}
.shd-checkbox:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.shd-checkbox:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── 16. Radio ───────────────────────────────────────────────────────── */
.shd-radio-wrap { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.shd-radio {
  width: 1rem; height: 1rem; border: 1px solid var(--border);
  border-radius: 50%; background: var(--bg); cursor: pointer;
  appearance: none; display: grid; place-content: center;
  transition: border-color 0.15s;
}
.shd-radio:checked {
  border-color: var(--accent); border-width: 4px;
}
.shd-radio:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }

/* ── 17. Switch ──────────────────────────────────────────────────────── */
.shd-switch {
  position: relative; display: inline-flex; align-items: center;
  width: 2.75rem; height: 1.5rem; padding: 0.125rem;
  border-radius: 999px; background: var(--bg-secondary);
  border: 1px solid var(--border); cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.shd-switch::after {
  content: ''; width: 1.125rem; height: 1.125rem;
  border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}
.shd-switch.active, .shd-switch[data-checked="true"] {
  background: var(--accent); border-color: var(--accent);
}
.shd-switch.active::after, .shd-switch[data-checked="true"]::after {
  transform: translateX(1.25rem);
}
.shd-switch:disabled { opacity: 0.5; cursor: not-allowed; }
.shd-switch-sm { width: 2.25rem; height: 1.25rem; }
.shd-switch-sm::after { width: 0.875rem; height: 0.875rem; }
.shd-switch-sm.active::after { transform: translateX(1rem); }

/* ── 18. Progress ────────────────────────────────────────────────────── */
.shd-progress {
  width: 100%; height: 0.5rem; background: var(--bg-secondary);
  border-radius: 999px; overflow: hidden;
}
.shd-progress-bar {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.16,1,0.3,1);
}
.shd-progress-sm { height: 0.25rem; }
.shd-progress-lg { height: 0.75rem; }

/* ── 19. Skeleton ────────────────────────────────────────────────────── */
.shd-skeleton {
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  animation: shd-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite;
}
@keyframes shd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── 20. Avatar ──────────────────────────────────────────────────────── */
.shd-avatar {
  position: relative; display: inline-flex; align-items: center;
  justify-content: center; overflow: hidden;
  border-radius: 50%; background: var(--bg-secondary);
  flex-shrink: 0;
}
.shd-avatar-sm { width: 2rem; height: 2rem; font-size: 0.6875rem; }
.shd-avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.8125rem; }
.shd-avatar-lg { width: 3rem; height: 3rem; font-size: 1rem; }
.shd-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shd-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-weight: 600;
  color: var(--text-muted); font-family: var(--font);
}
.shd-avatar-group { display: flex; }
.shd-avatar-group .shd-avatar { margin-left: -0.5rem; border: 2px solid var(--bg); }
.shd-avatar-group .shd-avatar:first-child { margin-left: 0; }

/* ── 21. Dialog ──────────────────────────────────────────────────────── */
.shd-dialog-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.shd-dialog-backdrop.open { display: flex; }
.shd-dialog {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  width: 90%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  animation: shd-dialog-in 0.2s ease-out;
}
@keyframes shd-dialog-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.shd-dialog-header { padding: 1.25rem 1.25rem 0; }
.shd-dialog-title { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
.shd-dialog-description { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.375rem; line-height: 1.5; }
.shd-dialog-body { padding: 1.25rem; }
.shd-dialog-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 0 1.25rem 1.25rem;
}
.shd-dialog-close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0.25rem; border-radius: var(--radius-xs);
}
.shd-dialog-close:hover { color: var(--text); background: var(--bg-secondary); }

/* ── 22. Dropdown Menu ───────────────────────────────────────────────── */
.shd-dropdown-wrap { position: relative; display: inline-flex; }
.shd-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 200px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12); z-index: 50;
  overflow: hidden; padding: 0.25rem;
}
.shd-dropdown-wrap.open .shd-dropdown { display: block; }
.shd-dropdown-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.5rem; font-size: 0.8125rem;
  color: var(--text); cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
  border-radius: calc(var(--radius-sm) - 2px);
}
.shd-dropdown-item:hover { background: var(--bg-secondary); }
.shd-dropdown-item:disabled { opacity: 0.5; pointer-events: none; }
.shd-dropdown-label {
  padding: 0.375rem 0.5rem; font-size: 0.75rem;
  font-weight: 600; color: var(--text-muted);
}
.shd-dropdown-separator {
  height: 1px; background: var(--border); margin: 0.25rem 0;
}
.shd-dropdown-check {
  width: 0.875rem; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}

/* ── 23. Sheet (slide-over panel) ────────────────────────────────────── */
.shd-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; display: none; backdrop-filter: blur(2px);
}
.shd-sheet-backdrop.open { display: block; }
.shd-sheet {
  position: fixed; z-index: 101; background: var(--bg-card);
  border: 1px solid var(--border); overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}
.shd-sheet-right { top: 0; right: 0; bottom: 0; width: min(400px, 90vw); animation: shd-sheet-r-in 0.3s ease-out; }
@keyframes shd-sheet-r-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
.shd-sheet-left { top: 0; left: 0; bottom: 0; width: min(400px, 90vw); animation: shd-sheet-l-in 0.3s ease-out; }
@keyframes shd-sheet-l-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.shd-sheet-top { top: 0; left: 0; right: 0; max-height: 85vh; animation: shd-sheet-t-in 0.3s ease-out; }
@keyframes shd-sheet-t-in { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.shd-sheet-bottom { bottom: 0; left: 0; right: 0; max-height: 85vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation: shd-sheet-b-in 0.3s ease-out; }
@keyframes shd-sheet-b-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.shd-sheet-header { padding: 1.25rem; }
.shd-sheet-title { font-size: 1.0625rem; font-weight: 600; color: var(--text); }
.shd-sheet-description { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.shd-sheet-body { padding: 0 1.25rem 1.25rem; }
.shd-sheet-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0 1.25rem 1.25rem; }

/* ── 24. Accordion ───────────────────────────────────────────────────── */
.shd-accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shd-accordion-item { border-bottom: 1px solid var(--border); }
.shd-accordion-item:last-child { border-bottom: none; }
.shd-accordion-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0.875rem 1rem; font-size: 0.875rem;
  font-weight: 500; color: var(--text); background: none;
  border: none; cursor: pointer; text-align: left; font-family: var(--font);
}
.shd-accordion-trigger:hover { background: var(--bg-secondary); }
.shd-accordion-trigger svg { transition: transform 0.2s; flex-shrink: 0; }
.shd-accordion-item.open .shd-accordion-trigger svg { transform: rotate(180deg); }
.shd-accordion-content {
  display: none; padding: 0 1rem 0.875rem;
  font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6;
}
.shd-accordion-item.open .shd-accordion-content { display: block; }

/* ── 25. Popover ─────────────────────────────────────────────────────── */
.shd-popover-wrap { position: relative; display: inline-flex; }
.shd-popover {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); min-width: 240px; padding: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 50;
}
.shd-popover-wrap.open .shd-popover { display: block; }
.shd-popover-bottom { bottom: auto; top: calc(100% + 6px); }

/* ── 26. Hover Card ──────────────────────────────────────────────────── */
.shd-hovercard-wrap { position: relative; display: inline-flex; }
.shd-hovercard {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(0.96); opacity: 0;
  min-width: 260px; padding: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.shd-hovercard-wrap:hover .shd-hovercard {
  opacity: 1; transform: translateX(-50%) scale(1); pointer-events: auto;
}

/* ── 27. Breadcrumb ──────────────────────────────────────────────────── */
.shd-breadcrumb {
  display: flex; align-items: center; gap: 0.375rem;
  font-size: 0.8125rem; font-family: var(--font);
}
.shd-breadcrumb-item { color: var(--text-muted); text-decoration: none; }
.shd-breadcrumb-item:hover { color: var(--text); }
.shd-breadcrumb-item.active { color: var(--text); font-weight: 500; }
.shd-breadcrumb-sep { color: var(--text-muted); font-size: 0.75rem; }

/* ── 28. Pagination ──────────────────────────────────────────────────── */
.shd-pagination {
  display: flex; align-items: center; gap: 0.25rem;
  font-family: var(--font);
}
.shd-pagination-item {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 0.5rem;
  font-size: 0.8125rem; font-weight: 500;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text); cursor: pointer;
  transition: background 0.15s;
}
.shd-pagination-item:hover { background: var(--bg-secondary); }
.shd-pagination-item.active {
  border-color: var(--border); background: var(--bg-card);
}
.shd-pagination-item:disabled { opacity: 0.5; pointer-events: none; }
.shd-pagination-ellipsis { padding: 0 0.375rem; color: var(--text-muted); letter-spacing: 2px; }

/* ── 29. Kbd ─────────────────────────────────────────────────────────── */
.shd-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.125rem 0.375rem; font-size: 0.6875rem;
  font-family: var(--font-mono); font-weight: 500;
  background: var(--bg-secondary); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
  line-height: 1.4;
}

/* ── 30. Aspect Ratio ────────────────────────────────────────────────── */
.shd-aspect { position: relative; width: 100%; }
.shd-aspect > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shd-aspect-16-9 { aspect-ratio: 16/9; }
.shd-aspect-4-3 { aspect-ratio: 4/3; }
.shd-aspect-1-1 { aspect-ratio: 1/1; }
.shd-aspect-21-9 { aspect-ratio: 21/9; }

/* ── 31. Collapsible ─────────────────────────────────────────────────── */
.shd-collapsible {}
.shd-collapsible-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0.5rem 0; font-size: 0.875rem;
  font-weight: 500; color: var(--text); background: none;
  border: none; cursor: pointer; font-family: var(--font);
}
.shd-collapsible-trigger svg { transition: transform 0.2s; }
.shd-collapsible.open .shd-collapsible-trigger svg { transform: rotate(180deg); }
.shd-collapsible-content { display: none; }
.shd-collapsible.open .shd-collapsible-content { display: block; }

/* ── 32. Scroll Area ─────────────────────────────────────────────────── */
.shd-scroll-area {
  overflow: auto; position: relative;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.shd-scroll-area::-webkit-scrollbar { width: 6px; height: 6px; }
.shd-scroll-area::-webkit-scrollbar-track { background: transparent; }
.shd-scroll-area::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 999px;
}

/* ── 33. Resizable ───────────────────────────────────────────────────── */
.shd-resizable {
  display: flex; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.shd-resizable-panel { overflow: auto; }
.shd-resizable-handle {
  display: flex; align-items: center; justify-content: center;
  width: 8px; background: var(--bg-secondary); cursor: col-resize;
  flex-shrink: 0; border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.shd-resizable-handle::after {
  content: ''; width: 2px; height: 24px;
  border-radius: 999px; background: var(--text-muted);
  opacity: 0.4;
}
.shd-resizable-handle:hover::after { opacity: 0.8; }

/* ── 34. Slider ──────────────────────────────────────────────────────── */
.shd-slider {
  position: relative; display: flex; align-items: center;
  width: 100%; height: 1.25rem; cursor: pointer;
}
.shd-slider input[type="range"] {
  width: 100%; height: 6px; appearance: none;
  background: var(--bg-secondary); border-radius: 999px;
  outline: none;
}
.shd-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 1.25rem; height: 1.25rem;
  background: var(--bg-card); border: 2px solid var(--accent);
  border-radius: 50%; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.shd-slider input[type="range"]::-moz-range-thumb {
  width: 1.25rem; height: 1.25rem;
  background: var(--bg-card); border: 2px solid var(--accent);
  border-radius: 50%; cursor: pointer;
}

/* ── 35. Calendar (basic month grid) ─────────────────────────────────── */
.shd-calendar {
  display: inline-block; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.75rem; font-family: var(--font);
}
.shd-calendar-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}
.shd-calendar-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.shd-calendar-nav {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.25rem; border-radius: var(--radius-xs);
}
.shd-calendar-nav:hover { background: var(--bg-secondary); color: var(--text); }
.shd-calendar-grid { display: grid; grid-template-columns: repeat(7, 2rem); gap: 1px; }
.shd-calendar-day-name {
  text-align: center; font-size: 0.6875rem; font-weight: 600;
  color: var(--text-muted); padding: 0.25rem 0;
}
.shd-calendar-day {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; font-size: 0.75rem;
  border-radius: var(--radius-sm); cursor: pointer;
  border: none; background: none; color: var(--text);
}
.shd-calendar-day:hover { background: var(--bg-secondary); }
.shd-calendar-day.active { background: var(--accent); color: #fff; }
.shd-calendar-day.today { font-weight: 700; }
.shd-calendar-day.outside { color: var(--text-muted); opacity: 0.4; }

/* ── 36. Drawer (bottom sheet) ───────────────────────────────────────── */
.shd-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 100; display: none;
}
.shd-drawer-backdrop.open { display: block; }
.shd-drawer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card); border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 85vh; overflow-y: auto; z-index: 101;
  animation: shd-drawer-in 0.3s ease-out;
}
@keyframes shd-drawer-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.shd-drawer-handle {
  display: flex; justify-content: center; padding: 0.75rem 0 0.25rem;
}
.shd-drawer-handle::after {
  content: ''; width: 2.5rem; height: 0.25rem;
  background: var(--border); border-radius: 999px;
}
.shd-drawer-header { padding: 0.5rem 1.25rem 0; }
.shd-drawer-body { padding: 1rem 1.25rem; }
.shd-drawer-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 0 1.25rem 1.25rem; }

/* ── 37. Context Menu ────────────────────────────────────────────────── */
.shd-context-menu {
  position: fixed; display: none; min-width: 200px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 60; padding: 0.25rem; overflow: hidden;
}
.shd-context-menu.open { display: block; }
.shd-context-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.375rem 0.5rem; font-size: 0.8125rem;
  color: var(--text); cursor: pointer; border: none; background: none;
  width: 100%; text-align: left; font-family: var(--font);
  border-radius: calc(var(--radius-sm) - 2px);
}
.shd-context-menu-item:hover { background: var(--bg-secondary); }
.shd-context-menu-shortcut { font-size: 0.6875rem; color: var(--text-muted); font-family: var(--font-mono); }
.shd-context-menu-separator { height: 1px; background: var(--border); margin: 0.25rem 0; }

/* ── 38. Menubar ─────────────────────────────────────────────────────── */
.shd-menubar {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); padding: 0.125rem; gap: 0.125rem;
}
.shd-menubar-trigger {
  padding: 0.25rem 0.625rem; font-size: 0.8125rem; font-weight: 500;
  color: var(--text); background: none; border: none;
  border-radius: calc(var(--radius-sm) - 2px); cursor: pointer;
  font-family: var(--font);
}
.shd-menubar-trigger:hover { background: var(--bg-secondary); }
.shd-menubar-trigger.active { background: var(--bg-secondary); }

/* ── 39. Navigation Menu ─────────────────────────────────────────────── */
.shd-nav-menu {
  display: flex; align-items: center; gap: 0.25rem;
  font-family: var(--font);
}
.shd-nav-menu-item {
  padding: 0.375rem 0.75rem; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.shd-nav-menu-item:hover { background: var(--bg-secondary); color: var(--text); }
.shd-nav-menu-item.active { color: var(--text); }

/* ── 40. Command (cmdk-style palette) ────────────────────────────────── */
.shd-command {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  width: 100%; max-width: 480px;
}
.shd-command-input-wrap {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
}
.shd-command-input-wrap svg { flex-shrink: 0; color: var(--text-muted); }
.shd-command-input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 0.875rem; color: var(--text); font-family: var(--font);
}
.shd-command-input::placeholder { color: var(--text-muted); }
.shd-command-list { max-height: 300px; overflow-y: auto; padding: 0.25rem; }
.shd-command-group-label {
  padding: 0.375rem 0.5rem; font-size: 0.6875rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.shd-command-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.625rem; font-size: 0.8125rem;
  color: var(--text); cursor: pointer; border-radius: var(--radius-sm);
}
.shd-command-item:hover { background: var(--bg-secondary); }
.shd-command-item.selected { background: var(--bg-secondary); }
.shd-command-shortcut { margin-left: auto; font-size: 0.6875rem; color: var(--text-muted); font-family: var(--font-mono); }
.shd-command-empty { padding: 1.5rem 0; text-align: center; font-size: 0.8125rem; color: var(--text-muted); }

/* ── 41. Carousel ────────────────────────────────────────────────────── */
.shd-carousel { position: relative; overflow: hidden; }
.shd-carousel-track {
  display: flex; gap: 1rem; transition: transform 0.3s ease-out;
}
.shd-carousel-item { flex: 0 0 auto; }
.shd-carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.shd-carousel-btn:hover { background: var(--bg-secondary); }
.shd-carousel-prev { left: 0.5rem; }
.shd-carousel-next { right: 0.5rem; }

/* ── 42. Empty state ─────────────────────────────────────────────────── */
.shd-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem 1.5rem;
  text-align: center; color: var(--text-muted);
}
.shd-empty-icon { font-size: 2rem; margin-bottom: 0.75rem; opacity: 0.5; }
.shd-empty-title { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.shd-empty-description { font-size: 0.8125rem; margin-top: 0.25rem; max-width: 320px; line-height: 1.5; }
.shd-empty-action { margin-top: 1rem; }

/* ── 43. Field (form field wrapper) ──────────────────────────────────── */
.shd-field { display: flex; flex-direction: column; gap: 0.375rem; }
.shd-field-label { font-size: 0.8125rem; font-weight: 500; color: var(--text); }
.shd-field-description { font-size: 0.75rem; color: var(--text-muted); }
.shd-field-error { font-size: 0.75rem; color: var(--danger); }

/* ── 44. Toggle Group ────────────────────────────────────────────────── */
.shd-toggle-group {
  display: inline-flex; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.shd-toggle-group .shd-toggle {
  border-radius: 0; border: none; border-right: 1px solid var(--border);
}
.shd-toggle-group .shd-toggle:last-child { border-right: none; }

/* ── 45. Button Group ────────────────────────────────────────────────── */
.shd-btn-group {
  display: inline-flex;
}
.shd-btn-group .shd-btn { border-radius: 0; }
.shd-btn-group .shd-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.shd-btn-group .shd-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.shd-btn-group .shd-btn + .shd-btn { margin-left: -1px; }

/* ── 46. Spinner ─────────────────────────────────────────────────────── */
.shd-spinner {
  display: inline-block; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: shd-spin 0.6s linear infinite;
}
.shd-spinner-sm { width: 1rem; height: 1rem; }
.shd-spinner-md { width: 1.25rem; height: 1.25rem; }
.shd-spinner-lg { width: 1.5rem; height: 1.5rem; }
@keyframes shd-spin { to { transform: rotate(360deg); } }

/* ── 47. Typography ──────────────────────────────────────────────────── */
.shd-h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1.2; }
.shd-h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.015em; color: var(--text); line-height: 1.25; }
.shd-h3 { font-size: 1.25rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.shd-h4 { font-size: 1rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.shd-p { font-size: 0.875rem; color: var(--text); line-height: 1.6; }
.shd-lead { font-size: 1.0625rem; color: var(--text-muted); line-height: 1.6; }
.shd-large { font-size: 1rem; font-weight: 600; color: var(--text); }
.shd-small { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.4; }
.shd-muted { font-size: 0.8125rem; color: var(--text-muted); }
.shd-code {
  padding: 0.125rem 0.375rem; font-size: 0.8125rem;
  font-family: var(--font-mono); background: var(--bg-secondary);
  border-radius: var(--radius-xs); color: var(--text);
}
.shd-blockquote {
  border-left: 3px solid var(--border); padding-left: 1rem;
  font-style: italic; color: var(--text-muted); font-size: 0.875rem;
  line-height: 1.6;
}
.shd-list { padding-left: 1.5rem; font-size: 0.875rem; color: var(--text); line-height: 1.8; }

/* ── 48. Data Table enhancements ─────────────────────────────────────── */
.shd-datatable-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 0.75rem;
}
.shd-datatable-search { max-width: 240px; }
.shd-datatable-info { font-size: 0.75rem; color: var(--text-muted); }

/* ── 49. Combobox (input + dropdown) ─────────────────────────────────── */
.shd-combobox-wrap { position: relative; display: inline-flex; width: 100%; }
.shd-combobox-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  display: none; max-height: 200px; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 50; padding: 0.25rem;
}
.shd-combobox-wrap.open .shd-combobox-list { display: block; }
.shd-combobox-option {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.375rem 0.5rem; font-size: 0.8125rem;
  color: var(--text); cursor: pointer; border-radius: calc(var(--radius-sm) - 2px);
}
.shd-combobox-option:hover { background: var(--bg-secondary); }
.shd-combobox-option.selected { font-weight: 600; }

/* ── 50. Input OTP ───────────────────────────────────────────────────── */
.shd-otp {
  display: flex; gap: 0.375rem;
}
.shd-otp-slot {
  width: 2.5rem; height: 3rem; text-align: center;
  font-size: 1.25rem; font-weight: 600; font-family: var(--font-mono);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  outline: none;
}
.shd-otp-slot:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,179,116,0.15); }
.shd-otp-separator {
  display: flex; align-items: center; padding: 0 0.25rem;
  color: var(--text-muted); font-size: 1.25rem;
}

/* ── 51. Date Picker (extends calendar) ──────────────────────────────── */
.shd-datepicker-wrap { position: relative; display: inline-flex; }
.shd-datepicker-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.shd-datepicker-wrap.open .shd-datepicker-dropdown { display: block; }

/* ── 52. Bar Chart ──────────────────────────────────────────────────── */
.shd-chart {
  padding: 1.25rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.shd-chart-header { margin-bottom: 1rem; }
.shd-chart-title { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.shd-chart-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.shd-chart-body { position: relative; }
.shd-chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.shd-chart-grid-line { border-bottom: 1px dashed var(--border); width: 100%; }
.shd-chart-grid-line:last-child { border-bottom: 1px solid var(--border); }
.shd-chart-bar { display: flex; align-items: flex-end; gap: 0.5rem; height: 100%; position: relative; z-index: 1; }
.shd-chart-bar-col { flex: 1; text-align: center; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.shd-chart-bar-val { font-size: 0.625rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.25rem; opacity: 0; transition: opacity 0.2s; }
.shd-chart-bar-col:hover .shd-chart-bar-val { opacity: 1; }
.shd-chart-bar-item {
  width: 100%; background: var(--accent); border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 4px; transition: height 0.4s ease-out, opacity 0.15s;
  opacity: 0.75;
}
.shd-chart-bar-col:hover .shd-chart-bar-item { opacity: 1; }
.shd-chart-labels { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.shd-chart-label { flex: 1; font-size: 0.6875rem; color: var(--text-muted); text-align: center; }

/* ── 53. Sidebar ─────────────────────────────────────────────────────── */
.shd-sidebar {
  width: 260px; background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 0.75rem; height: 100%; overflow-y: auto;
}
.shd-sidebar-group { margin-bottom: 0.5rem; }
.shd-sidebar-group-label {
  padding: 0.375rem 0.5rem; font-size: 0.6875rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
}
.shd-sidebar-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.375rem 0.5rem; font-size: 0.8125rem;
  color: var(--text-muted); border-radius: var(--radius-sm);
  cursor: pointer; text-decoration: none;
  transition: all 0.15s;
}
.shd-sidebar-item:hover { background: var(--bg-secondary); color: var(--text); }
.shd-sidebar-item.active { background: var(--bg-secondary); color: var(--text); font-weight: 500; }
.shd-sidebar-item svg { flex-shrink: 0; }

/* ── 54. Direction (LTR/RTL helper) ──────────────────────────────────── */
[dir="rtl"] .shd-breadcrumb { flex-direction: row-reverse; }
[dir="rtl"] .shd-input-addon:first-child { border-right: 1px solid var(--border); border-left: none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
[dir="rtl"] .shd-input-addon:last-child { border-left: 1px solid var(--border); border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

/* ── 55. Native Select ───────────────────────────────────────────────── */
.shd-native-select {
  display: flex; height: 2.25rem; width: 100%;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  font-size: 0.8125rem; font-family: var(--font);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  appearance: none; cursor: pointer; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
}
.shd-native-select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,179,116,0.15); }

/* ── 56. Item (generic list item) ────────────────────────────────────── */
.shd-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.shd-item:last-child { border-bottom: none; }
.shd-item-icon { flex-shrink: 0; color: var(--text-muted); }
.shd-item-body { flex: 1; min-width: 0; }
.shd-item-title { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.shd-item-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }
.shd-item-action { flex-shrink: 0; }

/* ── 37. Chip / Tag ──────────────────────────────────────────────────── */
.shd-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500; font-family: var(--font);
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text); transition: all 0.15s; cursor: default;
}
.shd-chip-default { background: var(--bg-secondary); }
.shd-chip-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.shd-chip-success { background: var(--success-subtle); color: var(--success); border-color: var(--success); }
.shd-chip-warning { background: var(--warning-subtle); color: var(--warning); border-color: var(--warning); }
.shd-chip-destructive { background: rgba(239,68,68,0.1); color: var(--danger); border-color: var(--danger); }
.shd-chip-icon { display: flex; align-items: center; }
.shd-chip-close {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 0.125rem; padding: 0; background: none; border: none;
  color: inherit; cursor: pointer; opacity: 0.5; font-size: 1rem; line-height: 1;
}
.shd-chip-close:hover { opacity: 1; }

/* ── 38. Code Block / Snippet ────────────────────────────────────────── */
.shd-code-inline {
  padding: 0.125rem 0.375rem; border-radius: var(--radius-sm);
  background: var(--bg-secondary); color: var(--accent);
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  font-size: 0.8125rem; border: 1px solid var(--border);
}
.shd-code-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-card);
}
.shd-code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.shd-code-lang { font-size: 0.6875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.shd-code-copy {
  font-size: 0.6875rem; font-weight: 500; color: var(--text-muted);
  background: none; border: none; cursor: pointer; padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}
.shd-code-copy:hover { background: var(--bg); color: var(--text); }
.shd-code-pre {
  margin: 0; padding: 0.75rem 1rem; overflow-x: auto;
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  font-size: 0.8125rem; line-height: 1.6; color: var(--text);
}

/* ── 39. Slider / Range ──────────────────────────────────────────────── */
.shd-slider-wrap { display: flex; flex-direction: column; gap: 0.375rem; }
.shd-slider-header { display: flex; justify-content: space-between; align-items: center; }
.shd-slider-label { font-size: 0.8125rem; font-weight: 500; color: var(--text); }
.shd-slider-value { font-size: 0.8125rem; font-weight: 600; color: var(--accent); font-family: var(--font-mono, monospace); }
.shd-slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: 999px; background: var(--bg-secondary); outline: none;
  border: 1px solid var(--border);
}
.shd-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.shd-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ── 40. Rating ──────────────────────────────────────────────────────── */
.shd-rating { display: inline-flex; align-items: center; gap: 0.125rem; }
.shd-rating-sm .shd-rating-star { width: 14px; height: 14px; }
.shd-rating-md .shd-rating-star { width: 18px; height: 18px; }
.shd-rating-lg .shd-rating-star { width: 24px; height: 24px; }
.shd-rating-star-full { color: #f59e0b; }
.shd-rating-star-half { color: #f59e0b; }
.shd-rating-star-empty { color: var(--border); }
.shd-rating-value { margin-left: 0.375rem; font-size: 0.8125rem; font-weight: 600; color: var(--text); }

/* ── 41. Stat Card ───────────────────────────────────────────────────── */
.shd-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; min-width: 140px;
}
.shd-stat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.shd-stat-label { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.shd-stat-icon { color: var(--text-muted); }
.shd-stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.shd-stat-footer { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.375rem; }
.shd-stat-trend { font-size: 0.75rem; font-weight: 600; }
.shd-stat-trend-up { color: var(--success); }
.shd-stat-trend-down { color: var(--danger); }
.shd-stat-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── 42. Circular Progress ───────────────────────────────────────────── */
.shd-cprog { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.shd-cprog-svg { width: 100%; height: 100%; }
.shd-cprog-ring { transition: stroke-dashoffset 0.6s ease; }
.shd-cprog-label {
  position: absolute; font-size: 0.8125rem; font-weight: 700;
  color: var(--text); font-family: var(--font-mono, monospace);
}

/* ── 43. Timeline ────────────────────────────────────────────────────── */
.shd-timeline { display: flex; flex-direction: column; }
.shd-timeline-item { display: flex; gap: 0.75rem; min-height: 60px; }
.shd-timeline-indicator { display: flex; flex-direction: column; align-items: center; }
.shd-timeline-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--border); border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}
.shd-timeline-item-active .shd-timeline-dot { background: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.shd-timeline-icon { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.shd-timeline-line { flex: 1; width: 2px; background: var(--border); min-height: 20px; }
.shd-timeline-item:last-child .shd-timeline-line { display: none; }
.shd-timeline-content { padding-bottom: 1.5rem; flex: 1; }
.shd-timeline-title { font-size: 0.875rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; }
.shd-timeline-time { font-size: 0.6875rem; color: var(--text-muted); font-weight: 400; }
.shd-timeline-desc { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── 44. Link ────────────────────────────────────────────────────────── */
.shd-link {
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px; font-weight: 500;
  transition: color 0.15s, opacity 0.15s;
}
.shd-link:hover { opacity: 0.8; }
.shd-link-muted { color: var(--text-muted); }
.shd-link-muted:hover { color: var(--text); }
.shd-link-subtle { text-decoration: none; }
.shd-link-subtle:hover { text-decoration: underline; }

/* ── 45. Image ───────────────────────────────────────────────────────── */
.shd-image-wrap { display: inline-block; overflow: hidden; }
.shd-image { display: block; object-fit: cover; border-radius: var(--radius); }
.shd-image-rounded { border-radius: 50%; }
.shd-image-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted); font-size: 0.875rem;
}

/* ── 46. Fieldset ────────────────────────────────────────────────────── */
.shd-fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin: 0;
}
.shd-fieldset-legend {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
  padding: 0 0.375rem;
}
.shd-fieldset-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ── 47. Scroll Area ─────────────────────────────────────────────────── */
.shd-scroll-area {
  overflow: auto; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.5rem;
}
.shd-scroll-area::-webkit-scrollbar { width: 6px; height: 6px; }
.shd-scroll-area::-webkit-scrollbar-track { background: transparent; }
.shd-scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.shd-scroll-area::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.shd-scroll-horizontal { overflow-x: auto; overflow-y: hidden; white-space: nowrap; }

/* ── 48. Stepper / Steps ─────────────────────────────────────────────── */
.shd-stepper { display: flex; align-items: flex-start; width: 100%; }
.shd-step { display: flex; align-items: center; flex: 1; min-width: 0; }
.shd-step:last-child { flex: 0; }
.shd-step-marker {
  display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 50%; flex-shrink: 0;
  font-size: 0.75rem; font-weight: 600;
  background: var(--bg-secondary); color: var(--text-muted);
  border: 2px solid var(--border);
}
.shd-step-active .shd-step-marker { background: var(--accent); color: #fff; border-color: var(--accent); }
.shd-step-completed .shd-step-marker { background: var(--success); color: #fff; border-color: var(--success); }
.shd-step-label { margin-left: 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.shd-step-active .shd-step-label { color: var(--text); font-weight: 600; }
.shd-step-completed .shd-step-label { color: var(--text); }
.shd-step-connector {
  flex: 1; height: 2px; background: var(--border); margin: 0 0.5rem;
  min-width: 1.5rem;
}
.shd-step-completed .shd-step-connector { background: var(--success); }

/* ── 49. Banner / Announcement — see section 6b above ────────────────── */

/* ── 50. Status Indicator ────────────────────────────────────────────── */
.shd-status { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; }
.shd-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.shd-status-online .shd-status-dot { background: var(--success); box-shadow: 0 0 0 2px var(--success-subtle); }
.shd-status-offline .shd-status-dot { background: var(--text-muted); }
.shd-status-away .shd-status-dot { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
.shd-status-busy .shd-status-dot { background: var(--danger); box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }
.shd-status-label { font-weight: 500; color: var(--text); }

/* ── 51. Toggle Group ────────────────────────────────────────────────── */
.shd-toggle-group {
  display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.shd-tg-item {
  padding: 0.375rem 0.75rem; font-size: 0.8125rem; font-weight: 500;
  background: var(--bg); color: var(--text-muted); border: none; cursor: pointer;
  border-right: 1px solid var(--border); transition: all 0.15s; font-family: var(--font);
}
.shd-tg-item:last-child { border-right: none; }
.shd-tg-item:hover { background: var(--bg-secondary); }
.shd-tg-item.active { background: var(--accent); color: #fff; }

/* ── 52. Hover Card ──────────────────────────────────────────────────── */
.shd-hover-card-wrap { position: relative; display: inline-block; }
.shd-hover-card-trigger { cursor: pointer; }
.shd-hover-card {
  display: none; position: absolute; z-index: 50; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); min-width: 240px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg, 0 10px 25px rgba(0,0,0,0.15));
  padding: 0.75rem 1rem;
  opacity: 0; transition: opacity 0.15s;
}
.shd-hover-card-wrap:hover .shd-hover-card { display: block; opacity: 1; }

/* ── 53. Number Ticker ───────────────────────────────────────────────── */
.shd-ticker {
  font-size: 2rem; font-weight: 700; color: var(--text);
  font-family: var(--font-mono, monospace); font-variant-numeric: tabular-nums;
}

/* ── 54. Marquee ─────────────────────────────────────────────────────── */
.shd-marquee {
  overflow: hidden; width: 100%; position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}
.shd-marquee-track {
  display: flex; gap: 1.5rem; width: max-content;
  animation: shd-marquee-scroll var(--shd-marquee-speed, 30s) linear infinite;
  animation-direction: var(--shd-marquee-dir, normal);
}
.shd-marquee-pause:hover .shd-marquee-track { animation-play-state: paused; }
.shd-marquee-item { flex-shrink: 0; display: flex; align-items: center; }
@keyframes shd-marquee-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ── 55. Navbar ──────────────────────────────────────────────────────── */
.shd-navbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.625rem 1rem; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.shd-navbar-brand { font-weight: 700; font-size: 0.9375rem; color: var(--text); white-space: nowrap; }
.shd-navbar-links { display: flex; gap: 0.25rem; flex: 1; }
.shd-navbar-link {
  padding: 0.375rem 0.625rem; font-size: 0.8125rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.shd-navbar-link:hover { background: var(--bg-secondary); color: var(--text); }
.shd-navbar-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── 56. Tree ────────────────────────────────────────────────────────── */
.shd-tree { font-size: 0.8125rem; font-family: var(--font); }
.shd-tree-node { padding: 0.25rem 0; padding-left: calc(var(--shd-tree-level, 0) * 1.25rem); }
.shd-tree-trigger {
  display: flex; align-items: center; gap: 0.375rem; cursor: pointer;
  padding: 0.25rem 0.375rem; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500;
}
.shd-tree-trigger:hover { background: var(--bg-secondary); }
.shd-tree-trigger svg { transition: transform 0.15s; flex-shrink: 0; }
.shd-tree-branch.open > .shd-tree-trigger svg { transform: rotate(90deg); }
.shd-tree-children { display: none; }
.shd-tree-branch.open > .shd-tree-children { display: block; }
.shd-tree-leaf {
  display: flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.375rem; color: var(--text-muted);
}
.shd-tree-leaf-spacer { width: 14px; flex-shrink: 0; }
.shd-tree-icon { display: flex; align-items: center; flex-shrink: 0; }

/* ── Component Page Sidebar ──────────────────────────────────────────── */
.comp-layout { display: flex; gap: 1.5rem; }
.comp-sidebar {
  width: 220px; flex-shrink: 0; position: sticky; top: 1rem;
  max-height: calc(100vh - 2rem); overflow-y: auto;
  padding-right: 0.5rem;
}
.comp-sidebar::-webkit-scrollbar { width: 4px; }
.comp-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.comp-sidebar-group { margin-bottom: 1rem; }
.comp-sidebar-title {
  font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 0.25rem 0.5rem; margin-bottom: 0.25rem;
}
.comp-sidebar a {
  display: block; padding: 0.25rem 0.5rem; font-size: 0.8125rem;
  color: var(--text-secondary); text-decoration: none;
  border-radius: var(--radius-sm); transition: background 0.12s, color 0.12s;
}
.comp-sidebar a:hover { background: var(--bg-secondary); color: var(--text); }
.comp-sidebar a.active { background: var(--bg-secondary); color: var(--text); font-weight: 600; }
.comp-main { flex: 1; min-width: 0; }
.comp-main .exp-section, .comp-main .exp-part { scroll-margin-top: 5rem; }

/* Show/hide group system */
[data-group] { display: none; }
[data-group].comp-group-visible { display: block; }

/* Sidebar group titles clickable */
.comp-sidebar-title { cursor: pointer; transition: color 0.15s; }
.comp-sidebar-title:hover { color: var(--text); }
.comp-sidebar-title.active { color: var(--accent); }

/* Search bar */
.comp-search-wrap {
  position: relative; margin-bottom: 0.625rem;
}
.comp-search-icon {
  position: absolute; left: 0.5rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.comp-search {
  width: 100%; padding: 0.375rem 1.75rem 0.375rem 1.75rem;
  font-size: 0.8125rem; font-family: var(--font);
  background: var(--bg-secondary); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.15s;
}
.comp-search:focus { border-color: var(--accent); }
.comp-search::placeholder { color: var(--text-muted); }
.comp-search-clear {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); cursor: pointer; display: none;
  transition: color 0.12s;
}
.comp-search-clear:hover { color: var(--text); }
.comp-search-wrap.has-value .comp-search-clear { display: block; }
/* Search match highlight */
.comp-sidebar a.comp-search-match { background: var(--accent-subtle); }
.comp-sidebar a.comp-search-hidden,
.comp-sidebar-group.comp-search-hidden { display: none; }

/* "All" link */
.comp-sidebar-all {
  display: block; padding: 0.375rem 0.5rem; font-size: 0.8125rem;
  font-weight: 600; color: var(--text-secondary); text-decoration: none;
  border-radius: var(--radius-sm); margin-bottom: 0.75rem;
  transition: background 0.12s, color 0.12s;
}
.comp-sidebar-all:hover { background: var(--bg-secondary); color: var(--text); }
.comp-sidebar-all.active { color: var(--accent); }

/* Collapse/expand sidebar items */
.comp-sidebar-group a[data-group-parent] {
  max-height: 0; overflow: hidden; padding-top: 0; padding-bottom: 0;
  opacity: 0; transition: max-height 0.2s, padding 0.2s, opacity 0.15s;
}
.comp-sidebar-group.expanded a[data-group-parent] {
  max-height: 2rem; padding: 0.25rem 0.5rem; opacity: 1;
}

@media (max-width: 768px) {
  .comp-sidebar { display: none; }
  .comp-main { width: 100%; }
  /* Mobile: show all groups (no sidebar to toggle) */
  [data-group] { display: block !important; }
}

/* ── Chart: SVG containers & common ──────────────────────────────────── */
.shd-chart-svg {
  width: 100%; display: block; height: auto;
}
.shd-chart-axis-label {
  font-size: 9px; fill: var(--text-muted); font-family: inherit;
}
.shd-chart-dot { transition: r 0.15s; cursor: default; }
.shd-chart-dot:hover { r: 5; }

/* ── Chart: Legend ───────────────────────────────────────────────────── */
.shd-chart-legend { display: flex; flex-direction: column; gap: 0.375rem; min-width: 140px; }
.shd-chart-legend-item {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--text);
}
.shd-chart-legend-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.shd-chart-pie-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }

/* ── Chart: Donut center text ───────────────────────────────────────── */
.shd-chart-donut-center { font-size: 1.25rem; font-weight: 700; fill: var(--text); font-family: inherit; }

/* ── Chart: Scatter ─────────────────────────────────────────────────── */
.shd-chart-scatter-dot { transition: r 0.15s, opacity 0.15s; cursor: default; }
.shd-chart-scatter-dot:hover { r: 7; opacity: 1; }

/* ── Chart: Funnel ──────────────────────────────────────────────────── */
.shd-chart-funnel-wrap { display: flex; flex-direction: column; }
.shd-chart-funnel-step { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.375rem; }
.shd-chart-funnel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0.875rem; border-radius: var(--radius-sm); color: #fff;
  font-size: 0.8125rem; min-height: 2.25rem; transition: width 0.3s;
}
.shd-chart-funnel-label { font-weight: 500; white-space: nowrap; }
.shd-chart-funnel-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.shd-chart-funnel-pct {
  font-size: 0.75rem; color: var(--text-muted); white-space: nowrap;
}

/* ── Chart: Gauge ───────────────────────────────────────────────────── */
.shd-chart-gauge-wrap { text-align: center; }
.shd-chart-gauge-value { font-size: 1.75rem; font-weight: 700; fill: var(--text); font-family: inherit; }
.shd-chart-gauge-sublabel { font-size: 0.75rem; fill: var(--text-muted); font-family: inherit; }

/* ── Chart: Grouped Bar ────────────────────────────────────────────── */
.shd-chart-grouped-wrap { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.shd-chart-grouped-category { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.shd-chart-grouped-bars {
  display: flex; align-items: flex-end; gap: 2px;
}
.shd-chart-grouped-segment {
  width: 16px; min-height: 2px; border-radius: 2px 2px 0 0; transition: opacity 0.15s;
}
.shd-chart-grouped-segment:hover { opacity: 0.8; }

/* ── Chart: Stacked Bar ───────────────────────────────────────────── */
.shd-chart-stacked-wrap { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.shd-chart-stacked-col-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.shd-chart-stacked-col {
  display: flex; flex-direction: column-reverse; width: 36px;
}
.shd-chart-stacked-segment {
  display: flex; align-items: center; justify-content: center;
  min-height: 2px; transition: opacity 0.15s;
}
.shd-chart-stacked-segment:first-child { border-radius: 0 0 2px 2px; }
.shd-chart-stacked-segment:last-child { border-radius: 2px 2px 0 0; }
.shd-chart-stacked-lbl { font-size: 0.625rem; color: #fff; font-weight: 600; }

/* ── Chart: Horizontal Bar ────────────────────────────────────────── */
.shd-chart-hbar-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.shd-chart-hbar-row { display: flex; align-items: center; gap: 0.75rem; }
.shd-chart-hbar-label {
  min-width: 100px; text-align: right; font-size: 0.8125rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shd-chart-hbar-track {
  flex: 1; height: 24px; background: var(--bg); border-radius: var(--radius-sm); overflow: hidden;
}
.shd-chart-hbar-bar {
  height: 100%; border-radius: var(--radius-sm); transition: width 0.3s;
}
.shd-chart-hbar-val {
  min-width: 40px; font-size: 0.8125rem; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Chart: Sparkline ─────────────────────────────────────────────── */
.shd-chart-sparkline { display: inline-block; vertical-align: middle; }

/* ── Chart: Treemap ───────────────────────────────────────────────── */
.shd-chart-treemap-label {
  font-size: 10px; font-weight: 600; font-family: inherit; pointer-events: none;
}

/* ── Chart: Waffle ────────────────────────────────────────────────── */
.shd-chart-waffle-wrap { display: flex; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.shd-chart-waffle-grid { flex-shrink: 0; }
.shd-chart-waffle-cell { transition: opacity 0.15s; }
.shd-chart-waffle-cell:hover { opacity: 0.75; }

/* ── Chart: Histogram ─────────────────────────────────────────────── */
.shd-chart-histogram-bar { transition: opacity 0.15s; }
.shd-chart-histogram-bar:hover { opacity: 1; }

/* ── Chart: Heatmap ───────────────────────────────────────────────── */
.shd-chart-heatmap-cell { transition: opacity 0.15s; }

/* ── Chart: Sankey ────────────────────────────────────────────────── */
.shd-chart-sankey-node { stroke: var(--bg-card); stroke-width: 1; }
.shd-chart-sankey-band { transition: opacity 0.15s; }
.shd-chart-sankey-band:hover { opacity: 0.7 !important; }
.shd-chart-sankey-label { font-size: 0.6875rem; fill: var(--text); font-family: inherit; }

/* ── Chart: Radar / Spider ────────────────────────────────────────── */
.shd-chart-radar-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.shd-chart-radar-axis { stroke: var(--border); stroke-width: 0.5; }
.shd-chart-radar-area { transition: fill-opacity 0.2s; }
.shd-chart-radar-area:hover { fill-opacity: 0.35; }
.shd-chart-radar-label { font-size: 0.6875rem; fill: var(--text); font-family: inherit; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .shd-chart-pie-wrap { flex-direction: column; }
  .shd-dialog { max-width: 95%; }
  .shd-command { max-width: 95%; }
  .shd-calendar-grid { grid-template-columns: repeat(7, minmax(1.75rem, 1fr)); }
  .shd-toast { min-width: auto; max-width: calc(100vw - 3rem); }
  .shd-toast-container { right: 0.75rem; bottom: 0.75rem; }
  .shd-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}
