/* =========================================================================
   DB Platform UI — shared design system v1
   =========================================================================
   Loaded by panel/admin/sub/landing cabinets via:
       <link rel="stylesheet" href="/_shared/dbp-ui.css?v=1">
   Placed BEFORE the cabinet's inline <style> so that existing inline
   rules win on conflict (layered-override approach). New code uses
   `.dbp-*` prefixed classes which don't collide with existing names.
   ========================================================================= */


/* =========================================================================
   1. Tokens
   ========================================================================= */
:root {
  /* surfaces */
  --bg: hsl(0 0% 3%);
  --bg-secondary: hsl(0 0% 5%);
  --bg-tertiary: hsl(0 0% 7%);
  --bg-card: hsl(0 0% 5%);
  --bg-card-hover: hsl(0 0% 8%);
  --bg-row: hsl(0 0% 7%);
  --bg-elev: hsl(0 0% 9%);
  --bg-input: hsl(0 0% 10%);

  /* foreground */
  --fg: hsl(0 0% 96%);
  --fg-soft: hsl(0 0% 78%);
  --fg-muted: hsl(0 0% 56%);
  --fg-dim: hsl(0 0% 38%);

  /* accent (gold / champagne) */
  --primary: hsl(38 65% 52%);
  --primary-glow: hsl(38 75% 62%);
  --primary-soft: hsl(38 50% 28%);
  --primary-faint: hsl(38 65% 52% / 0.08);

  /* borders */
  --border: hsl(0 0% 13%);
  --border-strong: hsl(0 0% 18%);
  --border-glow: hsl(38 35% 30%);

  /* status */
  --destructive: hsl(0 60% 48%);
  --success: hsl(140 50% 45%);
  --warning: hsl(38 70% 55%);
  --info: hsl(200 60% 50%);
  --ring: hsl(38 65% 52%);

  /* radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;

  /* shadows */
  --shadow-sm: 0 1px 4px -1px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 2px 10px -2px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 6px 24px -6px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 20px -8px hsl(38 65% 52% / 0.25);

  /* gradients */
  --gradient-primary: linear-gradient(135deg, hsl(38 65% 52%) 0%, hsl(38 80% 62%) 100%);
  --gradient-subtle:  linear-gradient(180deg, hsl(0 0% 6%) 0%, hsl(0 0% 3%) 100%);
  --gradient-glass:   linear-gradient(135deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.005) 100%);
  --gradient-glow:    radial-gradient(ellipse at center, hsl(38 65% 52% / 0.08) 0%, transparent 70%);

  /* typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* transitions */
  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}


/* =========================================================================
   2. Base — safe additions only
   ========================================================================= */

/* feature settings + AA — no layout impact */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* selection */
::selection { background: hsl(38 65% 52% / 0.3); color: var(--fg); }

/* premium scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: hsl(0 0% 18%); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: hsl(0 0% 25%); }
* { scrollbar-color: hsl(0 0% 18%) transparent; scrollbar-width: thin; }

/* focus ring — keyboard only, never on mouse */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* prefers-reduced-motion respect */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* link helper class — opt-in (no default <a> override) */
a.dbp-link {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--t-fast);
}
a.dbp-link:hover { color: var(--primary-glow); }


/* =========================================================================
   3. Layout primitives — opt-in, all `.dbp-*` prefixed
   ========================================================================= */

.dbp-container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.dbp-container-narrow { max-width: 920px; }
.dbp-container-wide   { max-width: 1440px; }

.dbp-page {
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse at center top, hsl(38 65% 52% / 0.06), transparent 50%);
  color: var(--fg);
  font-family: var(--font-sans);
}

.dbp-section       { padding: 24px 0; }
.dbp-section-tight { padding: 12px 0; }
.dbp-section-loose { padding: 48px 0; }

.dbp-stack    { display: flex; flex-direction: column; gap: 12px; }
.dbp-stack-sm { gap: 8px; }
.dbp-stack-lg { gap: 20px; }
.dbp-stack-xl { gap: 32px; }

.dbp-row       { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.dbp-row-tight { gap: 6px; }
.dbp-row-loose { gap: 20px; }
.dbp-row-wrap  { flex-wrap: wrap; }

.dbp-grid         { display: grid; gap: 16px; }
.dbp-grid-2       { grid-template-columns: 1fr 1fr; }
.dbp-grid-3       { grid-template-columns: repeat(3, 1fr); }
.dbp-grid-4       { grid-template-columns: repeat(4, 1fr); }
.dbp-grid-auto    { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.dbp-grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.dbp-grid-auto-lg { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.dbp-split {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.dbp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.dbp-toolbar-end { margin-left: auto; }

@media (max-width: 1024px) {
  .dbp-grid-3, .dbp-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .dbp-container { padding: 0 16px; }
  .dbp-grid-2, .dbp-grid-3, .dbp-grid-4 { grid-template-columns: 1fr; }
}


/* =========================================================================
   4. Component primitives (v1)
   =========================================================================
   IMPORTANT: cabinet inline <style> is loaded AFTER this file. For names
   that already exist in cabinets (.btn, .pill-pending, .card, .modal,
   .drawer, .tab, etc.), inline styles win — these definitions are
   harmless. Selector additions here are ones cabinets don't yet have.
   ========================================================================= */

/* 4.1 Card primitives ---------------------------------------------------- */
.dbp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.dbp-card-glass {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.dbp-card-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-glass);
  pointer-events: none;
}
.dbp-card-glass > * { position: relative; z-index: 1; }

.dbp-card-elevated {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.dbp-card-interactive {
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base), transform var(--t-base);
}
.dbp-card-interactive:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.dbp-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.dbp-card-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.dbp-card-sub   { margin: 2px 0 0; font-size: 12px; color: var(--fg-muted); }


/* 4.2 Stat card --------------------------------------------------------- */
.dbp-stat {
  position: relative;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.dbp-stat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  margin-bottom: 6px;
}
.dbp-stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--fg);
}
.dbp-stat-value-mono {
  font-family: var(--font-mono);
  font-size: 22px;
}
.dbp-stat-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  margin-top: 6px;
}
.dbp-stat-delta.up      { color: var(--success); }
.dbp-stat-delta.down    { color: var(--destructive); }
.dbp-stat-delta.neutral { color: var(--fg-muted); }
.dbp-stat-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-faint);
  color: var(--primary);
}


/* 4.3 Buttons — additive variants (cabinets already have .btn / .btn-primary / .btn-danger / .btn-success) */
.btn-secondary {
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}
.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--fg);
  border-color: var(--border);
}
.btn-destructive {
  background: transparent;
  color: var(--destructive);
  border: 1px solid hsl(0 60% 48% / 0.3);
}
.btn-destructive:hover {
  background: hsl(0 60% 48% / 0.1);
  border-color: var(--destructive);
}
.btn-icon {
  padding: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon.btn-sm { width: 28px; height: 28px; }
.btn-icon.btn-xs { width: 24px; height: 24px; }
.btn-lg {
  padding: 12px 22px;
  font-size: 14px;
}


/* 4.4 Pills — DBP variants (do NOT touch cabinet .pill-pending, .pill-resolved, etc.) */
.dbp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.dbp-pill-with-dot::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.dbp-pill-primary     { background: hsl(38 65% 52% / 0.15);  color: var(--primary);     border-color: hsl(38 65% 52% / 0.25); }
.dbp-pill-success     { background: hsl(140 50% 45% / 0.15); color: var(--success);     border-color: hsl(140 50% 45% / 0.25); }
.dbp-pill-destructive { background: hsl(0 60% 48% / 0.15);   color: var(--destructive); border-color: hsl(0 60% 48% / 0.25); }
.dbp-pill-info        { background: hsl(200 60% 50% / 0.15); color: hsl(200 70% 65%);   border-color: hsl(200 60% 50% / 0.25); }
.dbp-pill-warning     { background: hsl(38 70% 55% / 0.15);  color: hsl(38 80% 70%);    border-color: hsl(38 70% 55% / 0.25); }
.dbp-pill-muted       { background: hsl(0 0% 50% / 0.15);    color: var(--fg-muted);    border-color: hsl(0 0% 30%); }


/* 4.5 Tables — NEW unified style (cabinet inline tables remain untouched) */
.dbp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dbp-table thead {
  background: linear-gradient(180deg, hsl(38 65% 52% / 0.06), hsl(38 65% 52% / 0.02));
}
.dbp-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--fg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}
.dbp-table td {
  padding: 12px;
  border-bottom: 1px solid hsl(0 0% 13% / 0.6);
  vertical-align: middle;
  color: var(--fg-soft);
}
.dbp-table tbody tr:nth-child(even) td { background: hsl(0 0% 11% / 0.4); }
.dbp-table tbody tr:hover td           { background: hsl(38 65% 52% / 0.06); }
.dbp-table tbody tr.dbp-row-active td  {
  background: hsl(38 65% 52% / 0.1);
  box-shadow: inset 2px 0 0 var(--primary);
}
.dbp-table tr.dbp-row-clickable { cursor: pointer; }
.dbp-table-scroll {
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}


/* 4.6 Inputs / textarea / select / fields */
.dbp-input,
.dbp-select,
.dbp-textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}
.dbp-input::placeholder,
.dbp-textarea::placeholder { color: var(--fg-dim); }
.dbp-input:focus,
.dbp-select:focus,
.dbp-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsl(38 65% 52% / 0.15);
}
.dbp-input:disabled,
.dbp-select:disabled,
.dbp-textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.dbp-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.dbp-input-with-icon { position: relative; display: block; }
.dbp-input-with-icon .dbp-input { padding-left: 36px; }
.dbp-input-with-icon .dbp-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  pointer-events: none;
  width: 14px;
  height: 14px;
}

.dbp-field { display: flex; flex-direction: column; gap: 6px; }
.dbp-field-label  { font-size: 12px; font-weight: 500; color: var(--fg-soft); }
.dbp-field-helper { font-size: 11px; color: var(--fg-muted); }
.dbp-field-error  { font-size: 11px; color: var(--destructive); }
.dbp-field.has-error .dbp-input,
.dbp-field.has-error .dbp-textarea,
.dbp-field.has-error .dbp-select { border-color: var(--destructive); }


/* 4.7 Tabs — pill variant (sub-tabs); cabinet `.tabs/.tab` underline kept */
.dbp-tabs-pill {
  display: inline-flex;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--r-md);
  gap: 2px;
  border: 1px solid var(--border);
}
.dbp-tab-pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t-base);
  font-family: inherit;
}
.dbp-tab-pill:hover { color: var(--fg); }
.dbp-tab-pill.active {
  color: var(--fg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}


/* 4.8 Toast (NEW; cabinet inline toast still works alongside) */
.dbp-toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  pointer-events: none;
}
.dbp-toast-wrap > * { pointer-events: auto; }
.dbp-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: dbp-toast-in 200ms ease-out;
}
.dbp-toast-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
.dbp-toast-body  { flex: 1; min-width: 0; }
.dbp-toast-title { font-weight: 600; color: var(--fg); }
.dbp-toast-desc  { color: var(--fg-muted); margin-top: 2px; }
.dbp-toast-close {
  margin-left: 4px;
  background: transparent;
  border: 0;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-family: inherit;
}
.dbp-toast-close:hover { color: var(--fg); }
.dbp-toast.success { border-color: hsl(140 50% 45% / 0.4); }
.dbp-toast.success .dbp-toast-icon { color: var(--success); }
.dbp-toast.error   { border-color: hsl(0 60% 48% / 0.4); }
.dbp-toast.error   .dbp-toast-icon { color: var(--destructive); }
.dbp-toast.info    { border-color: hsl(200 60% 50% / 0.4); }
.dbp-toast.info    .dbp-toast-icon { color: hsl(200 70% 65%); }
@keyframes dbp-toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}


/* 4.9 Modal & Drawer (NEW; cabinet inline .modal/.drawer untouched) */
.dbp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.dbp-overlay[data-visible="true"] { opacity: 1; pointer-events: auto; }

.dbp-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-width: 400px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  z-index: 101;
  transform: translate(-50%, calc(-50% + 8px)) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 200ms, opacity 200ms;
}
.dbp-modal[data-visible="true"] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.dbp-modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.dbp-modal-title { margin: 0; font-size: 16px; font-weight: 600; }
.dbp-modal-body  { padding: 18px 22px; }
.dbp-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

.dbp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(720px, 100vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 101;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.dbp-drawer[data-visible="true"] { transform: translateX(0); }
.dbp-drawer-md { width: min(560px, 100vw); }
.dbp-drawer-sm { width: min(420px, 100vw); }
.dbp-drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.dbp-drawer-body   { flex: 1; padding: 18px 22px; overflow-y: auto; }
.dbp-drawer-footer {
  flex: 0 0 auto;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.dbp-drawer-section { margin-bottom: 22px; }
.dbp-drawer-section:last-child { margin-bottom: 0; }
.dbp-drawer-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}
.dbp-drawer-close:hover {
  background: var(--bg-card-hover);
  color: var(--fg);
  border-color: var(--border-strong);
}


/* 4.10 Empty state */
.dbp-empty {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--fg-muted);
}
.dbp-empty-icon  { width: 48px; height: 48px; color: var(--fg-dim); margin-bottom: 4px; }
.dbp-empty-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--fg); }
.dbp-empty-desc  { margin: 0; font-size: 13px; line-height: 1.5; max-width: 360px; }
.dbp-empty-action { margin-top: 4px; }


/* 4.11 Skeleton loaders */
.dbp-skel {
  background: linear-gradient(90deg,
    var(--bg-card) 0%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 100%);
  background-size: 200% 100%;
  animation: dbp-shimmer 1.4s linear infinite;
  border-radius: var(--r-sm);
  display: inline-block;
}
.dbp-skel-text    { height: 12px; width: 100%; }
.dbp-skel-text-sm { height: 10px; width: 60%; }
.dbp-skel-line    { height: 14px; width: 100%; }
.dbp-skel-row     { height: 18px; width: 100%; }
.dbp-skel-circle  { width: 28px; height: 28px; border-radius: 50%; }
.dbp-skel-card    { height: 80px; width: 100%; border-radius: var(--r-md); }
@keyframes dbp-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* 4.12 Page header (NEW pattern for redesigned cabinets) */
.dbp-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.dbp-page-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.dbp-page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--fg) 0%, var(--primary) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dbp-page-subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--fg-muted);
}
@media (max-width: 720px) {
  .dbp-page-title { font-size: 22px; }
}


/* 4.13 KV list (key-value rows for drawer details) */
.dbp-kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.dbp-kv dt { color: var(--fg-muted); }
.dbp-kv dd { margin: 0; word-break: break-word; color: var(--fg-soft); }


/* 4.14 Avatar */
.dbp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-glow));
  color: hsl(0 0% 8%);
  overflow: hidden;
  flex: 0 0 auto;
}
.dbp-avatar img    { width: 100%; height: 100%; object-fit: cover; }
.dbp-avatar-sm     { width: 24px; height: 24px; font-size: 10px; }
.dbp-avatar-lg     { width: 40px; height: 40px; font-size: 14px; }
.dbp-avatar-xl     { width: 56px; height: 56px; font-size: 18px; }
.dbp-avatar-muted  { background: var(--bg-card-hover); color: var(--fg-muted); }


/* 4.15 Divider */
.dbp-divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 16px 0;
}
.dbp-divider-glow {
  background: linear-gradient(90deg, transparent, var(--border), hsl(38 35% 30% / 0.5), var(--border), transparent);
}


/* =========================================================================
   5. Utility layer — generic helpers
   =========================================================================
   Names without `.dbp-` prefix are used widely by tailwind-style code.
   None of these clash with current cabinet inline classes (verified).
   ========================================================================= */

/* display */
.dbp-hidden, .hidden { display: none !important; }
.block         { display: block !important; }
.inline        { display: inline !important; }
.inline-block  { display: inline-block !important; }
.flex          { display: flex !important; }
.inline-flex   { display: inline-flex !important; }
.grid          { display: grid !important; }

/* text colors */
.text-muted       { color: var(--fg-muted) !important; }
.text-soft        { color: var(--fg-soft) !important; }
.text-dim         { color: var(--fg-dim) !important; }
.text-primary     { color: var(--primary) !important; }
.text-success     { color: var(--success) !important; }
.text-destructive { color: var(--destructive) !important; }
.text-warning     { color: var(--warning) !important; }

/* text alignment / weight / size */
.text-left   { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }
.text-mono   { font-family: var(--font-mono) !important; }
.text-xs     { font-size: 11px !important; }
.text-sm     { font-size: 12px !important; }
.text-md     { font-size: 14px !important; }
.text-lg     { font-size: 16px !important; }
.text-xl     { font-size: 20px !important; }
.font-medium   { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold     { font-weight: 700 !important; }
.uppercase     { text-transform: uppercase !important; letter-spacing: 0.05em; }
.lowercase     { text-transform: lowercase !important; }
.capitalize    { text-transform: capitalize !important; }
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.break-words { word-break: break-word; overflow-wrap: anywhere; }

/* sizing */
.w-full { width: 100% !important; }
.w-auto { width: auto !important; }
.h-full { height: 100% !important; }
.min-w-0 { min-width: 0 !important; }
.max-w-full { max-width: 100% !important; }

/* margin */
.m-0  { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-5 { margin-top: 20px !important; }
.mt-6 { margin-top: 24px !important; }
.mt-8 { margin-top: 32px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-5 { margin-bottom: 20px !important; }
.mb-6 { margin-bottom: 24px !important; }
.mb-8 { margin-bottom: 32px !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
.p-5 { padding: 20px !important; }
.p-6 { padding: 24px !important; }
.px-2 { padding-left: 8px !important; padding-right: 8px !important; }
.px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.px-4 { padding-left: 16px !important; padding-right: 16px !important; }
.py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3 { padding-top: 12px !important; padding-bottom: 12px !important; }
.py-4 { padding-top: 16px !important; padding-bottom: 16px !important; }

/* gap */
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 20px !important; }
.gap-6 { gap: 24px !important; }

/* flex helpers */
.items-start    { align-items: flex-start !important; }
.items-center   { align-items: center !important; }
.items-end      { align-items: flex-end !important; }
.items-stretch  { align-items: stretch !important; }
.items-baseline { align-items: baseline !important; }
.justify-start   { justify-content: flex-start !important; }
.justify-center  { justify-content: center !important; }
.justify-end     { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }
.justify-around  { justify-content: space-around !important; }
.flex-1     { flex: 1 1 0% !important; }
.flex-auto  { flex: 1 1 auto !important; }
.flex-none  { flex: none !important; }
.flex-wrap  { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-col   { flex-direction: column !important; }
.flex-row   { flex-direction: row !important; }
.flex-grow  { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* misc */
.rounded      { border-radius: var(--r-sm) !important; }
.rounded-md   { border-radius: var(--r-md) !important; }
.rounded-lg   { border-radius: var(--r-lg) !important; }
.rounded-xl   { border-radius: var(--r-xl) !important; }
.rounded-full { border-radius: 999px !important; }
.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }
.select-none   { user-select: none !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.opacity-50      { opacity: 0.5 !important; }
.opacity-70      { opacity: 0.7 !important; }
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.sticky   { position: sticky !important; }
.z-10 { z-index: 10 !important; }
.z-50 { z-index: 50 !important; }

/* responsive utilities */
@media (max-width: 720px) {
  .sm\:hidden       { display: none !important; }
  .sm\:flex         { display: flex !important; }
  .sm\:block        { display: block !important; }
  .sm\:flex-col     { flex-direction: column !important; }
  .sm\:w-full       { width: 100% !important; }
  .sm\:text-left    { text-align: left !important; }
  .sm\:text-center  { text-align: center !important; }
}
@media (min-width: 721px) {
  .md\:hidden       { display: none !important; }
  .md\:flex         { display: flex !important; }
  .md\:block        { display: block !important; }
}

/* =========================================================================
   END dbp-ui.css v1
   ========================================================================= */
