﻿/* ═══════════════════════════════════════════
   URBÆ · Kit de Marca — Modo oscuro (Noir)
   ═══════════════════════════════════════════ */
:root {
  /* Paleta oficial */
  --noir:    #0E0E10;
  --crema:   #F5F3EF;
  --lavanda: #C4B5FD;
  --violeta: #7C6FCD;
  --grafito: #2D2B35;
  --pizarra: #5C5870;

  /* Fondos */
  --bg:      #0E0E10;
  --bg-soft: #0A0A0C;

  /* Superficies */
  --surface:  #18171C;
  --surface2: #211F28;
  --surface3: rgba(196,181,253,0.05);

  /* Bordes */
  --border:  rgba(196,181,253,0.10);
  --border2: rgba(124,111,205,0.45);

  /* Textos */
  --text:  #F5F3EF;
  --text2: #9490A8;
  --text3: #5C5870;

  /* Acento principal — Violeta */
  --accent:       #7C6FCD;
  --accent-strong: #6358B8;
  --accent-light: rgba(124,111,205,0.14);
  --accent-text:  #C4B5FD;

  /* Semánticos */
  --danger:       #E05C6C;
  --danger-light: rgba(224,92,108,0.12);
  --danger-text:  #E88A95;
  --warn:         #C4894A;
  --warn-light:   rgba(196,137,74,0.12);
  --warn-text:    #D4A76A;
  --info:         #5B8FBF;
  --info-light:   rgba(91,143,191,0.12);
  --info-text:    #88B4D8;

  /* Radio */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  /* Sombras */
  --shadow:    0 16px 40px rgba(0,0,0,.35);
  --shadow-md: 0 26px 60px rgba(0,0,0,.50);

  /* Glows — sutiles, sin neón */
  --body-glow-1: rgba(124,111,205,.08);
  --body-glow-2: rgba(124,111,205,.05);
  --body-gradient: linear-gradient(145deg, #0E0E10 0%, #111013 55%, #0E0E10 100%);

  /* Sidebar */
  --sidebar-sheen: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  --sidebar-glow:  linear-gradient(180deg, rgba(124,111,205,.10), rgba(0,0,0,0) 28%);
  --sidebar-base:  #0A0A0C;

  /* Topbar */
  --topbar-bg:      rgba(14,14,16,0.92);
  --app-version-bg: rgba(10,10,12,0.88);

  /* Interacción */
  --button-hover: rgba(255,255,255,.07);
  --ghost-hover:  rgba(255,255,255,.04);
  --badge-gray-bg: rgba(196,181,253,0.06);
}

/* ═══════════════════════════════════════════
   URBÆ · Kit de Marca — Modo claro (Crema)
   ═══════════════════════════════════════════ */
body[data-theme="light"] {
  --bg:      #F5F3EF;
  --bg-soft: #EDEAE4;

  --surface:  rgba(255,255,255,0.92);
  --surface2: rgba(237,234,228,0.95);
  --surface3: rgba(124,111,205,0.06);

  --border:  rgba(45,43,53,0.10);
  --border2: rgba(124,111,205,0.35);

  --text:  #0E0E10;
  --text2: #5C5870;
  --text3: #9490A8;

  --accent:        #7C6FCD;
  --accent-strong: #6358B8;
  --accent-light:  rgba(124,111,205,0.10);
  --accent-text:   #7C6FCD;

  --danger-light: rgba(201,64,80,0.09);
  --danger-text:  #C94050;
  --warn-light:   rgba(181,114,42,0.09);
  --warn-text:    #B5722A;
  --info-light:   rgba(58,111,158,0.09);
  --info-text:    #3A6F9E;

  --shadow:    0 16px 40px rgba(45,43,53,.10);
  --shadow-md: 0 24px 56px rgba(45,43,53,.16);

  --body-glow-1: rgba(124,111,205,.06);
  --body-glow-2: rgba(124,111,205,.03);
  --body-gradient: linear-gradient(145deg, #F5F3EF 0%, #EDE9E3 58%, #F0EDE8 100%);

  --sidebar-sheen: linear-gradient(180deg, rgba(255,255,255,.70), rgba(255,255,255,.50));
  --sidebar-glow:  linear-gradient(180deg, rgba(124,111,205,.08), rgba(255,255,255,0) 34%);
  --sidebar-base:  #EDEAE4;

  --topbar-bg:      rgba(245,243,239,0.92);
  --app-version-bg: rgba(255,255,255,0.92);

  --button-hover:  rgba(45,43,53,0.06);
  --ghost-hover:   rgba(45,43,53,0.05);
  --badge-gray-bg: rgba(45,43,53,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  background-image:
    radial-gradient(circle at top right, var(--body-glow-1), transparent 28%),
    radial-gradient(circle at bottom left, var(--body-glow-2), transparent 24%),
    var(--body-gradient);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* LAYOUT */
.app { display: flex; height: 100vh; overflow: hidden; position: relative; }
.mobile-topbar,
.mobile-nav-backdrop,
.mobile-bottom-nav { display: none; }

/* SIDEBAR */
.sidebar {
  width: 236px;
  min-width: 236px;
  position: relative;
  z-index: 1100;
  background:
    var(--sidebar-sheen),
    var(--sidebar-glow),
    var(--sidebar-base);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.03);
  backdrop-filter: blur(12px);
}
.sidebar-brand {
  padding: 24px 18px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand-name {
  font-family: 'Arial Black', Arial, sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}
.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .18em;
}
.brand-accent {
  color: var(--violeta);
}
.brand-wordmark {
  font-family: 'Arial Black', Arial, sans-serif;
  font-weight: 800;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}
.brand-wordmark-lg { font-size: 30px; }
.brand-wordmark-md { font-size: 24px; }
.sidebar-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--text3);
  text-transform: uppercase;
  padding: 12px 8px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
  transition: background .16s, color .16s, border-color .16s, transform .16s;
  user-select: none;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(124,111,205,.08); color: var(--text); border-color: rgba(124,111,205,.14); transform: translateX(2px); }
body[data-theme="light"] .nav-item:hover {
  background: rgba(124,111,205,.08);
  border-color: rgba(124,111,205,.14);
}
.nav-item.active { background: rgba(124,111,205,.14); color: var(--accent-text); font-weight: 600; border-color: rgba(124,111,205,.28); border-left: 2px solid var(--violeta); }
.nav-item svg { flex-shrink: 0; opacity: .7; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer {
  position: relative;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text2);
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.02));
}
body[data-theme="light"] .sidebar-footer {
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(124,111,205,.04));
}
.utility-launcher {
  display: flex;
  align-items: center;
  gap: 8px;
}
.utility-trigger {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
  transition: .18s ease;
  text-align: left;
}
.utility-trigger:hover {
  border-color: rgba(124,111,205,.22);
  background: rgba(124,111,205,.08);
}
body[data-theme="light"] .utility-trigger {
  border-color: rgba(62,40,92,.1);
  background: rgba(255,255,255,.76);
}
.utility-trigger-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.utility-trigger-title {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}
.utility-trigger-meta {
  color: var(--text3);
  font-size: 10px;
  line-height: 1.2;
}
.utility-trigger-chevron {
  flex-shrink: 0;
  color: var(--text3);
  transition: transform .18s ease, color .18s ease;
}
body.utility-dock-open .utility-trigger-chevron {
  transform: rotate(180deg);
  color: var(--text);
}
.utility-dock {
  display: none;
  gap: 10px;
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: calc(100% - 8px);
  padding: 12px;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid rgba(255,255,255,.06);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    rgba(7, 7, 12, .46);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  z-index: 20;
  max-height: min(72vh, 520px);
  overflow: auto;
}
.utility-dock.is-open {
  display: grid !important;
}
body[data-theme="light"] .utility-dock {
  border-color: rgba(62, 40, 92, .1);
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.74)),
    rgba(124,111,205,.03);
  box-shadow: 0 12px 26px rgba(78,44,118,.08);
}
.utility-dock-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}
.utility-dock-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text3);
  margin-bottom: 3px;
}
.utility-dock-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.utility-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.utility-action {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  color: var(--text2);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: .18s ease;
  text-align: left;
}
.utility-action:hover {
  transform: translateY(-1px);
  border-color: rgba(124,111,205,.26);
  background: rgba(124,111,205,.08);
  color: var(--text);
}
.utility-action svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.utility-action-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.utility-action-title {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.1;
}
.utility-action-meta {
  color: var(--text3);
  font-size: 10px;
  line-height: 1.2;
}
.utility-action-primary {
  background: linear-gradient(135deg, rgba(124,111,205,.18), rgba(124,111,205,.06));
  border-color: rgba(124,111,205,.28);
  color: var(--accent-text);
}
.utility-action-primary:hover {
  background: linear-gradient(135deg, rgba(124,111,205,.24), rgba(124,111,205,.1));
}
.utility-action-compact {
  grid-column: auto;
}
body[data-theme="light"] .utility-action {
  border-color: rgba(62,40,92,.1);
  background: rgba(255,255,255,.7);
  color: var(--text2);
}
body[data-theme="light"] .utility-action:hover {
  border-color: rgba(124,111,205,.2);
  background: rgba(124,111,205,.08);
}
.utility-status-stack {
  display: grid;
  gap: 6px;
}
.utility-status-line {
  display: grid;
  gap: 3px;
  align-items: flex-start;
  min-height: 40px;
  padding: 10px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.025);
  color: var(--text2);
  font-size: 10.5px;
  letter-spacing: .01em;
}
.utility-status-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.utility-status-line strong {
  color: var(--text);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.15;
}
.utility-status-line small {
  color: var(--text3);
  font-size: 10px;
  line-height: 1.25;
  padding-left: 18px;
  word-break: break-word;
}
.utility-status-line-brand {
  color: var(--accent-text);
}
.utility-status-line.is-online {
  border-color: rgba(124,111,205,.2);
}
.utility-status-line.is-offline {
  color: #ffbf47;
  border-color: rgba(255,191,71,.2);
}
body[data-theme="light"] .utility-status-line {
  border-color: rgba(62,40,92,.08);
  background: rgba(255,255,255,.74);
}
.theme-icon-btn {
  flex: 0 0 40px;
  justify-content: center;
  padding: 0;
}
.utility-icon-btn {
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
body[data-theme="light"] .utility-icon-btn {
  border-color: rgba(62,40,92,.1);
  background: rgba(255,255,255,.76);
}
.theme-icon-btn span,
.mobile-theme-btn span {
  font-size: 16px;
  line-height: 1;
}
.mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1300;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.mobile-menu-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
body[data-theme="light"] .mobile-menu-btn,
body[data-theme="light"] .mobile-theme-btn {
  background: rgba(94, 46, 147, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.mobile-topbar-copy { min-width: 0; }
.mobile-theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mobile-topbar-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: 1;
}
.mobile-topbar-title {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 4px;
}
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1190;
  border: 0;
  background: rgba(4, 4, 8, .6);
  backdrop-filter: blur(4px);
}
body[data-theme="light"] .mobile-nav-backdrop {
  background: rgba(80, 53, 122, .18);
}

/* MAIN CONTENT */
.main { flex: 1; overflow-y: auto; background: transparent; position: relative; }
.page { display: none; padding: 32px 30px 40px; width: 100%; max-width: 1600px; }
.page.active { display: block; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.page-header-premium {
  position: relative;
  padding-bottom: 18px;
}
.page-header-premium::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(124,111,205,.2), rgba(255,255,255,.06), transparent 85%);
}
.page-hero-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -.06em; line-height: 1; }
.page-sub { font-size: 14px; color: var(--text2); max-width: 740px; }
.page-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.page-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--text2);
  font-size: 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.header-actions-dashboard {
  gap: 10px;
}
.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dashboard-popover-wrap {
  position: relative;
}
.dashboard-toolbar-btn {
  position: relative;
  min-width: 0;
}
.dashboard-toolbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.dashboard-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 48px));
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)),
    var(--surface);
  box-shadow: 0 20px 40px rgba(0,0,0,.24);
}
body[data-theme="light"] .dashboard-popover {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,241,252,.94)),
    var(--surface);
  box-shadow: 0 18px 34px rgba(78,44,118,.12);
}
.dashboard-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.dashboard-popover-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text3);
  margin-bottom: 4px;
}
.dashboard-popover-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.notification-list,
.dashboard-layout-list {
  display: grid;
  gap: 10px;
}
.notification-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
body[data-theme="light"] .notification-item {
  border-color: rgba(62,40,92,.08);
  background: rgba(255,255,255,.74);
}
.notification-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.notification-title {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}
.notification-copy {
  color: var(--text2);
  font-size: 12px;
  line-height: 1.45;
}
.notification-actions {
  display: flex;
  justify-content: flex-end;
}
.layout-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
body[data-theme="light"] .layout-choice {
  border-color: rgba(62,40,92,.08);
  background: rgba(255,255,255,.74);
}
.layout-choice-copy {
  display: grid;
  gap: 3px;
}
.layout-choice-title {
  color: var(--text);
  font-weight: 600;
  font-size: 12.5px;
}
.layout-choice-meta {
  color: var(--text3);
  font-size: 11px;
}
.layout-choice input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
body[data-theme="light"] .page-header-premium::after {
  background: linear-gradient(90deg, rgba(124,111,205,.16), rgba(49,33,77,.08), transparent 85%);
}
body[data-theme="light"] .page-meta-pill {
  background: rgba(255,255,255,.78);
  border-color: rgba(62, 40, 92, .1);
}
.app-version {
  position: fixed;
  right: 20px;
  bottom: 16px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--app-version-bg);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
  color: var(--text2);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}
.app-version strong {
  color: var(--accent-text);
  font-weight: 700;
  letter-spacing: .12em;
}
body[data-theme="light"] .app-version {
  border-color: rgba(62, 40, 92, .1);
  box-shadow: 0 16px 32px rgba(78,44,118,.12);
}
.mobile-bottom-nav {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1250;
  grid-template-columns: repeat(8, minmax(72px, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(10, 10, 16, 0.92);
  box-shadow: 0 18px 36px rgba(0,0,0,.32);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.mobile-bottom-nav::-webkit-scrollbar { display: none; }
body[data-theme="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(62, 40, 92, .1);
  box-shadow: 0 18px 32px rgba(78,44,118,.12);
}
.mobile-bottom-item {
  min-width: 72px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--text3);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
}
.mobile-bottom-item.active {
  background: linear-gradient(180deg, rgba(124,111,205,.22), rgba(124,111,205,.08));
  color: var(--accent-text);
}
.mobile-bottom-item svg { flex-shrink: 0; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  transition: all .16s;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.btn:hover { background: var(--button-hover); border-color: rgba(255,255,255,.12); }
body[data-theme="light"] .btn:hover { border-color: rgba(62, 40, 92, .14); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 12px 28px rgba(124,111,205,.28);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #a13224; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--ghost-hover); border-color: var(--border); }

/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}
.table-card {
  padding: 0;
  overflow: hidden;
  border-radius: 22px;
}
.helper-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02)),
    var(--surface);
}

/* CARDS */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.dashboard-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 2px 12px;
}
.dashboard-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent-text);
}
.dashboard-section-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text3);
}
.metric-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
body[data-theme="light"] .metric-card {
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(247,241,252,.88)), var(--surface);
}
.metric-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(124,111,205,.75), transparent);
  opacity: .85;
}
.metric-label { font-size: 11px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.metric-value { font-size: 24px; font-weight: 600; font-family: 'JetBrains Mono', monospace; letter-spacing: -1px; color: var(--text); }
.metric-value.green { color: #b97dff; }
.metric-value.red { color: #ff8096; }
.metric-value.blue { color: #90ccff; }
.metric-delta { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* URBAE redesign layer */
.metrics-grid { gap: 14px; margin-bottom: 18px; }
.metrics-grid-dashboard { grid-template-columns: 1.55fr repeat(3, minmax(0, 1fr)); }
.metric-card {
  border-radius: 22px;
  padding: 18px;
}
.metric-hero-card {
  min-height: 168px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(124,111,205,.18), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)),
    var(--surface);
}
.metric-hero-card::before {
  height: 4px;
  background: linear-gradient(90deg, rgba(124,111,205,.95), rgba(255,255,255,.12), transparent 86%);
}
.metric-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.05);
  color: var(--text2);
  font-size: 11px;
}
.metric-trend.positive { color: var(--accent-text); }
.metric-label {
  font-weight: 600;
  letter-spacing: .1em;
}
.metric-hero-card .metric-value {
  font-size: 38px;
  line-height: .98;
  margin-bottom: 10px;
}
.metric-copy {
  font-size: 13px;
  color: var(--text2);
  max-width: 48ch;
}
.metric-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.metric-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.05);
  font-size: 11px;
  color: var(--text2);
}
.section-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.section-grid-dashboard {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .9fr);
}
.section-grid-dashboard-compact {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
}
.section-panel {
  position: relative;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.018)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.section-panel::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(124,111,205,.22), rgba(255,255,255,.04), transparent 86%);
}
.section-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-panel-body {
  min-width: 0;
}
.panel-toggle-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: var(--text3);
  cursor: pointer;
  transition: .18s ease;
}
.panel-toggle-btn:hover {
  border-color: rgba(124,111,205,.22);
  background: rgba(124,111,205,.08);
  color: var(--text);
}
body[data-theme="light"] .panel-toggle-btn {
  border-color: rgba(62,40,92,.1);
  background: rgba(255,255,255,.76);
}
.section-grid.is-single {
  grid-template-columns: 1fr;
}
.dashboard-panel.is-hidden {
  display: none;
}
.section-panel-focus {
  background:
    radial-gradient(circle at top right, rgba(124,111,205,.1), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.018)),
    var(--surface);
}
.section-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.section-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text);
  margin-bottom: 6px;
}
.section-title-inline {
  font-size: 18px;
  margin-bottom: 12px;
}
.section-copy {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 16px;
  max-width: 54ch;
}
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.action-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,111,205,.24);
  background: rgba(124,111,205,.08);
  box-shadow: 0 18px 34px rgba(0,0,0,.2);
}
.action-card-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text3);
}
.action-card strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.action-card small {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
}
.focus-list,
.signal-list,
.activity-list {
  display: grid;
  gap: 12px;
}
.focus-item,
.signal-row,
.activity-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.focus-item:first-child,
.signal-row:first-child,
.activity-row:first-child {
  padding-top: 2px;
}
.focus-item:last-child,
.signal-row:last-child,
.activity-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.focus-item-main,
.signal-row-main,
.activity-row-main {
  min-width: 0;
}
.focus-item-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.focus-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(124,111,205,.14);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.focus-title,
.signal-title,
.activity-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.focus-sub,
.signal-sub,
.activity-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.45;
}
.signal-row-value,
.activity-row-value {
  text-align: right;
  white-space: nowrap;
}
.signal-amount,
.activity-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.signal-meta,
.activity-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text3);
}
.module-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.summary-stat {
  padding: 16px 18px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018)),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.summary-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text3);
  margin-bottom: 8px;
}
.summary-stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--text);
}
.summary-stat-value.mono {
  font-family: 'JetBrains Mono', monospace;
}
.summary-stat-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text2);
}
.product-photo-preview {
  margin-top: 10px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  min-height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,.025);
  color: var(--text3);
}
.product-photo-preview img {
  width: 100%;
  height: 152px;
  object-fit: cover;
  display: block;
}
.product-photo-preview.is-empty {
  background: rgba(255,255,255,.02);
}
.record-thumb {
  width: 100%;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}
.record-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.relationship-layout {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}
.relationship-list-card {
  min-height: 420px;
}
.relationship-detail-slot {
  min-height: 160px;
}
.relationship-detail-slot .detail-card {
  margin-top: 0;
  position: sticky;
  top: 18px;
}
.signal-stack {
  display: grid;
  gap: 12px;
}
.signal-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.signal-card-main {
  min-width: 0;
}
.signal-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.signal-card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
}
.signal-card-value {
  text-align: right;
  white-space: nowrap;
}
.signal-card-value strong {
  display: block;
  font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.signal-card-value small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text3);
}

.user-list-shell {
  overflow: hidden;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child {
  border-bottom: none;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.calc-main-stack,
.calc-side-stack {
  display: grid;
  gap: 16px;
}

.calc-panel {
  padding: 18px;
}

.calc-sticky-panel {
  position: sticky;
  top: 24px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(124,111,205,.16), transparent 32%),
    linear-gradient(180deg, rgba(6,6,9,.96), rgba(12,10,18,.98));
}

body[data-theme="light"] .auth-screen {
  background:
    radial-gradient(circle at top, rgba(124,111,205,.12), transparent 34%),
    linear-gradient(180deg, rgba(249,246,252,.98), rgba(241,235,247,.98));
}

.auth-card {
  width: min(420px, 92vw);
  padding: 40px 42px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)), var(--surface);
  box-shadow: var(--shadow-md);
}

body[data-theme="light"] .auth-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,243,252,.96));
  border-color: rgba(62, 40, 92, .12);
}

.auth-head {
  text-align: center;
  margin-bottom: 28px;
}

.auth-kicker {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.auth-sub {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text3);
}

.auth-meta {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}

.modal-lead {
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
}

.utility-note {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text2);
}

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { border-bottom: 1px solid var(--border); }
th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: rgba(255,255,255,.035); }
body[data-theme="light"] tbody tr:hover { background: rgba(76, 42, 120, .05); }
.td-name { font-weight: 500; color: var(--text); }
.table-card table { font-size: 13px; }
.table-card thead tr { background: rgba(255,255,255,.02); }
body[data-theme="light"] .table-card thead tr { background: rgba(94, 46, 147, .03); }

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--accent-light); color: var(--accent-text); }
.badge-red { background: var(--danger-light); color: var(--danger-text); }
.badge-warn { background: var(--warn-light); color: var(--warn-text); }
.badge-info { background: var(--info-light); color: var(--info-text); }
.badge-gray { background: var(--badge-gray-bg); color: var(--text2); }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: rgba(255,255,255,.03);
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
  outline: none;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
body[data-theme="light"] .form-control,
body[data-theme="light"] .search-input {
  background: rgba(255,255,255,.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,111,205,.18);
}
select.form-control {
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text3) 50%),
    linear-gradient(135deg, var(--text3) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.form-control option {
  background: #111117;
  color: var(--text);
}
body[data-theme="light"] .form-control option {
  background: #ffffff;
  color: var(--text);
}
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3,3,5,.72);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
body[data-theme="light"] .modal-overlay {
  background: rgba(109, 74, 158, .18);
}
.modal-overlay.open { display: flex; }
.modal {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), #111117;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}
body[data-theme="light"] .modal {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248,243,252,.92)), #ffffff;
  border-color: rgba(62, 40, 92, .12);
  box-shadow: 0 28px 58px rgba(80, 52, 125, .18);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text3);
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  transition: color .1s;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* SEARCH BAR */
.search-wrap {
  position: relative;
  flex: 1;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 11px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,111,205,.14); }
body[data-theme="light"] .search-input,
body[data-theme="light"] .tab-btn,
body[data-theme="light"] .pos-toolbar-card,
body[data-theme="light"] .wa-chip,
body[data-theme="light"] .wa-message,
body[data-theme="light"] .pay-btn {
  background: rgba(255,255,255,.78);
  border-color: rgba(62, 40, 92, .12);
}
body[data-theme="light"] .wa-message,
body[data-theme="light"] .wa-chip {
  color: var(--text2);
}
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar-shell {
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.012)), var(--surface);
  box-shadow: var(--shadow);
}

.tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tab-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active {
  background: linear-gradient(135deg, rgba(124,111,205,.22), rgba(124,111,205,.28));
  color: var(--accent-text);
  border-color: rgba(124,111,205,.28);
}

/* DASHBOARD */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dash-list-row:last-child { border-bottom: none; }
.dash-list-name { color: var(--text); }
.dash-list-sub { font-size: 11px; color: var(--text3); }

/* POS */
.pos-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; height: calc(100vh - 88px); }
.pos-products { overflow-y: auto; }
.pos-mobile-summary { display: none; }
.pos-mobile-summary-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 4px;
}
.pos-mobile-summary-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  color: var(--text2);
}
.pos-mobile-summary-value strong {
  font-size: 18px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.pos-cat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin: 16px 0 8px;
}
.pos-toolbar-card {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015)), var(--surface);
  box-shadow: var(--shadow);
}
.pos-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) auto;
  gap: 10px;
  align-items: end;
}
.pos-toolbar-field {
  min-width: 0;
}
.pos-toolbar-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  margin-bottom: 6px;
}
.pos-toolbar-toggle .btn {
  min-width: 170px;
  justify-content: center;
}
.pos-browser-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.pos-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text2);
}
.pos-summary-pill strong {
  color: var(--text);
  font-weight: 700;
}
.pos-cat-label:first-child { margin-top: 0; }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prod-tile {
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
  user-select: none;
  position: relative;
}
.prod-tile:hover { border-color: var(--border2); box-shadow: var(--shadow); transform: translateY(-2px); }
.prod-tile.selected { border-color: var(--accent); background: var(--accent-light); }
.prod-tile.out-of-stock {
  opacity: .74;
  border-style: dashed;
}
.prod-tile-media {
  width: 100%;
  height: 116px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
}
.prod-tile-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.prod-tile.out-of-stock:hover {
  border-color: rgba(255,255,255,.14);
}
#pos-foto-global-popup {
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s;
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
  border: 1px solid var(--border2);
  background: var(--surface);
}
#pos-foto-global-popup.visible {
  opacity: 1;
}
#pos-foto-global-popup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.prod-tile.has-foto .prod-tile-name::after {
  content: ' ·';
  font-size: 10px;
  opacity: .35;
}
.prod-tile-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.prod-tile-sub { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.prod-tile-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.prod-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
  color: var(--text3);
  font-size: 10px;
  letter-spacing: .03em;
}
.prod-mini-chip.warn {
  color: #ffcf8d;
  border-color: rgba(255,191,71,.18);
  background: rgba(255,191,71,.08);
}
.prod-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.prod-tile-price { font-size: 14px; font-weight: 600; font-family: 'JetBrains Mono', monospace; color: #d7b3ff; }
.prod-tile-stock { float: right; font-size: 10px; color: var(--text3); }

.ticket-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ticket-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ticket-header-title { font-size: 13px; font-weight: 600; }
.ticket-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.ticket-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.ticket-item:last-child { border-bottom: none; }
.ticket-item-info { flex: 1; }
.ticket-item-name { font-weight: 500; color: var(--text); }
.ticket-item-sub { color: var(--text3); font-size: 11px; }
.ticket-item-price { font-weight: 600; font-family: 'JetBrains Mono', monospace; color: var(--text); white-space: nowrap; }
.ticket-remove { background: none; border: none; cursor: pointer; color: var(--text3); font-size: 16px; line-height: 1; padding: 0; transition: color .1s; }
.ticket-remove:hover { color: var(--danger); }
.ticket-footer { padding: 14px 16px; border-top: 1px solid var(--border); }
.ticket-subtotal { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; color: var(--text2); }
.ticket-total { display: flex; justify-content: space-between; font-size: 17px; font-weight: 600; font-family: 'JetBrains Mono', monospace; margin-bottom: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.ticket-footer .btn-primary { min-height: 46px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.pay-btn {
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface2);
  color: var(--text2);
  transition: all .12s;
  text-align: center;
}
.pay-btn:hover, .pay-btn.active { background: linear-gradient(135deg, rgba(124,111,205,.18), rgba(124,111,205,.26)); border-color: var(--accent); color: var(--accent-text); }
.empty-ticket {
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
}
.empty-ticket svg { margin: 0 auto 8px; display: block; opacity: .4; }
.empty-ticket p { font-size: 12px; }

/* CLIENTES */
.client-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.client-row:hover { background: var(--bg); }
.client-row:last-child { border-bottom: none; }
.client-name { font-size: 13px; font-weight: 500; }
.client-meta { font-size: 11px; color: var(--text3); }
.client-saldo { font-size: 13px; font-weight: 600; font-family: 'JetBrains Mono', monospace; margin-left: auto; }

/* HISTORIAL */
.hist-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  gap: 10px;
}
.hist-row:last-child { border-bottom: none; }
.hist-date { color: var(--text3); white-space: nowrap; min-width: 80px; }
.hist-desc { flex: 1; color: var(--text); }
.hist-amount { font-weight: 600; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

/* TOAST */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--text);
  color: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  max-width: 300px;
}
.toast.success { background: linear-gradient(135deg, var(--accent-strong), var(--accent)); }
.toast.error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* VARIANTE SELECTOR */
.variant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.variant-chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text2);
  transition: all .1s;
}
.variant-chip:hover, .variant-chip.selected { background: linear-gradient(135deg, var(--accent-strong), var(--accent)); border-color: var(--accent); color: #fff; }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.empty-state svg { margin: 0 auto 12px; display: block; opacity: .35; }
.empty-state h3 { font-size: 15px; font-weight: 500; color: var(--text2); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* DETAIL PANEL */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.detail-avatar-lg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,111,205,.2), rgba(124,111,205,.28));
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-name { font-size: 16px; font-weight: 600; }
.detail-sub { font-size: 12px; color: var(--text2); margin-top: 2px; }
.detail-actions { display: flex; gap: 8px; margin-bottom: 16px; }

/* CARDS */
.mobile-record-list {
  display: grid;
  gap: 12px;
}
.mobile-record-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.mobile-record-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.mobile-record-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.mobile-record-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}
.mobile-record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 12px;
}
.mobile-record-kv {
  min-width: 0;
}
.mobile-record-kv span {
  display: block;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 3px;
}
.mobile-record-kv strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}
.mobile-record-text {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  margin-bottom: 12px;
}
.mobile-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mobile-record-actions .btn {
  flex: 1 1 calc(50% - 4px);
  justify-content: center;
}

/* WHATSAPP HUB */
.wa-section {
  margin-bottom: 16px;
}
.wa-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.wa-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.wa-section-sub {
  font-size: 12px;
  color: var(--text3);
}
.wa-list {
  display: grid;
  gap: 12px;
}
.wa-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.wa-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.wa-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.wa-card-meta {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}
.wa-card-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.wa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  font-size: 11px;
  color: var(--text2);
}
.wa-message {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 12px;
}
.wa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wa-actions .btn {
  flex: 1 1 180px;
  justify-content: center;
}
.wa-campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.wa-campaign-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 12px;
}
.wa-campaign-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.wa-campaign-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.wa-campaign-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
}
.wa-campaign-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wa-campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wa-campaign-actions .btn {
  flex: 1 1 150px;
  justify-content: center;
}
.wa-campaign-preview {
  margin: 0;
  padding-left: 18px;
  color: var(--text2);
  font-size: 12px;
  display: grid;
  gap: 6px;
}
.wa-campaign-preview strong {
  color: var(--text);
}

/* PEDIDOS / RESERVAS */
.pr-list {
  display: grid;
  gap: 12px;
}
.pr-card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.pr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.pr-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.pr-sub {
  font-size: 12px;
  color: var(--text3);
  margin-top: 4px;
}
.pr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 12px;
}
.pr-kv span {
  display: block;
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 3px;
}
.pr-kv strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.pr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pr-actions .btn {
  flex: 1 1 170px;
  justify-content: center;
}

/* STOCK INDICATOR */
.stock-indicator { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.stock-dot { width: 7px; height: 7px; border-radius: 50%; }
.stock-dot.ok { background: var(--accent); }
.stock-dot.low { background: var(--warn); }
.stock-dot.out { background: var(--danger); }

/* SALDO PREVIEW */
.saldo-preview {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin: 12px 0;
}
.saldo-row { display: flex; justify-content: space-between; padding: 3px 0; }
.saldo-row.total { font-weight: 600; font-size: 14px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }

/* DECANT ML SELECTOR */
.ml-input-wrap { display: flex; align-items: center; gap: 8px; }
.ml-preset { padding: 5px 10px; border: 1px solid var(--border); border-radius: 20px; font-size: 12px; cursor: pointer; background: rgba(255,255,255,.05); color: var(--text2); transition: all .1s; }
.ml-preset:hover, .ml-preset.active { background: linear-gradient(135deg, var(--accent-strong), var(--accent)); border-color: var(--accent); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

/* WELCOME SCREEN */
#welcome-screen {
  position: fixed; inset: 0; background:
    radial-gradient(circle at top, rgba(124,111,205,.18), transparent 30%),
    linear-gradient(180deg, #040406, #08070d 55%, #050507 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; flex-direction: column; gap: 0;
}
.welcome-card {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)), rgba(12,12,18,.94); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px 44px;
  max-width: 460px; width: 90%; box-shadow: var(--shadow-md);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.welcome-card::before {
  content: '';
  position: absolute;
  inset: -20% auto auto 50%;
  width: 200px;
  height: 200px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(124,111,205,.22), transparent 68%);
  pointer-events: none;
}
.welcome-logo {
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(124,111,205,.26)); display: flex; align-items: center;
  justify-content: center; margin: 0 auto 18px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 14px 40px rgba(124,111,205,.24);
}
.welcome-title { font-size: 34px; font-weight: 700; letter-spacing: -.08em; margin-bottom: 8px; line-height: .95; }
.welcome-sub { font-size: 13px; color: var(--text2); margin-bottom: 28px; line-height: 1.6; }
.drop-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius);
  padding: 28px 20px; cursor: pointer; transition: all .15s;
  margin-bottom: 16px; background: rgba(255,255,255,.025);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent); background: rgba(124,111,205,.1);
}
.drop-zone svg { margin: 0 auto 10px; display: block; color: var(--text3); }
.drop-zone.drag-over svg { color: var(--accent); }
.drop-zone-label { font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 3px; }
.drop-zone-sub { font-size: 11px; color: var(--text3); }
.welcome-sep { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.welcome-sep::before, .welcome-sep::after { content:''; flex:1; height:1px; background:var(--border); }
.welcome-sep span { font-size: 11px; color: var(--text3); }

/* AUTOSAVE INDICATOR */
#autosave-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
  margin-right: 5px; vertical-align: middle;
  opacity: 0; transition: opacity .3s;
}
#autosave-dot.saving { opacity: 1; animation: pulse-dot .6s ease-in-out 3; }
@keyframes pulse-dot { 0%,100%{opacity:.3} 50%{opacity:1} }

@media (max-width: 980px) {
  .metrics-grid-dashboard,
  .module-summary-strip,
  .section-grid-dashboard,
  .section-grid-dashboard-compact,
  .relationship-layout,
  .calc-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-hero-card {
    grid-column: 1 / -1;
  }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  .sidebar { width: 200px; min-width: 200px; }
  .utility-grid { grid-template-columns: 1fr; }
  .utility-action-compact { grid-column: auto; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-sticky-panel { position: static; }
}

@media (max-width: 720px), (pointer: coarse) and (max-height: 560px) {
  .mobile-topbar,
  .mobile-bottom-nav { display: grid; }
  .mobile-topbar { display: flex; }
  body.mobile-nav-open .mobile-nav-backdrop { display: block; }
  .app {
    display: block;
    height: auto;
    min-height: 100vh;
    padding-top: 72px;
    padding-bottom: 94px;
    overflow: visible;
  }
  .sidebar {
    position: fixed;
    top: 72px;
    bottom: 90px;
    left: 0;
    width: min(86vw, 320px);
    min-width: min(86vw, 320px);
    z-index: 1200;
    transform: translateX(-104%);
    transition: transform .22s ease;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  body.mobile-nav-open .sidebar { transform: translateX(0); }
  .main {
    overflow: visible;
    min-height: calc(100vh - 166px);
  }
  .page { padding: 16px 14px 24px; }
  .page-header, .toolbar { flex-direction: column; align-items: stretch; }
  .page-header > div:last-child,
  .pos-header-actions { width: 100%; }
  .header-actions { justify-content: stretch; }
  .header-actions .btn { width: 100%; justify-content: center; }
  .dashboard-toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-popover-wrap {
    min-width: 0;
  }
  .dashboard-toolbar-btn {
    width: 100%;
    justify-content: center;
  }
  .dashboard-popover {
    right: 0;
    left: auto;
    width: min(100vw - 48px, 360px);
  }
  .pos-toolbar-grid { grid-template-columns: 1fr; }
  .pos-toolbar-toggle .btn { width: 100%; min-width: 0; }
  .page-title { font-size: 28px; }
  .card { padding: 16px; border-radius: 18px; }
  .btn, .form-control, .search-input { min-height: 44px; font-size: 14px; }
  .btn-sm { min-height: 40px; padding: 8px 12px; }
  .table-wrap { margin: 0 -4px; padding-bottom: 4px; }
  table { min-width: 640px; }
  .dash-grid, .metrics-grid, .metrics-grid-dashboard, .module-summary-strip, .section-grid-dashboard, .section-grid-dashboard-compact, .relationship-layout, .calc-shell, .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .quick-actions-grid { grid-template-columns: 1fr; }
  .utility-grid { grid-template-columns: 1fr; }
  .utility-dock {
    left: 12px;
    right: 12px;
    bottom: calc(100% - 2px);
    max-height: min(58vh, 420px);
  }
  .sidebar-footer {
    padding: 10px 12px 12px;
  }
  .section-panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-toggle-btn {
    align-self: flex-end;
  }
  .signal-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .signal-card-value {
    width: 100%;
    text-align: left;
  }
  .relationship-detail-slot .detail-card { position: static; }
  .user-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .user-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pos-products {
    overflow: visible;
  }
  .pos-mobile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02)), var(--surface);
    box-shadow: var(--shadow);
  }
  .prod-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .prod-tile {
    padding: 14px;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .prod-tile-name { font-size: 13px; }
  .prod-tile-sub { font-size: 12px; }
  .prod-tile-price { font-size: 16px; }
  .ticket-panel {
    position: relative;
    overflow: hidden;
  }
  .ticket-header,
  .ticket-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .ticket-body {
    max-height: 42vh;
    padding-left: 14px;
    padding-right: 14px;
  }
  .ticket-item {
    gap: 10px;
    padding: 10px 0;
  }
  .ticket-item-price { font-size: 14px; }
  .pay-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pay-btn {
    min-height: 44px;
    padding: 10px 6px;
  }
  #page-ventas .toolbar > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #page-ventas .toolbar > div:last-child span {
    display: none;
  }
  #page-ventas .toolbar > div:last-child .btn {
    grid-column: 1 / -1;
  }
  #page-ventas .toolbar input[type="date"] {
    width: 100% !important;
  }
  .toolbar > * { width: 100% !important; }
  .modal {
    width: calc(100% - 18px);
    max-width: none;
    max-height: calc(100vh - 18px);
    border-radius: 22px;
  }
  .modal-body, .modal-footer, .modal-header { padding-left: 16px; padding-right: 16px; }
  #modal-confirmar-venta .modal {
    width: calc(100% - 12px);
    min-height: calc(100vh - 12px);
    max-height: calc(100vh - 12px);
    display: flex;
    flex-direction: column;
  }
  #modal-confirmar-venta .modal-body {
    flex: 1;
    overflow-y: auto;
  }
  #modal-confirmar-venta .modal-footer {
    justify-content: stretch;
    flex-direction: column-reverse;
  }
  #modal-confirmar-venta .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
  #pago-parcial-section .form-row.cols-2 {
    grid-template-columns: 1fr;
  }
  .mobile-record-grid { grid-template-columns: 1fr 1fr; }
  .wa-card-top,
  .wa-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .wa-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }
  .wa-campaign-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }
  .tabs-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tab-btn {
    text-align: center;
  }
  .pr-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .pr-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pr-actions .btn {
    flex: 1 1 calc(50% - 4px);
  }
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .detail-header > div:last-child {
    width: 100%;
    text-align: left !important;
  }
  .detail-actions {
    flex-wrap: wrap;
  }
  .detail-actions .btn {
    flex: 1 1 calc(50% - 4px);
    margin-left: 0 !important;
    justify-content: center;
  }
  .app-version {
    right: 14px;
    bottom: 92px;
    font-size: 10px;
  }
  .welcome-card { padding: 28px 22px; }
}

/* LOGIN SCREEN */
#login-screen { display: none; }
#login-screen.open { display: flex; }



/* =============================================
   CAJA — Estilos
   ============================================= */
.caja-fecha-group {
  margin-bottom: 20px;
}
.caja-fecha-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.caja-fecha-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.caja-fecha-neto {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
}
.caja-mov-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-soft, rgba(255,255,255,.04));
}
.caja-mov-row:last-child { border-bottom: none; }
.caja-mov-icono {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.caja-icono-in {
  background: rgba(34,197,94,.15);
  color: #22c55e;
}
.caja-icono-out {
  background: rgba(239,68,68,.15);
  color: #ef4444;
}
.caja-mov-info {
  flex: 1;
  min-width: 0;
}
.caja-mov-desc {
  font-size: 13px;
  font-weight: 500;
  color: var(--text1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.caja-mov-meta {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.caja-mov-monto {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.caja-monto-in { color: var(--accent, #b97dff); }
.caja-monto-out { color: var(--danger, #ef4444); }

/* metric-clickable: tarjeta de metrica clickable */
.metric-clickable {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.metric-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.metric-clickable:active {
  transform: translateY(0);
}
