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

:root {
  --bg:           #0D1117;
  --bg2:          #161B22;
  --yellow:       #E8F03A;
  --blue:         #4B9FE1;
  --text:         #F0F6FC;
  --text-muted:   #8B949E;
  --border:       #30363D;
  --error:        #F85149;
  --success:      #3FB950;
  --radius:       12px;
  --shadow:       0 1px 3px rgba(0,0,0,0.4);

  /* Aliases usados por clases referenciadas en JS */
  --primary:        #4B9FE1;
  --primary-dark:   #3a8fd1;
  --primary-light:  rgba(75,159,225,0.12);
  --success-light:  rgba(63,185,80,0.15);
  --danger:         #F85149;
  --danger-light:   rgba(248,81,73,0.15);
  --warning:        #E8F03A;
  --warning-light:  rgba(232,240,58,0.12);
  --card:           #161B22;
}

html { color-scheme: dark; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════
   AUTH PAGE
═══════════════════════════════════════ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* ── Logo ── */
.auth-logo { text-align: center; }

.auth-logo-icon {
  color: var(--yellow);
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.auth-logo-name {
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1.1;
}

.auth-logo-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── Card ── */
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
}

.auth-body { padding: 1.75rem; }

/* ── Tabs (sin uso activo pero mantenidas) ── */
.auth-tabs { display: flex; border-bottom: 1px solid var(--border); }

.auth-tab {
  flex: 1;
  padding: .85rem;
  background: none;
  border: none;
  font-size: .95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
  border-bottom: 2px solid transparent;
}

.auth-tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }

.auth-form { display: none; }
.auth-form.active { display: block; }

/* ── Separador en formulario de login ── */
.login-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0 0.25rem;
}

/* ── Enlace entre login y registro ── */
.auth-switch {
  text-align: center;
  margin-top: 1rem;
  font-size: .87rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.auth-switch a:hover { text-decoration: underline; }

.auth-switch a.yellow { color: var(--yellow); }

/* ── Variante prominente para el link de registro ── */
.auth-switch-prominent {
  color: var(--text);
  font-size: .95rem;
  margin-top: .6rem;
}

.auth-switch-prominent a.yellow {
  font-size: 1rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════
   FORM ELEMENTS
═══════════════════════════════════════ */
.form-group { margin-bottom: 1.1rem; }

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="email"] {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder { color: var(--text-muted); opacity: 1; }

input[type="date"] { color-scheme: dark; }

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(75,159,225,0.18);
}

/* Monoespaciado para RUT, PIN y OTP */
#login-rut,
#reg-rut,
#forgot-rut,
#pin-input,
#pin-confirm {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 0.04em;
}

.input-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .3rem;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  min-height: 44px;
  font-family: inherit;
}

.btn-primary {
  background: var(--yellow);
  color: #0D1117;
  width: 100%;
}

.btn-primary:hover { background: #d4da34; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary .spinner {
  border-color: rgba(13,17,23,0.3);
  border-top-color: #0D1117;
}

.btn-success { background: var(--success); color: #0D1117; }
.btn-success:hover { filter: brightness(.92); }

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1.5px solid rgba(248,81,73,0.4);
}
.btn-danger:hover { background: rgba(248,81,73,0.1); border-color: var(--error); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); background: rgba(240,246,252,0.05); }

.btn-register {
  background: transparent;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  width: 100%;
  margin-top: 12px;
}
.btn-register:hover { background: rgba(232,240,58,0.08); }

.btn-sm { padding: .4rem .75rem; font-size: .82rem; min-height: 36px; }

/* ═══════════════════════════════════════
   ALERTS
═══════════════════════════════════════ */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 1rem;
  display: none;
  border: 1px solid transparent;
}

.alert.visible { display: block; }

.alert-error {
  background: rgba(248,81,73,0.1);
  color: #ff8585;
  border-color: rgba(248,81,73,0.25);
}

.alert-success {
  background: rgba(63,185,80,0.1);
  color: var(--success);
  border-color: rgba(63,185,80,0.25);
}

/* ═══════════════════════════════════════
   SPINNER
═══════════════════════════════════════ */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════ */
.dashboard-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

/* ── Sidebar (desktop) ── */
.sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 20;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 1.25rem 1.1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar-logo-icon { color: var(--yellow); flex-shrink: 0; }

.sidebar-logo-text {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.04em;
  color: var(--text);
}

.sidebar-nav {
  padding: 0.75rem 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(240,246,252,0.04);
  border-left-color: var(--border);
}

.sidebar-link.active {
  color: var(--text);
  background: #1F2937;
  border-left-color: var(--yellow);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1.1rem;
}

.sidebar-service {
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
}

.sidebar-service-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.sidebar-service-number {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--blue);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Dashboard main ── */
.dashboard-main {
  flex: 1;
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ── */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
  color: var(--text);
}

.navbar-brand-icon { color: var(--yellow); }

.navbar-user {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
  color: var(--text-muted);
  margin-left: auto;
}

.rut-badge {
  background: rgba(75,159,225,0.1);
  color: var(--blue);
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid rgba(75,159,225,0.2);
}

.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  flex: 1;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.15s ease;
}

.card-header {
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--text);
}

.card-body { padding: 1.4rem; }

/* ── Secciones SPA — ocultas por defecto, showSection() activa la elegida ── */
.dashboard-section { display: none; }

/* ── Service phone card ── */
.service-card { border-left: 3px solid var(--blue) !important; }

#service-phone {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════
   PIN SECTION
═══════════════════════════════════════ */
.pin-status {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.1rem;
  font-size: .92rem;
  font-weight: 500;
  border: 1px solid;
}

.pin-status.has-pin {
  background: rgba(63,185,80,0.08);
  color: var(--success);
  border-color: rgba(63,185,80,0.2);
}

.pin-status.no-pin {
  background: rgba(232,240,58,0.06);
  color: var(--yellow);
  border-color: rgba(232,240,58,0.18);
}

.pin-form { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.pin-form .form-group { margin-bottom: 0; flex: 1; min-width: 130px; }

/* ═══════════════════════════════════════
   CONTACTS
═══════════════════════════════════════ */
.contacts-counter {
  font-size: .83rem;
  color: var(--text-muted);
  background: rgba(240,246,252,0.05);
  padding: .25rem .65rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.contact-list { display: flex; flex-direction: column; gap: .6rem; }

.contact-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s ease;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.contact-item:hover { border-color: var(--blue); }

.contact-position {
  width: 30px;
  height: 30px;
  background: rgba(75,159,225,0.1);
  color: var(--blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(75,159,225,0.2);
}

.contact-info { flex: 1; min-width: 0; }
.contact-name  { font-weight: 600; font-size: .95rem; color: var(--text); }
.contact-phone { font-size: .82rem; color: var(--text-muted); font-family: 'JetBrains Mono', 'Courier New', monospace; }
.contact-email { font-size: .78rem; color: var(--text-muted); }

.contact-actions { display: flex; gap: .4rem; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

.contact-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: .92rem;
}

/* ── Add contact form ── */
.add-form {
  display: none;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 1.1rem;
  margin-top: .8rem;
  background: rgba(232,240,58,0.02);
}

.add-form.visible { display: block; }

.add-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: .75rem;
}

.add-form-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* ── Edit inline ── */
.edit-form {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  align-items: center;
}

.edit-form.visible { display: grid; width: 100%; }

/* ── Drag & drop ── */
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  padding: .2rem .3rem;
  flex-shrink: 0;
  opacity: .35;
  transition: opacity .15s;
  display: flex;
  align-items: center;
}

.drag-handle:hover { opacity: .8; }

.contact-item.sortable-ghost {
  opacity: .3;
  background: rgba(232,240,58,0.04);
  border-color: var(--yellow);
}

/* ═══════════════════════════════════════
   CONSENT BADGES
═══════════════════════════════════════ */
.consent-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 20px;
  margin-top: .25rem;
}

.consent-pendiente {
  background: rgba(232,240,58,0.1);
  color: var(--yellow);
  border: 1px solid rgba(232,240,58,0.2);
}

.consent-aceptado {
  background: rgba(63,185,80,0.1);
  color: var(--success);
  border: 1px solid rgba(63,185,80,0.2);
}

.consent-rechazado {
  background: rgba(248,81,73,0.1);
  color: var(--error);
  border: 1px solid rgba(248,81,73,0.2);
}

/* ═══════════════════════════════════════
   REGISTRATION STEPS
═══════════════════════════════════════ */
.reg-steps { margin-bottom: 1.25rem; }

.reg-step-label {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: .5rem;
}

.reg-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.reg-progress-fill {
  height: 100%;
  background: var(--yellow);
  border-radius: 3px;
  transition: width .3s ease;
}

.reg-step-btns { display: flex; gap: .6rem; margin-top: .4rem; }
.reg-step-btns .btn-primary { flex: 1; }

/* ── Grid apellidos ── */
.reg-name-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ── Label opcional ── */
.label-optional { font-weight: 400; font-size: .74rem; color: var(--text-muted); }

/* ═══════════════════════════════════════
   PASSWORD STRENGTH & VALIDATION
═══════════════════════════════════════ */
.confirm-msg { font-size: .78rem; margin-top: .3rem; display: block; }
.confirm-msg.valid   { color: var(--success); }
.confirm-msg.invalid { color: var(--error); }

input.rut-valid   { border-color: var(--success) !important; }
input.rut-invalid { border-color: var(--error)   !important; }

.rut-msg { font-size: .78rem; margin-top: .3rem; display: block; }
.rut-msg.valid   { color: var(--success); }
.rut-msg.invalid { color: var(--error); }

.pwd-strength { margin-top: .55rem; }

.pwd-strength-bar {
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: .45rem;
}

.pwd-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width .25s ease, background-color .25s ease;
}

.pwd-strength-fill.weak   { background-color: var(--error); }
.pwd-strength-fill.medium { background-color: var(--yellow); }
.pwd-strength-fill.strong { background-color: var(--success); }

.pwd-strength-label { font-size: .78rem; font-weight: 600; margin-bottom: .35rem; display: block; }
.pwd-strength-label.weak   { color: var(--error); }
.pwd-strength-label.medium { color: var(--yellow); }
.pwd-strength-label.strong { color: var(--success); }

.pwd-reqs { list-style: none; font-size: .77rem; display: flex; flex-direction: column; gap: .2rem; }
.pwd-req { color: var(--text-muted); }
.pwd-req::before { content: '✗ '; color: var(--error); }
.pwd-req.met { color: var(--text); }
.pwd-req.met::before { content: '✓ '; color: var(--success); }

/* ── Password visibility toggle ── */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { padding-right: 2.6rem !important; }

.pwd-eye {
  position: absolute;
  right: .55rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: .25rem;
  display: flex;
  align-items: center;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s;
}

.pwd-eye:hover { color: var(--text); }

/* ── T&C checkbox ── */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text-muted);
}

.checkbox-label input[type="checkbox"] {
  margin-top: .2rem;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--yellow);
}

.checkbox-label a { color: var(--blue); }

/* ═══════════════════════════════════════
   OTP INPUTS
═══════════════════════════════════════ */
.otp-inputs { display: flex; gap: .45rem; justify-content: center; margin: 1.1rem 0; }

.otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  color: var(--text);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.otp-digit:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(75,159,225,0.18); }
.otp-digit.filled { border-color: var(--success); }

.otp-desc { font-size: .88rem; color: var(--text-muted); text-align: center; }
.otp-resend { text-align: center; font-size: .84rem; color: var(--text-muted); }

/* ═══════════════════════════════════════
   MODAL
═══════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal.open { display: flex; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: -1;
}

.modal-dialog {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  width: 100%;
  max-width: 520px;
  position: relative;
}

.modal-sm { max-width: 360px; }

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

.modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: .2rem .4rem;
  border-radius: 4px;
  line-height: 1;
  transition: all .15s;
}

.modal-close-btn:hover { background: rgba(240,246,252,0.08); color: var(--text); }

.modal-body { padding: 1.4rem; }

.modal-tabs { display: flex; border-bottom: 1px solid var(--border); }

.modal-tab {
  flex: 1;
  padding: .8rem;
  background: none;
  border: none;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  font-family: inherit;
}

.modal-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.modal-tab-pane { display: none; padding: 1.4rem; }
.modal-tab-pane.active { display: block; }

.section-divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.form-section-title { font-weight: 700; font-size: .92rem; margin-bottom: 1rem; color: var(--text); }

/* ── Plan card ── */
.plan-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 1.5rem; text-align: center; }

.plan-badge {
  display: inline-block;
  padding: .3rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: 1rem;
}

.plan-badge.free { background: rgba(75,159,225,0.1); color: var(--blue); }
.plan-badge.pro  { background: rgba(232,240,58,0.1); color: var(--yellow); }

.plan-info { margin-bottom: 1.2rem; }
.plan-info p { font-size: .9rem; margin-bottom: .4rem; color: var(--text-muted); }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: .82rem;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.app-footer a { color: var(--blue); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

.app-footer .service-highlight {
  font-family: 'JetBrains Mono', monospace;
  color: var(--blue);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   MOBILE TABS
═══════════════════════════════════════ */
.mobile-tabs {
  display: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.mobile-tabs::-webkit-scrollbar { display: none; }

.mobile-tabs-inner { display: flex; min-width: max-content; }

.mobile-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.7rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.mobile-tab:hover { color: var(--text); }
.mobile-tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }

/* ═══════════════════════════════════════
   BOTTOM NAV (mobile)
═══════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #161B22;
  border-top: 1px solid #30363D;
  height: 60px;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  color: #8B949E;
  text-decoration: none;
  font-size: 0.65rem;
  flex: 1;
  height: 100%;
  transition: color 0.15s ease;
}

.bottom-nav-item:hover { color: var(--text); }
.bottom-nav-item.active { color: #E8F03A; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .dashboard-main { margin-left: 0; }
  .navbar-brand { display: flex; }
  .main-content { padding-bottom: 70px; }
  .bottom-nav { display: flex; }
  .rut-badge { display: none; }
}

@media (min-width: 769px) {
  .navbar-brand { display: none; }
  .bottom-nav { display: none; }
}

@media (max-width: 560px) {
  .contact-item { flex-wrap: wrap; gap: .5rem; }
  .contact-actions {
    flex-basis: 100%;
    border-top: 1px solid var(--border);
    padding-top: .5rem;
    justify-content: flex-start;
  }
  .edit-form { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  .add-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .reg-name-grid { grid-template-columns: 1fr; }
}
