@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@400;500;600;700;800&display=swap');

:root {
  /* Grupo Nosara · Libro de Marca 2025 */
  --brand-blue: #28509A;
  --brand-blue-rgb: 40, 80, 154;
  --brand-blue-950: #102A59;
  --brand-blue-900: #173A73;
  --brand-blue-800: #214783;
  --brand-blue-700: #28509A;
  --brand-blue-600: #3464B5;
  --brand-blue-500: #4C78C2;
  --brand-blue-200: #C7D5EB;
  --brand-blue-100: #EAF0F9;
  --brand-blue-50: #F4F7FC;
  --brand-yellow: #F3BF46;
  --brand-yellow-dark: #C99213;
  --brand-yellow-soft: #FFF6DD;
  --brand-green: #7EA34F;
  --brand-green-dark: #587936;
  --brand-green-soft: #EFF6E7;
  --brand-gray: #818285;
  --brand-black: #000000;
  --white: #FFFFFF;

  /* Compatibility aliases used by the existing application */
  --blue-950: var(--brand-blue-950);
  --blue-900: var(--brand-blue-900);
  --blue-800: var(--brand-blue-800);
  --blue-700: var(--brand-blue-700);
  --blue-600: var(--brand-blue-600);
  --blue-100: var(--brand-blue-100);

  --ink: #1A2440;
  --ink-soft: #34415E;
  --muted: #6F7480;
  --line: #DDE3EC;
  --line-strong: #CAD4E2;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFD;
  --bg: #F2F4F7;
  --success: #668F3E;
  --success-bg: #EEF6E8;
  --warning: #8A6406;
  --warning-bg: #FFF6DD;
  --danger: #B42318;
  --danger-bg: #FFF0EE;
  --info-bg: #EEF4FC;
  --shadow-sm: 0 4px 14px rgba(30, 56, 96, .06);
  --shadow: 0 14px 38px rgba(30, 56, 96, .09);
  --shadow-lg: 0 30px 80px rgba(12, 35, 74, .22);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 286px;
  --topbar: 76px;
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  font-family: "Red Hat Display", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 7%, rgba(243, 191, 70, .08), transparent 18rem),
    linear-gradient(180deg, #F7F8FA 0%, var(--bg) 38%, #EEF1F5 100%);
}
body.sidebar-open { overflow: hidden; }
a { color: var(--brand-blue); text-decoration: none; transition: color var(--transition), opacity var(--transition); }
a:hover { color: var(--brand-blue-900); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
code, .mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
code { background: var(--brand-blue-50); color: var(--brand-blue-900); padding: .12rem .34rem; border-radius: 5px; }
::selection { background: rgba(243, 191, 70, .42); color: var(--ink); }

/* =========================
   Guest / Login / Setup
   ========================= */
.guest-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 86% 8%, rgba(243, 191, 70, .22), transparent 18rem),
    linear-gradient(135deg, var(--brand-blue-950), var(--brand-blue));
  overflow-x: hidden;
}
.guest-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .7;
  background-image: url('../img/brand-pattern.svg');
  background-size: 280px 280px;
}
.guest-shell {
  position: relative;
  isolation: isolate;
  width: min(1240px, 100%);
  min-height: 690px;
  display: grid;
  grid-template-columns: minmax(460px, 1.05fr) minmax(430px, .95fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
}
.guest-brand {
  position: relative;
  min-height: 690px;
  padding: clamp(44px, 5vw, 74px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(160deg, rgba(40, 80, 154, .88) 0%, rgba(20, 54, 111, .94) 58%, rgba(13, 39, 82, .98) 100%),
    url('../img/login-construction.jpg') center / cover no-repeat;
}
.guest-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 17%, rgba(243, 191, 70, .28), transparent 13rem),
    linear-gradient(180deg, transparent 45%, rgba(7, 29, 58, .24));
  pointer-events: none;
}
.guest-brand::after {
  content: "";
  position: absolute;
  left: -32px;
  bottom: -18px;
  width: 310px;
  height: 250px;
  opacity: .22;
  background: url('../img/sun-rays.svg') center / contain no-repeat;
  filter: brightness(0) invert(1);
  transform: rotate(-18deg);
  pointer-events: none;
}
.guest-brand-inner { position: relative; z-index: 1; max-width: 560px; }
.guest-logo { width: min(470px, 86%); margin-bottom: 34px; }
.guest-system-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: rgba(255,255,255,.88);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.guest-system-label::before {
  content: "";
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-yellow);
}
.guest-brand h1 {
  margin: 0 0 16px;
  max-width: 520px;
  color: var(--white);
  font-size: clamp(2.15rem, 4vw, 3.45rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -.035em;
}
.guest-brand p {
  margin: 0;
  max-width: 520px;
  color: rgba(255,255,255,.82);
  font-size: 1.06rem;
  line-height: 1.75;
}
.guest-brand-features {
  display: grid;
  gap: 12px;
  margin-top: 34px;
  padding: 0;
  list-style: none;
}
.guest-brand-features li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,.9);
  font-size: .92rem;
  font-weight: 600;
}
.guest-brand-features li::before {
  content: "✓";
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  border-radius: 50%;
  color: var(--brand-blue-950);
  background: var(--brand-yellow);
  font-weight: 800;
}
.guest-card {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 5vw, 72px);
  background:
    radial-gradient(circle at 96% 4%, rgba(243,191,70,.11), transparent 12rem),
    var(--surface);
  overflow-y: auto;
}
.guest-card-inner { width: min(510px, 100%); margin: auto; }
.guest-mobile-logo { display: none; width: 260px; margin: 0 auto 34px; }
.guest-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
}
.guest-footer span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.guest-footer span:first-child::before { content: "●"; color: var(--brand-green); font-size: .7rem; }
.card-heading { margin-bottom: 30px; }
.card-heading h2, .page-header h1 {
  margin: .38rem 0 .62rem;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.025em;
}
.card-heading h2 { font-size: clamp(2rem, 3.2vw, 2.65rem); line-height: 1.06; }
.card-heading p, .page-header p, .card-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-blue);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-yellow);
  box-shadow: 0 0 0 4px rgba(243,191,70,.18);
}
.eyebrow-light { color: rgba(255,255,255,.88); }
.auth-form { gap: 20px; }
.auth-field { gap: 9px; }
.input-with-icon { position: relative; }
.input-with-icon > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--brand-blue);
  opacity: .72;
  pointer-events: none;
}
.input-with-icon input { padding-left: 48px !important; padding-right: 48px !important; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
}
.password-toggle:hover { color: var(--brand-blue); background: var(--brand-blue-50); }
.password-toggle svg { width: 19px; height: 19px; }
.security-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}
.security-note::before { content: "●"; color: var(--brand-green); font-size: .68rem; }

/* =========================
   Authenticated application
   ========================= */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(40,80,154,.98), rgba(19,54,109,.99)),
    url('../img/brand-pattern.svg') center / 260px 260px;
  box-shadow: 14px 0 34px rgba(25, 52, 98, .16);
}
.sidebar::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: 110px;
  width: 220px;
  height: 180px;
  opacity: .10;
  background: url('../img/sun-rays.svg') center / contain no-repeat;
  filter: brightness(0) invert(1);
  pointer-events: none;
}
.sidebar-brand {
  position: relative;
  z-index: 1;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 22px 22px 18px;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.sidebar-brand:hover { color: var(--white); text-decoration: none; }
.sidebar-logo { width: 214px; max-height: 63px; object-fit: contain; object-position: left center; }
.sidebar-brand small {
  margin-left: 2px;
  color: rgba(255,255,255,.67);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.sidebar-nav {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow: auto;
  padding: 18px 14px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.28) transparent;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin: 4px 0;
  padding: 10px 13px;
  border-radius: 11px;
  color: rgba(255,255,255,.76);
  font-size: .9rem;
  font-weight: 650;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,.10);
  transform: translateX(2px);
}
.nav-link.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(243,191,70,.27), rgba(255,255,255,.11));
  box-shadow: inset 4px 0 0 var(--brand-yellow);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-yellow);
}
.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  color: currentColor;
}
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-label {
  margin: 25px 12px 9px;
  color: rgba(255,255,255,.45);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.sidebar-footer {
  position: relative;
  z-index: 1;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.14);
  background: rgba(9,32,71,.17);
}
.user-summary { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.user-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 50%;
  color: var(--brand-blue-950);
  background: var(--brand-yellow);
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(243,191,70,.13);
}
.user-chip { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-chip strong, .user-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: var(--white); font-size: .88rem; }
.user-chip small { color: rgba(255,255,255,.62); font-size: .72rem; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 35; background: rgba(9,25,52,.55); backdrop-filter: blur(2px); }
.main-area { min-height: 100vh; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(202,212,226,.85);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(15px);
  box-shadow: 0 4px 18px rgba(31,61,105,.04);
}
.topbar-brand-mobile { display: none; width: 42px; height: 34px; object-fit: contain; }
.topbar-heading { display: flex; flex-direction: column; min-width: 0; }
.topbar-title {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-subtitle { color: var(--muted); font-size: .72rem; line-height: 1.25; }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}
.topbar-user .user-avatar { width: 38px; height: 38px; flex-basis: 38px; font-size: .9rem; }
.topbar-user-copy { display: flex; flex-direction: column; line-height: 1.2; }
.topbar-user-copy strong { font-size: .82rem; }
.topbar-user-copy small { color: var(--muted); font-size: .7rem; }
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--brand-blue);
  background: var(--brand-blue-50);
  font-size: .78rem;
  font-weight: 700;
}
.profile-link:hover { background: var(--brand-blue-100); }
.icon-button {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand-blue);
  background: var(--surface);
  font-size: 1.4rem;
}
.content { width: 100%; max-width: 1680px; margin: 0 auto; padding: 32px; flex: 1; }
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 32px 22px;
  padding: 16px 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: .75rem;
}
.app-footer-brand { display: flex; align-items: center; gap: 10px; color: var(--brand-blue); font-weight: 700; }
.app-footer-brand img { width: 38px; height: 28px; object-fit: contain; }
.app-footer-slogan { color: var(--brand-blue); }

/* Page framing */
.page-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 74px;
  height: 3px;
  border-radius: 99px;
  background: var(--brand-yellow);
}
.page-header h1 { font-size: clamp(1.75rem, 2.4vw, 2.25rem); line-height: 1.08; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Dashboard brand hero */
.dashboard-hero {
  position: relative;
  min-height: 235px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
  border-radius: 22px;
  color: var(--white);
  background:
    linear-gradient(100deg, rgba(28,68,133,.96), rgba(40,80,154,.88) 55%, rgba(23,58,115,.94)),
    url('../img/brand-construction-strip.jpg') center / cover no-repeat;
  box-shadow: var(--shadow);
}
.dashboard-hero::before {
  content: "";
  position: absolute;
  right: 16%;
  top: -50px;
  width: 220px;
  height: 170px;
  opacity: .16;
  background: url('../img/sun-rays.svg') center / contain no-repeat;
  filter: brightness(0) invert(1);
}
.dashboard-hero-copy { position: relative; z-index: 1; max-width: 760px; }
.dashboard-hero h1 { margin: 10px 0 10px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.02; letter-spacing: -.035em; }
.dashboard-hero p { margin: 0; max-width: 680px; color: rgba(255,255,255,.8); line-height: 1.65; }
.dashboard-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.dashboard-hero-mark { position: relative; z-index: 1; width: 165px; opacity: .95; filter: drop-shadow(0 10px 18px rgba(0,0,0,.08)); }

/* Containers and grids */
.card {
  position: relative;
  margin-bottom: 22px;
  padding: 23px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-yellow) 74%, transparent 74%);
  opacity: .85;
}
.card:hover { border-color: #D1DAE6; }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 17px; }
.card-header h2, .card h2 { margin: 0 0 5px; color: var(--ink); font-size: 1.12rem; font-weight: 800; }
.card h3 { color: var(--ink-soft); }
.narrow-card { max-width: 700px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card, .health-card {
  position: relative;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: rgba(40,80,154,.07);
}
.stat-card:nth-child(2)::after { background: rgba(243,191,70,.13); }
.stat-card:nth-child(3)::after { background: rgba(126,163,79,.13); }
.stat-card:nth-child(4)::after { background: rgba(129,130,133,.11); }
.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 11px;
  color: var(--white);
  background: var(--brand-blue);
}
.stat-card:nth-child(2) .stat-icon { color: var(--brand-blue-950); background: var(--brand-yellow); }
.stat-card:nth-child(3) .stat-icon { background: var(--brand-green); }
.stat-card:nth-child(4) .stat-icon { background: var(--brand-gray); }
.stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.stat-card span, .health-card span { color: var(--muted); font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-card strong, .health-card strong { color: var(--ink); font-size: 1.95rem; font-weight: 800; line-height: 1.1; }
.stat-card small, .health-card small { color: var(--muted); }
.health-card.ok { border-left: 5px solid var(--brand-green); }
.health-card.bad { border-left: 5px solid var(--danger); }
.health-card.pending { border-left: 5px solid var(--brand-yellow); }

/* Forms */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; align-items: end; }
.inline-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span, .static-field > span { color: var(--ink-soft); font-size: .79rem; font-weight: 750; }
.field small { color: var(--muted); font-size: .75rem; line-height: 1.45; }
.field input, .field select, .field textarea,
.catalog-row input, .activity-new input, .search-mini input, .config-item input, td input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: #FCFDFE;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.field input::placeholder, .field textarea::placeholder { color: #9BA4B2; }
.field select { cursor: pointer; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #AEBBD0; background: var(--white); }
.field input:focus, .field select:focus, .field textarea:focus,
.catalog-row input:focus, .config-item input:focus, td input:focus {
  border-color: var(--brand-blue);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(40,80,154,.11), 0 0 0 1px rgba(243,191,70,.38);
}
.field textarea { min-height: 112px; resize: vertical; }
.field.grow { flex: 1; min-width: 220px; }
.span-2 { grid-column: span 2; }
.align-end { align-self: flex-end; }
.form-actions, .filter-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.filter-actions { grid-column: 1 / -1; }
.check-field { flex-direction: row; align-items: center; gap: 10px; padding-top: 25px; }
.check-field input { width: 18px; min-height: 18px; accent-color: var(--brand-blue); }
.static-field { display: flex; flex-direction: column; gap: 9px; }
.static-field strong { padding: 10px 0; }
.assignment-box { padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.assignment-box legend { padding: 0 8px; color: var(--brand-blue); font-weight: 800; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.check-card {
  display: flex;
  gap: 10px;
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  background: var(--white);
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.check-card:hover { transform: translateY(-1px); border-color: var(--brand-blue-200); }
.check-card:has(input:checked) { border-color: var(--brand-blue); background: var(--brand-blue-50); box-shadow: inset 0 0 0 1px rgba(40,80,154,.05); }
.check-card input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--brand-blue); }
.check-card span { display: flex; flex-direction: column; gap: 3px; }
.check-card small { color: var(--muted); line-height: 1.35; }
.permission-group { margin-bottom: 24px; }
.permission-group h2 { padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--brand-blue); text-transform: capitalize; }
.permission-groups .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Buttons */
.btn {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  line-height: 1.1;
  font-weight: 750;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(243,191,70,.5); outline-offset: 2px; }
.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-900));
  box-shadow: 0 7px 16px rgba(40,80,154,.18);
}
.btn-primary:hover { color: var(--white); box-shadow: 0 10px 20px rgba(40,80,154,.24); }
.btn-secondary { color: var(--brand-blue); border-color: var(--brand-blue-200); background: var(--white); }
.btn-secondary:hover { color: var(--brand-blue-900); border-color: var(--brand-blue); background: var(--brand-blue-50); }
.btn-success { color: var(--white); background: var(--brand-green); }
.btn-warning { color: var(--brand-blue-950); background: var(--brand-yellow); box-shadow: 0 7px 16px rgba(201,146,19,.14); }
.btn-warning:hover { color: var(--brand-blue-950); background: #F5C95F; }
.btn-danger { color: var(--white); background: var(--danger); }
.btn-ghost { color: var(--white); border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.08); }
.btn-ghost:hover { color: var(--white); border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.14); }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: .77rem; }
.btn-block { width: 100%; }
.btn-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Alerts, badges, status */
.alert {
  position: relative;
  margin-bottom: 18px;
  padding: 14px 16px 14px 45px;
  border: 1px solid;
  border-radius: 11px;
  font-size: .9rem;
  line-height: 1.5;
}
.alert::before {
  position: absolute;
  left: 17px;
  top: 14px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 800;
}
.alert ul { margin: 7px 0 0; padding-left: 20px; }
.alert-success { color: #3F6625; border-color: #C5DDB4; background: var(--success-bg); }
.alert-success::before { content: "✓"; color: var(--white); background: var(--brand-green); }
.alert-warning { color: #785500; border-color: #EDD18D; background: var(--warning-bg); }
.alert-warning::before { content: "!"; color: var(--brand-blue-950); background: var(--brand-yellow); }
.alert-danger { color: #8D1B12; border-color: #F0B7B1; background: var(--danger-bg); }
.alert-danger::before { content: "×"; color: var(--white); background: var(--danger); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--brand-blue-900);
  background: var(--brand-blue-100);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .035em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge-success { color: var(--brand-green-dark); background: var(--brand-green-soft); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-soft { color: #566074; background: #EEF1F5; }
.result-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-left: 5px solid;
  border-radius: 11px;
}
.result-banner.success { color: #3F6625; border-color: var(--brand-green); background: var(--success-bg); }
.result-banner.warning { color: #785500; border-color: var(--brand-yellow); background: var(--warning-bg); }
.result-banner.danger { color: #8D1B12; border-color: var(--danger); background: var(--danger-bg); }
.status-panel { display: flex; gap: 12px; padding: 16px; border-radius: 11px; margin-bottom: 20px; }
.status-ready { background: var(--success-bg); }
.status-pending { background: var(--warning-bg); }
.status-dot { width: 11px; height: 11px; flex: 0 0 11px; margin-top: 6px; border-radius: 50%; background: currentColor; }
.status-panel p { margin: 4px 0 0; color: #596474; line-height: 1.5; }

/* Tables and data */
.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .86rem; }
th {
  padding: 12px 12px;
  border-bottom: 1px solid var(--brand-blue-200);
  color: var(--brand-blue-900);
  background: var(--brand-blue-50);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid #E8ECF2; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: #FAFBFD; }
.number { text-align: right; white-space: nowrap; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-cell, .empty-inline { padding: 34px; color: var(--muted); text-align: center; }
.block { display: block; }
.small-text { color: #586477; font-size: .78rem; }
.muted { color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding-top: 19px; }
.pagination a { min-width: 38px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); text-align: center; font-weight: 700; }
.pagination a:hover { border-color: var(--brand-blue); background: var(--brand-blue-50); }
.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-blue-50), #FBFCFE);
}
.summary-strip div, .detail-grid div { display: flex; flex-direction: column; gap: 5px; }
.summary-strip span, .detail-grid span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.detail-grid.large { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-grid strong { overflow-wrap: anywhere; }

/* Specialized components */
.timeline { margin-left: 8px; padding-left: 24px; border-left: 2px solid var(--brand-blue-200); }
.timeline article { position: relative; padding: 0 0 24px; }
.timeline-dot { position: absolute; left: -31px; top: 4px; width: 13px; height: 13px; border: 3px solid var(--white); border-radius: 50%; background: var(--brand-yellow); box-shadow: 0 0 0 2px var(--brand-blue); }
.timeline article div { display: flex; flex-direction: column; gap: 4px; }
.timeline small { color: var(--muted); }
.timeline p { margin: 4px 0 0; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 22px; }
.chip { padding: 7px 11px; border: 1px solid var(--brand-blue-200); border-radius: 999px; color: var(--brand-blue-900); background: var(--brand-blue-50); font-size: .77rem; font-weight: 750; }
.tabs { display: flex; gap: 5px; overflow-x: auto; margin-bottom: 21px; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 11px 14px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 750; white-space: nowrap; }
.tabs a:hover { color: var(--brand-blue); background: var(--brand-blue-50); }
.tabs a.active { margin-bottom: -1px; color: var(--brand-blue); border: 1px solid var(--line); border-bottom-color: var(--white); background: var(--white); box-shadow: inset 0 3px 0 var(--brand-yellow); }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.client-card { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(180deg, #FFF, #FBFCFE); }
.client-card-head { display: flex; justify-content: space-between; gap: 12px; }
.client-card-head div { display: flex; flex-direction: column; }
.client-card-head strong { color: var(--brand-blue-900); }
.client-card-head small { color: var(--muted); }
.client-card dl { display: grid; grid-template-columns: 95px 1fr; gap: 8px; margin: 16px 0; }
.client-card dt { color: var(--muted); font-size: .77rem; }
.client-card dd { margin: 0; overflow-wrap: anywhere; }
.inline-update { display: flex; align-items: end; gap: 10px; }
.inline-update .field { flex: 1; }
.form-list { display: flex; flex-direction: column; gap: 9px; }
.catalog-row { display: grid; grid-template-columns: 120px 1fr auto auto; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; }
.catalog-row:nth-child(odd) { background: var(--surface-soft); }
.currency-row { grid-template-columns: 70px 1fr 70px auto auto; }
.new-row { margin-top: 5px; padding-top: 13px; border-top: 1px dashed var(--line-strong); background: var(--brand-yellow-soft) !important; }
.short-input { max-width: 80px; }
.activity-new { display: grid; grid-template-columns: 150px 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--brand-blue-50); }
.wide-input { min-width: 360px; }
.search-mini { display: flex; gap: 8px; }
.config-list { display: flex; flex-direction: column; }
.config-item { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(250px, 1fr); gap: 20px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.config-item span { display: flex; flex-direction: column; gap: 4px; }
.config-item small { color: var(--muted); }
.requirements { line-height: 1.9; }
.empty-state { max-width: 720px; margin: 35px auto; padding: 64px 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); text-align: center; }
.empty-icon { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 50%; color: var(--brand-blue); background: var(--brand-blue-50); font-size: 2rem; }
.empty-state h1 { margin-bottom: 8px; }
.autocomplete-field { position: relative; }
.autocomplete-results { display: none; position: absolute; left: 0; right: 0; top: calc(100% - 2px); z-index: 50; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--white); box-shadow: 0 18px 38px rgba(28,53,83,.15); }
.autocomplete-results.open { display: block; }
.autocomplete-option { width: 100%; display: flex; flex-direction: column; gap: 3px; padding: 12px 13px; border: 0; border-bottom: 1px solid #EDF1F5; background: var(--white); text-align: left; cursor: pointer; }
.autocomplete-option:hover, .autocomplete-option:focus { outline: none; background: var(--brand-blue-50); }
.autocomplete-option small, .autocomplete-message { color: var(--muted); font-size: .78rem; }
.autocomplete-message { padding: 13px; }
.autocomplete-message.error { color: var(--danger); }

/* Standalone errors */
.brand-error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, var(--brand-blue-950), var(--brand-blue)); }
.brand-error-box { width: min(640px, 100%); padding: 42px; border-radius: 22px; background: var(--white); box-shadow: var(--shadow-lg); text-align: center; }
.brand-error-logo { width: 96px; margin: 0 auto 18px; }
.brand-error-box h1 { margin: 0 0 12px; color: var(--brand-blue-900); font-size: 2rem; }
.brand-error-box p { color: var(--muted); line-height: 1.65; }

/* Responsive */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid, .detail-grid.large { grid-template-columns: repeat(2, 1fr); }
  .check-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-hero-mark { width: 135px; }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-backdrop, .sidebar-backdrop.open { display: block; }
  .main-area { margin-left: 0; }
  .icon-button { display: grid; }
  .topbar-brand-mobile { display: block; }
  .content { padding: 24px; }
  .app-footer { margin-inline: 24px; }
}
@media (max-width: 900px) {
  .guest-body { padding: 16px; }
  .guest-shell { grid-template-columns: 1fr; min-height: auto; max-width: 660px; }
  .guest-brand { display: none; }
  .guest-card { min-height: calc(100vh - 32px); padding: 38px 32px; }
  .guest-mobile-logo { display: block; }
  .grid-2, .grid-3, .client-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-hero-mark { display: none; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .permission-groups .check-grid { grid-template-columns: 1fr; }
  .catalog-row, .currency-row, .activity-new { grid-template-columns: 1fr; }
  .wide-input { min-width: 0; }
  .config-item { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 640px) {
  :root { --topbar: 68px; }
  .content { padding: 16px; }
  .topbar { padding: 0 14px; }
  .topbar-user-copy, .profile-link { display: none; }
  .topbar-user { padding-left: 10px; border-left: 0; }
  .topbar-heading { max-width: calc(100vw - 168px); }
  .stats-grid, .filter-grid, .form-grid, .check-grid, .summary-strip, .detail-grid, .detail-grid.large { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .inline-form { align-items: stretch; }
  .inline-form .field, .inline-form .btn { width: 100%; }
  .card { padding: 17px; border-radius: 14px; }
  .page-header h1 { font-size: 1.65rem; }
  .dashboard-hero { min-height: 0; padding: 26px 22px; border-radius: 17px; }
  .dashboard-hero h1 { font-size: 2rem; }
  .guest-card { padding: 30px 22px; }
  .guest-footer { flex-direction: column; text-align: center; align-items: center; }
  .guest-mobile-logo { width: 220px; }
  .app-footer { flex-direction: column; align-items: flex-start; margin-inline: 16px; }
  .table-wrap { border-radius: 10px; }
}


/* =========================================================
   Microinteraccion de marca: pulso suave de puntos amarillos
   - Punto del menu activo
   - Punto de los encabezados tipo "Resumen operativo"
   ========================================================= */
.eyebrow::before,
.nav-link.active::after {
  animation: brand-dot-breathe 3.4s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, opacity, box-shadow;
}

.eyebrow::before {
  --brand-dot-rest-ring: 4px;
}

.nav-link.active::after {
  --brand-dot-rest-ring: 0px;
}

@keyframes brand-dot-breathe {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    background-color: var(--brand-yellow);
    box-shadow: 0 0 0 var(--brand-dot-rest-ring) rgba(243, 191, 70, .18);
  }
  42% {
    opacity: .62;
    transform: scale(.88);
    background-color: var(--brand-yellow);
    box-shadow: 0 0 0 2px rgba(243, 191, 70, .08);
  }
  68% {
    opacity: .96;
    transform: scale(1.05);
    background-color: var(--brand-yellow);
    box-shadow: 0 0 0 7px rgba(243, 191, 70, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
  .eyebrow::before, .nav-link.active::after { animation: none !important; }
}
@media print {
  .sidebar, .topbar, .app-footer, .header-actions, .filter-card, .btn { display: none !important; }
  .main-area { margin: 0; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* =========================================================
   Reportes: encabezados ordenables
   ========================================================= */
.table-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.table-sort:hover,
.table-sort:focus-visible,
.table-sort.active {
  color: var(--brand-blue);
  text-decoration: none;
}

.sort-indicator {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  color: var(--brand-yellow-dark, #c78c00);
  font-size: .82rem;
  line-height: 1;
  opacity: .68;
}

.table-sort.active .sort-indicator {
  opacity: 1;
}

.check-card.is-locked {
  cursor: default;
  background: rgba(40, 80, 154, .045);
}

.check-card.is-locked input {
  accent-color: var(--brand-blue);
}
