/* ==========================================================================
   Stezify — Design System v4 · "Bosque"
   Crema cálido + verde bosque profundo + esmeralda
   Display: Fraunces (serif) · Texto: Hanken Grotesk
   ========================================================================== */

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

:root {
  /* Brand */
  --primary:        #0E9D63;   /* esmeralda (botones, acentos) */
  --primary-dark:   #0B7A4F;   /* hover */
  --primary-light:  #0E9D63;   /* verde legible como texto sobre claro */
  --primary-soft:   rgba(25, 195, 125, 0.12);
  --primary-glow:   rgba(25, 195, 125, 0.22);
  --primary-bright: #19C37D;   /* esmeralda viva (detalles, sidebar) */

  --accent:         #0B7A4F;   /* acentos secundarios */
  --accent-soft:    rgba(11, 122, 79, 0.10);

  --forest:         #0B241B;   /* verde bosque profundo (sidebar) */
  --forest-2:       #123227;

  /* Surfaces (crema) */
  --bg:             #F7F2E8;   /* fondo base crema */
  --bg-elevated:    #ffffff;
  --bg-card:        #ffffff;   /* tarjetas */
  --bg-card-hover:  #F3EDDF;
  --bg-input:       #FBF8F1;
  --bg-soft:        rgba(19, 32, 25, 0.05); /* fondos sutiles (kanban, barras) */
  --bg-overlay:     rgba(11, 36, 27, 0.5);

  /* Text */
  --text:           #132019;
  --text-muted:     #5E6B63;
  --text-dim:       #8F998F;

  /* Border */
  --border:         #E5DCC9;
  --border-strong:  #D3C8AE;
  --border-focus:   var(--primary);

  /* Status */
  --success:        #0E9D63;
  --success-soft:   rgba(25, 195, 125, 0.12);
  --danger:         #dc2626;
  --danger-soft:    rgba(220, 38, 38, 0.08);
  --warning:        #d97706;
  --warning-soft:   rgba(217, 119, 6, 0.10);
  --info:           #0284c7;
  --info-soft:      rgba(2, 132, 199, 0.10);

  /* Radius */
  --radius-sm:      7px;
  --radius:         11px;
  --radius-lg:      16px;
  --radius-xl:      22px;

  /* Shadow */
  --shadow-sm:      0 1px 2px rgba(19, 32, 25, 0.05);
  --shadow:         0 4px 14px rgba(19, 32, 25, 0.07);
  --shadow-lg:      0 14px 36px rgba(19, 32, 25, 0.12);
  --shadow-glow:    0 0 0 4px var(--primary-glow);

  /* Type */
  --font-body:      'Hanken Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display:   'Fraunces', Georgia, serif;

  /* Misc */
  --sidebar-w:      264px;
  --transition:     150ms cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top left, rgba(25, 195, 125, 0.05), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(217, 169, 78, 0.05), transparent 50%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ==========================================================================
   Layout
   ========================================================================== */

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

.sidebar {
  /* Verde bosque profundo: las variables se re-mapean aqui para que los
     widgets con estilos inline (creditos, footer) sigan legibles en oscuro. */
  --text:           #F7F2E8;
  --text-muted:     #9DB3A6;
  --text-dim:       #7A9284;
  --border:         rgba(247, 242, 232, 0.13);
  --border-strong:  rgba(247, 242, 232, 0.22);
  --bg-soft:        rgba(247, 242, 232, 0.07);
  --bg-card:        rgba(247, 242, 232, 0.06);
  --bg-card-hover:  rgba(247, 242, 232, 0.09);
  --bg-input:       rgba(247, 242, 232, 0.07);
  --primary-dark:   #2BD68C;
  --primary-light:  #19C37D;

  width: var(--sidebar-w);
  background: var(--forest);
  color: var(--text);
  border-right: none;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  letter-spacing: -0.02em;
}

.sidebar-logo::before {
  content: '';
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--primary-bright);
  flex-shrink: 0;
  -webkit-mask: none;
  clip-path: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='1' y='1' width='38' height='38' rx='12' fill='%2319C37D'/%3E%3Cpath d='M20 8 l3 7.5 7.5 3 -7.5 3 -3 7.5 -3 -7.5 -7.5 -3 7.5 -3 Z' fill='%230B241B'/%3E%3C/svg%3E");
  background-size: cover;
}

.sidebar-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
  padding: 0 12px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  user-select: none;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-bright);
  color: var(--forest);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(25, 195, 125, 0.25);
}

.nav-item.active::before {
  content: none;
}

.nav-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  max-width: 1280px;
  width: calc(100% - var(--sidebar-w));
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--text);
}

.page-desc {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 13.5px;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ==========================================================================
   Stats
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-bright), var(--accent));
  opacity: 0.8;
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-value.success { color: var(--success); }
.stat-value.primary { color: var(--primary-dark); }
.stat-value.warning { color: var(--warning); }

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glow);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  font-weight: 600;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  font-weight: 600;
}
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
  background: #ffffff;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.form-input, .form-select, .form-textarea, select.form-input, input.form-input {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  line-height: 1.4;
}

.form-input::placeholder { color: var(--text-dim); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
select.form-input:focus,
input.form-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-input:hover:not(:focus) { border-color: var(--text-dim); }

.form-textarea { resize: vertical; min-height: 80px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235b6b62' stroke-width='2'%3e%3cpath d='M1 1l5 5 5-5'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  line-height: 1.4;
}

.badge-success {
  background: var(--success-soft);
  color: var(--primary-dark);
  border-color: rgba(22, 163, 74, 0.25);
}
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
}
.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.25);
}
.badge-primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(22, 163, 74, 0.25);
}

/* ==========================================================================
   Integration cards
   ========================================================================== */

.integration-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: var(--transition);
}

.integration-card:hover { border-color: var(--border-strong); }

.integration-info { display: flex; align-items: center; gap: 14px; }
.integration-icon {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  border-radius: 8px;
}
.integration-name { font-weight: 600; font-size: 14px; }
.integration-status { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ==========================================================================
   Scenario selector
   ========================================================================== */

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.scenario-card {
  padding: 24px 22px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.scenario-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  background: radial-gradient(circle at top right, var(--primary-soft), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition);
}

.scenario-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.scenario-card:hover::after { opacity: 1; }

.scenario-card.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-soft) 0%, #ffffff 70%);
}

.scenario-icon {
  font-size: 28px;
  margin-bottom: 12px;
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* Calendario mensual */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-head {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 6px 0;
}
.cal-cell {
  min-height: 84px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  overflow: hidden;
}
.cal-empty { background: transparent; border: none; }
.cal-day { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.cal-ev {
  font-size: 10px;
  background: var(--bg-soft);
  border-radius: 3px;
  padding: 2px 4px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Account type selector (registro) */
.acct-type-card {
  padding: 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.acct-type-card:hover { border-color: var(--border-strong); }
.acct-type-card.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.scenario-name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.scenario-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

thead tr {
  background: #F3EDDF !important;
}

th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr { transition: background-color var(--transition); }
tbody tr:hover td { background: var(--bg-card-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ==========================================================================
   Conversations
   ========================================================================== */

.chat-list {
  max-height: 600px;
  overflow-y: auto;
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
  transition: var(--transition);
}

.chat-contact:hover { background: var(--bg-card-hover); }
.chat-contact.active {
  background: var(--primary-soft);
  border: 1px solid rgba(22, 163, 74, 0.25);
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-bright) 0%, var(--accent) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-name { font-weight: 600; font-size: 13.5px; }
.chat-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  margin-top: 2px;
}

.messages-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding: 18px;
  background: #eef3ee; /* tipo fondo de chat WhatsApp */
  border-radius: var(--radius);
}

.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.msg-user {
  background: #d9fdd3; /* burbuja verde clara estilo WhatsApp */
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.msg-assistant {
  background: #ffffff;
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.msg-time {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(25, 195, 125, 0.12), transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(11, 36, 27, 0.10), transparent 50%),
    var(--bg);
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.auth-box::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-bright), transparent);
  opacity: 0.8;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-title::before {
  content: '';
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Crect x='1' y='1' width='38' height='38' rx='12' fill='%2319C37D'/%3E%3Cpath d='M20 8 l3 7.5 7.5 3 -7.5 3 -3 7.5 -3 -7.5 -7.5 -3 7.5 -3 Z' fill='%230B241B'/%3E%3C/svg%3E");
  background-size: cover;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.auth-link {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link a {
  color: var(--primary-dark);
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
}
.auth-link a:hover { color: var(--primary); }

/* ==========================================================================
   Alert
   ========================================================================== */

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-error {
  background: var(--danger-soft);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.25);
}

.alert-success {
  background: var(--success-soft);
  color: var(--primary-dark);
  border-color: rgba(22, 163, 74, 0.3);
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 540px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.18s ease;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Scrollbar
   ========================================================================== */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
  transition: background var(--transition);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ==========================================================================
   Helpers
   ========================================================================== */

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

code, .mono { font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 968px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main {
    margin-left: 0;
    width: 100%;
    padding: 18px;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .scenario-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr }
  .auth-box { padding: 24px; }
  .main { padding: 14px; }
  .card { padding: 16px; }
}

/* ===== Secciones plegables de formularios largos (p.ej. Crear puesto) ===== */
.form-sec {
  border: 1px solid var(--border); border-radius: 10px;
  margin: 10px 0; background: var(--bg-card, #fff);
}
.form-sec > summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 11px 14px; font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; gap: 8px;
}
.form-sec > summary::-webkit-details-marker { display: none; }
.form-sec > summary::after {
  content: '\25BE'; margin-left: auto; color: var(--text-muted);
  transition: transform .15s ease; font-size: 12px;
}
.form-sec[open] > summary::after { transform: rotate(180deg); }
.form-sec > summary:hover { color: var(--primary-dark, var(--primary)); }
.form-sec[open] > summary { border-bottom: 1px solid var(--border); }
.form-sec .form-sec-hint { font-weight: 400; font-size: 11.5px; color: var(--text-muted); }
.form-sec .form-sec-body { padding: 12px 14px; }

/* ===== Menu desplegable de acciones (tablas del superadmin) ===== */
.row-menu { position: relative; display: inline-block; }
.row-menu summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 5px 13px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; font-weight: 700; background: var(--bg-card, #fff); line-height: 1.2;
}
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu summary:hover, .row-menu[open] summary { border-color: var(--primary); color: var(--primary-dark); }
.row-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16); min-width: 190px; padding: 5px;
  display: flex; flex-direction: column; gap: 1px; text-align: left;
}
.row-menu-list button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer;
  font-family: inherit; color: inherit; white-space: nowrap;
}
.row-menu-list button:hover { background: var(--bg-soft); }
