/* ==========================================================================
   DBOS (Distrito Barber Operating System) - Master Design System
   Theme: Dark Obsidian & Antique Gold Luxury
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Color Tokens */
  --bg-dark-obsidian: #0D0F12;
  --bg-panel-charcoal: #14171D;
  --bg-card-surface: #1A1D24;
  --bg-card-hover: #222630;
  --bg-glass-overlay: rgba(26, 29, 36, 0.75);
  
  /* Accent Tokens */
  --accent-gold-primary: #D4AF37;
  --accent-gold-light: #F3E5AB;
  --accent-gold-dark: #AA820A;
  --accent-bronze: #C5A059;
  --accent-gold-glow: rgba(212, 175, 55, 0.25);
  
  /* Status Colors */
  --status-emerald: #10B981;
  --status-emerald-bg: rgba(16, 185, 129, 0.15);
  --status-amber: #F59E0B;
  --status-amber-bg: rgba(245, 158, 11, 0.15);
  --status-crimson: #EF4444;
  --status-crimson-bg: rgba(239, 68, 68, 0.15);
  --status-cyan: #06B6D4;
  --status-cyan-bg: rgba(6, 182, 212, 0.15);
  --status-purple: #8B5CF6;
  --status-purple-bg: rgba(139, 92, 246, 0.15);

  /* Neutral Text & Borders */
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  --border-gold-subtle: rgba(212, 175, 55, 0.18);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --tab-active-text: #0D0F12;

  /* Shadows & Depth */
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-gold-soft: 0 8px 25px -5px rgba(212, 175, 55, 0.2);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.15);

  /* Layout Standards */
  --sidebar-width: 280px;
  --header-height: 75px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Font Families */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

:root[data-theme="light"] {
  --bg-dark-obsidian: #F5F2EA;
  --bg-panel-charcoal: #FFFFFF;
  --bg-card-surface: #FCFAF5;
  --bg-card-hover: #F0EADB;
  --bg-glass-overlay: rgba(255, 255, 255, 0.88);
  --accent-gold-primary: #9A7410;
  --accent-gold-light: #B88A16;
  --accent-gold-dark: #725508;
  --accent-bronze: #8B672B;
  --accent-gold-glow: rgba(154, 116, 16, 0.16);
  --text-main: #201D18;
  --text-muted: #625C52;
  --text-dim: #81796C;
  --border-gold-subtle: rgba(154, 116, 16, 0.28);
  --border-subtle: rgba(41, 35, 26, 0.12);
  --tab-active-text: #FFFFFF;
  --shadow-card: 0 10px 30px -12px rgba(61, 48, 25, 0.22);
  --shadow-gold-soft: 0 8px 25px -8px rgba(154, 116, 16, 0.22);
  --shadow-glow: 0 0 20px rgba(154, 116, 16, 0.10);
}

/* Paletas de marca: los fondos y textos siguen gobernados por el tema para proteger el contraste. */
:root { --custom-primary:#D4AF37; --custom-secondary:#C5A059; --custom-selected:#AA820A; }
:root[data-palette="classic"] { --accent-gold-primary:#4F83C2; --accent-gold-light:#F3E8D0; --accent-gold-dark:#B52C37; --accent-bronze:#B52C37; --accent-gold-glow:rgba(79,131,194,.24); --border-gold-subtle:rgba(79,131,194,.28); --tab-active-text:#FFFFFF; }
:root[data-theme="light"][data-palette="classic"] { --accent-gold-primary:#173B67; --accent-gold-light:#315F91; --accent-gold-dark:#9E2632; --accent-bronze:#B52C37; --accent-gold-glow:rgba(23,59,103,.16); --border-gold-subtle:rgba(23,59,103,.24); }
:root[data-palette="silver"] { --accent-gold-primary:#C4CAD3; --accent-gold-light:#F2F4F7; --accent-gold-dark:#7D8795; --accent-bronze:#AEB6C2; --accent-gold-glow:rgba(174,182,194,.22); --border-gold-subtle:rgba(174,182,194,.25); --tab-active-text:#171A20; }
:root[data-theme="light"][data-palette="silver"] { --accent-gold-primary:#525866; --accent-gold-light:#707887; --accent-gold-dark:#343942; --accent-bronze:#667085; --accent-gold-glow:rgba(82,88,102,.14); --border-gold-subtle:rgba(82,88,102,.24); --tab-active-text:#FFFFFF; }
:root[data-palette="custom"] { --accent-gold-primary:var(--custom-primary); --accent-gold-light:var(--custom-secondary); --accent-gold-dark:var(--custom-selected); --accent-bronze:var(--custom-secondary); --accent-gold-glow:color-mix(in srgb, var(--custom-primary) 24%, transparent); --border-gold-subtle:color-mix(in srgb, var(--custom-primary) 28%, transparent); }

/* Base resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark-obsidian);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

body, .app-sidebar, .app-header, .content-panel, .form-input, .form-select, button {
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

:root[data-theme="light"] .auth-container {
  background: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.13) 0%, #F5F2EA 72%);
}

:root[data-theme="light"] .role-switcher-pill option {
  background: #FFFFFF !important;
  color: #201D18 !important;
}

:root[data-theme="light"] .unified-module-header {
  background: linear-gradient(135deg, #FFFFFF, #F6EFD9) !important;
  border-color: rgba(154, 116, 16, .48) !important;
}

:root[data-theme="light"] .command-center-ceo-banner {
  background: linear-gradient(100deg, #FFFFFF, #F8F3E6) !important;
  box-shadow: 0 8px 22px rgba(81, 60, 16, .12);
}

:root[data-theme="light"] .command-center-page-wrapper .content-panel {
  background: #FFFFFF;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark-obsidian);
}
::-webkit-scrollbar-thumb {
  background: var(--border-gold-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gold-primary);
}

/* ==========================================================================
   Typography & Utility Classes
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.text-gold {
  color: var(--accent-gold-primary);
}

.text-gradient-gold {
  background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold-primary) 50%, var(--accent-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.appearance-settings-panel { margin-top:20px; }
.appearance-palette-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px; }
.appearance-palette-card { min-height:128px;padding:16px;text-align:left;color:var(--text-main);background:var(--bg-dark-obsidian);border:2px solid var(--border-subtle);border-radius:var(--radius-md);cursor:pointer; }
.appearance-palette-card:hover { border-color:var(--accent-gold-primary);transform:translateY(-1px); }
.appearance-palette-card.is-selected { border-color:var(--accent-gold-primary);box-shadow:0 0 0 3px var(--accent-gold-glow);background:var(--bg-card-hover); }
.appearance-palette-card strong,.appearance-palette-card small { display:block; }
.appearance-palette-card small { color:var(--text-muted);margin-top:5px;line-height:1.35; }
.appearance-swatches { display:flex;margin-bottom:13px; }
.appearance-swatches i { width:34px;height:28px;background:var(--swatch);border:2px solid var(--bg-panel-charcoal);border-radius:8px;margin-right:-5px;box-shadow:0 2px 6px rgba(0,0,0,.18); }
.appearance-custom-colors { display:grid;grid-template-columns:repeat(3,minmax(160px,1fr));gap:12px;padding:16px;margin-top:16px;border:1px solid var(--border-subtle);border-radius:var(--radius-md);background:var(--bg-dark-obsidian); }
.appearance-custom-colors[hidden] { display:none; }
.appearance-custom-colors label { display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;font-size:.84rem;color:var(--text-muted); }
.appearance-custom-colors input { grid-row:1/3;grid-column:2;width:48px;height:42px;border:0;background:transparent;cursor:pointer; }
.appearance-custom-colors span { color:var(--text-main);font-family:monospace; }
.appearance-preview { display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:16px;margin-top:16px;border-radius:var(--radius-md);background:var(--bg-card-surface);border:1px solid var(--border-subtle); }
.appearance-preview>span { color:var(--text-muted);font-size:.82rem;text-transform:uppercase;letter-spacing:.08em; }
.appearance-preview button { padding:9px 14px;border:0;border-radius:10px;background:var(--accent-gold-primary);color:var(--tab-active-text);font-weight:700; }
.appearance-preview-selected { padding:8px 13px;border:2px solid var(--accent-gold-primary);border-radius:10px;color:var(--accent-gold-primary);font-weight:700; }
.design-system-entry { display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px;margin-top:20px;border:1px solid var(--border-subtle);border-radius:var(--radius-md);background:var(--bg-dark-obsidian); }
.design-system-entry p { color:var(--text-muted);font-size:.86rem;margin:5px 0 0; }
@media (max-width:700px) { .appearance-custom-colors { grid-template-columns:1fr; } }

.service-editor-card,.settings-service-row { display:grid;grid-template-columns:170px 1fr;gap:18px;padding:16px;margin-top:14px;background:var(--bg-dark-obsidian);border:1px solid var(--border-subtle);border-radius:var(--radius-md); }
.service-media-editor { display:flex;flex-direction:column;align-items:center;gap:8px; }
.service-image-preview { width:150px;aspect-ratio:4/3;display:grid;place-items:center;overflow:hidden;border-radius:var(--radius-md);background:var(--bg-card-surface);border:1px solid var(--border-subtle); }
.service-image-preview img { width:100%;height:100%;object-fit:cover; }
.service-image-preview span { font-size:2.7rem; }
.service-file-label { cursor:pointer;text-align:center; }
.service-file-label input { display:none; }
.service-media-editor small { color:var(--text-muted);text-align:center;font-size:.72rem; }
.service-remove-image { border:0;background:transparent;color:var(--status-crimson);cursor:pointer;font-size:.78rem; }
.service-fields-grid { display:grid;grid-template-columns:90px 2fr repeat(3,1fr);gap:10px;align-items:end; }
.service-description-field { grid-column:1/-1; }
.service-description-field textarea { resize:vertical;min-height:74px; }
.public-service-catalog { display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px; }
.public-service-card { display:block;overflow:hidden;padding:0;text-align:left;color:var(--text-main);background:var(--bg-dark-obsidian);border:2px solid var(--border-subtle);border-radius:var(--radius-md);cursor:pointer; }
.public-service-card:hover { transform:translateY(-2px);border-color:var(--accent-gold-primary);box-shadow:var(--shadow-card); }
.public-service-card.is-selected { border-color:var(--accent-gold-primary);box-shadow:0 0 0 3px var(--accent-gold-glow); }
.public-service-media { position:relative;height:140px;display:grid;place-items:center;background:linear-gradient(135deg,var(--bg-card-surface),var(--bg-card-hover));overflow:hidden; }
.public-client-navigation { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 20px; }
.public-client-nav-button { position:relative;width:100%;min-width:0;padding:13px 12px!important;border:1px solid var(--border-subtle)!important;background:var(--bg-card-surface)!important;text-align:left;justify-content:flex-start; }
.public-client-nav-button:hover { border-color:var(--accent-gold-primary)!important;transform:translateY(-1px); }
.public-client-nav-button.active { color:var(--tab-active-text)!important;border-color:var(--accent-gold-primary)!important;background:linear-gradient(135deg,var(--accent-gold-light),var(--accent-gold-primary))!important;box-shadow:0 0 0 3px var(--accent-gold-glow),0 6px 15px var(--accent-gold-glow); }
.public-client-nav-button > span:not(.public-client-nav-icon) { min-width:0;display:flex;flex-direction:column;gap:2px; }
.public-client-nav-button strong { font-size:.86rem;white-space:nowrap; }
.public-client-nav-button small { color:inherit;opacity:.78;font-size:.68rem;line-height:1.2;white-space:normal; }
.public-client-nav-icon { flex:0 0 auto;font-size:1.25rem; }
.public-store-cart-badge { position:absolute;top:7px;right:7px;min-width:20px;height:20px;padding:0 5px;display:grid;place-items:center;border-radius:99px;background:var(--status-crimson);color:#fff;font-size:.68rem; }
@media (max-width: 760px) { .public-client-navigation { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 420px) { .public-client-navigation { grid-template-columns:1fr; } }
.public-service-media img { width:100%;height:100%;object-fit:cover; }
.public-service-media>span { font-size:3.3rem; }
.public-service-media i { display:none;position:absolute;right:10px;top:10px;width:28px;height:28px;place-items:center;border-radius:50%;background:var(--accent-gold-primary);color:var(--tab-active-text);font-style:normal;font-weight:800; }
.public-service-card.is-selected .public-service-media i { display:grid; }
.public-service-copy { padding:14px; }
.public-service-copy strong { display:block;font-size:1rem;color:var(--text-main); }
.public-service-copy p { min-height:40px;margin:7px 0 12px;color:var(--text-muted);font-size:.8rem;line-height:1.4; }
.public-service-copy>div { display:flex;justify-content:space-between;align-items:center;color:var(--text-muted);font-size:.78rem; }
.public-service-copy b { color:var(--accent-gold-primary);font-size:1rem; }
.bundle-rule-editor { display:grid;grid-template-columns:minmax(220px,2fr) auto 130px 120px minmax(190px,1fr) auto;gap:12px;align-items:end;padding:16px;margin:18px 0;border:1px solid var(--border-gold-subtle);border-radius:var(--radius-md);background:var(--bg-card-surface); }
.bundle-rule-editor p { color:var(--text-muted);font-size:.78rem;margin-top:4px; }
.bundle-public-banner { padding:12px 14px;margin-top:14px;border:1px dashed var(--accent-gold-primary);border-radius:var(--radius-md);background:var(--accent-gold-glow);color:var(--text-main);font-size:.84rem; }
.public-booking-total { display:flex;justify-content:space-between;align-items:center;gap:16px;padding:15px;margin-top:12px;border-radius:var(--radius-md);background:var(--bg-card-surface);border:1px solid var(--border-subtle); }
.public-booking-total>div { display:flex;flex-direction:column;gap:4px; }
.public-booking-total>div:last-child { align-items:flex-end; }
.public-booking-total small { color:var(--status-emerald); }
.public-booking-total del { color:var(--text-muted);font-size:.82rem; }
.public-booking-total strong { color:var(--accent-gold-primary);font-size:1.1rem; }
.public-schedule-picker { display:grid;grid-template-columns:minmax(190px,.7fr) 2fr;gap:18px;padding:16px;margin-top:14px;background:var(--bg-card-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-md); }
.public-time-slots { display:flex;flex-wrap:wrap;gap:8px;margin-top:8px; }.public-time-slots p { color:var(--status-amber);font-size:.84rem; }
.public-time-slot { min-width:68px;padding:9px 12px;color:var(--text-main);background:var(--bg-dark-obsidian);border:1px solid var(--border-subtle);border-radius:var(--radius-sm);cursor:pointer;font-weight:700; }
.public-time-slot:hover { border-color:var(--accent-gold-primary); }.public-time-slot.is-selected,.public-time-slot[aria-pressed="true"] { color:var(--tab-active-text);background:var(--accent-gold-primary);border-color:var(--accent-gold-primary);box-shadow:0 0 0 3px var(--accent-gold-glow); }
@media (max-width:760px) { .service-editor-card,.settings-service-row { grid-template-columns:1fr; }.service-fields-grid { grid-template-columns:1fr 1fr; }.service-description-field { grid-column:1/-1; } }
@media (max-width:980px) { .bundle-rule-editor { grid-template-columns:1fr 1fr; }.bundle-rule-editor>div:first-child { grid-column:1/-1; } }
.bot-status-grid { display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px; }
.bot-status-grid>div { display:flex;flex-direction:column;gap:5px;padding:14px;background:var(--bg-dark-obsidian);border:1px solid var(--border-subtle);border-radius:var(--radius-md); }
.bot-status-grid span { color:var(--text-muted);font-size:.8rem; }.bot-status-grid strong { color:var(--accent-gold-primary); }
.bot-settings-grid { display:grid;grid-template-columns:repeat(2,minmax(220px,1fr));gap:4px 18px;align-items:center; }
.bot-security-note { margin-top:14px;color:var(--text-muted);font-size:.78rem; }
.bot-log-list { display:grid;gap:9px;margin-top:14px; }.bot-log-list>div { display:flex;align-items:center;gap:12px;padding:11px;background:var(--bg-dark-obsidian);border-radius:var(--radius-sm); }
.bot-log-list p { margin:0;font-size:.84rem; }.bot-log-list small { color:var(--text-muted); }.bot-channel { min-width:82px;padding:5px 8px;text-align:center;border-radius:999px;font-size:.72rem;font-weight:700; }.bot-channel.whatsapp { color:#10B981;background:rgba(16,185,129,.13); }.bot-channel.telegram { color:#38BDF8;background:rgba(56,189,248,.13); }
@media (max-width:700px) { .bot-status-grid,.bot-settings-grid { grid-template-columns:1fr; } }
@media (max-width:700px) { .public-schedule-picker { grid-template-columns:1fr; } }
.academy-student-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px; }.academy-student-card { padding:16px;background:var(--bg-dark-obsidian);border:1px solid var(--border-subtle);border-radius:var(--radius-md); }.academy-student-card p { color:var(--text-muted);font-size:.8rem;margin-top:3px; }.academy-progress { height:9px;margin:14px 0;background:var(--bg-card-hover);border-radius:99px;overflow:hidden; }.academy-progress span { display:block;height:100%;background:linear-gradient(90deg,var(--accent-gold-dark),var(--accent-gold-primary)); }.academy-student-kpis { display:grid;grid-template-columns:repeat(3,1fr);gap:7px; }.academy-student-kpis span { display:flex;flex-direction:column;padding:8px;text-align:center;background:var(--bg-card-surface);border-radius:8px;color:var(--text-muted);font-size:.72rem; }.academy-student-kpis strong { color:var(--text-main);font-size:1rem; }.academy-next-class,.academy-payment { padding:9px;margin-top:9px;border-radius:8px;background:var(--bg-card-surface);font-size:.78rem; }.academy-payment.pending,.academy-payment.partial { color:var(--status-amber); }.academy-payment.paid { color:var(--status-emerald); }.academy-admin-edit { display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end;margin-top:10px; }.academy-class-form { display:grid;grid-template-columns:repeat(3,1fr);gap:8px 14px;align-items:end; }.quick-pos-success { display:flex;flex-direction:column;gap:5px;padding:14px;margin-top:14px;border:1px solid var(--status-emerald);border-radius:var(--radius-md);background:var(--status-emerald-bg); }.quick-pos-success strong { color:var(--status-emerald); }.quick-pos-success span { font-size:.8rem; }
@media(max-width:760px){.academy-admin-edit,.academy-class-form{grid-template-columns:1fr}.academy-student-kpis{grid-template-columns:1fr 1fr 1fr}}
.barber-replenishment-form { display:grid;grid-template-columns:2fr .7fr 1fr auto;gap:12px;align-items:end;padding:14px;background:var(--bg-card-surface);border:1px solid var(--border-subtle);border-radius:var(--radius-md); }.store-stock-row { display:grid;grid-template-columns:2fr minmax(170px,1fr) auto;gap:12px;align-items:center;padding:13px;background:var(--bg-dark-obsidian);border-radius:var(--radius-md); }.store-stock-row small { color:var(--text-muted); }.store-request-list { display:grid;gap:10px;margin-top:15px; }.store-request-list>div { display:grid;grid-template-columns:2fr 1fr auto auto;gap:12px;align-items:center;padding:14px;background:var(--bg-dark-obsidian);border:1px solid var(--border-subtle);border-radius:var(--radius-md); }.store-request-list span { display:flex;flex-direction:column;gap:3px; }.store-request-list span:last-child { flex-direction:row; }.store-request-list small { color:var(--text-muted);font-size:.74rem; }
@media(max-width:760px){.barber-replenishment-form,.store-stock-row,.store-request-list>div{grid-template-columns:1fr}}

.bg-glass {
  background: var(--bg-glass-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold-subtle);
}

/* ==========================================================================
   Auth & Login Screen
   ========================================================================== */

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(212, 175, 55, 0.08) 0%, rgba(13, 15, 18, 1) 70%);
  padding: 20px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-gold-primary), transparent);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, rgba(20, 23, 29, 0.8) 100%);
  border: 1px solid var(--accent-gold-primary);
  border-radius: 50%;
  margin-bottom: 15px;
  box-shadow: var(--shadow-gold-soft);
}

.auth-brand-logo svg {
  width: 36px;
  height: 36px;
  fill: var(--accent-gold-primary);
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Demo Role Switcher Bar */
.demo-role-selector {
  margin-bottom: 25px;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.demo-role-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold-primary);
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.demo-role-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-role-chip {
  flex: 1 1 calc(33.33% - 6px);
  min-width: 80px;
  padding: 8px 10px;
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-role-chip:hover {
  border-color: var(--accent-gold-primary);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.btn-role-chip.active {
  background: linear-gradient(135deg, var(--accent-gold-primary), var(--accent-bronze));
  color: #000;
  font-weight: 700;
  border-color: var(--accent-gold-primary);
  box-shadow: var(--shadow-gold-soft);
}

/* Form inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.input-wrapper {
  position: relative;
}

.form-input, .form-select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-gold-primary);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-gold-light) 0%, var(--accent-gold-primary) 50%, var(--accent-bronze) 100%);
  color: var(--tab-active-text);
  font-weight: 800;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--accent-gold-primary), var(--accent-gold-dark));
  box-shadow: 0 12px 30px -5px var(--accent-gold-glow);
}

/* Acciones compactas creadas directamente por los módulos. Comparten la
   paleta global para que Gold, Barber Classic, Silver y Personalizado se
   comporten igual en toda la interfaz. */
.btn-primary-sm {
  padding: 7px 12px;
  background: linear-gradient(135deg, var(--accent-gold-primary), var(--accent-bronze));
  border: 1px solid var(--accent-gold-light);
  border-radius: var(--radius-md);
  color: var(--tab-active-text);
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-gold-glow);
  transition: all .2s ease;
}

.btn-primary-sm:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, var(--accent-gold-primary), var(--accent-gold-dark));
  box-shadow: 0 7px 16px var(--accent-gold-glow);
}

.btn-primary:focus-visible,
.btn-primary-sm:focus-visible {
  outline: 3px solid var(--accent-gold-light);
  outline-offset: 2px;
}

/* ==========================================================================
   Main App Layout
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-panel-charcoal);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-icon {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, rgba(20, 23, 29, 1) 100%);
  border: 1px solid var(--accent-gold-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--accent-gold-primary);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.68rem;
  color: var(--accent-gold-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

/* App Launcher Navigation Menu */
.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin: 14px 10px 6px;
}

.nav-app-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.nav-app-item:hover {
  background: var(--bg-card-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.nav-app-item.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(26, 29, 36, 0.9) 100%);
  color: var(--accent-gold-primary);
  border-color: var(--border-gold-subtle);
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.4);
}

.nav-app-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-app-badge {
  margin-left: auto;
  padding: 2px 7px;
  font-size: 0.68rem;
  border-radius: var(--radius-full);
  background: var(--status-emerald-bg);
  color: var(--status-emerald);
  font-weight: 700;
}

/* Sidebar Footer User Card */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card-surface);
}

.user-profile-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold-primary), var(--accent-bronze));
  color: #000;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--accent-gold-primary);
  font-weight: 600;
}

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

/* Header Bar */
.app-header {
  height: var(--header-height);
  background: var(--bg-panel-charcoal);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-app-title {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-branch-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.role-switcher-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--accent-gold-primary);
  border-radius: var(--radius-full);
  color: var(--accent-gold-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.header-icon-btn:hover {
  border-color: var(--accent-gold-primary);
  color: var(--accent-gold-primary);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--status-crimson);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--status-crimson);
}

/* Page Container Body */
.page-container {
  padding: 30px;
  flex: 1;
}

/* ==========================================================================
   Dashboard Widgets & Components
   ========================================================================== */

/* Grid Layouts */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.grid-dashboard-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}

@media (max-width: 1024px) {
  .grid-dashboard-main {
    grid-template-columns: 1fr;
  }
}

/* DBOS Metric Card */
.stat-card {
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-card);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold-subtle);
  box-shadow: var(--shadow-card), var(--shadow-gold-soft);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  font-family: var(--font-heading);
  line-height: 1;
  margin-bottom: 12px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.trend-up {
  color: var(--status-emerald);
}

.trend-down {
  color: var(--status-crimson);
}

/* Content Panels */
.content-panel {
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-secondary-sm {
  padding: 6px 12px;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-sm:hover {
  border-color: var(--accent-gold-primary);
  color: var(--accent-gold-primary);
}

/* Custom SVG Chart Container */
.chart-container {
  width: 100%;
  height: 260px;
  position: relative;
}

/* DBOS Data Tables */
.dbos-table-wrapper {
  overflow-x: auto;
}

.dbos-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.dbos-table th {
  padding: 14px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
}

.dbos-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-main);
}

.dbos-table tr:hover td {
  background: var(--bg-card-hover);
}

/* Badges */
.dbos-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-scheduled {
  background: var(--status-cyan-bg);
  color: var(--status-cyan);
}

.badge-in-chair {
  background: var(--status-amber-bg);
  color: var(--status-amber);
}

.badge-completed {
  background: var(--status-emerald-bg);
  color: var(--status-emerald);
}

.badge-cancelled {
  background: var(--status-crimson-bg);
  color: var(--status-crimson);
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.activity-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.activity-content {
  display: flex;
  flex-direction: column;
}

.activity-text {
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.3;
}

.activity-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.dbos-toast {
  padding: 14px 20px;
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--accent-gold-primary);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-card), var(--shadow-gold-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 300px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Modals & Dialogs (POS Express Checkout Modal)
   ========================================================================== */

.dbos-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.dbos-modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  overflow: hidden;
  position: relative;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--accent-gold-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: var(--bg-card-surface);
}

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

/* ==========================================================================
   Design System Extended Components (Buttons, Forms, Tabs, Badges & Charts)
   ========================================================================== */

/* Button Sizes & Variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-md {
  padding: 10px 18px;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-gold-primary);
  border-color: var(--border-subtle);
}

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}
.btn-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

/* Form Extensions (Toggle, Checkbox, Radio, Validation) */
.dbos-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
}

.dbos-toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  position: relative;
  transition: all 0.3s ease;
}

.dbos-toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s ease;
}

input[type="checkbox"]:checked + .dbos-toggle-switch {
  background: var(--accent-gold-glow);
  border-color: var(--accent-gold-primary);
}

input[type="checkbox"]:checked + .dbos-toggle-switch::after {
  transform: translateX(20px);
  background: var(--accent-gold-primary);
  box-shadow: 0 0 10px var(--accent-gold-primary);
}

.dbos-checkbox-label, .dbos-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
}

.dbos-checkbox, .dbos-radio {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bg-card-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.dbos-radio {
  border-radius: 50%;
}

.dbos-checkbox:checked, .dbos-radio:checked {
  background: var(--accent-gold-primary);
  border-color: var(--accent-gold-primary);
}

.dbos-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: -2px;
  left: 3px;
  color: #000;
  font-size: 0.75rem;
  font-weight: bold;
}

.dbos-radio:checked::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.form-helper-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.form-error-text {
  font-size: 0.78rem;
  color: var(--status-crimson);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Tabs System */
.dbos-tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.dbos-tab-btn {
  padding: 10px 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.dbos-tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.dbos-tab-btn.active {
  color: var(--tab-active-text);
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold-primary));
  border: 1px solid var(--accent-gold-primary);
  box-shadow: 0 5px 16px var(--accent-gold-glow), inset 0 0 0 1px rgba(255,255,255,.18);
  font-weight: 800;
  transform: translateY(-1px);
}
.dbos-tab-btn[aria-selected="true"] { color:var(--tab-active-text);background:linear-gradient(135deg,var(--accent-gold-light),var(--accent-gold-primary));border:1px solid var(--accent-gold-primary);box-shadow:0 5px 16px var(--accent-gold-glow),inset 0 0 0 1px rgba(255,255,255,.18);font-weight:800; }
.mode-option.is-selected { color:var(--tab-active-text)!important;background:var(--accent-gold-primary)!important;border:2px solid var(--accent-gold-light)!important;box-shadow:0 0 0 3px var(--accent-gold-glow),0 6px 15px var(--accent-gold-glow)!important;transform:translateY(-1px);font-weight:800; }

.dbos-tab-btn:focus-visible {
  outline: 3px solid var(--status-cyan);
  outline-offset: 2px;
}

/* Dropdown Menu */
.dbos-dropdown {
  position: relative;
  display: inline-block;
}

.dbos-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-gold-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  min-width: 200px;
  padding: 8px 0;
  z-index: 100;
  display: none;
  animation: fadeIn 0.2s ease;
}

.dbos-dropdown.open .dbos-dropdown-menu {
  display: block;
}

.dbos-dropdown-item {
  padding: 10px 16px;
  color: var(--text-main);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.dbos-dropdown-item:hover {
  background: var(--accent-gold-glow);
  color: var(--accent-gold-primary);
}

.dbos-dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 0;
}

/* Progress & Metrics */
.dbos-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-card-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  position: relative;
}

.dbos-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-bronze), var(--accent-gold-primary));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--accent-gold-primary);
}

/* Style Guide Layout */
.styleguide-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.component-preview-card {
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.component-preview-card:hover {
  border-color: var(--border-gold-subtle);
}

.component-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.component-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold-primary);
}

.component-spec {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: monospace;
}

.component-demo-box {
  padding: 20px;
  background: var(--bg-dark-obsidian);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.color-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.token-swatch {
  height: 90px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Booking App & Professional Agenda Calendar Styles
   ========================================================================== */

.booking-calendar-wrapper {
  background: var(--bg-panel-charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

.calendar-header-toolbar {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--bg-card-surface);
}

.now-indicator-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold-primary);
  box-shadow: 0 0 10px var(--accent-gold-primary);
  z-index: 10;
  pointer-events: none;
}

.now-indicator-label {
  position: absolute;
  left: 10px;
  top: -10px;
  background: var(--accent-gold-primary);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.appointment-card-block {
  padding: 10px 12px;
  background: var(--bg-card-surface);
  border-left: 4px solid var(--accent-gold-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.appointment-card-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212,175,55,0.25);
  border-color: var(--accent-gold-light);
}

.appointment-blocked-slot {
  background: repeating-linear-gradient(
    45deg,
    rgba(239, 68, 68, 0.08),
    rgba(239, 68, 68, 0.08) 10px,
    rgba(0, 0, 0, 0.2) 10px,
    rgba(0, 0, 0, 0.2) 20px
  );
  border: 1px dashed var(--status-crimson);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--status-crimson);
  font-size: 0.78rem;
  font-weight: 600;
}

.qr-code-box {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(252, 211, 77, 0.3);
}

/* ==========================================================================
   DBOS v30 — Responsive Workspace
   ========================================================================== */

html,
body,
#app-root {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.app-wrapper {
  width: 100%;
  max-width: 100vw;
  min-width: 0;
}

.app-main {
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: clip;
}

.app-header,
.header-left,
.header-right,
.page-container,
#page-content-area,
.content-panel,
.content-card,
.dbos-card {
  min-width: 0;
  max-width: 100%;
}

.header-app-title,
.header-branch-selector strong,
.role-switcher-pill span,
.role-switcher-pill strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dbos-table-wrapper,
.dbos-tabs-nav,
.booking-calendar-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.dbos-table {
  min-width: 680px;
}

.dbos-tab-btn {
  flex: 0 0 auto;
}

.dbos-modal-card {
  width: min(540px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
}

.modal-body {
  min-height: 0;
  overflow-y: auto;
}

.modal-footer {
  flex-wrap: wrap;
}

.toast-container {
  max-width: calc(100vw - 24px);
}

.dbos-toast {
  min-width: 0;
  max-width: 100%;
}

.mobile-nav-toggle,
.mobile-sidebar-backdrop {
  display: none;
}

@media (max-width: 1280px) and (min-width: 901px) {
  :root { --sidebar-width: 240px; }
  .app-header { padding-inline: 20px; }
  .page-container { padding: 22px; }
  .header-left { gap: 12px; }
  .header-right { gap: 10px; }
  .role-switcher-pill { max-width: 230px; }
}

@media (max-width: 900px) {
  body { overflow-x: hidden; }

  .app-sidebar {
    width: min(82vw, 300px);
    transform: translateX(-105%);
    box-shadow: 18px 0 45px rgba(0, 0, 0, 0.5);
    z-index: 120;
  }

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

  .mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    border: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(2px);
    cursor: pointer;
  }

  .app-wrapper.sidebar-open .mobile-sidebar-backdrop { display: block; }

  .app-main {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-gold-subtle);
    background: var(--bg-card-surface);
    color: var(--accent-gold-primary);
    font-size: 1.25rem;
    cursor: pointer;
  }

  .app-header {
    height: auto;
    min-height: var(--header-height);
    padding: 10px 14px;
    gap: 10px;
  }

  .header-left { gap: 10px; flex: 1 1 auto; }
  .header-right { gap: 8px; flex: 0 0 auto; }
  .header-app-title { font-size: 1.05rem; max-width: 210px; }
  .header-branch-selector { max-width: 205px; }
  .role-switcher-pill { max-width: 190px; }
  .page-container { padding: 18px; }
}

@media (max-width: 640px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 12px;
  }

  .header-left,
  .header-right { width: 100%; }
  .header-left { flex-wrap: wrap; }
  .header-app-title { flex: 1 1 170px; max-width: calc(100% - 52px); }
  .header-branch-selector { order: 3; width: 100%; max-width: none; justify-content: center; }
  .header-right { justify-content: flex-end; flex-wrap: wrap; }
  .role-switcher-pill { flex: 1 1 170px; max-width: none; }
  .header-icon-btn { width: 38px; height: 38px; flex: 0 0 38px; }
  .page-container { padding: 12px; }
  .grid-metrics { grid-template-columns: 1fr; gap: 12px; }

  #page-content-area [style*="grid-template-columns"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #page-content-area input,
  #page-content-area select,
  #page-content-area textarea,
  #page-content-area button {
    max-width: 100%;
  }

  .stat-card,
  .component-preview-card { padding: 16px; }
  .dbos-modal-overlay { padding: 8px; }
  .modal-header,
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .modal-footer > button { flex: 1 1 140px; }
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
}

/* DBOS v32 — Estado de sincronización real */
.remote-sync-heading { display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap; }
.remote-sync-heading p { color:var(--text-muted);margin:6px 0 0; }
.remote-sync-metrics { display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;margin-top:16px; }
.remote-sync-metrics span { display:grid;gap:3px;padding:12px;background:var(--bg-dark-obsidian);border:1px solid var(--border-subtle);border-radius:var(--radius-sm);color:var(--text-muted);font-size:.78rem; }
.remote-sync-metrics strong { color:var(--text-main);font-size:1rem;overflow-wrap:anywhere; }
.remote-sync-error { color:var(--status-amber);padding:10px 12px;border:1px solid var(--status-amber);border-radius:var(--radius-sm); }
@media (max-width: 760px) { .remote-sync-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 420px) { .remote-sync-metrics { grid-template-columns:1fr; } }

@media (max-width: 390px) {
  .header-app-title { font-size: 0.96rem; }
  .header-right { justify-content: space-between; }
  .role-switcher-pill { flex-basis: 100%; }
  .page-container { padding: 10px; }
}

/* DBOS v31 — Safe backup migration assistant */
.backup-import-preview {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--status-emerald);
  border-radius: var(--radius-md);
  background: var(--bg-dark-obsidian);
}
.backup-import-summary { display: grid; gap: 5px; }
.backup-import-summary strong { color: var(--status-emerald); }
.backup-import-summary span { color: var(--text-muted); font-size: .86rem; }
.backup-security-note {
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid var(--status-amber);
  border-radius: var(--radius-sm);
  color: var(--status-amber);
  font-size: .84rem;
}
.backup-group-list { display: grid; gap: 8px; margin-top: 14px; }
.backup-group-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card-surface);
}
.backup-group-row span { display: grid; min-width: 0; }
.backup-group-row strong { overflow-wrap: anywhere; font-size: .84rem; }
.backup-group-row small { color: var(--text-muted); }
.backup-group-row em { color: var(--status-emerald); font-size: .76rem; font-style: normal; text-align: right; }
.backup-group-row.is-conflict { opacity: .68; }
.backup-group-row.is-conflict em { color: var(--status-amber); }
.backup-import-policy { margin: 12px 0 0; color: var(--text-muted); font-size: .8rem; }
@media (max-width: 640px) {
  .backup-group-row { grid-template-columns: auto minmax(0, 1fr); }
  .backup-group-row em { grid-column: 2; text-align: left; }
}
