/* Scoped Dashboard UI, limited to .dashboard-ui-shell. */
/* ============================================================
   Codia Dashboard — Design tokens (Light + Dark)
   ============================================================ */

.dashboard-ui-shell {
  /* Light mode tokens */
  --dui-background: #FFFFFF;
  --dui-foreground: #252525;
  --dui-primary: #343434;
  --dui-primary-foreground: #FBFBFB;
  --dui-secondary: #F7F7F7;
  --dui-secondary-foreground: #343434;
  --dui-muted: #F7F7F7;
  --dui-muted-foreground: #6B6B6B;
  --dui-accent: #F2F2F2;
  --dui-accent-foreground: #343434;
  --dui-destructive: #EF4444;
  --dui-destructive-foreground: #FBFBFB;
  --dui-border: #EBEBEB;
  --dui-border-strong: #D8D8D8;
  --dui-input: #EBEBEB;
  --dui-ring: #B5B5B5;
  --dui-brand: #4F66D9;
  --dui-brand-hover: #4055C2;
  --dui-brand-soft: rgba(79, 102, 217, 0.08);
  --dui-brand-soft-strong: rgba(79, 102, 217, 0.14);
  --dui-on-brand: #FFFFFF;
  --dui-success: #1FD672;
  --dui-success-soft: rgba(31, 214, 114, 0.12);
  --dui-warning: #F2B70F;
  --dui-warning-soft: rgba(242, 183, 15, 0.14);
  --dui-destructive-soft: rgba(239, 68, 68, 0.10);
  --dui-disabled-bg: #EBEBEB;
  --dui-disabled-foreground: #686868;
  --dui-card: #FFFFFF;
  --dui-surface: #FAFAFA;
  --dui-hover: rgba(0, 0, 0, 0.04);
  --dui-selected: rgba(79, 102, 217, 0.08);

  --dui-shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.06);
  --dui-shadow-pin: 0 4px 14px rgba(0, 0, 0, 0.08);
  --dui-shadow-pin-hover: 0 6px 22px rgba(0, 0, 0, 0.16);
  --dui-shadow-popover: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --dui-shadow-modal: 0 32px 64px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);

  --dui-radius-sm: 6px;
  --dui-radius-md: 8px;
  --dui-radius-lg: 10px;
  --dui-radius-card: 18px;
  --dui-radius-tile: 24px;
  --dui-radius-full: 9999px;

  --dui-font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --dui-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --dui-font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace;

  color-scheme: light;
}

.dashboard-ui-shell.dark {
  --dui-background: #1B1B1F;
  --dui-foreground: #FFFFFF;
  --dui-primary: #FBFBFB;
  --dui-primary-foreground: #1B1B1F;
  --dui-secondary: #262629;
  --dui-secondary-foreground: #FBFBFB;
  --dui-muted: #262629;
  --dui-muted-foreground: #A6A6A6;
  --dui-accent: #2E2E33;
  --dui-accent-foreground: #FBFBFB;
  --dui-destructive: #F87171;
  --dui-destructive-foreground: #1B1B1F;
  --dui-border: #2E2E33;
  --dui-border-strong: #3A3A40;
  --dui-input: #2E2E33;
  --dui-ring: #4A4A52;
  --dui-brand: #6B7FE3;
  --dui-brand-hover: #5F73D7;
  --dui-brand-soft: rgba(107, 127, 227, 0.12);
  --dui-brand-soft-strong: rgba(107, 127, 227, 0.20);
  --dui-on-brand: #FFFFFF;
  --dui-success: #22C55E;
  --dui-success-soft: rgba(34, 197, 94, 0.16);
  --dui-warning: #FACC15;
  --dui-warning-soft: rgba(250, 204, 21, 0.18);
  --dui-destructive-soft: rgba(248, 113, 113, 0.14);
  --dui-disabled-bg: #2E2E33;
  --dui-disabled-foreground: #989898;
  --dui-card: #232327;
  --dui-surface: #1F1F23;
  --dui-hover: rgba(255, 255, 255, 0.05);
  --dui-selected: rgba(107, 127, 227, 0.14);

  --dui-shadow-soft: 0 2px 6px rgba(0, 0, 0, 0.30);
  --dui-shadow-pin: 0 4px 14px rgba(0, 0, 0, 0.40);
  --dui-shadow-pin-hover: 0 6px 22px rgba(0, 0, 0, 0.55);
  --dui-shadow-popover: 0 12px 32px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.30);
  --dui-shadow-modal: 0 32px 64px rgba(0, 0, 0, 0.60), 0 4px 12px rgba(0, 0, 0, 0.40);

  color-scheme: dark;
}

.dashboard-ui-shell * { box-sizing: border-box; }
.dashboard-ui-shell { height: 100%; }
.dashboard-ui-shell {
  margin: 0;
  font-family: var(--dui-font-sans);
  background: var(--dui-background);
  color: var(--dui-foreground);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.dashboard-ui-shell button { font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; background: transparent; color: inherit; border: 0; }
.dashboard-ui-shell input, .dashboard-ui-shell textarea, .dashboard-ui-shell select { font-family: inherit; }
.dashboard-ui-shell a { color: inherit; text-decoration: none; }

/* ============================================================
   Layout
   ============================================================ */
.dashboard-ui-shell .app-shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  overflow: hidden;
}

.dashboard-ui-shell .main-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--dui-background);
}

.dashboard-ui-shell .main-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.dashboard-ui-shell .main-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}

/* ============================================================
   Sidebar
   ============================================================ */
.dashboard-ui-shell .sidebar {
  background: var(--dui-surface);
  border-right: 1px solid var(--dui-border);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  overflow-y: auto;
}

.dashboard-ui-shell .sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 16px;
  border-bottom: 1px solid var(--dui-border);
  margin-bottom: 12px;
}
.dashboard-ui-shell .sb-brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--dui-foreground);
  color: var(--dui-background);
  display: grid; place-items: center;
  font-family: var(--dui-font-serif);
  font-weight: 700;
  font-size: 16px;
}
.dashboard-ui-shell .sb-brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.dashboard-ui-shell .sb-brand-logo {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.dashboard-ui-shell .sb-brand-wordmark {
  height: 16px;
  width: auto;
  max-width: 120px;
}
.dashboard-ui-shell:not(.dark) .sb-brand-wordmark {
  filter: invert(1);
}

.dashboard-ui-shell .ws-chev { color: var(--dui-muted-foreground); flex-shrink: 0; }

.dashboard-ui-shell .nav-section { margin-bottom: 18px; }
.dashboard-ui-shell .nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--dui-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 12px;
  margin-bottom: 6px;
}
.dashboard-ui-shell .nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--dui-radius-md);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--dui-foreground);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  margin-bottom: 1px;
  transition: background 0.12s;
}
.dashboard-ui-shell .nav-item:hover { background: var(--dui-hover); }
.dashboard-ui-shell .nav-item.active {
  background: var(--dui-background);
  box-shadow: var(--dui-shadow-soft), inset 0 0 0 1px var(--dui-border);
}
.dashboard-ui-shell .nav-item .icon { color: var(--dui-muted-foreground); flex-shrink: 0; }
.dashboard-ui-shell .nav-item.active .icon { color: var(--dui-brand); }
.dashboard-ui-shell .nav-item .badge-count {
  margin-left: auto;
  font-size: 11px;
  background: var(--dui-brand);
  color: var(--dui-on-brand);
  padding: 1px 6px;
  border-radius: var(--dui-radius-full);
  font-weight: 600;
}

.dashboard-ui-shell .sb-foot { margin-top: auto; padding-top: 12px; }
.dashboard-ui-shell .sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--dui-radius-lg);
  cursor: pointer;
  transition: background 0.12s;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}
.dashboard-ui-shell .sb-user:hover { background: var(--dui-hover); }
.dashboard-ui-shell .sb-user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F66D9, #8FA3FF);
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.dashboard-ui-shell .sb-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dashboard-ui-shell .sb-user-info { flex: 1; min-width: 0; }
.dashboard-ui-shell .sb-user-name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dashboard-ui-shell .sb-user-email {
  font-size: 11px; color: var(--dui-muted-foreground);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============================================================
   Page headers
   ============================================================ */
.dashboard-ui-shell .page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.dashboard-ui-shell .page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.dashboard-ui-shell .page-title {
  font-family: var(--dui-font-serif);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.dashboard-ui-shell .page-subtitle {
  font-size: 14px;
  color: var(--dui-muted-foreground);
  margin: 0;
  max-width: 560px;
}

.dashboard-ui-shell .page-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   Buttons
   ============================================================ */
.dashboard-ui-shell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--dui-radius-lg);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.06s;
  user-select: none;
}
.dashboard-ui-shell .btn:active { transform: translateY(0.5px); }
.dashboard-ui-shell .btn:disabled { cursor: not-allowed; opacity: 0.55; }

.dashboard-ui-shell .btn-brand {
  background: var(--dui-brand);
  color: var(--dui-on-brand);
  border-color: var(--dui-brand);
}
.dashboard-ui-shell .btn-brand:hover { background: var(--dui-brand-hover); border-color: var(--dui-brand-hover); }

.dashboard-ui-shell .btn-primary {
  background: var(--dui-primary);
  color: var(--dui-primary-foreground);
  border-color: var(--dui-primary);
}
.dashboard-ui-shell .btn-primary:hover { background: var(--dui-foreground); }

.dashboard-ui-shell .btn-outline {
  background: var(--dui-background);
  color: var(--dui-foreground);
  border-color: var(--dui-border);
}
.dashboard-ui-shell .btn-outline:hover { background: var(--dui-hover); border-color: var(--dui-border-strong); }

.dashboard-ui-shell .btn-ghost {
  background: transparent;
  color: var(--dui-foreground);
  border-color: transparent;
}
.dashboard-ui-shell .btn-ghost:hover { background: var(--dui-hover); }

.dashboard-ui-shell .btn-danger {
  background: var(--dui-destructive);
  color: var(--dui-destructive-foreground);
  border-color: var(--dui-destructive);
}
.dashboard-ui-shell .btn-danger:hover { filter: brightness(0.92); }

.dashboard-ui-shell .btn-danger-outline {
  background: var(--dui-background);
  color: var(--dui-destructive);
  border-color: var(--dui-border);
}
.dashboard-ui-shell .btn-danger-outline:hover {
  background: var(--dui-destructive-soft);
  border-color: var(--dui-destructive);
}

.dashboard-ui-shell .btn-sm {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  border-radius: var(--dui-radius-md);
}
.dashboard-ui-shell .btn-lg { padding: 11px 18px; font-size: 14px; }
.dashboard-ui-shell .btn-icon { padding: 7px; width: 32px; height: 32px; }

/* ============================================================
   Card, Section
   ============================================================ */
.dashboard-ui-shell .card {
  background: var(--dui-card);
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-card);
  overflow: hidden;
}
.dashboard-ui-shell .card-pad { padding: 22px; }
.dashboard-ui-shell .card-pad-lg { padding: 28px; }
.dashboard-ui-shell .card-head {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--dui-border);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.dashboard-ui-shell .card-title {
  font-size: 15px; font-weight: 600; margin: 0;
  letter-spacing: -0.005em;
}
.dashboard-ui-shell .card-subtitle {
  font-size: 12.5px; color: var(--dui-muted-foreground); margin: 3px 0 0;
}
.dashboard-ui-shell .card-body { padding: 18px 22px; }
.dashboard-ui-shell .card-foot {
  padding: 14px 22px; border-top: 1px solid var(--dui-border);
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  background: var(--dui-surface);
}
.dashboard-ui-shell .card-foot .btn.btn-sm {
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  padding-top: 0;
  padding-bottom: 0;
}
.dashboard-ui-shell .card-foot .entitlement-open-btn {
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  margin-block: 1px;
}

.dashboard-ui-shell .section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--dui-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 28px 0 12px;
}

/* ============================================================
   Pills / Badges
   ============================================================ */
.dashboard-ui-shell .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--dui-radius-full);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--dui-muted);
  color: var(--dui-foreground);
  border: 1px solid transparent;
  white-space: nowrap;
}
.dashboard-ui-shell .pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.dashboard-ui-shell .pill-success { background: var(--dui-success-soft); color: var(--dui-success); }
.dashboard-ui-shell .pill-warning { background: var(--dui-warning-soft); color: #B8870A; }
.dashboard-ui-shell.dark .pill-warning { color: var(--dui-warning); }
.dashboard-ui-shell .pill-danger  { background: var(--dui-destructive-soft); color: var(--dui-destructive); }
.dashboard-ui-shell .pill-brand   { background: var(--dui-brand-soft); color: var(--dui-brand); }
.dashboard-ui-shell .pill-muted   { background: var(--dui-muted); color: var(--dui-muted-foreground); }
.dashboard-ui-shell .pill-outline { background: transparent; border-color: var(--dui-border); color: var(--dui-foreground); }
.dashboard-ui-shell .pill.pill-active-status {
  background: #F4C84A;
  color: #111111;
  border-color: rgba(17, 17, 17, 0.08);
}

.dashboard-ui-shell .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  font-size: 12px; font-weight: 500;
  border-radius: var(--dui-radius-full);
  background: var(--dui-muted);
  color: var(--dui-foreground);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.dashboard-ui-shell .chip:hover { background: var(--dui-accent); }
.dashboard-ui-shell .chip.active {
  background: var(--dui-primary);
  color: var(--dui-primary-foreground);
}

/* ============================================================
   Tabs
   ============================================================ */
.dashboard-ui-shell .tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--dui-border);
  margin-bottom: 24px;
}
.dashboard-ui-shell .tab {
  padding: 10px 14px;
  background: transparent;
  border: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--dui-muted-foreground);
  cursor: pointer;
  position: relative;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color 0.12s;
}
.dashboard-ui-shell .tab:hover { color: var(--dui-foreground); }
.dashboard-ui-shell .tab.active {
  color: var(--dui-foreground);
  border-bottom-color: var(--dui-foreground);
  font-weight: 600;
}

/* ============================================================
   Inputs
   ============================================================ */
.dashboard-ui-shell .input, .dashboard-ui-shell .select, .dashboard-ui-shell .textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--dui-radius-md);
  border: 1px solid var(--dui-input);
  background: var(--dui-background);
  color: var(--dui-foreground);
  font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
}
.dashboard-ui-shell .input:focus, .dashboard-ui-shell .select:focus, .dashboard-ui-shell .textarea:focus {
  border-color: var(--dui-brand);
  box-shadow: 0 0 0 3px var(--dui-brand-soft);
}
.dashboard-ui-shell .field { display: flex; flex-direction: column; gap: 6px; }
.dashboard-ui-shell .field-label {
  font-size: 12.5px; font-weight: 600; color: var(--dui-foreground);
}
.dashboard-ui-shell .field-hint {
  font-size: 12px; color: var(--dui-muted-foreground);
}
.dashboard-ui-shell .field-error {
  font-size: 12px; color: var(--dui-destructive);
}

/* ============================================================
   Table
   ============================================================ */
.dashboard-ui-shell .table-wrap { width: 100%; overflow-x: auto; }
.dashboard-ui-shell .tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dashboard-ui-shell .tbl thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--dui-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--dui-border);
  background: var(--dui-surface);
  white-space: nowrap;
}
.dashboard-ui-shell .tbl tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--dui-border);
  vertical-align: middle;
  white-space: nowrap;
}
.dashboard-ui-shell .tbl td.wrap { white-space: normal; }
.dashboard-ui-shell .tbl tbody tr:last-child td { border-bottom: 0; }
.dashboard-ui-shell .tbl tbody tr:hover { background: var(--dui-hover); }
.dashboard-ui-shell .tbl tbody tr.expanded { background: var(--dui-surface); }
.dashboard-ui-shell .tbl-row-clickable { cursor: pointer; }

.dashboard-ui-shell .tbl-sub {
  background: var(--dui-surface);
}
.dashboard-ui-shell .tbl-sub td {
  padding: 8px 16px 8px 56px;
  font-size: 12.5px;
  color: var(--dui-muted-foreground);
}

/* ============================================================
   Stats
   ============================================================ */
.dashboard-ui-shell .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}
.dashboard-ui-shell .stat {
  padding: 14px 16px;
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-card);
  background: var(--dui-card);
  min-width: 0;
}
.dashboard-ui-shell .stat-label {
  font-size: 11px;
  color: var(--dui-muted-foreground);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  line-height: 1.3;
}
.dashboard-ui-shell .stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-ui-shell .stat-meta {
  font-size: 11.5px;
  color: var(--dui-muted-foreground);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-ui-shell .stat-meta .up { color: var(--dui-success); font-weight: 600; }
.dashboard-ui-shell .stat-meta .down { color: var(--dui-destructive); font-weight: 600; }

/* ============================================================
   Modal / Popover / Drawer
   ============================================================ */
.dashboard-ui-shell .scrim {
  position: fixed; inset: 0;
  background: rgba(20, 20, 24, 0.32);
  z-index: 60;
  display: grid; place-items: center;
  padding: 32px;
  animation: fadeIn 0.16s ease;
}
.dashboard-ui-shell.dark .scrim { background: rgba(0, 0, 0, 0.55); }

.dashboard-ui-shell .modal {
  background: var(--dui-background);
  border-radius: var(--dui-radius-card);
  box-shadow: var(--dui-shadow-modal);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  animation: scaleIn 0.18s ease;
  border: 1px solid var(--dui-border);
}
.dashboard-ui-shell .modal-lg { max-width: 640px; }
.dashboard-ui-shell .modal-xl { max-width: 1040px; }

.dashboard-ui-shell .modal-head {
  padding: 22px 26px 6px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.dashboard-ui-shell .modal-title {
  font-size: 18px; font-weight: 600; margin: 0;
  letter-spacing: -0.01em;
}
.dashboard-ui-shell .modal-subtitle {
  font-size: 13px; color: var(--dui-muted-foreground);
  margin: 4px 0 0;
}
.dashboard-ui-shell .modal-body { padding: 16px 26px; }
.dashboard-ui-shell .modal-foot {
  padding: 16px 26px 22px;
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
}
.dashboard-ui-shell .modal-close {
  background: transparent; border: 0; cursor: pointer;
  color: var(--dui-muted-foreground); padding: 6px; border-radius: var(--dui-radius-md);
}
.dashboard-ui-shell .modal-close:hover { background: var(--dui-hover); color: var(--dui-foreground); }

.dashboard-ui-shell .drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(20, 20, 24, 0.30);
  z-index: 60;
  animation: fadeIn 0.16s ease;
}
.dashboard-ui-shell.dark .drawer-scrim { background: rgba(0, 0, 0, 0.55); }
.dashboard-ui-shell .drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 480px;
  max-width: calc(100vw - 40px);
  background: var(--dui-background);
  border-left: 1px solid var(--dui-border);
  box-shadow: var(--dui-shadow-modal);
  z-index: 61;
  display: flex; flex-direction: column;
  animation: slideInRight 0.22s ease;
}
.dashboard-ui-shell .drawer-wide { width: 600px; }
.dashboard-ui-shell .drawer-head {
  padding: 22px 26px 14px;
  border-bottom: 1px solid var(--dui-border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.dashboard-ui-shell .drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px;
}
.dashboard-ui-shell .drawer-foot {
  padding: 14px 26px;
  border-top: 1px solid var(--dui-border);
  display: flex; gap: 8px; justify-content: flex-end;
}

.dashboard-ui-shell .popover {
  position: absolute;
  z-index: 50;
  background: var(--dui-background);
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-lg);
  box-shadow: var(--dui-shadow-popover);
  min-width: 220px;
  padding: 6px;
  animation: scaleIn 0.14s ease;
}
.dashboard-ui-shell .menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--dui-radius-md);
  font-size: 13px;
  color: var(--dui-foreground);
  cursor: pointer;
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
}
.dashboard-ui-shell .menu-item:hover { background: var(--dui-hover); }
.dashboard-ui-shell .menu-item.danger { color: var(--dui-destructive); }
.dashboard-ui-shell .menu-item.danger:hover { background: var(--dui-destructive-soft); }
.dashboard-ui-shell .menu-item .icon { color: var(--dui-muted-foreground); }
.dashboard-ui-shell .menu-item.danger .icon { color: var(--dui-destructive); }
.dashboard-ui-shell .menu-divider {
  height: 1px; background: var(--dui-border);
  margin: 4px 0;
}
.dashboard-ui-shell .menu-label {
  font-size: 11px; font-weight: 600;
  color: var(--dui-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px 4px;
}
.dashboard-ui-shell .team-switcher-menu {
  display: flex;
  flex-direction: column;
  max-height: min(360px, calc(100vh - 160px));
  min-height: 0;
}
.dashboard-ui-shell .team-switcher-list {
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.dashboard-ui-shell .team-switcher-footer {
  flex-shrink: 0;
  margin: 6px -6px -6px;
  padding: 6px;
  border-top: 1px solid var(--dui-border);
  background: var(--dui-background);
}
.dashboard-ui-shell .team-manage-list {
  display: flex;
  flex-direction: column;
  max-height: min(520px, calc(100vh - 260px));
  overflow-y: auto;
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-card);
}
.dashboard-ui-shell .team-manage-list .list-row:last-child {
  border-bottom: 0;
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.97) } to { opacity: 1; transform: scale(1) } }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }

/* ============================================================
   Misc
   ============================================================ */
.dashboard-ui-shell .kv-list { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.dashboard-ui-shell .kv-label {
  font-size: 11.5px; font-weight: 600;
  color: var(--dui-muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.dashboard-ui-shell .kv-value { font-size: 14px; font-weight: 500; }
.dashboard-ui-shell .mono { font-family: var(--dui-font-mono); font-size: 12.5px; }

/* Team subscription pricing modal */
.dashboard-ui-shell .team-subscribe-flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dashboard-ui-shell .billing-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-full);
  background: var(--dui-surface);
}
.dashboard-ui-shell .billing-toggle button {
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--dui-radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--dui-muted-foreground);
}
.dashboard-ui-shell .billing-toggle button.active {
  background: var(--dui-background);
  color: var(--dui-foreground);
  box-shadow: var(--dui-shadow-soft), inset 0 0 0 1px var(--dui-border);
}
.dashboard-ui-shell .billing-toggle button span {
  margin-left: 6px;
  color: var(--dui-brand);
  font-size: 11px;
}
.dashboard-ui-shell .team-subscribe-footer-hint {
  margin-right: auto;
  color: var(--dui-muted-foreground);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-ui-shell .team-subscribe-footer-seats {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dashboard-ui-shell .team-subscribe-footer-seats > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--dui-muted-foreground);
}
.dashboard-ui-shell .team-subscribe-footer-seats .input {
  width: 88px;
  height: 34px;
  text-align: center;
}
.dashboard-ui-shell .team-subscribe-checkout-button {
  background: var(--dui-brand);
  border-color: var(--dui-brand);
  color: var(--dui-on-brand);
}
.dashboard-ui-shell .team-subscribe-checkout-button:hover:not(:disabled) {
  background: var(--dui-brand-hover);
  border-color: var(--dui-brand-hover);
}
.dashboard-ui-shell .team-subscribe-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  height: clamp(460px, calc(100vh - 300px), 620px);
}
.dashboard-ui-shell .team-product-picker {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-card);
  padding: 8px;
  background: var(--dui-surface);
}
.dashboard-ui-shell .team-product-group + .team-product-group {
  margin-top: 4px;
}
.dashboard-ui-shell .team-product-group:has(.team-product-group-label) {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--dui-border);
}
.dashboard-ui-shell .team-product-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 7px;
  color: var(--dui-muted-foreground);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dashboard-ui-shell .team-product-option {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 40px 9px 10px;
  border-radius: var(--dui-radius-lg);
  text-align: left;
  transition: background 0.12s, box-shadow 0.12s;
}
.dashboard-ui-shell .team-product-option:hover:not(:disabled) { background: var(--dui-hover); }
.dashboard-ui-shell .team-product-option.active {
  background: var(--dui-background);
  box-shadow: var(--dui-shadow-soft), inset 0 0 0 1px var(--dui-brand);
}
.dashboard-ui-shell .team-product-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dashboard-ui-shell .team-product-option img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--dui-background);
  border: 1px solid var(--dui-border);
}
.dashboard-ui-shell .team-product-option span {
  flex: 1;
  min-width: 0;
}
.dashboard-ui-shell .team-product-option strong,
.dashboard-ui-shell .team-product-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-ui-shell .team-product-option strong {
  font-size: 13px;
  font-weight: 650;
}
.dashboard-ui-shell .team-product-option small {
  margin-top: 1px;
  color: var(--dui-muted-foreground);
  font-size: 11.5px;
}
.dashboard-ui-shell .team-product-option > .icon {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
}
.dashboard-ui-shell .team-product-skeleton {
  height: 58px;
  border-radius: var(--dui-radius-lg);
  background: linear-gradient(90deg, var(--dui-muted), var(--dui-background), var(--dui-muted));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  margin-bottom: 6px;
}
.dashboard-ui-shell .team-plan-panel {
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-card);
  padding: 16px;
  background: var(--dui-background);
}
.dashboard-ui-shell .team-plan-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.dashboard-ui-shell .team-plan-product-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dashboard-ui-shell .team-plan-product-title img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  border: 1px solid var(--dui-border);
  background: var(--dui-surface);
}
.dashboard-ui-shell .team-plan-product-link {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--dui-foreground);
  line-height: 1.25;
}
.dashboard-ui-shell .team-plan-product-link:hover {
  color: var(--dui-brand);
}
.dashboard-ui-shell .team-plan-product-title p {
  margin: 2px 0 0;
  color: var(--dui-muted-foreground);
  font-size: 12.5px;
}
.dashboard-ui-shell .team-plan-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.dashboard-ui-shell .team-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.dashboard-ui-shell .team-pricing-card {
  min-height: 252px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-lg);
  padding: 13px;
  background: var(--dui-card);
  text-align: left;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.dashboard-ui-shell .team-pricing-card:hover:not(:disabled) {
  border-color: var(--dui-border-strong);
  box-shadow: var(--dui-shadow-pin);
  transform: translateY(-1px);
}
.dashboard-ui-shell .team-pricing-card.active {
  border-color: var(--dui-brand);
  box-shadow: 0 0 0 2px var(--dui-brand-soft-strong), var(--dui-shadow-pin);
}
.dashboard-ui-shell .team-pricing-card:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}
.dashboard-ui-shell .team-pricing-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.dashboard-ui-shell .team-pricing-card h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}
.dashboard-ui-shell .team-pricing-card p {
  margin: 3px 0 0;
  color: var(--dui-muted-foreground);
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-ui-shell .team-pricing-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.dashboard-ui-shell .team-pricing-price strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}
.dashboard-ui-shell .team-pricing-price span {
  color: var(--dui-muted-foreground);
  font-size: 12px;
}
.dashboard-ui-shell .team-pricing-strike {
  text-decoration: line-through;
  font-size: 15px !important;
}
.dashboard-ui-shell .team-pricing-meta {
  min-height: 18px;
  margin-top: 5px;
  color: var(--dui-muted-foreground);
  font-size: 11.5px;
}
.dashboard-ui-shell .team-pricing-meta b {
  margin-left: 8px;
  color: var(--dui-brand);
}
.dashboard-ui-shell .team-pricing-card ul {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 2px;
}
.dashboard-ui-shell .team-pricing-card li {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  color: var(--dui-muted-foreground);
  font-size: 11.8px;
  line-height: 1.35;
}
.dashboard-ui-shell .team-pricing-card li .icon {
  color: var(--dui-brand);
  margin-top: 2px;
  flex-shrink: 0;
}
.dashboard-ui-shell .team-summary-fixed {
  flex-shrink: 0;
  padding-top: 12px;
}
.dashboard-ui-shell .team-subscribe-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: var(--dui-radius-lg);
  background: var(--dui-surface);
}
.dashboard-ui-shell .team-subscribe-summary span,
.dashboard-ui-shell .team-subscribe-summary strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-ui-shell .team-subscribe-summary span {
  font-size: 11px;
  margin-bottom: 2px;
}
.dashboard-ui-shell .team-subscribe-summary strong {
  font-size: 12.5px;
  font-weight: 650;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.dashboard-ui-shell .progress {
  width: 100%; height: 6px;
  background: var(--dui-muted);
  border-radius: var(--dui-radius-full);
  overflow: hidden;
}
.dashboard-ui-shell .progress-bar {
  height: 100%; background: var(--dui-brand);
  border-radius: var(--dui-radius-full);
  transition: width 0.4s ease;
}
.dashboard-ui-shell .progress-bar.warning { background: var(--dui-warning); }
.dashboard-ui-shell .progress-bar.danger { background: var(--dui-destructive); }

.dashboard-ui-shell .divider { height: 1px; background: var(--dui-border); margin: 16px 0; }

.dashboard-ui-shell .empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--dui-muted-foreground);
  background: var(--dui-surface);
  border-radius: var(--dui-radius-card);
  border: 1px dashed var(--dui-border);
}
.dashboard-ui-shell .empty-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--dui-muted);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  color: var(--dui-muted-foreground);
}
.dashboard-ui-shell .empty-title { font-size: 15px; font-weight: 600; color: var(--dui-foreground); margin-bottom: 6px; }

.dashboard-ui-shell .toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 100;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.dashboard-ui-shell .toast {
  background: var(--dui-card);
  color: var(--dui-foreground);
  padding: 10px 12px;
  border-radius: var(--dui-radius-lg);
  border: 1px solid var(--dui-border-strong);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  box-shadow: var(--dui-shadow-popover);
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideInRight 0.22s ease;
  pointer-events: auto;
  min-width: 220px;
  max-width: 360px;
}
.dashboard-ui-shell .toast p {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dashboard-ui-shell .toast .icon {
  font-size: 17px;
  line-height: 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  flex-shrink: 0;
}
.dashboard-ui-shell .toast-success .icon { color: var(--dui-success); }
.dashboard-ui-shell .toast-error .icon { color: var(--dui-destructive); }
.dashboard-ui-shell .toast-info .icon { color: var(--dui-brand); }

/* product brand chips */
.dashboard-ui-shell .product-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: transparent;
  font-family: var(--dui-font-serif);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.dashboard-ui-shell .product-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.dashboard-ui-shell .product-mark.studio,
.dashboard-ui-shell .product-mark.noteslide,
.dashboard-ui-shell .product-mark.openapi,
.dashboard-ui-shell .product-mark.site {
  background: transparent;
  color: var(--dui-foreground);
}

.dashboard-ui-shell .skel {
  background: linear-gradient(90deg, var(--dui-muted) 0%, var(--dui-accent) 50%, var(--dui-muted) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.35s infinite;
  border-radius: var(--dui-radius-md);
}
@keyframes shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }

/* Scrollbar */
.dashboard-ui-shell .main-scroll::-webkit-scrollbar,
.dashboard-ui-shell .drawer-body::-webkit-scrollbar,
.dashboard-ui-shell .sidebar::-webkit-scrollbar { width: 10px; height: 10px; }
.dashboard-ui-shell .main-scroll::-webkit-scrollbar-thumb,
.dashboard-ui-shell .drawer-body::-webkit-scrollbar-thumb,
.dashboard-ui-shell .sidebar::-webkit-scrollbar-thumb {
  background: var(--dui-border);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.dashboard-ui-shell .main-scroll::-webkit-scrollbar-thumb:hover,
.dashboard-ui-shell .drawer-body::-webkit-scrollbar-thumb:hover,
.dashboard-ui-shell .sidebar::-webkit-scrollbar-thumb:hover { background: var(--dui-border-strong); background-clip: content-box; }

/* Remix icon defaults */
.dashboard-ui-shell .icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; }
.dashboard-ui-shell .icon i { display: block; }

/* alert banner */
.dashboard-ui-shell .alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--dui-radius-lg);
  border: 1px solid var(--dui-border);
  background: var(--dui-surface);
  font-size: 13px;
}
.dashboard-ui-shell .alert-warning { background: var(--dui-warning-soft); border-color: rgba(242, 183, 15, 0.35); }
.dashboard-ui-shell .alert-danger  { background: var(--dui-destructive-soft); border-color: rgba(239, 68, 68, 0.30); }
.dashboard-ui-shell .alert-brand   { background: var(--dui-brand-soft); border-color: rgba(79, 102, 217, 0.30); }
.dashboard-ui-shell .alert-title { font-weight: 600; }
.dashboard-ui-shell .alert-body { color: var(--dui-muted-foreground); margin-top: 2px; }
/* Compact list rows */
.dashboard-ui-shell .list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--dui-border);
}
.dashboard-ui-shell .list-row:last-child { border-bottom: 0; }
.dashboard-ui-shell .list-row-action { margin-left: auto; }

/* utility */
.dashboard-ui-shell .muted { color: var(--dui-muted-foreground); }
.dashboard-ui-shell .strong { color: var(--dui-foreground); font-weight: 600; }
.dashboard-ui-shell .text-success { color: var(--dui-success); }
.dashboard-ui-shell .text-danger { color: var(--dui-destructive); }
.dashboard-ui-shell .text-warning { color: #B8870A; }
.dashboard-ui-shell.dark .text-warning { color: var(--dui-warning); }
.dashboard-ui-shell .text-brand { color: var(--dui-brand); }
.dashboard-ui-shell .row { display: flex; align-items: center; gap: 10px; }
.dashboard-ui-shell .row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dashboard-ui-shell .col { display: flex; flex-direction: column; gap: 4px; }
.dashboard-ui-shell .spacer { flex: 1; }
.dashboard-ui-shell .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dashboard-ui-shell .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .dashboard-ui-shell .grid-2, .dashboard-ui-shell .grid-3 { grid-template-columns: 1fr; } }

/* Toggle switch */
.dashboard-ui-shell .switch {
  position: relative;
  display: inline-block;
  width: 36px; height: 20px;
  flex-shrink: 0;
}
.dashboard-ui-shell .switch input { opacity: 0; width: 0; height: 0; }
.dashboard-ui-shell .switch-slider {
  position: absolute; inset: 0;
  background: var(--dui-border);
  border-radius: var(--dui-radius-full);
  transition: background 0.18s;
  cursor: pointer;
}
.dashboard-ui-shell .switch-slider::before {
  content: ''; position: absolute;
  left: 2px; top: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.18s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.dashboard-ui-shell .switch input:checked + .switch-slider { background: var(--dui-brand); }
.dashboard-ui-shell .switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* Code block */
.dashboard-ui-shell .code-block {
  background: var(--dui-surface);
  border: 1px solid var(--dui-border);
  border-radius: var(--dui-radius-md);
  padding: 12px 14px;
  font-family: var(--dui-font-mono);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  word-break: break-all;
  overflow-x: auto;
}

/* ============================================================
   Mobile top bar (hidden on desktop)
   ============================================================ */
.dashboard-ui-shell .mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--dui-background);
  border-bottom: 1px solid var(--dui-border);
  padding: 10px 14px;
  align-items: center;
  gap: 10px;
  height: 56px;
}
.dashboard-ui-shell .mobile-bar-brand {
  display: flex; align-items: center; gap: 8px;
  flex: 1;
  min-width: 0;
}
.dashboard-ui-shell .mobile-bar-brand .sb-brand-mark {
  width: 26px; height: 26px;
  font-size: 14px;
}
.dashboard-ui-shell .mobile-bar-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-ui-shell .sidebar-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20, 20, 24, 0.40);
  z-index: 40;
  animation: fadeIn 0.16s ease;
}
.dashboard-ui-shell.dark .sidebar-scrim { background: rgba(0, 0, 0, 0.60); }

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 1024px) {
  .dashboard-ui-shell .main-inner { padding: 20px 22px 80px; }
  .dashboard-ui-shell .grid-3 { grid-template-columns: 1fr 1fr; }
  .dashboard-ui-shell .team-subscribe-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .dashboard-ui-shell .team-product-picker {
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-ui-shell .team-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 768px) {
  .dashboard-ui-shell .app-shell {
    grid-template-columns: 1fr;
  }
  .dashboard-ui-shell .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: var(--dui-shadow-modal);
  }
  .dashboard-ui-shell .sidebar.open { transform: translateX(0); }
  .dashboard-ui-shell .sidebar-scrim.open { display: block; }

  .dashboard-ui-shell .mobile-bar { display: flex; }
  .dashboard-ui-shell .main-col { min-width: 0; }
  .dashboard-ui-shell .main-inner { padding: 16px 16px 80px; }
  .dashboard-ui-shell .page-title { font-size: 26px; }
  .dashboard-ui-shell .page-subtitle { font-size: 13px; }
  .dashboard-ui-shell .page-head {
    gap: 12px;
    margin-bottom: 18px;
  }
  .dashboard-ui-shell .page-actions { width: 100%; flex-wrap: wrap; }

  /* Cards / grids — single column */
  .dashboard-ui-shell .grid-2, .dashboard-ui-shell .grid-3 { grid-template-columns: 1fr; }
  .dashboard-ui-shell .kv-list { grid-template-columns: 1fr 1fr; gap: 14px 18px; }

  /* Stats grid — 2 per row */
  .dashboard-ui-shell .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .dashboard-ui-shell .stat { padding: 12px 14px; }
  .dashboard-ui-shell .stat-value { font-size: 20px; }

  /* Card chrome */
  .dashboard-ui-shell .card-head, .dashboard-ui-shell .card-foot { padding: 14px 16px; }
  .dashboard-ui-shell .card-body { padding: 14px 16px; }
  .dashboard-ui-shell .card-pad, .dashboard-ui-shell .card-pad-lg { padding: 16px; }
  .dashboard-ui-shell .card-head { flex-wrap: wrap; gap: 10px; }
  .dashboard-ui-shell .card-head > div:last-child { flex-shrink: 0; }
  .dashboard-ui-shell .card-foot { flex-wrap: wrap; }

  /* Modal becomes near-fullscreen sheet */
  .dashboard-ui-shell .scrim { padding: 12px; align-items: flex-end; }
  .dashboard-ui-shell .modal {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  .dashboard-ui-shell .modal-head { padding: 18px 18px 4px; }
  .dashboard-ui-shell .modal-body { padding: 12px 18px; }
  .dashboard-ui-shell .modal-foot { padding: 14px 18px 20px; flex-direction: column-reverse; align-items: stretch; }
  .dashboard-ui-shell .modal-foot .btn { width: 100%; justify-content: center; }
  .dashboard-ui-shell .modal-title { font-size: 16px; }
  .dashboard-ui-shell .billing-toggle { width: 100%; }
  .dashboard-ui-shell .billing-toggle button { flex: 1; }
  .dashboard-ui-shell .team-subscribe-footer-seats {
    width: 100%;
    justify-content: space-between;
  }
  .dashboard-ui-shell .team-subscribe-footer-seats .input { flex: 1; }
  .dashboard-ui-shell .team-product-picker,
  .dashboard-ui-shell .team-plan-grid,
  .dashboard-ui-shell .team-subscribe-summary {
    grid-template-columns: 1fr;
  }
  .dashboard-ui-shell .team-pricing-card { min-height: auto; }

  /* Drawer → full-width sheet */
  .dashboard-ui-shell .drawer {
    width: 100%;
    max-width: 100%;
  }
  .dashboard-ui-shell .drawer-foot { flex-direction: column-reverse; align-items: stretch; gap: 6px; }
  .dashboard-ui-shell .drawer-foot .btn { width: 100%; justify-content: center; }

  /* Tables: still scroll horizontally */
  .dashboard-ui-shell .tbl thead th, .dashboard-ui-shell .tbl tbody td {
    padding: 10px 12px;
  }

  /* List rows: stack identity + actions on mobile */
  .dashboard-ui-shell .list-row {
    flex-wrap: wrap;
    padding: 12px 14px;
    row-gap: 10px;
  }
  .dashboard-ui-shell .list-row > *:nth-child(n+3) {
    margin-left: auto;
  }

  /* Switches & form */
  .dashboard-ui-shell .field-label { font-size: 12px; }

  /* Tabs scroll */
  .dashboard-ui-shell .tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .dashboard-ui-shell .tabs::-webkit-scrollbar { display: none; }
  .dashboard-ui-shell .tab { flex-shrink: 0; }

  /* Chip rows scroll */
  .dashboard-ui-shell .chip-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .dashboard-ui-shell .chip-row::-webkit-scrollbar { display: none; }

  /* Popovers stay inside viewport */
  .dashboard-ui-shell .popover {
    max-width: calc(100vw - 32px);
  }

  /* Toasts */
  .dashboard-ui-shell .toast-container {
    left: 12px; right: 12px;
    bottom: 12px;
  }
  .dashboard-ui-shell .toast { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .dashboard-ui-shell .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-ui-shell .kv-list { grid-template-columns: 1fr; }
  .dashboard-ui-shell .page-title { font-size: 24px; }
}
