:root {
  --color-bg: #0a0a0a;
  --color-surface: #111111;
  --color-border: #c5a059;
  --color-primary: #c5a059;
  --color-primary-soft: rgba(197, 160, 89, 0.1);
  --color-gold-dark: #a07d3a;
  --color-text: #ffffff;
  --color-text-muted: rgba(255, 255, 255, 0.55);
  --color-success-bg: #0d2818;
  --color-success: #86efac;
  --color-error-bg: #2a0a0a;
  --color-error: #fecaca;
  --radius-md: 0.5rem;
  --radius-full: 999px;
  --shadow-soft: 0 24px 48px rgba(0, 0, 0, 0.55);
  --spacing: 1rem;
  --font-sans: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
}

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

body.app-body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  background: radial-gradient(ellipse 120% 80% at 50% 0%, #141414 0%, var(--color-bg) 55%);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

body.auth-body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout principal */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #020617;
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  border-right: 1px solid rgba(198, 167, 94, 0.3);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.sidebar__brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: 2px;
}

.sidebar__brand-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.85rem;
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease,
    background-color 0.25s ease;
}

.nav-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: rgba(197, 160, 89, 0.85);
}

.nav-link__icon svg {
  width: 100%;
  height: 100%;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(197, 160, 89, 0.04);
  border-color: rgba(197, 160, 89, 0.2);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.08), 0 0 28px rgba(197, 160, 89, 0.12);
}

.nav-link:hover .nav-link__icon {
  color: var(--color-primary);
}

.nav-link--active {
  background: rgba(197, 160, 89, 0.07);
  border-color: rgba(197, 160, 89, 0.35);
  color: var(--color-primary);
  box-shadow: 0 0 32px rgba(197, 160, 89, 0.1);
}

.nav-link--active .nav-link__icon {
  color: var(--color-primary);
}

.sidebar__footer {
  margin-top: auto;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.sidebar__footer-copy {
  margin-top: 0.75rem;
}

.layout__main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid rgba(197, 160, 89, 0.18);
  background: linear-gradient(180deg, #0d0d0d 0%, #0a0a0a 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(197, 160, 89, 0.25);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.topbar__menu-toggle:hover {
  border-color: rgba(197, 160, 89, 0.45);
  color: var(--color-primary);
  box-shadow: 0 0 20px rgba(197, 160, 89, 0.15);
}

.topbar__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.topbar__title {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.topbar__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.topbar__subtitle--row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.topbar__edit-perfil {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(197, 160, 89, 0.95);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(197, 160, 89, 0.35);
  background: rgba(197, 160, 89, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.topbar__edit-perfil:hover {
  color: #fff;
  border-color: rgba(197, 160, 89, 0.55);
  background: rgba(197, 160, 89, 0.12);
}

.main-content {
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Auth layout */
.auth-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-card {
  background: var(--color-surface);
  border-radius: 0.75rem;
  border: 1px solid rgba(198, 167, 94, 0.6);
  box-shadow: var(--shadow-soft);
  width: 100%;
  max-width: 420px;
  padding: 2.2rem 2rem;
}

.auth-card__header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-card__brand {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.auth-card__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Cards */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(197, 160, 89, 0.22);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem 1.3rem;
  margin-bottom: 1rem;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.card__header--between {
  gap: 1rem;
}

.card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.card__subtitle {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.card__body {
  margin-top: 0.75rem;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.card__value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  margin: 0.3rem 0 0;
  color: rgba(255, 255, 255, 0.96);
}

.card__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
}

/* Grid helpers */
.grid {
  display: grid;
  gap: 1rem;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card--metric {
  margin-bottom: 0;
}

.dashboard-chart-wrap {
  position: relative;
  height: 180px;
  width: 100%;
  margin-top: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.05s ease, border-color 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-gold-dark));
  border-color: transparent;
  color: #0a0a0a;
  font-weight: 700;
  box-shadow: 0 0 28px rgba(197, 160, 89, 0.22);
}

.btn--primary:hover {
  box-shadow: 0 0 40px rgba(197, 160, 89, 0.38);
  transform: translateY(-1px);
}

.btn--gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-gold-dark));
  border: 1px solid transparent;
  color: #0a0a0a;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  padding: 0.65rem 1.25rem;
  border-radius: 2px;
  box-shadow: 0 0 32px rgba(197, 160, 89, 0.28);
  text-decoration: none;
  transition: box-shadow 0.25s ease, transform 0.2s ease, filter 0.2s ease;
}

.btn--gold:hover {
  box-shadow: 0 0 48px rgba(197, 160, 89, 0.45);
  transform: translateY(-2px);
  filter: brightness(1.03);
  text-decoration: none;
}

.btn--outline {
  border-color: rgba(197, 160, 89, 0.45);
  color: var(--color-primary);
  background: transparent;
}

.btn--outline:hover {
  background: rgba(197, 160, 89, 0.08);
  box-shadow: 0 0 24px rgba(197, 160, 89, 0.12);
}

.btn--ghost {
  border-color: transparent;
  color: rgba(255, 255, 255, 0.55);
}

.btn--ghost:hover {
  color: var(--color-primary);
  background: rgba(197, 160, 89, 0.06);
  box-shadow: 0 0 20px rgba(197, 160, 89, 0.08);
}

.btn--danger {
  border-color: #f97373;
  color: #fecaca;
}

.btn--danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.btn--sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.w-100 {
  width: 100%;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(197, 160, 89, 0.22);
  background: #0a0a0a;
  color: var(--color-text);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(197, 160, 89, 0.55);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.25), 0 0 20px rgba(197, 160, 89, 0.08);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(198, 167, 94, 0.3);
}

.table thead {
  background: rgba(10, 10, 10, 0.98);
  border-bottom: 1px solid rgba(197, 160, 89, 0.25);
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.85rem;
}

.table th {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.table tbody tr:nth-child(odd) {
  background: rgba(17, 17, 17, 0.85);
}

.table tbody tr:nth-child(even) {
  background: rgba(12, 12, 12, 0.95);
}

.table__actions {
  white-space: nowrap;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--color-text-muted);
}

/* Tablas estilo landing (inventario / métricas) */
.lux-table {
  width: 100%;
  border-collapse: collapse;
  color: #ffffff;
  font-size: 0.85rem;
}

.lux-table th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: #111111;
  color: #c5a059;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  border-bottom: 1px solid #242424;
}

.lux-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #242424;
}

.lux-table tbody tr:hover {
  background: rgba(197, 160, 89, 0.04);
}

/* Flash messages */
.flash-container {
  margin-bottom: 1rem;
}

.alert {
  padding: 0.65rem 0.75rem;
  border-radius: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.alert--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.alert--error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.alert--info {
  background: rgba(197, 160, 89, 0.12);
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(197, 160, 89, 0.28);
}

.alert__close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.badge--success {
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 20;
    transition: left 0.2s ease;
  }

  .sidebar--open {
    left: 0;
  }

  .layout__main {
    margin-left: 0;
  }

  .topbar__menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .auth-card {
    padding: 1.8rem 1.5rem;
  }

  .topbar__title {
    font-size: 0.95rem;
  }
}
/* Tarjetas de resumen del dashboard (Clientes / Citas / Servicios) */
.grid--3 .card.card--interactive {
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.25s ease;
  border: 1px solid rgba(197, 160, 89, 0.42);
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #121212 0%, #0e0e0e 100%);
}

.grid--3 .card.card--interactive::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 0 rgba(197, 160, 89, 0);
  transition: box-shadow 0.3s ease;
}

.grid--3 .card.card--interactive:hover {
  transform: translateY(-3px);
  border-color: rgba(197, 160, 89, 0.75);
  box-shadow: 0 0 0 1px rgba(197, 160, 89, 0.15), 0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 36px rgba(197, 160, 89, 0.14);
}

.grid--3 .card.card--interactive:hover::after {
  box-shadow: inset 0 0 48px rgba(197, 160, 89, 0.06);
}

.card__value--highlight {
  color: var(--color-primary);
  font-weight: 600;
  text-shadow: 0 0 24px rgba(197, 160, 89, 0.25);
}

.card--interactive .card__label {
  transition: color 0.3s ease;
}

.card--interactive:hover .card__label {
  color: rgba(255, 255, 255, 0.82);
}

/* KPI CARDS MEJORADAS */
.kpi-card {
  padding: 28px !important;
  min-height: 120px !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
  margin-bottom: 4px !important;
}
.kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a07d3a, #c5a059);
}
.kpi-card:hover {
  border-color: rgba(197,160,89,0.4) !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 
              0 0 40px rgba(197,160,89,0.08) !important;
  background: linear-gradient(135deg, 
              rgba(197,160,89,0.07), #1a1a1a) !important;
}
.grid--4 {
  gap: 20px !important;
}

.grid--4 {
  margin-bottom: 32px !important;
}

