/* ============================================================
   Kachiball — Componentes compartidos (UI kit en CSS)
   FUENTE ÚNICA de los componentes de las apps web (dashboard, admin).
   Importar DESPUÉS de fonts.css y colors_and_type.css:
     <link rel="stylesheet" href="/brand/fonts/fonts.css">
     <link rel="stylesheet" href="/brand/colors_and_type.css">
     <link rel="stylesheet" href="/brand/components.css">
   Reglas: usa solo tokens (var(--...)). No duplicar estos estilos por app.
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body-m);
  -webkit-font-smoothing: antialiased;
}
button {
  font-family: var(--font-body);
}

/* Logo (sin aplastar) */
.logo {
  display: block;
  width: auto;
  object-fit: contain;
}

/* ───────── Botones ───────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body-s);
  cursor: pointer;
  white-space: nowrap;
  transition:
    filter var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}
.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--color-brand-orange);
}
.btn-ghost {
  background: transparent;
  color: var(--orange-700);
}
.btn-danger {
  background: var(--danger-500);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.05);
}
.btn-sm {
  height: 36px;
  padding: 0 12px;
  font-size: var(--fs-caption);
}
/* Botón solo-icono: cuadrado y centrado (no se ve apretado) */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

/* Grupo de acciones en filas/cards — separación consistente */
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3); /* 12px: aire suficiente entre acciones */
  flex-wrap: wrap;
}

/* ───────── Inputs ───────── */
.input,
.select {
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body-m);
}
.input:focus-visible,
.select:focus-visible {
  outline: none;
  border-color: var(--color-brand-orange);
  box-shadow: 0 0 0 4px rgba(237, 107, 29, 0.18);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

/* ───────── Login ───────── */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(237, 107, 29, 0.1), transparent),
    var(--bg);
}
.login {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
}
.login .logo {
  height: 40px;
  margin-bottom: 4px;
}
.login h1 {
  margin: 0 0 4px;
}
.login .sub {
  margin: -6px 0 6px;
  color: var(--fg-secondary);
  font-size: var(--fs-body-s);
}

/* ───────── App shell ───────── */
.app {
  display: flex;
  min-height: 100dvh;
}
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
/* Variante oscura (admin): herramienta interna */
.sidebar.dark {
  background: var(--neutral-900);
  border-right-color: #2a2a2a;
}
.sidebar.dark .name {
  color: #fff;
}
.sidebar.dark .role,
.sidebar.dark .nav-item {
  color: var(--neutral-400);
}
.sidebar.dark .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sidebar.dark .nav-item.active {
  background: rgba(237, 107, 29, 0.16);
  color: var(--orange-400);
}
.sidebar.dark .sidebar-foot {
  border-top-color: #2a2a2a;
}
.sidebar.dark .venue-meta .vn {
  color: #fff;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 22px;
}
.sidebar-brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.sidebar-brand .name {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 15px;
  line-height: 1;
}
.sidebar-brand .role {
  font-size: 11px;
  color: var(--fg-secondary);
  margin-top: 2px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
}
.nav-item:hover {
  background: var(--surface-3);
}
.nav-item.active {
  background: var(--orange-50);
  color: var(--orange-700);
  font-weight: var(--fw-semibold);
}
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.venue-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: var(--fw-bold);
  font-family: var(--font-display);
  font-size: 14px;
}
.venue-meta {
  flex: 1;
  min-width: 0;
}
.venue-meta .vn {
  font-size: 13.5px;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.venue-meta .vr {
  font-size: 11px;
  color: var(--fg-secondary);
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar h1 {
  margin: 0;
  font-size: 24px;
}
.topbar .sub {
  color: var(--fg-secondary);
  font-size: 14px;
  margin-top: 2px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.content {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ───────── Stat cards ───────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--orange-50);
  color: var(--orange-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
  font-size: 30px;
  margin-top: 12px;
  letter-spacing: -0.01em;
}

/* ───────── Cards ───────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  margin: 0;
  font-size: 16px;
}
.card-body {
  padding: 20px;
}

/* ───────── Tablas ───────── */
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  padding: 10px 20px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-secondary);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table td.num {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
}
.table tr:last-child td {
  border-bottom: none;
}
/* Columna de acciones: alineada a la derecha, sin que se peguen */
.table th:last-child,
.table td:last-child {
  text-align: right;
}
.table td:last-child .row-actions {
  justify-content: flex-end;
}

/* ───────── Badges ───────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: var(--fw-semibold);
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.ok,
.badge.active,
.badge.confirmed,
.badge.available {
  background: var(--success-50);
  color: var(--success-600);
}
.badge.pending {
  background: var(--warning-50);
  color: var(--warning-600);
}
.badge.bad,
.badge.cancelled,
.badge.rejected,
.badge.suspended {
  background: var(--danger-50);
  color: var(--danger-600);
}

/* ───────── Helpers ───────── */
.muted {
  color: var(--fg-tertiary);
  font-size: var(--fs-body-s);
}
.hint {
  color: var(--info-600);
  font-size: var(--fs-body-s);
  margin: 0;
}
.error {
  color: var(--danger-500);
  font-size: var(--fs-body-s);
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--fg-tertiary);
}

@media (max-width: 720px) {
  .sidebar {
    display: none;
  }
}
