/* =============================================
   SCOUT ADMIN — Dashboard Styles
   Paleta: Púrpura #824B99 | Azul #0066B3
           Rojo #E21F26 | Amarillo #FFCB05
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

:root {
  --purple:     #824B99;
  --blue:       #0066B3;
  --red:        #E21F26;
  --yellow:     #FFCB05;
  --white:      #ffffff;
  --bg:         #F0F2F7;
  --sidebar-bg: #0f1c2e;
  --sidebar-w:  260px;
  --card-bg:    #ffffff;
  --border:     #E2E6EE;
  --text:       #1a2035;
  --muted:      #6B7280;
  --success:    #16a34a;
  --warning:    #d97706;
  --danger:     #dc2626;
  --info:       #0284c7;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-md:  0 4px 24px rgba(0,0,0,.12);
  --transition: .22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── LOGIN PAGE ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f1c2e 0%, #0066B3 50%, #824B99 100%);
  padding: 2rem 1rem;
}
.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  text-align: center; margin-bottom: 1.75rem;
}
.login-logo svg { width: 54px; height: 54px; fill: var(--blue); }
.login-logo h1 { font-size: 1.4rem; margin-top: .6rem; color: var(--text); font-family: 'Playfair Display', serif; }
.login-logo p  { font-size: .82rem; color: var(--muted); margin-top: .2rem; }

.tab-buttons {
  display: flex; gap: .5rem;
  background: var(--bg);
  padding: .3rem;
  border-radius: 8px;
  margin-bottom: 1.75rem;
}
.tab-btn {
  flex: 1; padding: .55rem 1rem;
  border: none; border-radius: 6px;
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  background: transparent; color: var(--muted);
  transition: background var(--transition), color var(--transition);
}
.tab-btn.active { background: var(--white); color: var(--blue); box-shadow: var(--shadow); }

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

/* ── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block; font-size: .82rem; font-weight: 600;
  color: var(--text); margin-bottom: .38rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: .9rem; color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,102,179,.12);
}
.form-group textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.35rem;
  border: none; border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 3px 12px rgba(0,102,179,.3); }
.btn-primary:hover { background: #0055a0; }
.btn-purple  { background: var(--purple); color: #fff; box-shadow: 0 3px 12px rgba(130,75,153,.3); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* Alerts */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .88rem; font-weight: 500;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.alert-error   { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-warn    { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: var(--info);    border: 1px solid #bfdbfe; }

/* ── SIDEBAR ────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-logo { width: 36px; height: 36px; fill: #FFCB05; flex-shrink: 0; }
.sidebar-title { color: #fff; font-size: .95rem; font-weight: 700; line-height: 1.2; }
.sidebar-title span { display: block; font-size: .7rem; color: rgba(255,255,255,.45); font-weight: 400; margin-top: .1rem; }

.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-section-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .75rem 1.25rem .3rem;
}
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .65rem 1.25rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  cursor: pointer;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active {
  color: #fff;
  background: rgba(0,102,179,.25);
  border-left-color: var(--blue);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-chip {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .75rem;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .85rem; font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name  { color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { color: rgba(255,255,255,.45); font-size: .72rem; }

/* ── MAIN CONTENT ───────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-width: 0;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: .85rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.topbar-btn {
  padding: .45rem .9rem;
  border-radius: 7px;
  font-size: .82rem; font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--muted); cursor: pointer;
  background: transparent;
  transition: border-color var(--transition), color var(--transition);
  display: flex; align-items: center; gap: .4rem;
}
.topbar-btn:hover { border-color: var(--blue); color: var(--blue); }

.page-body { padding: 2rem; flex: 1; }
.page-header { margin-bottom: 1.75rem; }
.page-header h2 { font-size: 1.4rem; font-weight: 700; }
.page-header p  { color: var(--muted); font-size: .88rem; margin-top: .3rem; }

/* ── CARDS ──────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.card-header h3 { font-size: .95rem; font-weight: 700; }
.card-body { padding: 1.5rem; }

/* ── STAT CARDS ─────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-value  { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat-label  { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.stat-delta  { font-size: .75rem; font-weight: 600; }
.delta-up    { color: var(--success); }
.delta-down  { color: var(--danger); }

/* ── TABLES ─────────────────────────────────── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th {
  background: var(--bg); color: var(--muted);
  font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .65rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

/* ── BADGES ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem;
  border-radius: 50px;
  font-size: .75rem; font-weight: 700;
  letter-spacing: .02em;
}
.badge-admin   { background: rgba(130,75,153,.12); color: var(--purple); }
.badge-usuario { background: rgba(0,102,179,.10);  color: var(--blue); }
.badge-active  { background: #dcfce7; color: var(--success); }
.badge-blocked { background: #fee2e2; color: var(--danger); }
.badge-status-1 { background: #dcfce7; color: var(--success); }
.badge-status-2 { background: #fee2e2; color: var(--danger); }
.badge-status-3 { background: #f3f4f6; color: var(--muted); }

/* ── PAGINATION ─────────────────────────────── */
.pagination {
  display: flex; align-items: center; gap: .4rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}
.page-link {
  padding: .38rem .7rem;
  border-radius: 6px;
  font-size: .82rem; font-weight: 500;
  color: var(--muted); border: 1px solid var(--border);
  cursor: pointer; background: #fff;
  transition: background var(--transition), color var(--transition);
}
.page-link:hover, .page-link.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,28,46,.55);
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 640px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: .25rem;
  border-radius: 6px; transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }
.modal-body   { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* ── LOG TABLE ──────────────────────────────── */
.log-action { font-size: .78rem; font-weight: 600; }
.log-ok     { color: var(--success); }
.log-fail   { color: var(--danger); }
.log-logout { color: var(--muted); }
.log-warn   { color: var(--warning); }

/* ── SIDEBAR TOGGLE (mobile) ────────────────── */
.sidebar-overlay { display: none; }
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: .5rem; color: var(--text);
}
.menu-toggle svg { width: 22px; height: 22px; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,.35);
  }
  .sidebar-overlay {
    display: block;
    position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,.4);
    display: none;
  }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle  { display: block; }
  .page-body    { padding: 1.25rem; }
  .stats-row    { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .login-box { padding: 2rem 1.5rem; }
}

/* ── UTILITIES ──────────────────────────────── */
.text-muted   { color: var(--muted); }
.text-small   { font-size: .8rem; }
.mt-1  { margin-top:.5rem }  .mt-2 { margin-top:1rem } .mt-3 { margin-top:1.5rem }
.mb-1  { margin-bottom:.5rem } .mb-2 { margin-bottom:1rem } .mb-3 { margin-bottom:1.5rem }
.gap-1 { gap:.5rem } .gap-2 { gap:1rem }
.flex  { display:flex } .flex-center { display:flex;align-items:center }
.flex-between { display:flex;align-items:center;justify-content:space-between }
.flex-wrap { flex-wrap:wrap }
.w-100 { width:100% }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:1.25rem; }
@media(max-width:600px){ .grid-2{grid-template-columns:1fr} }
