/* ============================================================
   Maestro3D — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;700&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  /* Brand */
  --brand:          #A78BFA;
  --brand-dark:     #8B5CF6;
  --brand-light:    #C4B5FD;
  --brand-subtle:   rgba(167, 139, 250, 0.14);
  --accent:         #22D3EE;
  --accent-subtle:  rgba(34, 211, 238, 0.12);
  --plan-brand:     #00C4A0;
  --plan-brand-dark:#00A688;
  --plan-accent:    #6366F1;
  --plan-subtle:    rgba(0, 196, 160, 0.14);
  --plan-accent-subtle: rgba(99, 102, 241, 0.12);
  --plan-border:    rgba(0, 196, 160, 0.22);

  /* Surfaces — dark (Premium Deep Gray/Blue) */
  --bg-base:        #0B0A14;
  --bg-surface:     #141222;
  --bg-elevated:    #1B182B;
  --bg-card:        #141222;
  --bg-overlay:     rgba(11, 10, 20, 0.90);
  --bg-hover:       rgba(255, 255, 255, 0.04);
  --bg-input:       #100E1C;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.12);
  --border-subtle:  rgba(255, 255, 255, 0.08);
  --border-focus:   var(--brand);

  /* Text */
  --text-primary:   #F5F5FA;
  --text-secondary: #B8B8C8;
  --text-tertiary:  #7A7A90;
  --text-inverse:   #0B0A14;

  /* Status */
  --success:        #10B981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --warning:        #F59E0B;
  --warning-subtle: rgba(245, 158, 11, 0.12);
  --danger:         #EF4444;
  --danger-subtle:  rgba(239, 68, 68, 0.12);
  --info:           #3B82F6;
  --info-subtle:    rgba(59, 130, 246, 0.12);

  /* Sidebar */
  --sidebar-w:      260px;
  --sidebar-bg:     #0C0B15;

  /* Spacing & Shape */
  --radius-sm:      8px;
  --radius:         12px;
  --radius-lg:      20px;
  --radius-full:    9999px;
  --shadow-sm:      0 10px 24px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow:         0 18px 42px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-lg:      0 28px 60px rgba(0,0,0,0.34), inset 0 1px 0 rgba(255,255,255,0.05);

  /* Timing */
  --ease:           cubic-bezier(0.16, 1, 0.3, 1);
  --duration:       300ms;
}

[data-theme="light"] {
  --brand:          #7C3AED;
  --brand-dark:     #6D28D9;
  --brand-light:    #A78BFA;
  --brand-subtle:   rgba(124, 58, 237, 0.10);
  --accent:         #0891B2;
  --accent-subtle:  rgba(8, 145, 178, 0.10);
  --plan-brand:     #059669;
  --plan-brand-dark:#047857;
  --plan-accent:    #4F46E5;
  --plan-subtle:    rgba(5, 150, 105, 0.14);
  --plan-accent-subtle: rgba(79, 70, 229, 0.10);
  --plan-border:    rgba(5, 150, 105, 0.18);
  --bg-base:        #F4F2FA;
  --bg-surface:     #FFFFFF;
  --bg-elevated:    #F1EEF8;
  --bg-card:        #FFFFFF;
  --bg-overlay:     rgba(244,242,250,0.9);
  --bg-hover:       rgba(0,0,0,0.04);
  --bg-input:       #FFFFFF;
  --sidebar-bg:     #171429;
  --border:         #DAD4EC;
  --border-subtle:  #ECE7F6;
  --text-primary:   #1A202C;
  --text-secondary: #4B5563;
  --text-tertiary:  #6B7280;
  --text-inverse:   #FFFFFF;
  --shadow-sm:      0 6px 18px rgba(15, 23, 42, 0.06);
  --shadow:         0 14px 30px rgba(15, 23, 42, 0.10);
  --shadow-lg:      0 22px 48px rgba(15, 23, 42, 0.14);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background:
    radial-gradient(60rem 60rem at 100% -10%, rgba(167,139,250,.16), transparent 52%),
    radial-gradient(44rem 44rem at 42% 110%, rgba(34,211,238,.06), transparent 56%),
    var(--bg-base);
  min-height: 100vh;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--brand-light); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
p { color: var(--text-secondary); }
small { font-size: 12px; }
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; }
.text-2xl  { font-size: 22px; }
.text-muted    { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-brand    { color: var(--brand); }
.text-success  { color: var(--success); }
.text-warning  { color: var(--warning); }
.text-danger   { color: var(--danger); }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ── Layout ─────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  border-right: 1px solid rgba(255,255,255,0.06);
  transition: transform var(--duration) var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.sidebar-logo-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}
.sidebar-logo-text span {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
}
.sidebar-section {
  margin-bottom: 20px;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 0 10px;
  margin-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
  position: relative;
  white-space: nowrap;
  margin-bottom: 2px;
  opacity: 0.85;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  opacity: 1;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(167,139,250,0.14) 0%, rgba(34,211,238,0.04) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(167,139,250,.14);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 15%; bottom: 15%;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 12px var(--brand-subtle);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease); }
.nav-item.active svg { opacity: 1; color: var(--brand); }
.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  line-height: 16px;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}
.user-chip:hover { background: rgba(255,255,255,0.07); }
.user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info span {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* ── Main Content ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}
.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.topbar-btn svg { width: 18px; height: 18px; }

/* Trial banner */
.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--warning-subtle);
  border: 1px solid var(--warning);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--warning);
  white-space: nowrap;
}

.page-body {
  padding: 28px 28px;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
}
.card:hover { border-color: var(--border); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--duration) var(--ease);
}
.stat-card:hover { border-color: var(--border); transform: translateY(-1px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--stat-accent, var(--brand));
}
.stat-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--stat-bg, var(--brand-subtle));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border-color: rgba(167, 139, 250, 0.22);
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(167,139,250,0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
  border-color: rgba(167, 139, 250, 0.34);
  color: #fff;
  box-shadow: 0 0 0 3px var(--brand-subtle), 0 12px 24px rgba(167,139,250,0.26);
}
.btn-secondary {
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.btn-danger {
  background: var(--danger-subtle);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 8px; }
.btn-icon.btn-sm { padding: 5px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 5px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  transition: all var(--duration) var(--ease);
  outline: none;
  appearance: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}
.form-control::placeholder { color: var(--text-tertiary); }
.form-control:hover:not(:disabled) { border-color: var(--border); }
.form-control:focus {
  background: var(--bg-surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0,196,160,0.15), inset 0 1px 2px rgba(0,0,0,0.2);
}
.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { 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='%238B949E' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-subtle); }
.invalid-feedback { font-size: 12px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* Color picker row */
.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-swatch-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}
.color-swatch-btn input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.color-swatch-btn:hover { border-color: var(--brand); }

/* Weight progress bar */
.weight-bar-wrap {
  margin-top: 6px;
}
.weight-bar-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.weight-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-light) 100%);
  transition: width 0.5s var(--ease);
}
.weight-bar-fill.low   { background: linear-gradient(90deg, var(--warning) 0%, #FCD34D 100%); }
.weight-bar-fill.empty { background: var(--border); }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-brand   { background: var(--brand-subtle); color: var(--brand); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger  { background: var(--danger-subtle); color: var(--danger); }
.badge-info    { background: var(--info-subtle); color: var(--info); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-accent  { background: var(--accent-subtle); color: var(--accent); }

/* Material badges */
.mat-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}
.mat-PLA    { background: #134E4A; color: #5EEAD4; }
.mat-PETG   { background: #1E3A5F; color: #60A5FA; }
.mat-ABS    { background: #3B1F2B; color: #F9A8D4; }
.mat-ASA    { background: #27272A; color: #A1A1AA; }
.mat-TPU    { background: #1E1B4B; color: #A5B4FC; }
.mat-Nylon  { background: #422006; color: #FDE68A; }
.mat-PC     { background: #1C1917; color: #D6D3D1; }
.mat-default{ background: var(--bg-elevated); color: var(--text-secondary); }

/* Status badges */
.status-open     { background: var(--success-subtle); color: var(--success); }
.status-sealed   { background: var(--info-subtle);    color: var(--info); }
.status-empty    { background: var(--bg-elevated);    color: var(--text-tertiary); border: 1px solid var(--border); }
.status-discarded{ background: var(--danger-subtle);  color: var(--danger); }

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-elevated); }
th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
}
td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--duration) var(--ease); }
tbody tr:hover { background: var(--bg-hover); }

/* ── Filament Color Dot ──────────────────────────────────────── */
.color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
  display: inline-block;
}
.color-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

/* ── Filament Card (grid view) ───────────────────────────────── */
.filament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.filament-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--duration) var(--ease);
  cursor: pointer;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}
.filament-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.filament-card-accent {
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.filament-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.filament-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.filament-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.filament-card-weight {
  text-align: right;
}
.filament-card-weight strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.filament-card-weight span {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ── Pricing ───────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.pricing-grid-wide {
  grid-template-columns: minmax(0, 1fr) 390px;
}
.pricing-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
}
.pricing-tab {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.pricing-tab:hover,
.pricing-tab.active {
  background: var(--brand-subtle);
  color: var(--brand);
}
.pricing-form {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.pricing-form .card-header {
  align-items: center;
  margin-bottom: 24px;
}
.journey-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration) var(--ease);
}
.journey-block:focus-within {
  border-color: var(--brand-subtle);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow);
}
.journey-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
}
.journey-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--brand-subtle);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.journey-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.pricing-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pricing-result {
  position: sticky;
  top: 84px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
  border: 1px solid var(--border-subtle);
}
.pricing-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 2px 0 14px;
}
.pricing-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
}
.pricing-multimaterial {
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin-top: 12px;
}
.price-hero {
  padding: 24px;
  border: 1px solid rgba(0, 196, 160, 0.2);
  background: linear-gradient(135deg, rgba(0, 196, 160, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: var(--radius);
  margin-bottom: 18px;
  text-align: center;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}
.price-hero span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 8px;
}
.price-hero strong {
  font-size: 36px;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 10px rgba(0, 196, 160, 0.4);
}
.pricing-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.pricing-metrics div {
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  text-align: center;
  border: 1px solid var(--border-subtle);
}
.pricing-metrics span {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.pricing-metrics strong {
  font-size: 13px;
  color: var(--text-primary);
}
.breakdown-list {
  border-top: 1px solid var(--border-subtle);
}
.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.breakdown-row span {
  color: var(--text-secondary);
}
.breakdown-row strong {
  color: var(--text-primary);
}
.roi-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  margin-bottom: 16px;
}
.roi-panel p {
  font-size: 12px;
  margin-top: 3px;
}
.roi-ring {
  --roi-progress: 0%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand) var(--roi-progress), var(--border-subtle) 0);
  position: relative;
}
.roi-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--bg-surface);
  border-radius: 50%;
}
.roi-ring span {
  position: relative;
  z-index: 1;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
}
.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.breakdown-bar div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 5px;
}
.breakdown-bar span {
  color: var(--text-secondary);
}
.breakdown-bar strong {
  color: var(--text-primary);
}
.breakdown-bar i {
  display: block;
  height: 5px;
  background: var(--brand);
  border-radius: var(--radius-full);
}

/* --- QUICK ACTIONS HUB --- */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.quick-action-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--qa-color, var(--brand));
  opacity: 0.5;
  transition: opacity var(--duration) var(--ease);
}
.quick-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
  border-color: var(--qa-color, var(--brand));
}
.quick-action-card:hover::before {
  opacity: 1;
}
.qa-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--qa-color, var(--brand));
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  transition: transform var(--duration) var(--ease);
}
.quick-action-card:hover .qa-icon {
  transform: scale(1.1);
}
.qa-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.qa-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pricing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}
.pricing-settings-card {
  max-width: 980px;
}
.proposal-print {
  display: none;
}
.proposal-sheet {
  background: #fff;
  color: #111827;
  max-width: 760px;
  margin: 0 auto;
  padding: 42px;
  min-height: 980px;
}
.proposal-sheet p {
  color: #374151;
  margin-bottom: 8px;
}
.proposal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid #111827;
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.proposal-head strong {
  display: block;
  font-size: 18px;
  color: #111827;
}
.proposal-head span {
  color: #6b7280;
}
.proposal-sheet h1 {
  color: #111827;
  font-size: 28px;
  margin-bottom: 8px;
}
.proposal-total {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #d1d5db;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.proposal-total strong {
  color: #111827;
  font-size: 28px;
}

/* ── Customers ──────────────────────────────────────────────── */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.customer-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  text-decoration: none;
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.customer-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
  color: var(--text-primary);
}
.customer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #07110f;
  font-size: 13px;
  font-weight: 800;
}
.customer-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  font-size: 18px;
}
.customer-card-body {
  flex: 1;
  min-width: 0;
}
.customer-card-body strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
}
.customer-card-body span {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
}
.customer-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.customer-meta span {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.customer-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.customer-stats div,
.customer-summary div,
.customer-contact-grid div {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.customer-stats b,
.customer-summary strong,
.customer-contact-grid strong {
  display: block;
  color: var(--text-primary);
}
.customer-stats span,
.customer-summary span,
.customer-contact-grid span {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.customer-profile {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.customer-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.customer-summary {
  display: grid;
  gap: 10px;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-success { background: var(--success-subtle); border-color: var(--success); color: var(--success); }
.alert-warning { background: var(--warning-subtle); border-color: var(--warning); color: var(--warning); }
.alert-danger  { background: var(--danger-subtle);  border-color: var(--danger);  color: var(--danger); }
.alert-info    { background: var(--info-subtle);    border-color: var(--info);    color: var(--info); }
.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  font-size: 16px;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ── Floating AI assistant ───────────────────────────────────── */
.studio-ai-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  font-family: inherit;
}
.studio-ai-fab {
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--brand) 48%, var(--border-subtle));
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 42px rgba(34,211,238,.22), 0 10px 26px rgba(0,0,0,.25);
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.studio-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(34,211,238,.28), 0 12px 30px rgba(0,0,0,.28);
}
.studio-ai-fab svg {
  width: 25px;
  height: 25px;
}
.studio-ai-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(392px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 118px));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-surface) 94%, #000 6%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.studio-ai-panel[hidden] { display: none; }
.studio-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.studio-ai-head strong {
  display: block;
  color: var(--text-primary);
  font-size: 14px;
}
.studio-ai-head span {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 2px;
}
.studio-ai-head-actions,
.studio-ai-composer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.studio-ai-icon,
.studio-ai-send {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}
.studio-ai-icon:hover,
.studio-ai-send:hover {
  color: var(--text-primary);
  border-color: var(--border);
  background: var(--bg-hover);
}
.studio-ai-icon svg,
.studio-ai-send svg {
  width: 17px;
  height: 17px;
}
.studio-ai-send {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-color: color-mix(in srgb, var(--brand) 46%, var(--border-subtle));
}
.studio-ai-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow: auto;
  background: var(--bg-elevated);
}
.studio-ai-message {
  max-width: 92%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 11px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}
.studio-ai-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand-subtle), var(--accent-subtle));
  border-color: color-mix(in srgb, var(--brand) 32%, var(--border-subtle));
}
.studio-ai-message.bot { align-self: flex-start; }
.studio-ai-message.loading { opacity: .72; }
.studio-ai-message div {
  color: var(--text-tertiary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.studio-ai-message p {
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.48;
  margin: 0;
  white-space: pre-line;
}
.studio-ai-action {
  margin-top: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--border-subtle));
  border-radius: 8px;
  background: var(--brand-subtle);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.studio-ai-action-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.studio-ai-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 7px;
}
.studio-ai-pill.high { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border-subtle)); background: var(--danger-subtle); }
.studio-ai-pill.medium { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, var(--border-subtle)); background: var(--warning-subtle); }
.studio-ai-pill.low { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, var(--border-subtle)); background: var(--success-subtle); }
.studio-ai-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.studio-ai-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.studio-ai-suggestions button {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  padding: 7px 10px;
  white-space: nowrap;
}
.studio-ai-suggestions button:hover {
  color: var(--text-primary);
  border-color: var(--border);
}
.studio-ai-composer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.studio-ai-composer .form-control {
  min-height: 38px;
  font-size: 13px;
  padding: 9px 11px;
}
.studio-ai-mic.is-listening {
  color: #fff;
  border-color: color-mix(in srgb, var(--danger) 44%, var(--border-subtle));
  background: var(--danger);
  box-shadow: 0 0 0 5px var(--danger-subtle);
}
.studio-ai-mic:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Toast ───────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 96px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  pointer-events: all;
  animation: toast-in 0.3s var(--ease) both;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger); }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-hiding  { animation: toast-out 0.3s var(--ease) both; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(20px); } }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s var(--ease);
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scale-in 0.2s var(--ease);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--duration) var(--ease);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ── Drawer (right slide-in panel) ──────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  animation: fade-in 0.2s var(--ease);
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: slide-in-right 0.25s var(--ease);
  overflow: hidden;
}
.drawer-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@keyframes slide-in-right { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── Auth Layout ─────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.auth-shell::before {
  content: '';
  position: absolute;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 800px;
  background: radial-gradient(ellipse, rgba(0,196,160,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo-image {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0 auto 14px;
}
.auth-logo-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 20px; font-weight: 700; }
.auth-logo p  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 16px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Filters bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-bar .form-control { width: auto; min-width: 130px; }
.filter-search { flex: 1; min-width: 200px; max-width: 320px; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p  { font-size: 13.5px; color: var(--text-secondary); max-width: 320px; margin: 0 auto 20px; }

/* ── Misc ─────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-subtle); margin: 20px 0; }
.separator { display: inline-block; width: 1px; height: 14px; background: var(--border); vertical-align: middle; margin: 0 8px; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Chart container */
.chart-container { position: relative; height: 200px; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .filament-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-result { position: static; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .drawer { width: 100%; }
}

@media print {
  body { background: #fff; }
  .sidebar,
  .topbar,
  .page-body > *:not(.proposal-print),
  .studio-ai-widget,
  #toast-container,
  .drawer-backdrop {
    display: none !important;
  }
  .app-shell,
  .main-content,
  .page-body {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .proposal-print {
    display: block !important;
  }
  .proposal-sheet {
    box-shadow: none;
    max-width: none;
    min-height: auto;
  }
}

@media (max-width: 480px) {
  .page-body { padding: 16px; }
  .auth-card { padding: 24px; }
  .stat-grid { grid-template-columns: 1fr; }
  .studio-ai-widget { right: 16px; bottom: 16px; }
  .studio-ai-panel {
    right: -8px;
    bottom: 70px;
    width: calc(100vw - 32px);
    height: min(590px, calc(100vh - 100px));
  }
  #toast-container { right: 16px; bottom: 88px; }
}

/* ============================================================
   Dashboard v2 — New Layout
   ============================================================ */

/* ── Sidebar Search ─────────────────────────────────────────── */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px 4px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  cursor: text;
  transition: border-color var(--duration) var(--ease);
}
.sidebar-search:focus-within {
  border-color: var(--brand);
  background: rgba(0,196,160,0.05);
}
.sidebar-search svg { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.sidebar-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  min-width: 0;
}
.sidebar-search input::placeholder { color: var(--text-tertiary); }
.sidebar-search kbd {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.07);
  color: var(--text-tertiary);
  border: 1px solid rgba(255,255,255,0.1);
  font-family: inherit;
  white-space: nowrap;
}

/* ── Topbar Breadcrumb & CTA ────────────────────────────────── */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.topbar-breadcrumb a { color: var(--text-tertiary); font-weight: 500; }
.topbar-breadcrumb a:hover { color: var(--text-primary); }
.topbar-breadcrumb span:not(.topbar-breadcrumb a) { color: var(--text-tertiary); }
.topbar-breadcrumb > span:last-child { color: var(--text-primary); font-weight: 600; }
.topbar-cta { gap: 5px; }

/* ── Hero ───────────────────────────────────────────────────── */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding: 28px 32px;
  background: linear-gradient(135deg,
    rgba(0,196,160,0.06) 0%,
    rgba(99,102,241,0.04) 50%,
    transparent 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,196,160,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.dash-greeting {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.dash-headline {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.dash-status-text {
  background: linear-gradient(135deg, var(--brand) 0%, #22D3EE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dash-subtext {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.dash-revenue-box {
  background: linear-gradient(135deg, rgba(0,196,160,0.1) 0%, rgba(34,211,238,0.05) 100%);
  border: 1px solid rgba(0,196,160,0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 200px;
  text-align: right;
}
.dash-revenue-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dash-revenue-period {
  background: var(--brand-subtle);
  color: var(--brand);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
}
.dash-revenue-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 8px;
}
.dash-revenue-chart { height: 32px; margin-bottom: 6px; }
.dash-revenue-change {
  font-size: 11px;
  color: var(--text-tertiary);
}
.dash-revenue-change.positive { color: var(--success); }
.dash-revenue-change span { color: var(--text-tertiary); margin-left: 4px; }

/* ── Quick Actions ──────────────────────────────────────────── */
.dash-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.dash-action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}
.dash-action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--qa) 8%, transparent) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}
.dash-action-card:hover { border-color: var(--qa, var(--brand)); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.dash-action-card:hover::before { opacity: 1; }
.da-icon-wrap {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.da-icon-wrap svg { width: 22px; height: 22px; }
.da-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.da-desc  { font-size: 11.5px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px; }
.da-link  { font-size: 11.5px; color: var(--brand); font-weight: 500; }
.da-badge {
  display: inline-flex; align-items: center;
  background: rgba(0,196,160,0.12); color: var(--brand);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
}

/* ── KPI Strip ──────────────────────────────────────────────── */
.kpi-strip {
  display: flex;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.kpi-item {
  flex: 1;
  padding: 18px 20px;
}
.kpi-divider {
  width: 1px;
  background: var(--border-subtle);
  flex-shrink: 0;
  margin: 12px 0;
}
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  font-weight: 600;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}
.kpi-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
}
.kpi-alert {
  background: var(--warning-subtle);
  color: var(--warning);
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: var(--radius-full);
}
.kpi-change {
  font-size: 11px; font-weight: 600;
  padding: 1px 5px; border-radius: var(--radius-full);
}
.kpi-change.positive { background: var(--success-subtle); color: var(--success); }
.kpi-change.negative { background: var(--danger-subtle); color: var(--danger); }
.kpi-bar-wrap { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--text-tertiary); }
.kpi-bar-track { flex: 1; height: 4px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; }
.kpi-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand) 0%, var(--brand-light) 100%); border-radius: var(--radius-full); transition: width 0.6s var(--ease); }

/* ── Main Grid: Filaments + Kanban ──────────────────────────── */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  margin-bottom: 20px;
  align-items: start;
}
.dash-filaments-card { }
.dash-kanban-card { }

/* Filament Rings */
.filament-rings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.fil-ring-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}
.fil-ring-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-subtle);
}
.fil-ring-wrap {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}
.fil-ring-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}
.fil-ring-info { flex: 1; min-width: 0; }
.fil-ring-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.fil-ring-color {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.fil-ring-weight { font-size: 12px; font-weight: 700; color: var(--text-primary); }

/* Kanban List */
.kanban-list { display: flex; flex-direction: column; gap: 10px; }
.kanban-item {
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--duration) var(--ease);
}
.kanban-item:hover { border-color: var(--border); }
.kanban-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.kanban-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kanban-item-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-item-id {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.kanban-item-time {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.kanban-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.kanban-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-tertiary);
}
.kanban-progress-track {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.kanban-progress-fill { height: 100%; border-radius: var(--radius-full); transition: width 0.5s var(--ease); }
.kanban-badge-done {
  font-size: 10px; font-weight: 600;
  color: var(--success);
  background: var(--success-subtle);
  padding: 1px 7px; border-radius: var(--radius-full);
  display: inline-block; margin-top: 4px;
}
.kanban-badge-paused {
  font-size: 10px; font-weight: 600;
  color: var(--warning);
  background: var(--warning-subtle);
  padding: 1px 7px; border-radius: var(--radius-full);
  display: inline-block; margin-top: 4px;
}

/* ── Chart Card ─────────────────────────────────────────────── */
.dash-chart-card { margin-bottom: 20px; }
.chart-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.chart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.chart-footer strong { color: var(--text-primary); }
.chart-footer-line { display: flex; gap: 6px; align-items: center; }

/* ── Movements ──────────────────────────────────────────────── */
.dash-movements-card { }
.movements-list { display: flex; flex-direction: column; }
.movement-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--duration) var(--ease);
}
.movement-row:last-child { border-bottom: none; }
.movement-row:hover { background: var(--bg-hover); border-radius: var(--radius-sm); padding-left: 4px; padding-right: 4px; }
.movement-dot-wrap { flex-shrink: 0; display: flex; align-items: center; }
.movement-info { flex: 1; min-width: 0; }
.movement-name { font-size: 12.5px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movement-desc { font-size: 11px; color: var(--text-tertiary); }
.movement-delta { text-align: right; flex-shrink: 0; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .dash-actions-grid { grid-template-columns: repeat(2, 1fr); }
  .filament-rings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero-right { display: none; }
  .dash-main-grid { grid-template-columns: 1fr; }
  .kpi-strip { flex-direction: column; gap: 0; }
  .kpi-divider { width: auto; height: 1px; margin: 0 12px; }
}
@media (max-width: 600px) {
  .dash-actions-grid { grid-template-columns: 1fr; }
  .filament-rings-grid { grid-template-columns: 1fr; }
  .dash-headline { font-size: 20px; }
}

/* ── Dashboard v2 Visual Polish ──────────────────────────────── */

/* Hero gradient more intense */
.dash-hero {
  background: linear-gradient(135deg,
    rgba(0,196,160,0.08) 0%,
    rgba(99,102,241,0.06) 40%,
    rgba(34,211,238,0.03) 100%);
  border-color: rgba(0,196,160,0.15);
}
.dash-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(99,102,241,0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* Revenue sparkline canvas */
#miniSparkline { width: 100%; height: 36px; display: block; }

/* Filament ring glow */
.fil-ring-wrap svg circle:last-child {
  filter: drop-shadow(0 0 6px currentColor);
}
.fil-ring-item:hover .fil-ring-wrap svg { transform: scale(1.05); transition: transform 0.3s ease; }

/* KPI strip hover */
.kpi-item {
  transition: background var(--duration) var(--ease);
  cursor: default;
}
.kpi-item:hover { background: var(--bg-hover); }

/* Kanban item glow on hover */
.kanban-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Chart bars gradient */
.chart-bar-gradient-teal  { background: linear-gradient(180deg, #00C4A0 0%, #00A688 100%); }
.chart-bar-gradient-blue  { background: linear-gradient(180deg, #3B82F6 0%, #2563EB 100%); }
.chart-bar-gradient-violet{ background: linear-gradient(180deg, #8B5CF6 0%, #7C3AED 100%); }

/* Sidebar plan badge */
.sidebar-plan-badge {
  margin: 4px 10px 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--plan-subtle), var(--plan-accent-subtle));
  border: 1px solid var(--plan-border);
  border-radius: var(--radius-sm);
}
.sidebar-plan-badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sidebar-plan-name {
  font-size: 11px; font-weight: 700;
  color: var(--plan-brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-plan-days {
  font-size: 11px; font-weight: 700;
  color: var(--text-primary);
}
.sidebar-plan-bar {
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.sidebar-plan-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--plan-brand), var(--plan-accent));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

/* Quick action card bottom CTA row */
.da-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.da-count {
  font-size: 11px; font-weight: 700;
  color: var(--brand);
  background: var(--brand-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Movement row type dot */
.mov-type-entrada { background: var(--success); }
.mov-type-saida   { background: var(--danger); }
.mov-type-ajuste  { background: var(--info); }

/* Kanban progress glow */
.kanban-progress-fill[style*="background:#00C4A0"] {
  box-shadow: 0 0 6px rgba(0,196,160,0.5);
}

/* Revenue change arrow */
.dash-revenue-arrow {
  display: inline-block;
  margin-right: 3px;
  font-size: 12px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.16); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.24); }

/* ============================================================
   Studio Refresh — Base Layout Alignment
   ============================================================ */

:root {
  --studio-bg-0: #0b0a14;
  --studio-bg-1: #100e1c;
  --studio-bg-2: #17142a;
  --studio-surface: rgba(255,255,255,.03);
  --studio-surface-2: rgba(255,255,255,.05);
  --studio-surface-3: rgba(255,255,255,.08);
  --studio-line: rgba(255,255,255,.08);
  --studio-line-2: rgba(255,255,255,.14);
  --studio-text: #f5f5fa;
  --studio-text-2: #c6c4d8;
  --studio-text-3: #7b7991;
  --studio-violet: #A78BFA;
  --studio-violet-2: #8B5CF6;
  --studio-cyan: #22D3EE;
  --studio-emerald: #34D399;
  --studio-amber: #FBBF24;
  --studio-rose: #FB7185;
}

[x-cloak] { display: none !important; }

[data-theme="light"] {
  --studio-bg-0: #f6f7fb;
  --studio-bg-1: #ffffff;
  --studio-bg-2: #eef2f7;
  --studio-surface: rgba(15,23,42,.035);
  --studio-surface-2: rgba(15,23,42,.055);
  --studio-surface-3: rgba(15,23,42,.08);
  --studio-line: rgba(15,23,42,.10);
  --studio-line-2: rgba(15,23,42,.16);
  --studio-text: #111827;
  --studio-text-2: #4b5563;
  --studio-text-3: #7c8493;
  --studio-violet: #7C3AED;
  --studio-violet-2: #6D28D9;
  --studio-cyan: #0891B2;
  --studio-emerald: #059669;
  --studio-amber: #D97706;
  --studio-rose: #E11D48;
}

.studio-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(70rem 70rem at 92% -8%, rgba(167,139,250,.20), transparent 55%),
    radial-gradient(54rem 54rem at 42% 110%, rgba(34,211,238,.08), transparent 60%),
    radial-gradient(40rem 40rem at 74% 60%, rgba(236,72,153,.08), transparent 60%),
    var(--studio-bg-0);
}

.studio-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 11, .72);
  backdrop-filter: blur(4px);
  z-index: 48;
}

.studio-sidebar {
  width: 256px;
  padding: 16px 12px;
  background: rgba(11,10,20,.78);
  border-right: 1px solid var(--studio-line);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: width .22s ease, padding .22s ease, transform .22s ease;
}

[data-theme="light"] .studio-sidebar {
  background: rgba(255,255,255,.90);
  box-shadow: 12px 0 36px rgba(15,23,42,.05);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--studio-line);
}

.studio-brand-link {
  min-width: 0;
  display: flex;
  align-items: center;
  flex: 1;
  color: inherit;
}

.studio-brand-logo {
  display: block;
  width: 100%;
  max-width: 198px;
  height: auto;
  object-fit: contain;
}

.studio-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(167,139,250,.16), rgba(34,211,238,.10));
  border: 1px solid rgba(167,139,250,.16);
  color: var(--studio-cyan);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.studio-brand-mark svg {
  width: 20px;
  height: 20px;
}

.studio-brand-copy {
  min-width: 0;
}

.studio-brand-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--studio-text);
  letter-spacing: -.02em;
}

.studio-brand-copy span {
  display: block;
  font-size: 11px;
  color: var(--studio-text-3);
}

.studio-brand-toggle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--studio-line);
  background: transparent;
  color: var(--studio-text-3);
  border-radius: 8px;
}

.studio-brand-toggle svg {
  width: 14px;
  height: 14px;
}

.studio-search {
  margin: 0 2px 18px;
  padding: 10px 12px;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--studio-line);
  border-radius: 10px;
}

[data-theme="light"] .studio-search {
  background: rgba(15,23,42,.035);
}

.studio-search:focus-within {
  border-color: rgba(167,139,250,.30);
  background: rgba(255,255,255,.05);
}

[data-theme="light"] .studio-search:focus-within {
  background: rgba(255,255,255,.86);
}

.studio-search svg {
  color: var(--studio-text-3);
}

.studio-search input {
  color: var(--studio-text);
  font-size: 13px;
}

.studio-search input::placeholder {
  color: var(--studio-text-3);
}

.studio-search kbd {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--studio-text-2);
  background: rgba(255,255,255,.06);
  border-color: var(--studio-line);
}

[data-theme="light"] .studio-search kbd,
[data-theme="light"] .studio-nav-badge,
[data-theme="light"] .studio-plan-head span {
  background: rgba(15,23,42,.06);
}

.studio-nav {
  padding: 0 2px;
}

.studio-navgroup {
  margin-bottom: 16px;
}

.studio-navgroup-title {
  padding: 0 10px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--studio-text-3);
}

.studio-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--studio-text-2);
  font-size: 13px;
  font-weight: 600;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.studio-nav-item:hover {
  color: var(--studio-text);
  background: rgba(255,255,255,.04);
}

[data-theme="light"] .studio-nav-item:hover {
  background: rgba(124,58,237,.07);
}

.studio-nav-item.is-active {
  color: var(--studio-text);
  background: linear-gradient(90deg, rgba(167,139,250,.15), rgba(34,211,238,.06));
  box-shadow: inset 0 0 0 1px rgba(167,139,250,.18);
}

[data-theme="light"] .studio-nav-item.is-active {
  background: linear-gradient(90deg, rgba(124,58,237,.10), rgba(8,145,178,.06));
  box-shadow: inset 0 0 0 1px rgba(124,58,237,.14);
}

.studio-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--studio-violet), var(--studio-cyan));
}

.studio-nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: inherit;
  opacity: .92;
}

.studio-nav-item span:first-of-type {
  flex: 1;
}

.studio-nav-badge {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--studio-text-2);
  background: rgba(255,255,255,.05);
}

.studio-nav-item.is-active .studio-nav-badge {
  background: rgba(167,139,250,.18);
  color: var(--studio-violet);
}

.studio-side-foot {
  margin-top: 18px;
  padding: 0 2px 2px;
}

.studio-plan-card {
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--plan-subtle), rgba(99,102,241,.08));
  border: 1px solid var(--plan-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

[data-theme="light"] .studio-plan-card {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

.studio-plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.studio-plan-head strong {
  font-size: 12px;
  color: var(--studio-text);
}

.studio-plan-head span {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--studio-text);
  background: rgba(255,255,255,.08);
}

.studio-plan-bar {
  height: 4px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}

[data-theme="light"] .studio-plan-bar {
  background: rgba(15,23,42,.08);
}

.studio-plan-bar > div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--plan-brand), var(--plan-accent));
}

.studio-plan-card p {
  font-size: 11px;
  color: var(--studio-text-3);
}

.studio-plan-card a {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--plan-brand);
}

.studio-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--studio-line);
  background: rgba(255,255,255,.03);
  color: inherit;
}

[data-theme="light"] .studio-user-card {
  background: rgba(255,255,255,.72);
}

.studio-user-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--studio-violet), var(--studio-cyan));
  color: #0b0a14;
  font-size: 12px;
  font-weight: 700;
}

.studio-user-copy {
  flex: 1;
  min-width: 0;
}

.studio-user-copy strong {
  display: block;
  color: var(--studio-text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-user-copy span {
  display: block;
  color: var(--studio-text-3);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-user-more {
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--studio-text-3);
}

.studio-side-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 2px;
}

.studio-side-links a,
.studio-side-links .logout-btn {
  font-size: 11px;
  color: var(--studio-text-3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.studio-main {
  margin-left: 256px;
  min-height: 100vh;
  background: transparent;
  transition: margin-left .22s ease;
}

.studio-shell.sidebar-collapsed .studio-sidebar {
  width: 76px;
  padding: 16px 10px;
}

.studio-shell.sidebar-collapsed .studio-main {
  margin-left: 76px;
}

.studio-shell.sidebar-collapsed .studio-brand {
  justify-content: center;
  gap: 0;
  padding: 8px 0 14px;
}

.studio-shell.sidebar-collapsed .studio-brand-link {
  display: none;
}

.studio-shell.sidebar-collapsed .studio-brand-toggle svg {
  transform: rotate(180deg);
}

.studio-shell.sidebar-collapsed .studio-search {
  justify-content: center;
  padding: 10px;
  margin: 0 0 18px;
}

.studio-shell.sidebar-collapsed .studio-search input,
.studio-shell.sidebar-collapsed .studio-search kbd,
.studio-shell.sidebar-collapsed .studio-navgroup-title,
.studio-shell.sidebar-collapsed .studio-nav-item span:first-of-type,
.studio-shell.sidebar-collapsed .studio-plan-card,
.studio-shell.sidebar-collapsed .studio-user-copy,
.studio-shell.sidebar-collapsed .studio-user-more,
.studio-shell.sidebar-collapsed .studio-side-links {
  display: none;
}

.studio-shell.sidebar-collapsed .studio-nav {
  padding: 0;
}

.studio-shell.sidebar-collapsed .studio-navgroup {
  margin-bottom: 10px;
}

.studio-shell.sidebar-collapsed .studio-nav-item {
  width: 44px;
  height: 44px;
  justify-content: center;
  padding: 0;
  margin: 0 auto 6px;
  border-radius: 12px;
}

.studio-shell.sidebar-collapsed .studio-nav-item svg {
  width: 19px;
  height: 19px;
}

.studio-shell.sidebar-collapsed .studio-nav-item.is-active::before {
  top: 10px;
  bottom: 10px;
}

.studio-shell.sidebar-collapsed .studio-nav-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  padding: 1px 5px;
}

.studio-shell.sidebar-collapsed .studio-side-foot {
  margin-top: 14px;
  padding: 0;
}

.studio-shell.sidebar-collapsed .studio-user-card {
  width: 44px;
  height: 44px;
  justify-content: center;
  padding: 0;
  margin: 10px auto 0;
}

[data-theme="light"] .studio-shell {
  background:
    radial-gradient(70rem 70rem at 92% -8%, rgba(124,58,237,.11), transparent 55%),
    radial-gradient(54rem 54rem at 42% 110%, rgba(8,145,178,.08), transparent 60%),
    radial-gradient(40rem 40rem at 74% 60%, rgba(5,150,105,.07), transparent 60%),
    var(--studio-bg-0);
}

.studio-topbar {
  height: auto;
  padding: 14px 28px;
  border-bottom: 1px solid var(--studio-line);
  background: rgba(11,10,20,.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-theme="light"] .studio-topbar {
  background: rgba(255,255,255,.74);
  box-shadow: 0 1px 0 rgba(15,23,42,.02), 0 14px 32px rgba(15,23,42,.04);
}

.studio-topbar-left,
.studio-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-mobile-toggle {
  display: none;
}

.studio-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.studio-breadcrumbs a,
.studio-breadcrumbs span:first-of-type {
  color: var(--studio-text-3);
}

.studio-breadcrumbs span:last-of-type {
  color: var(--studio-text);
  font-weight: 600;
}

.studio-icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--studio-line);
  background: rgba(255,255,255,.02);
  color: var(--studio-text-2);
}

.studio-icon-btn svg {
  width: 18px;
  height: 18px;
}

.studio-icon-btn:hover,
.studio-ghost-btn:hover {
  color: var(--studio-text);
  border-color: var(--studio-line-2);
  background: rgba(255,255,255,.04);
}

[data-theme="light"] .studio-icon-btn,
[data-theme="light"] .studio-ghost-btn {
  background: rgba(255,255,255,.66);
}

[data-theme="light"] .studio-icon-btn:hover,
[data-theme="light"] .studio-ghost-btn:hover {
  background: rgba(15,23,42,.05);
}

.studio-theme-btn {
  position: relative;
}

.studio-theme-btn svg {
  transition: transform .16s ease;
}

.studio-theme-btn:hover svg {
  transform: rotate(-8deg) scale(1.04);
}

.studio-notify-btn {
  position: relative;
}

.studio-notify-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--studio-rose);
  box-shadow: 0 0 0 2px var(--studio-bg-1);
}

.studio-ghost-btn,
.studio-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.studio-ghost-btn {
  border: 1px solid var(--studio-line);
  color: var(--studio-text-2);
  background: rgba(255,255,255,.02);
}

.studio-primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--studio-violet), var(--studio-violet-2));
  box-shadow: 0 8px 24px rgba(167,139,250,.32), inset 0 1px 0 rgba(255,255,255,.15);
}

.studio-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(167,139,250,.38), inset 0 1px 0 rgba(255,255,255,.18);
  color: #fff;
}

.studio-primary-btn svg {
  width: 16px;
  height: 16px;
}

.studio-topbar-sep {
  width: 1px;
  height: 22px;
  background: var(--studio-line);
}

.studio-page-body {
  padding: 28px;
}

.studio-dashboard {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.studio-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: center;
}

.studio-hero-kicker {
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--studio-text-3);
}

.studio-hero-title {
  max-width: 840px;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.05em;
  color: var(--studio-text);
}

.studio-hero-title span {
  background: linear-gradient(135deg, var(--studio-violet), var(--studio-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.studio-hero-subtitle {
  margin-top: 10px;
  font-size: 16px;
  color: var(--studio-text-2);
}

.studio-revenue-card,
.studio-card,
.studio-action-card,
.studio-stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--studio-line);
  background: rgba(255,255,255,.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.studio-revenue-card {
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(167,139,250,.14), rgba(34,211,238,.06));
  border-color: rgba(167,139,250,.20);
}

.studio-revenue-card::before,
.studio-card::before,
.studio-action-card::before,
.studio-stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(24rem 12rem at 100% 0%, rgba(167,139,250,.16), transparent 70%);
}

.studio-revenue-eye {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--studio-text-3);
}

.studio-revenue-value {
  margin: 10px 0 6px;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.05em;
  color: var(--studio-text);
}

.studio-revenue-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--studio-text-3);
}

.studio-revenue-up {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--studio-emerald);
  background: rgba(52,211,153,.10);
}

.studio-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.studio-action-card {
  padding: 18px;
  border-radius: 16px;
  color: inherit;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.studio-action-card:hover,
.studio-stat-card:hover,
.studio-card:hover {
  transform: translateY(-2px);
  border-color: var(--studio-line-2);
  background: rgba(255,255,255,.04);
  box-shadow: 0 14px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
}

[data-theme="light"] .studio-revenue-card,
[data-theme="light"] .studio-card,
[data-theme="light"] .studio-action-card,
[data-theme="light"] .studio-stat-card {
  background: rgba(255,255,255,.78);
  box-shadow: 0 14px 34px rgba(15,23,42,.06), inset 0 1px 0 rgba(255,255,255,.85);
}

[data-theme="light"] .studio-revenue-card {
  background: linear-gradient(135deg, rgba(124,58,237,.10), rgba(8,145,178,.06)), rgba(255,255,255,.82);
}

[data-theme="light"] .studio-action-card:hover,
[data-theme="light"] .studio-stat-card:hover,
[data-theme="light"] .studio-card:hover {
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 38px rgba(15,23,42,.09), inset 0 1px 0 rgba(255,255,255,.92);
}

.studio-action-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.studio-action-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
}

[data-theme="light"] .studio-action-icon {
  border-color: rgba(15,23,42,.08);
}

.studio-action-icon svg {
  width: 20px;
  height: 20px;
}

.studio-action-violet .studio-action-icon {
  color: var(--studio-violet);
  background: rgba(167,139,250,.12);
  border-color: rgba(167,139,250,.24);
}

.studio-action-cyan .studio-action-icon {
  color: var(--studio-cyan);
  background: rgba(34,211,238,.12);
  border-color: rgba(34,211,238,.24);
}

.studio-action-emerald .studio-action-icon {
  color: var(--studio-emerald);
  background: rgba(52,211,153,.12);
  border-color: rgba(52,211,153,.24);
}

.studio-action-amber .studio-action-icon {
  color: var(--studio-amber);
  background: rgba(251,191,36,.12);
  border-color: rgba(251,191,36,.24);
}

.studio-action-badge,
.studio-stat-pill,
.studio-chip-btn {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  line-height: 1.2;
}

.studio-action-badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(34,211,238,.14);
  color: var(--studio-cyan);
  font-weight: 700;
}

.studio-action-title,
.studio-card-head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--studio-text);
}

.studio-action-desc,
.studio-card-head p {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--studio-text-3);
}

.studio-action-cta {
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--studio-text-2);
}

.studio-action-violet:hover .studio-action-cta {
  color: var(--studio-violet);
}

.studio-action-cyan:hover .studio-action-cta {
  color: var(--studio-cyan);
}

.studio-action-emerald:hover .studio-action-cta {
  color: var(--studio-emerald);
}

.studio-action-amber:hover .studio-action-cta {
  color: var(--studio-amber);
}

.studio-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.studio-stat-card {
  padding: 16px 18px;
  border-radius: 14px;
}

.studio-stat-label {
  font-size: 12px;
  color: var(--studio-text-3);
}

.studio-stat-value {
  margin: 6px 0 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--studio-text);
}

.studio-stat-value.is-healthy {
  color: var(--studio-amber);
}

.studio-stat-value.is-warning {
  color: var(--studio-rose);
}

.studio-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--studio-text-3);
}

.studio-stat-pill {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--studio-text-2);
  background: rgba(255,255,255,.05);
}

[data-theme="light"] .studio-stat-pill,
[data-theme="light"] .studio-chip-btn {
  background: rgba(15,23,42,.05);
}

.studio-stat-pill.studio-up {
  color: var(--studio-emerald);
  background: rgba(52,211,153,.10);
}

.studio-stat-pill.studio-warn {
  color: var(--studio-amber);
  background: rgba(251,191,36,.10);
}

.studio-stat-pill.studio-down {
  color: var(--studio-rose);
  background: rgba(251,113,133,.10);
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr);
  gap: 14px;
}

.studio-card {
  border-radius: 18px;
}

.studio-card-wide {
  width: 100%;
}

.studio-card-half {
  max-width: 580px;
}

.studio-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--studio-line);
}

.studio-chip-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--studio-line);
  color: var(--studio-text-2);
  background: rgba(255,255,255,.04);
}

[data-theme="light"] .studio-chip-btn {
  background: rgba(255,255,255,.68);
}

.studio-spools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 14px 14px 16px;
}

.studio-spool-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  color: inherit;
  transition: background .16s ease;
}

.studio-spool-item:hover {
  background: rgba(255,255,255,.03);
}

[data-theme="light"] .studio-spool-item:hover {
  background: rgba(15,23,42,.04);
}

.studio-spool-ring svg {
  width: 64px;
  height: 64px;
}

.studio-spool-track,
.studio-spool-fill {
  fill: none;
  stroke-width: 5;
  transform: rotate(-90deg);
  transform-origin: 32px 32px;
}

.studio-spool-track {
  stroke: rgba(255,255,255,.08);
}

[data-theme="light"] .studio-spool-track {
  stroke: rgba(15,23,42,.10);
}

.studio-spool-fill {
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.08));
}

.studio-spool-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--studio-text);
}

.studio-spool-copy span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--studio-text-3);
}

.studio-spool-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
}

.studio-spool-meta b {
  color: var(--studio-text);
}

.studio-spool-meta span {
  margin-top: 0;
  color: var(--studio-text-3);
}

.studio-production-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.studio-production-item {
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--studio-line);
  background: rgba(255,255,255,.03);
}

[data-theme="light"] .studio-production-item {
  background: rgba(255,255,255,.72);
}

.studio-production-item.is-paused {
  border-color: rgba(251,191,36,.18);
  background: rgba(251,191,36,.04);
}

.studio-production-item.is-idle {
  opacity: .65;
}

.studio-production-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.studio-production-head strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--studio-text);
}

.studio-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 10px currentColor;
}

.studio-production-eta {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--studio-emerald);
}

.studio-production-eta.is-warning {
  color: var(--studio-amber);
}

.studio-production-eta.is-idle {
  color: var(--studio-text-3);
}

.studio-production-item p {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--studio-text-2);
}

.studio-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}

[data-theme="light"] .studio-progress-track {
  background: rgba(15,23,42,.08);
}

.studio-progress-fill {
  height: 100%;
  border-radius: inherit;
  box-shadow: 0 0 10px rgba(255,255,255,.18);
}

.studio-production-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--studio-text-3);
}

.studio-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 16px 20px 0;
  font-size: 12px;
  color: var(--studio-text-2);
}

.studio-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.studio-chart-legend b {
  font-size: 12px;
  color: var(--studio-text);
}

.studio-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: currentColor;
}

.studio-chart-legend i.is-pla {
  color: var(--studio-violet);
}

.studio-chart-legend i.is-petg {
  color: var(--studio-cyan);
}

.studio-chart-legend i.is-abs {
  color: var(--studio-amber);
}

.studio-chart-line {
  margin-left: auto;
  color: var(--studio-text-3);
}

.studio-chart-legend i.is-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.92), rgba(255,255,255,0));
}

[data-theme="light"] .studio-chart-legend i.is-line {
  background: linear-gradient(90deg, rgba(15,23,42,0), rgba(15,23,42,.45), rgba(15,23,42,0));
}

.studio-chart-wrap {
  height: 360px;
  padding: 18px 20px 12px;
}

.studio-chart-foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--studio-line);
}

.studio-chart-foot span {
  display: block;
  font-size: 11px;
  color: var(--studio-text-3);
}

.studio-chart-foot b {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.15;
  color: var(--studio-text);
}

.studio-movement-list {
  padding: 6px 20px 12px;
}

.studio-movement-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--studio-line);
}

.studio-movement-item:last-child {
  border-bottom: 0;
}

.studio-movement-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.studio-movement-icon.is-in,
.studio-movement-meta .is-in {
  color: var(--studio-emerald);
}

.studio-movement-icon.is-in {
  background: rgba(52,211,153,.12);
}

.studio-movement-icon.is-out,
.studio-movement-meta .is-out {
  color: var(--studio-rose);
}

.studio-movement-icon.is-out {
  background: rgba(251,113,133,.12);
}

.studio-movement-icon.is-neutral,
.studio-movement-meta .is-neutral {
  color: var(--studio-cyan);
}

.studio-movement-icon.is-neutral {
  background: rgba(34,211,238,.12);
}

.studio-movement-copy strong {
  display: block;
  font-size: 13px;
  color: var(--studio-text);
}

.studio-movement-copy span,
.studio-movement-meta span {
  display: block;
  font-size: 11px;
  color: var(--studio-text-3);
}

.studio-movement-meta {
  text-align: right;
}

.studio-movement-meta b {
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
}

.studio-empty {
  padding: 28px 20px 22px;
  font-size: 13px;
  color: var(--studio-text-3);
}

#miniSparkline {
  width: 100%;
  height: 36px;
  display: block;
}

@media (max-width: 1280px) {
  .studio-actions,
  .studio-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1080px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }

  .studio-card-half {
    max-width: none;
  }
}

@media (max-width: 960px) {
  .studio-sidebar {
    width: 256px;
    padding: 16px 12px;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }

  .studio-shell.sidebar-collapsed .studio-sidebar {
    width: 256px;
    padding: 16px 12px;
  }

  .studio-sidebar.open {
    transform: translateX(0);
  }

  .studio-main,
  .studio-shell.sidebar-collapsed .studio-main {
    margin-left: 0;
  }

  .studio-shell.sidebar-collapsed .studio-brand {
    justify-content: flex-start;
    gap: 12px;
    padding: 8px 8px 14px;
  }

  .studio-shell.sidebar-collapsed .studio-brand-link,
  .studio-shell.sidebar-collapsed .studio-nav-item span:first-of-type {
    display: flex;
  }

  .studio-shell.sidebar-collapsed .studio-search input,
  .studio-shell.sidebar-collapsed .studio-search kbd,
  .studio-shell.sidebar-collapsed .studio-navgroup-title,
  .studio-shell.sidebar-collapsed .studio-plan-card,
  .studio-shell.sidebar-collapsed .studio-user-copy,
  .studio-shell.sidebar-collapsed .studio-user-more {
    display: block;
  }

  .studio-shell.sidebar-collapsed .studio-side-links {
    display: flex;
  }

  .studio-shell.sidebar-collapsed .studio-nav-item {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 8px 10px;
    margin: 0;
    border-radius: 9px;
  }

  .studio-shell.sidebar-collapsed .studio-user-card {
    width: auto;
    height: auto;
    justify-content: flex-start;
    padding: 8px;
    margin: 12px 0 0;
  }

  .studio-mobile-toggle {
    display: grid;
  }
}

@media (max-width: 720px) {
  .studio-page-body,
  .studio-topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .studio-actions,
  .studio-stats,
  .studio-chart-foot,
  .studio-spools {
    grid-template-columns: 1fr;
  }

  .studio-topbar-actions .studio-ghost-btn {
    display: none;
  }

  .studio-topbar-sep {
    display: none;
  }

  .studio-hero-title {
    font-size: 30px;
  }

  .studio-chart-line {
    margin-left: 0;
  }
}

/* ============================================================
   Shared Module System
   ============================================================ */

.content-limit-md {
  max-width: 820px;
}

.content-limit-lg {
  max-width: 1120px;
}

.page-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--studio-text-3);
}

.page-breadcrumbs a {
  color: var(--studio-text-3);
}

.page-breadcrumbs a:hover {
  color: var(--studio-text);
}

.page-breadcrumbs strong,
.page-breadcrumbs span:last-child {
  color: var(--studio-text);
  font-weight: 600;
}

.page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-intro-copy {
  min-width: 0;
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--studio-text-3);
}

.page-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--studio-violet), var(--studio-cyan));
  box-shadow: 0 0 0 5px rgba(167,139,250,.10);
}

.page-title {
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: -.04em;
  color: var(--studio-text);
}

.page-subtitle {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--studio-text-2);
  max-width: 760px;
}

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

.legal-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.legal-section h2 {
  margin-bottom: 8px;
  font-size: 16px;
  color: var(--studio-text);
}

.legal-section p {
  color: var(--studio-text-2);
  line-height: 1.75;
}

.admin-users-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.content-limit-md,
.content-limit-lg {
  width: 100%;
  margin: 0 auto;
}

.surface-panel,
.service-table,
.add-form,
.price-matrix,
.section-block,
.kanban-col,
.order-card,
.product-card,
.sup-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)),
    var(--studio-surface);
  border: 1px solid var(--studio-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.surface-panel {
  border-radius: 18px;
  overflow: hidden;
}

.surface-panel-body {
  padding: 20px;
}

.surface-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--studio-line);
}

.surface-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--studio-text);
  letter-spacing: -.02em;
}

.surface-panel-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--studio-text-3);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.stack-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sticky-side {
  position: sticky;
  top: 84px;
}

.studio-form-shell .form-control,
.service-table .form-control,
.add-form .form-control,
.price-matrix .form-control {
  background: rgba(255,255,255,.03);
  border-color: var(--studio-line);
}

.studio-form-shell .form-control:focus,
.service-table .form-control:focus,
.add-form .form-control:focus,
.price-matrix .form-control:focus {
  background: rgba(255,255,255,.05);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--studio-text-3);
}

.section-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--studio-line);
}

.table-wrap {
  border-radius: 16px;
  border-color: var(--studio-line);
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

thead {
  background: rgba(255,255,255,.03);
}

th {
  color: var(--studio-text-3);
  border-bottom-color: var(--studio-line);
}

td {
  border-bottom-color: var(--studio-line);
}

.card,
.stat-card,
.filament-card,
.customer-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)),
    var(--studio-surface);
  border-color: var(--studio-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.card:hover,
.stat-card:hover,
.filament-card:hover,
.customer-card:hover {
  border-color: var(--studio-line-2);
}

.filter-bar {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--studio-line);
  background: rgba(255,255,255,.025);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.filter-bar .btn-secondary {
  background: rgba(255,255,255,.05);
}

.empty-state {
  padding: 52px 24px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.02);
}

.empty-state h3 {
  color: var(--studio-text);
}

.empty-state p {
  color: var(--studio-text-2);
}

.customer-card,
.product-card,
.sup-card,
.section-block,
.add-form,
.service-table,
.price-matrix,
.kanban-col {
  border-radius: 16px;
}

.kanban-col-header,
.pm-header,
.service-head {
  border-bottom-color: var(--studio-line);
  background: rgba(255,255,255,.02);
}

.order-card {
  background: rgba(255,255,255,.03);
  border-radius: 12px;
  border-color: var(--studio-line);
}

.order-card:hover {
  border-color: var(--studio-line-2);
  box-shadow: 0 10px 24px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.03);
}

.section-block,
.sup-card,
.product-card,
.service-table,
.add-form,
.price-matrix {
  box-shadow: 0 12px 28px rgba(0,0,0,.14), inset 0 1px 0 rgba(255,255,255,.03);
}

@media (max-width: 960px) {
  .split-layout {
    grid-template-columns: 1fr;
  }

  .sticky-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .page-title {
    font-size: 21px;
  }
}
