/* WAM Tools Portal — Design System v4
 * Fase 1: Portal + Financial hub redesign.
 * Tokens imported from tokens.css; components below.
 */
@import url('tokens.css');

/* ── LEGACY TOKEN ALIASES ───────────────────────────────
   Cashflow, Planillas, HR reference these old names.
   Keep them mapped so submodules don't break.         */
:root {
  --wam-red:        var(--wam-pink);
  --wam-grad:       var(--wam-gradient);
  --bg:             var(--wam-black);
  --surface-1:      var(--wam-black);
  --surface-2:      var(--wam-black-soft);
  --surface-3:      var(--wam-black-raised);
  --text-primary:   var(--wam-text-primary);
  --text-secondary: var(--wam-text-secondary);
  --text-tertiary:  var(--wam-text-tertiary);
  --border-subtle:  var(--wam-border-soft);
  --border-default: var(--wam-border);
  --border-strong:  rgba(255,255,255,0.18);
  --color-success:  var(--wam-success);
  --color-warning:  var(--wam-warning);
  --color-danger:   var(--wam-danger);
  --color-info:     var(--wam-info);
  --r-sm:  var(--radius-sm);
  --r-md:  var(--radius-md);
  --r-lg:  var(--radius-lg);
  --r-xl:  var(--radius-xl);
  --r-pill: var(--radius-full);
  --font-display: var(--font-serif);
  --font-body:    var(--font-sans);
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;
  --z-base:    1;
  --z-above:   10;
  --z-header:  100;
  --z-overlay: 500;
  --z-toast:   1000;
}

/* ── RESET ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { -webkit-text-size-adjust: 100%; tab-size: 4; }

body {
  background: var(--wam-black);
  color: var(--wam-text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
}

/* Gradient sutil del fondo */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--wam-gradient-subtle);
  pointer-events: none;
  z-index: 0;
}

/* Grain overlay — brand book: gradientes siempre con textura */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  opacity: 0.4;
}

img, video { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
a { color: inherit; }

/* ── GRAIN TEXTURE ───────────────────────────────────── */
.grain-overlay {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.30;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* ── GLOW BLOBS (legacy, still used by some pages) ──── */
.glow-blob {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 0; filter: blur(60px);
}
.glow-blob--tr {
  top: -200px; right: -100px; width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(233,30,99,0.10) 0%, rgba(139,92,246,0.05) 40%, transparent 70%);
}
.glow-blob--bl {
  bottom: -200px; left: -100px; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
}

/* ── LAYOUT ──────────────────────────────────────────── */
.page-wrap {
  position: relative; z-index: var(--z-base);
  min-height: 100vh; display: flex; flex-direction: column;
}
.content-wrap {
  max-width: 1280px; margin: 0 auto;
  padding: 0 var(--space-12); width: 100%;
}

/* ── HEADER ──────────────────────────────────────────── */
.portal-header {
  position: sticky; top: 0; z-index: var(--z-header);
  border-bottom: none;
  background: rgba(10,10,15,0.80);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; align-items: center;
  padding: var(--space-6) 0;
}
.portal-header__inner {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.portal-header__left  { display: flex; align-items: center; gap: var(--space-4); }
.portal-header__right { display: flex; align-items: center; gap: var(--space-3); }

.header-logo { display: flex; align-items: center; gap: var(--space-3); }
.header-logo img { height: 34px; width: auto; }
.header-logo__text {
  font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600;
  color: var(--wam-text-primary); letter-spacing: -0.01em;
}
.header-sep { width: 1px; height: 22px; background: var(--wam-border); }
.header-area-label {
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--wam-text-tertiary);
}

/* ── USER PILL ───────────────────────────────────────── */
.user-pill {
  display: flex; align-items: center; gap: var(--space-2);
  border: 1px solid var(--wam-border); border-radius: var(--radius-full);
  padding: 5px 14px 5px 5px;
}
.user-pill__avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
}
.user-pill__avatar img  { width: 100%; height: 100%; object-fit: cover; }
.user-pill__avatar-fb {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--wam-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.user-pill__name  { font-size: 13px; font-weight: 500; color: var(--wam-text-primary); }
.user-pill__email { font-size: 10px; color: var(--wam-text-secondary); }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 14px 28px; border-radius: var(--radius-full);
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent; text-decoration: none;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); transition-duration: 100ms; }

.btn--ghost {
  background: transparent; border-color: var(--wam-border);
  color: var(--wam-text-secondary);
}
.btn--ghost:hover { background: var(--wam-black-raised); border-color: rgba(255,255,255,0.2); color: var(--wam-text-primary); }

.btn--danger {
  background: transparent;
  border-color: rgba(239,68,68,0.3);
  color: var(--wam-danger);
}
.btn--danger:hover { background: rgba(239,68,68,0.1); border-color: var(--wam-danger); }

.btn--primary {
  background: var(--wam-gradient); border-color: transparent; color: #fff;
}
.btn--primary:hover { filter: brightness(1.1); box-shadow: var(--glow-pink); }

.btn--save {
  background: var(--wam-success); border-color: transparent;
  color: var(--wam-black); font-weight: 600;
}
.btn--save:hover { filter: brightness(1.08); box-shadow: 0 0 24px rgba(14, 207, 130, 0.30); }
.btn--save.saving { opacity: 0.5; pointer-events: none; }

/* ── SECTION LABEL ───────────────────────────────────── */
.section-label {
  font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--wam-text-tertiary);
  display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-8);
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--wam-border-soft);
}

/* ── HERO TEXT ────────────────────────────────────────── */
.hero-eyebrow {
  font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--wam-text-tertiary);
  margin-bottom: var(--space-6);
  animation: wam-fade-in-up var(--t-slow) var(--ease-expo) both;
  animation-delay: 100ms;
  --fade-distance: 16px;
}
.hero-title {
  font-family: var(--font-sans); font-weight: 700;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.05; letter-spacing: -0.02em; color: var(--wam-text-primary);
  animation: wam-fade-in-up var(--t-slow) var(--ease-expo) both;
  animation-delay: 200ms;
  --fade-distance: 16px;
}
.hero-title em,
.hero-title .wam-italic-gradient {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  background: var(--wam-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  padding: 0.1em 0.2em 0.15em 0.15em;
  margin: -0.1em -0.2em -0.15em -0.15em;
}

/* ── HUB LAYOUT ──────────────────────────────────────── */
.hub-main { position: relative; z-index: 1; flex: 1; }
.hub-content { padding-top: var(--space-20); padding-bottom: var(--space-20); }
.hub-hero { margin-bottom: var(--space-16); }

/* ── MODULE GRID ─────────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.module-card {
  background: var(--wam-black-soft);
  padding: 40px;
  text-decoration: none; display: flex; flex-direction: column;
  position: relative; overflow: hidden; min-height: 320px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  transition:
    background var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    transform 100ms var(--ease-out);
  /* Stagger animation */
  animation: wam-fade-in-up var(--t-slow) var(--ease-expo) both;
  --fade-distance: 24px;
}
.module-card:nth-child(1) { animation-delay: 250ms; }
.module-card:nth-child(2) { animation-delay: 330ms; }
.module-card:nth-child(3) { animation-delay: 410ms; }

.module-card--active:hover {
  background: var(--wam-black-raised);
  box-shadow: var(--shadow-card-hover);
}
.module-card--active:active { transform: scale(0.98); }
.module-card--coming {
  cursor: not-allowed;
  opacity: 0.6;
}

.module-card__num {
  font-family: var(--font-serif); font-style: italic;
  font-size: var(--text-sm); color: var(--wam-text-tertiary);
  margin-bottom: var(--space-12);
}

.module-card__icon {
  width: 72px; height: 72px; border-radius: var(--radius-lg);
  border: 1px solid var(--wam-border);
  background: var(--wam-black-raised);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-6);
  transition: border-color var(--t-base) var(--ease-out);
}
.module-card__icon svg {
  width: 28px; height: 28px;
  stroke: var(--wam-text-primary);
  stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--t-base);
}
.module-card--active:hover .module-card__icon {
  border-color: rgba(233,30,99,0.3);
}

/* Corner decorative icon */
.module-card__corner-icon {
  position: absolute; top: 24px; right: 24px;
}
.module-card__corner-icon svg {
  width: 18px; height: 18px;
  stroke: var(--wam-text-muted); stroke-width: 1.5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}
.module-card--active:hover .module-card__corner-icon svg {
  stroke: var(--wam-pink);
}

.module-card__title {
  font-size: var(--text-2xl); font-weight: 600; color: var(--wam-text-primary);
  margin-bottom: var(--space-2); letter-spacing: -0.02em;
}
.module-card--coming .module-card__title { color: var(--wam-text-muted); }

.module-card__sub {
  font-size: var(--text-base); color: var(--wam-text-secondary); line-height: 1.5; flex: 1;
}
.module-card--coming .module-card__sub { color: var(--wam-text-muted); }

/* Mini-badges (informational pills inside cards) */
.module-card__badges {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4);
}
.module-card__badge-pill {
  font-size: var(--text-xs); color: var(--wam-text-secondary);
  background: var(--wam-black-raised); padding: 4px 12px;
  border-radius: var(--radius-full);
}

.module-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: var(--space-6);
}
.module-card__status {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase;
}
.module-card__status--live { color: var(--wam-pink); }
.module-card__status--coming { color: var(--wam-text-muted); }

.badge-active-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--wam-pink);
  animation: wam-pulse 2s ease-in-out infinite;
}

.module-card__arrow {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--wam-border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t-base) var(--ease-out);
}
.module-card__arrow svg {
  width: 16px; height: 16px;
  stroke: var(--wam-text-secondary); stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--t-base), transform var(--t-base);
}
.module-card--active:hover .module-card__arrow {
  background: var(--wam-gradient); border-color: transparent;
}
.module-card--active:hover .module-card__arrow svg {
  stroke: #fff; transform: translateX(2px);
}

/* ── LOGIN CARD ──────────────────────────────────────── */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: var(--space-6);
}
.login-card {
  width: 100%; max-width: 380px;
  animation: wam-fade-in-up var(--t-slow) var(--ease-expo) both;
  --fade-distance: 20px;
}
.login-logo { text-align: center; margin-bottom: var(--space-12); }
.login-logo img { height: 72px; width: auto; margin: 0 auto; }
.login-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: rgba(255,255,255,0.04); border: 1px solid var(--wam-border);
  border-radius: var(--radius-full); padding: 5px 14px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--wam-text-tertiary);
  margin-bottom: var(--space-8);
}
.login-heading {
  font-family: var(--font-serif);
  font-size: 26px; font-weight: 400; letter-spacing: -0.5px;
  margin-bottom: var(--space-2); line-height: 1.2;
}
.login-subheading {
  font-size: 13px; color: var(--wam-text-secondary);
  margin-bottom: var(--space-8); line-height: 1.6;
}
.btn--google {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  width: 100%; padding: 15px 24px;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--radius-full); color: var(--wam-text-primary);
  font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.btn--google:hover {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}
.btn--google svg { width: 18px; height: 18px; flex-shrink: 0; }

.login-divider { height: 1px; background: var(--wam-border-soft); margin: var(--space-8) 0 var(--space-6); }
.login-footer { text-align: center; font-size: 11px; color: var(--wam-text-tertiary); line-height: 1.7; }

.alert {
  padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px;
  margin-bottom: var(--space-6); border: 1px solid transparent; line-height: 1.5;
}
.alert--error   { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); color: rgba(255,120,130,0.95); }
.alert--success { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); color: var(--wam-success); }

/* ── TOAST ───────────────────────────────────────────── */
#wam-toast {
  position: fixed; bottom: var(--space-6); right: var(--space-6);
  z-index: var(--z-toast); max-width: 340px;
  background: var(--wam-black-soft); border: 1px solid var(--wam-border);
  border-radius: var(--radius-lg); padding: 12px 18px;
  font-size: 13px; color: var(--wam-text-primary);
  display: flex; align-items: center; gap: var(--space-3);
  transform: translateY(12px); opacity: 0;
  transition: all var(--t-base) var(--ease-out);
  pointer-events: none;
}
#wam-toast.show { transform: translateY(0); opacity: 1; pointer-events: auto; }
#wam-toast.success { border-color: rgba(16,185,129,0.3); }
#wam-toast.error   { border-color: rgba(239,68,68,0.3); }

/* ── SAVE INDICATOR ──────────────────────────────────── */
.save-indicator {
  font-size: 10px; color: var(--wam-text-tertiary);
  font-family: var(--font-mono); letter-spacing: 0.3px;
}

/* ── FOOTER ──────────────────────────────────────────── */
.portal-footer {
  border-top: 1px solid var(--wam-border-soft);
  padding: var(--space-6) 0;
  margin-top: auto;
}
.portal-footer .content-wrap {
  display: flex; align-items: center; justify-content: space-between;
}
.portal-footer__left  { font-size: 11px; color: var(--wam-text-muted); }
.portal-footer__right { font-size: 11px; color: var(--wam-text-muted); font-family: var(--font-mono); }

/* ── UTILITIES ───────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-gradient {
  background: var(--wam-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════════════════════
   SHARED COMPONENTS v2.0 — Design System Foundation
   Consumed by all modules. Never duplicate in sub-modules.
   ══════════════════════════════════════════════════════ */

/* ── KPI CARD ───────────────────────────────────────── */
.kpi-card {
  background: var(--wam-black-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-6) var(--space-8);
  border: 1px solid var(--wam-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-out);
}

.kpi-card__label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--wam-text-tertiary);
}

.kpi-card__value {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: 500;
  color: var(--wam-text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-card__sub {
  font-size: var(--text-sm);
  color: var(--wam-text-secondary);
}

.kpi-card__meta {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-2);
}

.kpi-card--healthy  { border-top: 2px solid var(--wam-success); }
.kpi-card--warning  { border-top: 2px solid var(--wam-warning); }
.kpi-card--critical { border-top: 2px solid var(--wam-danger); }
.kpi-card--featured {
  border-top: 2px solid var(--wam-bold-red);
  box-shadow: 0 -8px 32px -16px rgba(238, 31, 72, 0.25);
}

.kpi-card--featured .kpi-card__value {
  background: var(--wam-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── BADGE / PILL ───────────────────────────────────── */
.wam-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.wam-badge--success {
  background: var(--wam-success-soft);
  color: var(--wam-success);
  border-color: rgba(14, 207, 130, 0.25);
}

.wam-badge--warning {
  background: var(--wam-warning-soft);
  color: var(--wam-warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.wam-badge--danger {
  background: var(--wam-danger-soft);
  color: var(--wam-danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.wam-badge--info {
  background: var(--wam-info-soft);
  color: var(--wam-info);
  border-color: rgba(7, 76, 231, 0.25);
}

.wam-badge--neutral {
  background: rgba(255, 255, 255, 0.05);
  color: var(--wam-text-secondary);
  border-color: var(--wam-border);
}

.wam-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: wam-pulse 2s ease-in-out infinite;
}

/* ── TABLE ──────────────────────────────────────────── */
.wam-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--wam-black-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--wam-border);
}

.wam-table thead th {
  background: rgba(255, 255, 255, 0.02);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wam-text-tertiary);
  border-bottom: 1px solid var(--wam-border);
  white-space: nowrap;
}

.wam-table tbody td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--wam-text-primary);
  border-bottom: 1px solid var(--wam-border-soft);
}

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

.wam-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.wam-table .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.wam-table tfoot td,
.wam-table .row-total td {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: var(--wam-text-primary);
  border-top: 1px solid var(--wam-border);
}

/* ── INPUT EDITABLE INLINE ──────────────────────────── */
.wam-input-inline {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  border-image: var(--wam-gradient) 1;
  border-image-slice: 1;
  color: var(--wam-text-primary);
  font: inherit;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: var(--space-1) var(--space-2);
  width: 100%;
  min-width: 60px;
  transition: box-shadow var(--t-base) var(--ease-out);
}

.wam-input-inline:hover {
  background: rgba(255, 255, 255, 0.02);
}

.wam-input-inline:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 2px 0 0 var(--wam-rebel), var(--glow-rebel);
}

/* ── MODAL ──────────────────────────────────────────── */
.wam-modal-backdrop[hidden] { display: none; }

.wam-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: wam-fade-in-up var(--t-base) var(--ease-out);
  --fade-distance: 0px;
}

.wam-modal {
  background: var(--wam-black-soft);
  border: 1px solid var(--wam-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 560px;
  width: calc(100% - var(--space-8));
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  animation: wam-fade-in-up var(--t-base) var(--ease-expo);
  --fade-distance: 24px;
}

.wam-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.wam-modal__title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--wam-text-primary);
}

.wam-modal__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.wam-modal__label {
  font-size: var(--text-sm);
  color: var(--wam-text-secondary);
}

.wam-modal__input,
.wam-modal__textarea,
.wam-modal__select {
  background: var(--wam-black);
  border: 1px solid var(--wam-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--wam-text-primary);
  font: inherit;
  font-family: var(--font-sans);
  width: 100%;
  transition: border-color var(--t-fast) var(--ease-out);
}

.wam-modal__textarea {
  min-height: 96px;
  resize: vertical;
}

.wam-modal__input:focus,
.wam-modal__textarea:focus,
.wam-modal__select:focus {
  outline: none;
  border-color: var(--wam-bold-red);
  box-shadow: 0 0 0 3px rgba(238, 31, 72, 0.15);
}

.wam-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ── TABS ───────────────────────────────────────────── */
.wam-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--wam-border);
  padding: 0 var(--space-2);
  margin-bottom: var(--space-8);
}

.wam-tab {
  background: transparent;
  border: none;
  padding: var(--space-4) var(--space-5);
  font: inherit;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--wam-text-tertiary);
  cursor: pointer;
  position: relative;
  transition: color var(--t-base) var(--ease-out);
}

.wam-tab:hover {
  color: var(--wam-text-secondary);
}

.wam-tab--active {
  color: var(--wam-text-primary);
}

.wam-tab--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--wam-gradient);
  border-radius: var(--radius-full);
}

/* ── ALERT BANNER ───────────────────────────────────── */
.wam-alert-banner {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid;
  align-items: center;
  font-size: var(--text-sm);
}

.wam-alert-banner__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.wam-alert-banner__label {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: var(--text-xs);
  margin-right: var(--space-2);
}

.wam-alert-banner--critical {
  background: var(--wam-danger-soft);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--wam-text-primary);
}
.wam-alert-banner--critical .wam-alert-banner__icon,
.wam-alert-banner--critical .wam-alert-banner__label {
  color: var(--wam-danger);
}

.wam-alert-banner--warning {
  background: var(--wam-warning-soft);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--wam-text-primary);
}
.wam-alert-banner--warning .wam-alert-banner__icon,
.wam-alert-banner--warning .wam-alert-banner__label {
  color: var(--wam-warning);
}

.wam-alert-banner--info {
  background: var(--wam-info-soft);
  border-color: rgba(7, 76, 231, 0.25);
  color: var(--wam-text-primary);
}
.wam-alert-banner--info .wam-alert-banner__icon,
.wam-alert-banner--info .wam-alert-banner__label {
  color: var(--wam-info);
}

/* ── SECTION LABEL ──────────────────────────────────── */
.wam-section {
  margin-bottom: var(--space-12);
}

.wam-section__label {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--wam-text-tertiary);
}

.wam-section__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    var(--wam-border) 0%,
    transparent 100%
  );
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1023px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .module-card { padding: 32px; min-height: 280px; }
  .hero-title { font-size: clamp(32px, 4.5vw, 48px); }
  .content-wrap { padding: 0 var(--space-6); }
}
@media (max-width: 639px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-card { padding: 28px; min-height: auto; }
  .module-card__num { margin-bottom: var(--space-6); }
  .module-card__icon { width: 56px; height: 56px; }
  .hero-title { font-size: 36px; }
  .hub-content { padding-top: var(--space-12); padding-bottom: var(--space-12); }
  .portal-header { padding: var(--space-4) 0; }
  .user-pill__email { display: none; }
  .portal-footer .content-wrap { flex-direction: column; gap: var(--space-2); text-align: center; }
}

/* ── HEADER ANIMATION ────────────────────────────────── */
.portal-header {
  animation: wam-fade-in-up 400ms var(--ease-expo) both;
  --fade-distance: -8px;
}
