/* ============================================================================
 * Integrasec — Design System (styles.css)
 * ----------------------------------------------------------------------------
 * Single source of truth for visual styles across all pages.
 *
 * STRUCTURE
 *   1. Design tokens  (CSS custom properties on :root)
 *      - Color scales: grey, primary (blue), danger, warning, success
 *      - Semantic aliases (--color-text-*, --color-bg-*, etc.)
 *      - Spacing, border-radius, typography, sidebar width
 *   2. Reset
 *   3. Components: Sidebar / Page layout / Buttons / Filter bar / Table /
 *      Badges / Pagination / Progress bar / Filter dropdown / Settings page
 *
 * EXTENDING
 *   - New badge color    → add `.badge-<key> { background: var(--<color>-100); }`
 *                            and `.badge-<key> .badge-dot { background: var(--<color>-500); }`
 *   - New spacing token  → bump `--space-N` series and use as `var(--space-N)`
 *   - New page-specific style → put in the page's inline `<style>` block to
 *                                keep this file generic.
 * ========================================================================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  /* ── Color Scale: Grey ── */
  --grey-50:    #fafafa;
  --grey-white: #ffffff;
  --grey-100:   #f7f7f7;
  --grey-200:   #efefef;
  --grey-300:   #e4e4e4;
  --grey-400:   #c4c4c4;
  --grey-500:   #797979;
  --grey-600:   #464646;
  --grey-700:   #323232;
  --grey-800:   #242424;
  --grey-900:   #141414;
  --grey-black: #0a0a0a;

  /* ── Color Scale: Primary (Blue) ── */
  --primary-50:  #f6fafd;
  --primary-100: #e2eef8;
  --primary-200: #6cacdf;
  --primary-300: #57a0db;
  --primary-400: #4294d6;
  --primary-500: #2e88d1;
  --primary-600: #297bbd;
  --primary-700: #246da8;
  --primary-800: #205f93;
  --primary-900: #1e598a;

  /* ── Color Scale: Danger (Red) ── */
  --danger-100: #fff1f2;
  --danger-200: #ffdcdc;
  --danger-300: #fca5a5;
  --danger-400: #ef4444;
  --danger-500: #8d0000;

  /* ── Color Scale: Warning (Amber) ── */
  --warning-100: #fffbeb;
  --warning-200: #fde68a;
  --warning-300: #fbbf24;
  --warning-400: #f59e0b;
  --warning-500: #8d6500;

  /* ── Color Scale: Success (Green) ── */
  --success-100: #f0fdf4;
  --success-200: #bbf7d0;
  --success-300: #4ade80;
  --success-400: #22c55e;
  --success-500: #008d23;

  /* ── Semantic Aliases (map scale → role) ── */

  /* Background */
  --color-bg-surface:  var(--grey-white);
  --color-bg-bare:     var(--grey-50);
  --color-bg-page:     var(--grey-100);
  --color-bg-subtle:   var(--grey-200);
  --color-bg-muted:    var(--grey-200);
  --color-bg-neutral:  var(--grey-200);

  /* Border */
  --color-border:        var(--grey-300);
  --color-border-card:   var(--grey-300);
  --color-border-stat:   var(--grey-300);
  --color-border-pill:   var(--grey-300);

  /* Text */
  --color-text-primary:   var(--grey-900);
  --color-text-body:      var(--grey-800);
  --color-text-base:      var(--grey-black);
  --color-text-secondary: var(--grey-600);
  --color-text-muted:     var(--grey-500);
  --color-text-badge:     var(--grey-900);
  --color-text-strong:    var(--grey-800);
  --color-text-meta:      var(--grey-700);
  --color-text-trend:     var(--grey-900);

  /* Semantic – Primary */
  --color-primary:      var(--primary-500);
  --color-primary-dark: var(--primary-600);
  --color-primary-bg:   var(--primary-50);
  --color-primary-light: var(--primary-100);

  /* Semantic – Danger */
  --color-danger:          var(--danger-400);
  --color-danger-dark:     var(--danger-500);
  --color-danger-bg:       rgba(141, 0, 0, 0.08);   /* danger-500 @ 8% */
  --color-danger-trend-bg: var(--danger-200);

  /* Semantic – Warning */
  --color-warning:      var(--warning-400);
  --color-warning-dark: var(--warning-500);
  --color-warning-bg:   rgba(141, 101, 0, 0.08);   /* warning-500 @ 8% */

  /* Semantic – Success */
  --color-success:      var(--success-400);
  --color-success-dark: var(--success-500);
  --color-success-bg:   rgba(0, 141, 35, 0.08);    /* success-500 @ 8% */

  /* Semantic – Neutral (Spam / Pendiente) */
  --color-neutral:    var(--grey-500);
  --color-neutral-bg: rgba(70, 70, 70, 0.08);      /* grey-600 @ 8% */

  /* Riesgo badges */
  --color-alto-bg:    rgba(141, 0, 0, 0.08);        /* danger-500 @ 8% */
  --color-medio-bg:   rgba(141, 101, 0, 0.08);      /* warning-500 @ 8% */
  --color-bajo-bg:    rgba(0, 141, 35, 0.08);       /* success-500 @ 8% */

  /* Status badges */
  --color-activa-bg:    rgba(0, 141, 35, 0.08);     /* success-500 @ 8% */
  --color-pendiente-bg: rgba(70, 70, 70, 0.08);     /* grey-600 @ 8% */

  /* Border radius */
  --radius-sm:      8px;
  --radius-md:      10px;
  --radius-card-sm: 13px;
  --radius-table:   16px;
  --radius-card:    20px;
  --radius-badge:   22px;
  --radius-tab:     80px;
  --radius-pill:    800px;
  --radius-full:    8000px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 18px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography */
  --font-family: 'Inter', sans-serif;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 15px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   32px;
  --text-2xl:  40px;
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;

  /* Sidebar */
  --sidebar-width: 250px;
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent FOUC / shimmer on navigation */
html { background: var(--color-bg-surface); }

body {
  font-family: var(--font-family);
  background: var(--color-bg-surface);
  height: 100vh;
  overflow: hidden;
  color: var(--color-text-body);
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ── */
.dashboard {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* ─────────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100%;
  background: var(--color-bg-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3) var(--space-2);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Client module */
.client-module {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  gap: var(--space-2);
  width: 100%;
  background:
    linear-gradient(90deg, rgba(196,196,196,.09) 0%, rgba(196,196,196,.09) 100%),
    var(--grey-white);
}
.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--grey-300);
  overflow: hidden;
  flex-shrink: 0;
}
.client-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.client-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}
.client-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-type {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation */
.nav-menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  transition: background 0.15s;
}
.nav-item.active { background: var(--primary-50); }
.nav-item:hover:not(.active) { background: var(--grey-100); }

.nav-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icon img { width: 20px; height: 20px; }

/* User module */
.user-module {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  gap: var(--space-2);
  width: 100%;
  background:
    linear-gradient(90deg, rgba(196,196,196,.09) 0%, rgba(196,196,196,.09) 100%),
    var(--grey-white);
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
}
.user-avatar img {
  width: 100%;
  height: 147%;
  object-fit: cover;
  margin-top: -6%;
}
.user-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-email {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--color-text-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   PAGE LAYOUT (shared across table pages)
   ───────────────────────────────────────────── */
.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  min-height: 84px;
  max-height: 84px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.page-title-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.page-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-base);
}
.page-date {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--color-text-secondary);
  display: flex;
  gap: 6px;
}
.page-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ── Buttons ── */
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-3);
  min-height: 36px;
  background: var(--color-bg-subtle);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  cursor: pointer;
}
.btn-ghost {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-3);
  min-height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  cursor: pointer;
}
.btn-icon { width: 20px; height: 20px; }
.btn-secondary { transition: background 0.15s; }
.btn-secondary:hover  { background: var(--grey-300); }
.btn-secondary:active { background: var(--grey-400); }
.btn-ghost { transition: background 0.15s; }
.btn-ghost:hover  { background: var(--grey-100); }
.btn-ghost:active { background: var(--grey-200); }

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-6) var(--space-6);
}

/* ─────────────────────────────────────────────
   FILTER BAR
   ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-4) var(--space-4) 0;
}
.filter-count {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-text-secondary);
}
.filter-dropdowns {
  display: flex;
  gap: 10px;
  align-items: center;
}
.filter-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-3);
  min-height: 36px;
  background: var(--color-bg-surface);
  border: 1px solid var(--grey-400);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  font-family: var(--font-family);
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn img { width: 20px; height: 20px; }
.filter-btn { transition: background 0.15s, border-color 0.15s; }
.filter-btn:hover  { background: var(--grey-100); }
.filter-btn.active { border-color: var(--grey-900); }
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-900);
  color: var(--grey-white);
  border-radius: var(--radius-tab);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 20px;
  padding: 0 8px;
  min-width: 22px;
}

/* ─────────────────────────────────────────────
   TABLE
   ───────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-table);
  overflow: hidden;
  background: var(--color-bg-surface);
}
table.tbl {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.tbl th,
.tbl td {
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl th:last-child,
.tbl td:last-child {
  border-right: none;
}
.tbl th {
  background: var(--color-bg-surface);
  height: 52px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  line-height: 1.5;
}
.tbl td {
  height: 60px;
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-text-primary);
  line-height: 1.5;
}
.th-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.sort-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
}
.tbl th[data-sort],
.tbl th[data-sort-type] {
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.tbl th[data-sort]:hover,
.tbl th[data-sort-type]:hover { background: var(--grey-50); }
.tbl th[data-sort]:hover .sort-icon,
.tbl th[data-sort-type]:hover .sort-icon { opacity: 0.75; }
.tbl th.sorted-asc .sort-icon,
.tbl th.sorted-desc .sort-icon { opacity: 1; }
.tbl th.sorted-desc .sort-icon { transform: rotate(180deg); }
.col-actions {
  width: 56px;
  text-align: center !important;
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 1px 4px 0 rgba(164, 164, 164, 0.05);
}
.tbl th.col-actions { background: var(--grey-50); }
.action-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}
.action-btn img { width: 20px; height: 20px; }
.col-num { text-align: right !important; }
.col-num .th-inner { justify-content: flex-end; }

/* ─────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px var(--space-2);
  border-radius: var(--radius-tab);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-badge);
  line-height: 20px;
  white-space: nowrap;
}

/* Dot indicator (replaces icon images) */
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Veredicto badges */
.badge-malicioso  { background: var(--danger-100); }
.badge-malicioso  .badge-dot { background: var(--danger-500); }
.badge-inofensivo { background: var(--success-100); }
.badge-inofensivo .badge-dot { background: var(--success-500); }
.badge-sospechoso { background: var(--warning-100); }
.badge-sospechoso .badge-dot { background: var(--warning-500); }
.badge-spam       { background: var(--grey-100); }
.badge-spam       .badge-dot { background: var(--grey-500); }

/* Riesgo badges */
.badge-alto  { background: var(--danger-100); }
.badge-alto  .badge-dot { background: var(--danger-500); }
.badge-medio { background: var(--warning-100); }
.badge-medio .badge-dot { background: var(--warning-500); }
.badge-bajo  { background: var(--success-100); }
.badge-bajo  .badge-dot { background: var(--success-500); }

/* Estado badges */
.badge-activa    { background: var(--success-100); }
.badge-activa    .badge-dot { background: var(--success-500); }
.badge-pendiente { background: var(--grey-100); }
.badge-pendiente .badge-dot { background: var(--grey-500); }

/* ─────────────────────────────────────────────
   PAGINATION
   ───────────────────────────────────────────── */
.pag-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  height: 60px;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
}
.pag-bar.hidden { display: none; }
.pag-left  { display: flex; align-items: center; gap: var(--space-4); }
.pag-group { display: flex; align-items: center; gap: var(--space-3); }
.pag-arrows { display: flex; gap: var(--space-2); }
.pag-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: none;
  background: none;
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-text-meta);
  font-family: var(--font-family);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pag-btn { transition: background 0.1s; }
.pag-btn.current {
  background: var(--grey-600);
  color: var(--color-bg-surface);
  font-weight: var(--font-bold);
}
.pag-btn:hover:not(.current):not(:disabled)  { background: var(--grey-100); }
.pag-btn:active:not(.current):not(:disabled) { background: var(--grey-200); }
.pag-btn:disabled { opacity: 0.35; cursor: default; }
.pag-ellipsis { cursor: default; }
.pag-right {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-meta);
}
.pag-items-per-page {
  background: transparent;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-meta);
  font-family: var(--font-family);
  cursor: pointer;
}
.pag-items-per-page:focus { outline: none; border-color: var(--grey-900); }

/* ─────────────────────────────────────────────
   PROGRESS BAR (formaciones)
   ───────────────────────────────────────────── */
.progress-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.progress-text {
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--color-text-primary);
  white-space: nowrap;
  min-width: 56px;
}
.progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--color-bg-muted);
  border-radius: 99px;
  overflow: hidden;
  min-width: 60px;
  max-width: 120px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--color-success);
  border-radius: 99px;
}
.progress-dash { color: var(--grey-400); }

/* ─────────────────────────────────────────────
   FILTER DROPDOWN PANEL
   ───────────────────────────────────────────── */
.filter-wrap { position: relative; }

.dropdown-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  width: 220px;
  background: var(--grey-white);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.dropdown-panel.open { display: flex; }

.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  background: var(--grey-white);
  flex-shrink: 0;
}
.dropdown-title {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--grey-500);
  line-height: 16px;
}
.dropdown-reset {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  font-family: var(--font-family);
  color: var(--grey-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.dropdown-reset.visible { opacity: 1; pointer-events: auto; }

.dropdown-body {
  overflow-y: auto;
  max-height: 196px;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-300) transparent;
}
.dropdown-body::-webkit-scrollbar { width: 6px; }
.dropdown-body::-webkit-scrollbar-track { background: transparent; }
.dropdown-body::-webkit-scrollbar-thumb { background: var(--grey-300); border-radius: 99px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  user-select: none;
  min-height: 36px;
  transition: background 0.1s;
}
.dropdown-item:hover { background: var(--grey-100); }

.dropdown-checkbox {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--grey-400);
  background: var(--grey-white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s;
}
.dropdown-item.selected .dropdown-checkbox {
  background: var(--primary-900);
  border-color: var(--primary-900);
}
.dropdown-item.selected .dropdown-checkbox::after {
  content: '';
  display: block;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--grey-white);
  border-bottom: 2px solid var(--grey-white);
  transform: rotate(-45deg) translateY(-1px);
}
.dropdown-label {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--grey-700);
  letter-spacing: 0.15px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   TABLE HORIZONTAL SCROLL
   ───────────────────────────────────────────── */
.tbl-scroll-x {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--grey-300) transparent;
}
.tbl-scroll-x::-webkit-scrollbar { height: 6px; }
.tbl-scroll-x::-webkit-scrollbar-track { background: transparent; }
.tbl-scroll-x::-webkit-scrollbar-thumb { background: var(--grey-300); border-radius: 99px; }

/* ─────────────────────────────────────────────
   SETTINGS PAGE
   ───────────────────────────────────────────── */
.settings-page {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.settings-card {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
  padding: var(--space-6) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.settings-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.settings-card-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-base);
  line-height: normal;
}
.settings-card-meta {
  display: flex;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--color-text-secondary);
}

.settings-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 32px var(--space-6);
  width: 100%;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 280px;
  min-width: 0;
  max-width: 525px;
}

.settings-label {
  font-size: 13px;
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  line-height: normal;
}

.settings-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 44px;
  padding: 10px var(--space-2);
  background: var(--grey-200);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.settings-input-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-text-secondary);
}

.settings-input-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.settings-input-icon img {
  width: 20px;
  height: 20px;
}

/* ─────────────────────────────────────────────
   AUTH PAGES (login / recuperar / change-password)
   Standalone layout: no sidebar, viewport-centered card.
   ───────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4);
  background: var(--color-bg-page);
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card-sm);
  padding: var(--space-8) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  box-shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .06);
}

.auth-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
.auth-wordmark {
  height: 44px;
  width: auto;
  max-width: 80%;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}
.auth-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  letter-spacing: -.01em;
  color: var(--color-text-base);
  line-height: 1.2;
}
.auth-subtitle {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.auth-label {
  font-size: 13px;
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  line-height: normal;
}
.auth-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 10px var(--space-3);
  background: var(--grey-200);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color .15s, box-shadow .15s;
}
.auth-input-wrap:focus-within {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 1px var(--primary-500);
  background: var(--grey-white);
}
.auth-input-icon {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.auth-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-base);
}
.auth-input::placeholder { color: var(--grey-400); }
.auth-input:disabled { opacity: .6; cursor: not-allowed; }

.auth-identity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  background: var(--grey-100);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
}
.auth-identity i { color: var(--color-text-muted); }

/* Primary CTA used across auth flows. Solid black for high contrast. */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: 10px var(--space-4);
  background: var(--color-text-base);
  border: 1px solid var(--color-text-base);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--grey-white);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-primary:hover  { background: var(--grey-800); border-color: var(--grey-800); }
.btn-primary:active { background: var(--grey-700); border-color: var(--grey-700); }
.btn-primary:disabled,
.btn-primary[disabled] { opacity: .55; cursor: not-allowed; }

.btn-sso {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: 10px var(--space-4);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-base);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn-sso:hover  { background: var(--grey-100); }
.btn-sso:active { background: var(--grey-200); }
.btn-sso:disabled { opacity: .55; cursor: not-allowed; }
.sso-icon { width: 20px; height: 20px; flex-shrink: 0; }

.auth-message {
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: center;
  line-height: 1.4;
  border: 1px solid transparent;
}
.auth-message.is-error   { background: var(--danger-100);  color: var(--danger-500);  border-color: var(--danger-200);  }
.auth-message.is-success { background: var(--success-100); color: var(--success-500); border-color: var(--success-200); }
.auth-message.is-info    { background: var(--primary-50);  color: var(--primary-700); border-color: var(--primary-100); }

.auth-footer {
  text-align: center;
}
.auth-link {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color .15s, border-color .15s;
}
.auth-link:hover {
  color: var(--color-text-base);
  border-bottom-color: var(--color-text-base);
}

/* Sentinel that the page is running against develop. Removed in production
   deploys (see prior commit history on main). */
.dev-badge {
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  background: var(--warning-200);
  color: var(--warning-500);
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--warning-300);
  z-index: 50;
}

/* The auth pages need scroll on small viewports — relax the dashboard reset. */
html.auth, body.auth {
  height: auto;
  overflow: auto;
}
