/* ============================================================
   Portal LACSAC — estilos base
   ============================================================ */

:root {
  --navy-950: #061c37;
  --navy-900: #082647;
  --navy-800: #0b2f5e;
  --navy-700: #123f78;
  --blue-700: #17529c;
  --blue-600: #1d5fae;
  --blue-100: #dce9f8;
  --blue-50: #eef4fb;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dce2ea;
  --border-strong: #c5cfdb;
  --text: #172033;
  --text-soft: #344054;
  --muted: #667085;
  --green-700: #067647;
  --green-100: #dcfae6;
  --green-50: #ecfdf3;
  --amber-800: #92400e;
  --amber-100: #fef0c7;
  --red-700: #b42318;
  --red-100: #fee4e2;
  --red-50: #fef3f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 12px 32px rgba(8, 30, 60, 0.14);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue-700); }

.hidden { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(29, 95, 174, 0.35);
  outline-offset: 2px;
}

/* ---------------------------- Boot ---------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--navy-950);
  z-index: 50;
}

.boot-card {
  display: grid;
  justify-items: center;
  gap: 18px;
  color: #dbe7f5;
  text-align: center;
  padding: 24px;
}

.boot-logo { width: min(280px, 70vw); filter: brightness(0) invert(1); }

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

/* ---------------------------- Login ---------------------------- */

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  background: var(--surface);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 72px);
  color: #eaf2fb;
  background:
    radial-gradient(circle at 18% 8%, rgba(54, 130, 214, 0.35), transparent 38%),
    radial-gradient(circle at 92% 88%, rgba(23, 82, 156, 0.35), transparent 42%),
    linear-gradient(150deg, var(--navy-950) 0%, var(--navy-800) 55%, var(--navy-700) 100%);
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto -120px -180px auto;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.brand-block { position: relative; z-index: 1; }

.brand-logo img { display: block; width: 100%; }
.brand-logo.large { width: min(300px, 62%); filter: brightness(0) invert(1); }
.brand-logo.small { width: 132px; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-600);
}

.login-brand .eyebrow { color: #9dc3ee; margin-top: 34px; }

.login-brand h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.login-lead {
  margin: 0;
  max-width: 46ch;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #c3d6ea;
}

.login-features {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 44ch;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.94rem;
  color: #d9e7f6;
}

.feature-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #b9f5d0;
  font-size: 0.75rem;
  flex: 0 0 auto;
}

.login-brand-footer {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fadcd;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  background: var(--surface);
}

.login-card { width: min(420px, 100%); }

.login-card-head h2 {
  margin: 0 0 6px;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.login-card-head p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.55;
}

.field { display: grid; gap: 7px; margin-bottom: 16px; }

.field span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(29, 95, 174, 0.12);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: progress; }

.btn-primary {
  background: var(--navy-800);
  color: #ffffff;
}

.btn-primary:hover:not(:disabled) { background: var(--navy-700); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.btn-secondary:hover { background: var(--surface-soft); }

.btn-block { width: 100%; }

.form-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f3b6b2;
  border-radius: var(--radius-sm);
  background: var(--red-50);
  color: var(--red-700);
  font-size: 0.88rem;
  line-height: 1.45;
}

.login-help {
  margin: 22px 0 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------------------------- Sin acceso ---------------------------- */

.no-access-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(23, 82, 156, 0.12), transparent 45%),
    var(--bg);
}

.no-access-card {
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 48px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.no-access-card img { width: 190px; margin: 0 auto 26px; }

.no-access-card h1 {
  margin: 14px 0 10px;
  font-size: 1.5rem;
  line-height: 1.3;
}

.no-access-card p { color: var(--muted); line-height: 1.6; margin: 0 0 24px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-100);
  color: var(--amber-800);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------------------------- App shell ---------------------------- */

.app-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  gap: 22px;
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: 10px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-link:hover { background: var(--surface-soft); color: var(--text); }

.nav-link.is-active {
  background: var(--blue-50);
  color: var(--blue-700);
}

.nav-link [data-icon] { display: inline-flex; }

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy-800);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.user-meta {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.user-meta strong {
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.user-meta small {
  font-size: 0.74rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.icon-btn:hover { background: var(--surface-soft); color: var(--text); }

.page {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) clamp(16px, 4vw, 32px) 56px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.025em;
}

.page-lead {
  margin: 0;
  max-width: 64ch;
  color: var(--muted);
  line-height: 1.6;
}

.head-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-700);
  box-shadow: 0 0 0 4px var(--green-50);
}

/* ---------------------------- Tarjetas ---------------------------- */

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.app-card {
  --accent: var(--blue-700);
  --accent-soft: var(--blue-50);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--accent);
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 30px rgba(8, 30, 60, 0.1);
}

.app-card[data-app="seguimiento"] { --accent: #17529c; --accent-soft: #e8f1fb; }
.app-card[data-app="corimayo"] { --accent: #0f766e; --accent-soft: #e6f7f4; }
.app-card[data-app="maestranza"] { --accent: #b45309; --accent-soft: #fff4e5; }

.app-card.is-inactive { opacity: 0.72; }
.app-card.is-inactive::before { background: var(--border-strong); }

.app-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.app-card h2 {
  margin: 0 0 5px;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.status-line .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-700);
}

.status-line.is-off .status-dot { background: var(--muted); }

.app-card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.app-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--navy-800);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.app-open:hover { background: var(--navy-700); }

.app-open.is-disabled {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--muted);
  pointer-events: none;
}

.empty-note {
  margin: 26px 0 0;
  padding: 18px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* ---------------------------- Mi cuenta ---------------------------- */

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 1.04rem;
  letter-spacing: -0.01em;
}

.detail-list { margin: 0; display: grid; gap: 14px; }

.detail-list div {
  display: grid;
  gap: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-list div:last-child { border-bottom: 0; padding-bottom: 0; }

.detail-list dt {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-list dd { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }

.account-apps { display: grid; gap: 10px; }

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.account-row strong { display: block; font-size: 0.92rem; }
.account-row small { color: var(--muted); font-size: 0.78rem; }

.account-row .role-chip { flex: 0 0 auto; }

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 18px clamp(16px, 4vw, 32px) 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------------------------- Responsive ---------------------------- */

@media (max-width: 900px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { min-height: 42vh; padding: 36px 28px; }
  .login-features { display: none; }
  .login-panel { padding: 36px 24px 48px; }
  .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .main-nav { order: 3; width: 100%; margin: 0; }
  .nav-link { flex: 1; justify-content: center; }
  .topbar-user { margin-left: auto; }
  .user-meta { display: none; }
  .page-head { flex-direction: column; gap: 14px; }
  .app-footer { flex-direction: column; }
}

/* ---------------------------- Accesos ---------------------------- */

.head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm { min-height: 36px; padding: 7px 12px; font-size: 0.84rem; }

.btn-danger {
  background: var(--red-700);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) { background: #8f1c13; }

.access-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: min(380px, 100%);
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}

.search-field input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  color: var(--text);
}

.access-loading {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.access-list { display: grid; gap: 12px; }

.access-card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.access-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.access-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
  margin-right: auto;
}

.access-identity strong { font-size: 0.98rem; }
.access-identity small { color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }

.self-badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 0.72rem;
  font-weight: 700;
}

.access-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.access-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 0.76rem;
  line-height: 1.2;
}

.access-chip .chip-app { font-weight: 700; color: var(--text-soft); }
.access-chip .chip-role { color: var(--muted); }
.access-chip.is-none { border-style: dashed; color: var(--muted); background: transparent; }
.access-chip.is-none .chip-app { color: var(--muted); font-weight: 600; }
.access-chip .chip-muted { color: var(--muted); }
.access-chip.is-off { opacity: 0.68; }
.access-chip .chip-off {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--amber-100);
  color: var(--amber-800);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.app-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--blue-700);
}

.app-dot.app-seguimiento { background: #17529c; }
.app-dot.app-corimayo { background: #0f766e; }
.app-dot.app-maestranza { background: #b45309; }

/* ---------------------------- Modal ---------------------------- */

body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 28, 55, 0.55);
  backdrop-filter: blur(3px);
}

.modal-card {
  width: min(620px, 100%);
  max-height: min(90vh, 840px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(6, 28, 55, 0.3);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; }
.modal-head .eyebrow { margin-bottom: 4px; }

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.modal-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.field-full { grid-column: 1 / -1; }

.form-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 0.84rem;
  line-height: 1.5;
}

.access-matrix {
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.access-matrix legend {
  padding: 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
}

.access-rows { display: grid; gap: 8px; margin-top: 8px; }

.access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.access-row:has([data-access-toggle]:not(:checked)) { background: var(--surface-soft); }

.access-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.access-check input { width: 16px; height: 16px; accent-color: var(--blue-700); }

.access-app-name { display: grid; min-width: 0; gap: 1px; }
.access-app-name strong { font-size: 0.88rem; }
.access-app-name small {
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-cell { display: grid; gap: 3px; }

.role-hint {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.access-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.access-row select:disabled { opacity: 0.55; }

.active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.active-toggle input { accent-color: var(--green-700); }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #f3b6b2;
  border-radius: var(--radius-sm);
  background: var(--red-50);
}

.danger-zone strong { display: block; color: var(--red-700); font-size: 0.88rem; }
.danger-zone p { margin: 4px 0 0; color: var(--text-soft); font-size: 0.78rem; line-height: 1.45; }

/* ---------------------------- Toast ---------------------------- */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: #ffffff;
  font-size: 0.86rem;
  box-shadow: var(--shadow-md);
}

@media (max-width: 720px) {
  .access-toolbar { flex-direction: column; align-items: stretch; }
  .search-field { width: 100%; }
  .access-row { grid-template-columns: 1fr; }
  .active-toggle { justify-self: start; }
  .form-grid { grid-template-columns: 1fr; }
  .danger-zone { flex-direction: column; align-items: flex-start; }
  .modal-card { max-height: 94vh; }
}
