/* ============================================================
   MailApp Pro — Design System
   Base: Bootstrap 5.3 override + custom tokens
   Direction: clean SaaS, B2B, dark sidebar variant
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   1. Design Tokens (CSS custom properties)
   ──────────────────────────────────────────────────────────── */
:root {
  /* Sidebar */
  --ma-sidebar-bg:        #1a1f2e;
  --ma-sidebar-border:    #262c3d;
  --ma-sidebar-width:     240px;

  /* Nav links */
  --ma-nav-text:          #8e9ab5;
  --ma-nav-text-hover:    #e2e8f4;
  --ma-nav-text-active:   #ffffff;
  --ma-nav-bg-hover:      rgba(255,255,255,.07);
  --ma-nav-bg-active:     rgba(108,140,255,.18);
  --ma-nav-accent:        #6c8cff;
  --ma-nav-label:         #4a5470;

  /* App surface */
  --ma-body-bg:           #f4f6fa;
  --ma-surface:           #ffffff;
  --ma-border:            #e8ecf4;
  --ma-border-strong:     #d0d7e8;

  /* Typography */
  --ma-text-primary:      #17203a;
  --ma-text-secondary:    #5e6e8a;
  --ma-text-muted:        #8e9ab5;

  /* Brand / primary */
  --ma-primary:           #4263eb;
  --ma-primary-hover:     #3554d6;
  --ma-primary-subtle:    #eef2ff;
  --ma-primary-text:      #2442c8;

  /* Topbar */
  --ma-topbar-bg:         #ffffff;
  --ma-topbar-border:     #e8ecf4;
  --ma-topbar-height:     56px;

  /* Radius */
  --ma-radius-sm:         6px;
  --ma-radius:            10px;
  --ma-radius-lg:         14px;
  --ma-radius-xl:         18px;

  /* Shadows */
  --ma-shadow-xs:         0 1px 3px rgba(23,32,58,.06), 0 1px 2px rgba(23,32,58,.04);
  --ma-shadow-sm:         0 1px 4px rgba(23,32,58,.08), 0 2px 8px rgba(23,32,58,.05);
  --ma-shadow:            0 4px 16px rgba(23,32,58,.10), 0 1px 4px rgba(23,32,58,.06);

  /* States */
  --ma-success-bg:        #ecfdf5;
  --ma-success-text:      #166534;
  --ma-success-border:    #bbf7d0;
  --ma-success-dot:       #22c55e;

  --ma-warning-bg:        #fffbeb;
  --ma-warning-text:      #92400e;
  --ma-warning-border:    #fde68a;
  --ma-warning-dot:       #f59e0b;

  --ma-danger-bg:         #fef2f2;
  --ma-danger-text:       #991b1b;
  --ma-danger-border:     #fecaca;
  --ma-danger-dot:        #ef4444;

  --ma-info-bg:           #eff6ff;
  --ma-info-text:         #1e40af;
  --ma-info-border:       #bfdbfe;
  --ma-info-dot:          #3b82f6;

  --ma-neutral-bg:        #f8fafc;
  --ma-neutral-text:      #475569;
  --ma-neutral-border:    #e2e8f0;
}

/* ────────────────────────────────────────────────────────────
   2. Base resets & global typography
   ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: clip; scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ma-text-primary);
  background: var(--ma-body-bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ma-text-primary);
  font-weight: 600;
  letter-spacing: -.015em;
  line-height: 1.3;
}

p { color: var(--ma-text-secondary); }

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

code {
  font-size: .85em;
  color: var(--ma-primary);
  background: var(--ma-primary-subtle);
  padding: .1em .4em;
  border-radius: 4px;
}

/* ────────────────────────────────────────────────────────────
   3. Bootstrap overrides — buttons
   ──────────────────────────────────────────────────────────── */
.btn {
  border-radius: var(--ma-radius-sm);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -.01em;
  transition: background .15s, box-shadow .15s, border-color .15s, color .15s;
}

.btn-sm { font-size: 12.5px; }

.btn-primary {
  background: var(--ma-primary);
  border-color: var(--ma-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(66,99,235,.25), inset 0 1px 0 rgba(255,255,255,.12);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--ma-primary-hover);
  border-color: var(--ma-primary-hover);
  box-shadow: 0 3px 8px rgba(66,99,235,.35);
}

.btn-outline-primary {
  color: var(--ma-primary);
  border-color: var(--ma-primary);
}
.btn-outline-primary:hover {
  background: var(--ma-primary);
  border-color: var(--ma-primary);
}

.btn-outline-secondary {
  color: var(--ma-text-secondary);
  border-color: var(--ma-border-strong);
  background: var(--ma-surface);
}
.btn-outline-secondary:hover {
  background: var(--ma-body-bg);
  border-color: var(--ma-border-strong);
  color: var(--ma-text-primary);
}

.btn-link {
  color: var(--ma-primary);
  text-decoration: none;
  padding: 0;
}
.btn-link:hover { color: var(--ma-primary-hover); text-decoration: underline; }

/* ────────────────────────────────────────────────────────────
   4. Bootstrap overrides — forms
   ──────────────────────────────────────────────────────────── */
.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ma-text-primary);
  margin-bottom: .35rem;
}

.form-control, .form-select {
  border: 1px solid var(--ma-border-strong);
  border-radius: var(--ma-radius-sm);
  font-size: 13.5px;
  color: var(--ma-text-primary);
  background-color: var(--ma-surface);
  padding: .5rem .75rem;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(23,32,58,.04);
}

.form-control::placeholder { color: var(--ma-text-muted); }

.form-control:focus, .form-select:focus {
  border-color: var(--ma-primary);
  box-shadow: 0 0 0 3px rgba(66,99,235,.12);
  outline: none;
}

.form-control.is-invalid, .form-select.is-invalid { border-color: var(--ma-danger-dot); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.12); }

.form-control-sm { font-size: 13px; padding: .35rem .65rem; }

.form-text {
  font-size: 12px;
  color: var(--ma-text-muted);
  margin-top: .3rem;
}

.invalid-feedback { font-size: 12px; color: var(--ma-danger-text); }

.form-check-input:checked {
  background-color: var(--ma-primary);
  border-color: var(--ma-primary);
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(66,99,235,.12); }

/* ────────────────────────────────────────────────────────────
   5. Bootstrap overrides — cards
   ──────────────────────────────────────────────────────────── */
.card {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border) !important;
  border-radius: var(--ma-radius-lg) !important;
  box-shadow: var(--ma-shadow-sm);
}

.card-body { padding: 1.25rem 1.5rem; }

.card-header {
  background: var(--ma-surface);
  border-bottom: 1px solid var(--ma-border);
  padding: .85rem 1.5rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--ma-text-secondary);
  letter-spacing: .02em;
  text-transform: uppercase;
  border-radius: var(--ma-radius-lg) var(--ma-radius-lg) 0 0 !important;
}

/* ────────────────────────────────────────────────────────────
   6. Bootstrap overrides — tables
   ──────────────────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
  color: var(--ma-text-primary);
  border-color: var(--ma-border);
}

.table thead th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .055em;
  color: var(--ma-text-muted);
  border-bottom: 1px solid var(--ma-border) !important;
  border-top: none;
  padding: .65rem 1rem;
  white-space: nowrap;
  background: var(--ma-surface);
}

.table tbody td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--ma-border);
  vertical-align: middle;
  color: var(--ma-text-primary);
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr:hover td { background: #f8faff; }

.table-sm thead th { padding: .5rem .85rem; }
.table-sm tbody td { padding: .5rem .85rem; }

/* ────────────────────────────────────────────────────────────
   7. Bootstrap overrides — badges
   ──────────────────────────────────────────────────────────── */
.badge {
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 20px;
  padding: .28em .75em;
  letter-spacing: .02em;
}

/* Status badges — MailApp semantic */
.badge-ma-active   { background: var(--ma-success-bg); color: var(--ma-success-text); border: 1px solid var(--ma-success-border); }

/* Campaign detail — subtle emphasis when status is Activa (ficha only) */
@keyframes ma-campaign-active-soft-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    opacity: 0.92;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
  }
}
.badge-ma-active-live {
  animation: ma-campaign-active-soft-pulse 3.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .badge-ma-active-live {
    animation: none;
    opacity: 1;
    box-shadow: none;
  }
}

.badge-ma-paused   { background: var(--ma-info-bg);    color: var(--ma-info-text);    border: 1px solid var(--ma-info-border); }
.badge-ma-draft    { background: var(--ma-warning-bg); color: var(--ma-warning-text); border: 1px solid var(--ma-warning-border); }
.badge-ma-archived { background: var(--ma-neutral-bg); color: var(--ma-neutral-text); border: 1px solid var(--ma-neutral-border); }
.badge-ma-failed   { background: var(--ma-danger-bg);  color: var(--ma-danger-text);  border: 1px solid var(--ma-danger-border); }
.badge-ma-sent     { background: var(--ma-success-bg); color: var(--ma-success-text); border: 1px solid var(--ma-success-border); }
.badge-ma-pending  { background: var(--ma-info-bg);    color: var(--ma-info-text);    border: 1px solid var(--ma-info-border); }
.badge-ma-blocked  { background: var(--ma-neutral-bg); color: var(--ma-neutral-text); border: 1px solid var(--ma-neutral-border); }
.badge-ma-eligible { background: var(--ma-success-bg); color: var(--ma-success-text); border: 1px solid var(--ma-success-border); }

/* Override Bootstrap default badge colours to match system */
.text-bg-success {
  background: var(--ma-success-bg) !important;
  color: var(--ma-success-text) !important;
  border: 1px solid var(--ma-success-border);
}
.text-bg-secondary {
  background: var(--ma-neutral-bg) !important;
  color: var(--ma-neutral-text) !important;
  border: 1px solid var(--ma-neutral-border);
}
.text-bg-danger {
  background: var(--ma-danger-bg) !important;
  color: var(--ma-danger-text) !important;
  border: 1px solid var(--ma-danger-border);
}
.text-bg-warning {
  background: var(--ma-warning-bg) !important;
  color: var(--ma-warning-text) !important;
  border: 1px solid var(--ma-warning-border);
}
.text-bg-info {
  background: var(--ma-info-bg) !important;
  color: var(--ma-info-text) !important;
  border: 1px solid var(--ma-info-border);
}

/* ────────────────────────────────────────────────────────────
   8. Bootstrap overrides — alerts
   ──────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--ma-radius);
  font-size: 13.5px;
  border-width: 1px;
}
.alert-success { background: var(--ma-success-bg); color: var(--ma-success-text); border-color: var(--ma-success-border); }
.alert-danger   { background: var(--ma-danger-bg);  color: var(--ma-danger-text);  border-color: var(--ma-danger-border); }
.alert-warning  { background: var(--ma-warning-bg); color: var(--ma-warning-text); border-color: var(--ma-warning-border); }
.alert-info     { background: var(--ma-info-bg);    color: var(--ma-info-text);    border-color: var(--ma-info-border); }
.alert-light    { background: var(--ma-neutral-bg); color: var(--ma-neutral-text); border-color: var(--ma-neutral-border); }

/* ────────────────────────────────────────────────────────────
   9. Bootstrap overrides — pagination
   ──────────────────────────────────────────────────────────── */
.pagination .page-link {
  color: var(--ma-text-secondary);
  border-color: var(--ma-border);
  font-size: 13px;
  border-radius: var(--ma-radius-sm) !important;
}
.pagination .page-link:hover {
  background: var(--ma-primary-subtle);
  color: var(--ma-primary);
  border-color: var(--ma-border);
}
.pagination .page-item.active .page-link {
  background: var(--ma-primary);
  border-color: var(--ma-primary);
}

/* ────────────────────────────────────────────────────────────
   10. App shell — sidebar (dark)
   ──────────────────────────────────────────────────────────── */
.app-shell {
  min-height: 100vh;
  max-width: 100%;
}

.app-sidebar-desktop {
  width: var(--ma-sidebar-width);
  flex-shrink: 0;
  background: var(--ma-sidebar-bg);
  border-right: 1px solid var(--ma-sidebar-border);
  padding: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 992px) {
  .app-sidebar-desktop {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }
}

.app-mobile-sidebar.offcanvas {
  --bs-offcanvas-width: min(260px, 90vw);
  background: var(--ma-sidebar-bg);
  border-right: 1px solid var(--ma-sidebar-border) !important;
}

/* ── Sidebar brand / logo area ── */
.sidebar-brand-wrap {
  padding: 1.05rem 1rem .85rem;
  border-bottom: 1px solid var(--ma-sidebar-border);
  min-width: 0;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -.02em;
  line-height: 1;
}

.sidebar-brand-env {
  font-size: 10.5px;
  color: var(--ma-nav-label);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Sidebar navigation ── */
.sidebar-nav-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: .75rem .75rem .75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.app-sidebar-panel {
  min-height: 0;
}

.sidebar-nav-wrap::-webkit-scrollbar { width: 4px; }
.sidebar-nav-wrap::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Zona flexible entre menú y acción final: empuja el logout al fondo del panel */
.sidebar-nav-spacer {
  flex: 1 1 auto;
  min-height: 1.5rem;
}

/* Pie del panel lateral (fuera de <nav>): sesión / logout */
.sidebar-nav-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 1.1rem;
  padding-bottom: .35rem;
  border-top: 1px solid var(--ma-sidebar-border);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ma-nav-label);
  padding: 1.1rem .5rem .3rem;
  display: block;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: .55rem;
  border-radius: var(--ma-radius-sm);
  padding: .48rem .65rem;
  text-decoration: none;
  color: var(--ma-nav-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .14s, color .14s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.app-nav-link i { font-size: 14px; opacity: .8; flex-shrink: 0; }

.app-nav-link:hover {
  background: var(--ma-nav-bg-hover);
  color: var(--ma-nav-text-hover);
  text-decoration: none;
}

.app-nav-link.active {
  background: var(--ma-nav-bg-active);
  color: var(--ma-nav-text-active);
}

.app-nav-link.active i { opacity: 1; color: var(--ma-nav-accent); }

.app-nav-group { display: grid; gap: .12rem; }

.app-nav-link-parent {
  min-width: 0;
  font-weight: 600;
  color: var(--ma-nav-text-hover);
}

.app-nav-group-children {
  margin-left: .95rem;
  padding-left: .6rem;
  border-left: 1px solid rgba(255, 255, 255, .08);
  display: grid;
  gap: .08rem;
}

.app-nav-link-child {
  padding-left: .45rem;
  color: rgba(142, 154, 181, .88);
  font-size: 12.9px;
  font-weight: 500;
  gap: .45rem;
}

.app-nav-link-child:hover {
  color: var(--ma-nav-text-hover);
}

.app-nav-link-child.active {
  color: var(--ma-nav-text-active);
}

.app-nav-bullet {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: .75;
  flex-shrink: 0;
  margin-left: 1px;
}

/* ────────────────────────────────────────────────────────────
   11. App shell — topbar
   ──────────────────────────────────────────────────────────── */
.content-wrap {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  height: var(--ma-topbar-height);
  background: var(--ma-topbar-bg);
  border-bottom: 1px solid var(--ma-topbar-border);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
}

.topbar-brand-mobile {
  font-size: 14px;
  font-weight: 700;
  color: var(--ma-text-primary);
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--ma-border-strong);
  flex-shrink: 0;
}

.topbar-status-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--ma-success-bg);
  color: var(--ma-success-text);
  border: 1px solid var(--ma-success-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  padding: .22rem .65rem;
}

.topbar-status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ma-success-dot);
  flex-shrink: 0;
}

.topbar-user-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--ma-body-bg);
  border: 1px solid var(--ma-border-strong);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ma-text-secondary);
  padding: .25rem .7rem;
}

/* User account dropdown (topbar) */
.topbar-user-dropdown .topbar-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 11rem;
  margin: 0;
  padding: .2rem .5rem .2rem .55rem;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ma-text-secondary);
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: 20px;
  box-shadow: none;
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}

.topbar-user-dropdown .topbar-user-trigger:hover {
  color: var(--ma-text-primary);
  background: var(--ma-body-bg);
  border-color: var(--ma-border-strong);
}

.topbar-user-dropdown .topbar-user-trigger:focus-visible {
  outline: 2px solid var(--ma-primary);
  outline-offset: 2px;
}

.topbar-user-dropdown .topbar-user-trigger .bi {
  font-size: 12px;
  flex-shrink: 0;
  opacity: .9;
}

.topbar-user-dropdown .topbar-user-trigger::after {
  margin-left: .1rem;
  flex-shrink: 0;
  opacity: .5;
  font-size: .55rem;
}

.topbar-user-dropdown .topbar-user-name {
  min-width: 0;
  max-width: 7.5rem;
}

@media (min-width: 576px) {
  .topbar-user-dropdown .topbar-user-name {
    max-width: 10rem;
  }
}

.ma-user-dropdown-menu {
  min-width: 11rem;
  padding: .25rem 0;
  font-size: 12.5px;
  background: #f4f5f7;
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius-sm);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.ma-user-dropdown-menu .dropdown-item {
  padding: .35rem .85rem;
  color: var(--ma-text-secondary);
  font-weight: 500;
}

.ma-user-dropdown-menu .dropdown-item:hover,
.ma-user-dropdown-menu .dropdown-item:focus {
  background: rgba(255, 255, 255, .85);
  color: var(--ma-text-primary);
}

.ma-user-dropdown-menu .dropdown-divider {
  border-color: var(--ma-border);
  opacity: 1;
}

.ma-user-dropdown-menu .ma-user-dropdown-logout {
  color: #8a4b4b;
  font-weight: 600;
}

.ma-user-dropdown-menu .ma-user-dropdown-logout:hover,
.ma-user-dropdown-menu .ma-user-dropdown-logout:focus {
  background: rgba(220, 53, 69, .08);
  color: #7a2e2e;
}

.app-main {
  flex: 1;
  padding: 1.5rem 1.25rem;
  min-width: 0;
}

@media (min-width: 992px) {
  .app-main { padding: 1.75rem 2rem; }
}

/* ────────────────────────────────────────────────────────────
   12. Page-level helpers
   ──────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ma-text-primary);
  margin: 0 0 .15rem;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--ma-text-muted);
  margin: 0;
}

.breadcrumb-ma {
  font-size: 12px;
  color: var(--ma-text-muted);
  margin-bottom: .3rem;
}
.breadcrumb-ma span { color: var(--ma-text-secondary); }
.breadcrumb-ma .sep { margin: 0 .35rem; color: var(--ma-text-muted); }

/* ────────────────────────────────────────────────────────────
   13. Stat / metric cards
   ──────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius-lg);
  box-shadow: var(--ma-shadow-sm);
  padding: 1rem 1.25rem;
}

.stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ma-text-muted);
  margin-bottom: .35rem;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ma-text-primary);
  line-height: 1;
  letter-spacing: -.03em;
}

/* ────────────────────────────────────────────────────────────
   14. Guest / auth layout (split screen)
   ──────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  background: var(--ma-body-bg);
}

.auth-panel {
  background: var(--ma-surface);
  border-radius: var(--ma-radius-xl);
  box-shadow: var(--ma-shadow);
  padding: 2.25rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--ma-primary);
  letter-spacing: -.03em;
}

/* Marca en auth (panel #fff / fondo app claro) — protagonista, sin deformar */
.auth-brand-mark {
  width: 100%;
  margin-bottom: .45rem;
}
.auth-brand-mark-inner {
  max-width: 220px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.auth-brand-logo-img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Sidebar oscuro: compacto, sin recorte (ancho útil sidebar − padding) */
.sidebar-brand-logo-row {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 0;
}
.sidebar-brand-logo-img {
  display: block;
  max-width: min(170px, 100%);
  max-height: 34px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1rem 0;
  color: var(--ma-text-muted);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ma-border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .6rem 1rem;
  background: var(--ma-surface);
  border: 1px solid var(--ma-border-strong);
  border-radius: var(--ma-radius-sm);
  color: var(--ma-text-primary);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--ma-shadow-xs);
}
.btn-google:hover {
  background: var(--ma-body-bg);
  border-color: var(--ma-border-strong);
  color: var(--ma-text-primary);
  text-decoration: none;
  box-shadow: var(--ma-shadow-sm);
}

.google-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* ────────────────────────────────────────────────────────────
   15. Admin layout overrides
   ──────────────────────────────────────────────────────────── */
.admin-topnav {
  background: var(--ma-sidebar-bg);
  border-bottom: 1px solid var(--ma-sidebar-border);
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.admin-topnav .admin-brand {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}

.admin-topnav .admin-link {
  font-size: 13px;
  color: var(--ma-nav-text);
  text-decoration: none;
  font-weight: 500;
  transition: color .14s;
}
.admin-topnav .admin-link:hover { color: #fff; text-decoration: none; }

.admin-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ────────────────────────────────────────────────────────────
   16. Detail / settings cards
   ──────────────────────────────────────────────────────────── */
.detail-card {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius-lg);
  box-shadow: var(--ma-shadow-xs);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.detail-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ma-text-primary);
  margin-bottom: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ma-text-muted);
  margin-bottom: .35rem;
}

/* ────────────────────────────────────────────────────────────
   17. Responsive / mobile adjustments
   ──────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .app-main { padding: 1.1rem 1rem; }
  .auth-panel { padding: 1.75rem 1.25rem; }
  .card-body { padding: 1rem 1.1rem; }
}

@media (max-width: 576px) {
  .auth-panel { border-radius: var(--ma-radius-lg); max-width: 100%; }
  .table-responsive .badge { font-size: 11px; }
}
