:root {
  --ays-primary: #007cff;
  --ays-primary-strong: #002bff;
  --ays-primary-dark: #152036;
  --ays-accent: #00ccff;
  --ays-turquoise: #00ffdf;
  --ays-violet: #2700ff;
  --ays-violet-soft: #6e59e2;
  --ays-bg: rgba(0, 124, 255, .035);
  --ays-surface: #ffffff;
  --ays-border: rgba(21, 32, 54, .12);
  --ays-text: #152036;
  --ays-muted: rgba(21, 32, 54, .66);
  --ays-danger: #fd306b;
  --ays-warning: #ff8c9f;
  --ays-success: #00ffdf;
  --ays-sidebar-width: 272px;
  --ays-radius: 20px;
  --ays-radius-sm: 12px;
  --ays-focus: 0 0 0 4px rgba(0, 204, 255, .25);
  --ays-shadow: 0 18px 46px rgba(21, 32, 54, .10);
  --ays-shadow-soft: 0 7px 22px rgba(21, 32, 54, .07);
}

html, body { max-width: 100%; overflow-x: hidden; }
body { background: var(--ays-bg); color: var(--ays-text); }
img { max-width: 100%; height: auto; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
button, input, select, textarea { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(0, 204, 255, .55); outline-offset: 3px; }
.content-container { width: min(100%, 1480px); margin: 0 auto; }

.sidebar {
  width: var(--ays-sidebar-width);
  padding: 22px 16px 16px;
  overflow: hidden;
}
.sidebar-head { display: flex; align-items: flex-start; gap: 8px; }
.brand-block { flex: 1; min-width: 0; min-height: 48px; margin: 0 4px 18px; overflow: hidden; }
.cardmanager-brand {
  position: relative;
  display: block;
  flex: 0 0 192px;
  width: 192px;
  height: 49px;
  overflow: hidden;
}
.cardmanager-brand img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 246px;
  max-width: none;
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
}
.brand-copy { min-width: 0; }
.brand-copy strong, .brand-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-close { display: none; border: 0; background: transparent; color: #fff; font-size: 28px; line-height: 1; padding: 5px; cursor: pointer; }
.portal-identity { flex: 0 0 auto; margin-bottom: 8px; }
.side-nav {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 12px 0;
  scrollbar-width: thin;
}
.side-nav a { width: 100%; min-height: 44px; align-self: start; line-height: 1.25; }
.side-nav a.active { color: #fff; background: rgba(0, 124, 255, .28); box-shadow: inset 3px 0 var(--ays-turquoise); }
.nav-label { margin-top: 14px; }
.sidebar-footer { flex: 0 0 auto; padding-top: 12px; gap: 10px; }
.security-link { color: #c7d0df; font-size: 12px; font-weight: 700; }
.security-link:hover { color: #fff; }
.logout { min-height: 36px; }

.app-shell { margin-left: var(--ays-sidebar-width); max-width: none; width: calc(100% - var(--ays-sidebar-width)); padding: 28px clamp(22px, 3vw, 44px) 24px; }
.mobile-header, .sidebar-backdrop { display: none; }
.login-shell { width: 100%; margin-left: 0; padding: 24px; min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #152036 0%, #002bff 145%); }
.login-shell .content-container { display: grid; place-items: center; }
.login-card { width: min(100%, 480px); padding: clamp(26px, 5vw, 40px); background: #fff; border: 1px solid rgba(0, 204, 255, .18); border-radius: 28px 28px 28px 8px; box-shadow: var(--ays-shadow); }
.login-brand-logo {
  position: relative;
  width: min(100%, 260px);
  height: 70px;
  margin: 0 auto 22px;
  overflow: hidden;
}
.login-card .login-brand-logo img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 300px;
  max-width: none;
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.page-heading, .detail-header { align-items: flex-start; flex-wrap: wrap; }
.page-heading > div:first-child, .detail-header > div:first-child { min-width: min(100%, 280px); }
.page-heading h1, .detail-header h1 { overflow-wrap: anywhere; }
.panel, .metric-card, .filter-panel { max-width: 100%; }
.panel { padding: clamp(18px, 2vw, 26px); }
.form-panel { max-width: 980px; }
.form-panel.wide { max-width: 1180px; }

.form-intro { max-width: 760px; margin-bottom: 22px; }
.form-section { padding: 22px; margin-bottom: 18px; border: 1px solid var(--ays-border); border-radius: var(--ays-radius); background: #fff; }
.form-section-header { margin-bottom: 18px; }
.form-section-header h2 { margin-bottom: 5px; font-size: 20px; }
.form-section-header p { margin: 0; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { min-width: 0; }
.form-field legend { margin-bottom: 9px; color: #405068; font-size: 12px; font-weight: 750; }
fieldset.form-field { margin: 0; padding: 0; border: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field > label:not(.choice-card):not(.check-control) { display: block; margin-bottom: 6px; color: #405068; font-size: 12px; font-weight: 750; }
.form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select, .form-field textarea,
.form-card input:not([type="checkbox"]):not([type="radio"]), .form-card select, .form-card textarea,
.reveal-panel input, .reveal-panel select, .reveal-panel textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ays-text); background: #fff;
  border: 1px solid #ccd7e4; border-radius: 11px;
}
.form-field textarea { min-height: 100px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--ays-primary); outline: 0; box-shadow: var(--ays-focus); }
.field-help { display: block; margin-top: 6px; color: var(--ays-muted); font-size: 11px; line-height: 1.4; }
.field-error, .errorlist { color: var(--ays-danger); font-size: 12px; }
.errorlist { margin: 6px 0; padding-left: 20px; }
.required-mark { color: var(--ays-danger); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.choice-grid > div { display: contents; }
.choice-grid label, .choice-card, .check-control { display: flex; align-items: flex-start; gap: 9px; min-height: 42px; padding: 10px 12px; border: 1px solid var(--ays-border); border-radius: 11px; background: #f9fbfd; color: var(--ays-text); cursor: pointer; }
.choice-grid input, .choice-card input, .check-control input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ays-primary); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.form-actions .btn { min-width: 150px; }
.btn.danger { background: var(--ays-danger); color: #fff; }
.danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid #f0c8cd; }
.security-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--ays-border); }
.security-row > div { min-width: 0; display: grid; }
.security-row small { color: var(--ays-muted); overflow-wrap: anywhere; }
.security-row form { display: flex; flex-wrap: wrap; gap: 8px; }
.security-row input, .table-actions input { min-height: 40px; padding: 8px 10px; border: 1px solid #ccd7e4; border-radius: 10px; }
.otp-qr { width: min(190px, 70%) !important; max-height: 190px !important; padding: 8px; border: 1px solid var(--ays-border); border-radius: 12px; }
.manual-key { display: block; max-width: 100%; margin: 10px 0; padding: 10px; overflow-wrap: anywhere; background: #eef4fa; border-radius: 8px; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.recovery-grid code { padding: 9px; text-align: center; background: #eef4fa; border-radius: 8px; }

.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border-radius: 0 0 16px 6px; }
.table, .table-wrap table { min-width: 720px; }
.table th, .table td, .table-wrap th, .table-wrap td { vertical-align: top; }
.table td:last-child, .table th:last-child { position: sticky; right: 0; background: inherit; }
.table tbody tr:hover td:last-child { background: #fbfdff; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
.badge { line-height: 1.2; }
.badge.success, .badge.ACTIVE, .badge.SENT, .badge.CLOSED, .badge.JUSTIFIED, .badge.SUCCESS { background: #e5f8ef; color: var(--ays-success); }
.badge.danger, .badge.CRITICAL, .badge.FAILED, .badge.BLOCKED, .badge.DENIED { background: #ffebed; color: var(--ays-danger); }
.badge.HIGH, .badge.ESCALATED, .badge.RETRY { background: #fff0da; color: var(--ays-warning); }
.badge.MEDIUM, .badge.IN_REVIEW, .badge.REOPENED { background: #fff5d8; color: #875c00; }
.filter-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
.filter-grid label { display: grid; gap: 5px; color: var(--ays-muted); font-size: 11px; font-weight: 700; }
.filter-grid input, .filter-grid select { width: 100%; }
.pagination { flex-wrap: wrap; align-items: center; }
.pagination .btn { min-width: 100px; }
.timeline article { grid-template-columns: minmax(130px, 180px) minmax(0, 1fr); }
.timeline article div { min-width: 0; overflow-wrap: anywhere; }

/* Línea de tiempo e informes */
.timeline-filter-panel { padding: 0; overflow: hidden; }
.timeline-filter-panel .panel-head { padding: 22px 24px 16px; }
.timeline-filter-panel > form:first-of-type { padding: 0 24px 24px; }
.quick-filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px; margin-bottom: 18px; border: 1px solid var(--ays-border); border-radius: 14px; background: #f7fafc; }
.quick-filter-label { color: var(--ays-primary-dark); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.quick-filter-separator { width: 1px; height: 25px; margin: 0 3px; background: var(--ays-border); }
.quick-chip, .quick-clear { min-height: 34px; padding: 7px 11px; border: 1px solid #cbd9e6; border-radius: 999px; background: #fff; color: #31516e; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.quick-chip:hover, .quick-chip:focus-visible { border-color: var(--ays-primary); color: var(--ays-primary-dark); }
.quick-chip.active { border-color: var(--ays-primary-dark); background: var(--ays-primary-dark); color: #fff; box-shadow: 0 3px 10px rgba(7, 60, 123, .18); }
.quick-clear { margin-left: auto; border-color: transparent; color: var(--ays-danger); }
.timeline-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.timeline-filter-grid > label, .result-preferences label { display: grid; min-width: 0; gap: 6px; color: #405068; font-size: 12px; font-weight: 750; }
.timeline-filter-grid input:not([type="checkbox"]), .timeline-filter-grid select, .result-preferences select { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #cbd7e3; border-radius: 10px; background: #fff; color: var(--ays-text); }
.timeline-filter-grid input:focus, .timeline-filter-grid select:focus, .result-preferences select:focus { border-color: var(--ays-primary); outline: 0; box-shadow: var(--ays-focus); }
.timeline-filter-grid small { min-height: 15px; color: var(--ays-muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
.timeline-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.top-actions { margin: 0 0 18px; }
.bottom-actions { padding-top: 18px; border-top: 1px solid var(--ays-border); }
.btn.excel { background: #e7f6ee; border-color: #a9d8bd; color: #11663e; }
.btn.pdf { background: #fff0f1; border-color: #efbdc1; color: #a72835; }
.advanced-filters { margin-top: 18px; border: 1px solid var(--ays-border); border-radius: 13px; background: #fbfcfe; }
.advanced-filters > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; color: var(--ays-primary-dark); font-weight: 800; cursor: pointer; }
.advanced-filters > summary span { color: var(--ays-muted); font-size: 11px; font-weight: 500; }
.advanced-filters[open] > summary { border-bottom: 1px solid var(--ays-border); }
.advanced-grid { padding: 16px; }
.advanced-checks { grid-column: span 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 12px; border: 1px solid var(--ays-border); border-radius: 10px; }
.advanced-checks legend { padding-inline: 5px; color: #405068; font-size: 12px; font-weight: 750; }
.advanced-checks label { display: flex; align-items: center; gap: 8px; min-height: 35px; font-size: 12px; font-weight: 600; }
.advanced-checks input { width: 17px; height: 17px; accent-color: var(--ays-primary); }
.result-preferences { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.result-preferences label { width: min(100%, 210px); }
.form-errors { display: grid; gap: 4px; margin-bottom: 14px; padding: 12px 14px; border-left: 4px solid var(--ays-danger); border-radius: 8px; background: #fff0f1; color: #8c2530; font-size: 12px; }
.filter-summary { display: grid; gap: 12px; margin: 16px 0; padding: 16px 18px; border: 1px solid #cde0e9; border-radius: 14px; background: #eef7fa; }
.filter-summary > div:first-child { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.filter-summary span { color: var(--ays-muted); font-size: 12px; }
.active-filter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.active-filter-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 6px 9px; border: 1px solid #b5d6e2; border-radius: 999px; background: #fff; color: #244b68; font-size: 11px; font-weight: 700; }
.active-filter-chip span { overflow: hidden; color: inherit; text-overflow: ellipsis; white-space: nowrap; }
.active-filter-chip b { color: var(--ays-danger); font-size: 15px; }
.timeline-table { min-width: 1100px; }
.event-detail summary { color: var(--ays-primary-dark); font-size: 12px; font-weight: 800; cursor: pointer; }
.event-detail dl { min-width: 220px; margin: 8px 0 0; }
.event-detail dl div { display: grid; grid-template-columns: 60px 1fr; gap: 6px; padding-block: 3px; }
.event-detail dt { color: var(--ays-muted); font-size: 10px; font-weight: 700; }.event-detail dd { margin: 0; overflow-wrap: anywhere; font-size: 11px; }

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.report-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 13px 15px; align-content: start; }
.report-card h2 { margin: 2px 0 6px; font-size: 19px; }.report-card p { margin: 0; color: var(--ays-muted); font-size: 12px; }
.report-card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(145deg, var(--ays-primary-dark), #14789b); color: #fff; font-size: 19px; font-weight: 850; }
.report-meta { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0; padding: 12px; border-radius: 11px; background: #f5f8fb; }
.report-meta div { min-width: 0; }.report-meta dt { color: var(--ays-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }.report-meta dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; }
.report-config { grid-column: 1 / -1; }.report-config > summary { display: inline-flex; list-style: none; cursor: pointer; }.report-config > summary::-webkit-details-marker { display: none; }
.report-config[open] > summary { margin-bottom: 14px; }.report-config-form { padding-top: 14px; border-top: 1px solid var(--ays-border); }.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-config-form label { display: grid; gap: 5px; color: #405068; font-size: 11px; font-weight: 750; }.report-config-form input, .report-config-form select { width: 100%; min-height: 42px; padding: 9px; border: 1px solid #cbd7e3; border-radius: 10px; }

.toast-stack { width: min(390px, calc(100vw - 24px)); }
.toast { overflow-wrap: anywhere; }
.modal, dialog { width: min(640px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; }

/* Sistema visual oficial A&S */
body {
  font-family: "Poppins", Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

h1, h2, h3,
.brand-copy strong,
.metric-card strong,
.health {
  font-family: "Zain", "Poppins", Arial, sans-serif;
}

h1 { font-size: clamp(2.35rem, 4vw, 3.25rem); line-height: .98; }
h2 { font-size: clamp(1.55rem, 2vw, 1.85rem); line-height: 1.05; }
h3 { font-size: 1.28rem; line-height: 1.1; }
p { line-height: 1.65; }

.sidebar {
  background: linear-gradient(180deg, #152036 0%, #152036 78%, #002bff 170%);
  border-right: 1px solid rgba(0, 204, 255, .16);
}
.sidebar::before {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -118px;
  top: -102px;
  border: 34px solid rgba(0, 204, 255, .12);
  border-radius: 50%;
  pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.brand-block { gap: 13px; }
.brand-copy { line-height: 1.12; }
.brand-copy small { color: rgba(255, 255, 255, .66); font-size: .66rem; letter-spacing: .03em; }
.portal-identity {
  padding: 12px 13px;
  border-color: rgba(0, 204, 255, .18);
  background: rgba(0, 124, 255, .08);
  border-radius: 16px 16px 16px 5px;
}
.portal-dot { background: var(--ays-turquoise); box-shadow: 0 0 0 5px rgba(0, 255, 223, .12); }
.nav-label { color: rgba(255, 255, 255, .48); letter-spacing: .12em; }
.side-nav { scrollbar-color: rgba(0, 204, 255, .38) transparent; }
.side-nav a {
  border: 1px solid transparent;
  border-radius: 13px 13px 13px 4px;
  color: rgba(255, 255, 255, .74);
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.side-nav a:hover {
  color: #fff;
  border-color: rgba(0, 204, 255, .14);
  background: rgba(0, 124, 255, .13);
}
.nav-icon {
  border-radius: 50% 50% 50% 7px;
  background: rgba(0, 204, 255, .09);
  color: var(--ays-accent);
}
.side-nav a.active .nav-icon { background: var(--ays-turquoise); color: var(--ays-primary-dark); }
.sidebar-footer { border-top-color: rgba(0, 204, 255, .14); }
.avatar { background: linear-gradient(145deg, var(--ays-primary), var(--ays-primary-strong)); }

.app-shell:not(.login-shell) {
  background:
    radial-gradient(circle at 100% 0, rgba(0, 204, 255, .055), transparent 28rem),
    var(--ays-bg);
}
.content-container { padding-bottom: 18px; }
.breadcrumbs, .breadcrumbs a, .breadcrumbs span, .app-footer, .user-card small { color: var(--ays-muted); }
.breadcrumbs b, .text-link, a { color: var(--ays-primary-strong); }
.security-link, .logout { color: rgba(255, 255, 255, .68); }
.security-link:hover, .logout:hover { color: #fff; }
.page-heading, .detail-header { margin-bottom: 28px; }
.page-heading p, .detail-header p { max-width: 760px; }
.section-kicker, .login-kicker, .eyebrow.dark {
  color: var(--ays-primary);
  letter-spacing: .12em;
}

.hero, .help-banner, .help-hero {
  background: linear-gradient(130deg, #152036 0%, #002bff 115%);
  border: 1px solid rgba(0, 204, 255, .18);
  box-shadow: var(--ays-shadow);
}
.hero::before { border: 28px solid rgba(0, 204, 255, .18); background: transparent; }
.hero::after { background: var(--ays-turquoise); opacity: .76; }
.hero h1 strong { color: var(--ays-turquoise); }

.panel,
.metric-card,
.form-section,
.policy-card,
.report-card,
.filter-panel,
.empty-state {
  border-color: var(--ays-border);
  border-radius: var(--ays-radius) var(--ays-radius) var(--ays-radius) 6px;
  background: var(--ays-surface);
  box-shadow: var(--ays-shadow-soft);
}
.panel, .metric-card, .policy-card, .report-card {
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
@media (hover: hover) {
  .metric-card:hover, .policy-card:hover, .report-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 124, 255, .28);
    box-shadow: var(--ays-shadow);
  }
}
.panel-head { align-items: center; margin-bottom: 20px; }
.panel-head p { line-height: 1.5; }
.content-container > .panel + .panel,
.content-container > .form-panel + .panel,
.content-container > .panel + .control-grid,
.content-container > .control-grid + .panel,
.content-container > .metric-grid + .panel {
  margin-block-start: 22px;
}
.metric-grid { gap: 18px; margin-block: 22px; }
.metric-card { min-height: 138px; padding: 22px; }
.metric-card small { color: var(--ays-muted); letter-spacing: .055em; }
.metric-card strong { color: var(--ays-primary-dark); font-size: 2.35rem; font-weight: 500; }
.metric-icon, .branch-icon, .help-symbol {
  border-radius: 50% 50% 50% 8px;
  background: rgba(0, 124, 255, .09) !important;
  color: var(--ays-primary) !important;
}
.metric-icon.cyan { background: rgba(0, 204, 255, .13) !important; color: #152036 !important; }
.metric-icon.green { background: rgba(0, 255, 223, .16) !important; color: #152036 !important; }
.metric-icon.amber { background: rgba(255, 140, 159, .18) !important; color: #152036 !important; }
.metric-icon.red { background: rgba(253, 48, 107, .13) !important; color: var(--ays-danger) !important; }
.metric-icon.violet { background: rgba(110, 89, 226, .14) !important; color: var(--ays-violet-soft) !important; }

.btn {
  min-height: 44px;
  padding: 10px 19px;
  border-radius: 999px;
  font-family: "Poppins", Arial, sans-serif;
  font-size: .75rem;
  letter-spacing: .01em;
  box-shadow: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn.primary { background: var(--ays-primary); color: #fff; }
.btn.primary:hover { background: var(--ays-primary-strong); }
.btn.secondary, .btn.dark { background: var(--ays-primary-dark); color: #fff; }
.btn.secondary:hover, .btn.dark:hover { background: var(--ays-primary-strong); }
.btn.ghost { border-color: rgba(21, 32, 54, .18); color: var(--ays-primary-dark); }
.btn.ghost:hover { border-color: var(--ays-primary); color: var(--ays-primary-strong); background: rgba(0, 124, 255, .055); }
.btn.success { background: var(--ays-turquoise); color: var(--ays-primary-dark); }
.btn.warning { border-color: var(--ays-warning); background: rgba(255, 140, 159, .17); color: var(--ays-primary-dark); }
.btn.danger, .btn.danger-outline { border-color: var(--ays-danger); }
.btn.danger { background: var(--ays-danger); color: #fff; }
.btn.danger-outline { background: #fff; color: var(--ays-danger); }
.btn.excel { border-color: rgba(0, 255, 223, .6); background: rgba(0, 255, 223, .14); color: var(--ays-primary-dark); }
.btn.pdf { border-color: rgba(253, 48, 107, .38); background: rgba(253, 48, 107, .09); color: var(--ays-danger); }
.row-link { background: rgba(0, 124, 255, .09); color: var(--ays-primary-strong); }
.row-link:hover { background: var(--ays-primary-strong); color: #fff; }

.form-card { display: grid; gap: 17px; }
.form-section { padding: clamp(20px, 2.2vw, 28px); margin-bottom: 20px; }
.form-grid { gap: 20px; }
.form-field > label:not(.choice-card):not(.check-control),
.form-field legend,
.timeline-filter-grid > label,
.result-preferences label,
.report-config-form label,
.filter-panel label > span {
  color: var(--ays-primary-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .025em;
}
.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea,
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea,
.reveal-panel input,
.reveal-panel select,
.reveal-panel textarea,
.timeline-filter-grid input:not([type="checkbox"]),
.timeline-filter-grid select,
.result-preferences select,
.report-config-form input,
.report-config-form select,
.security-row input,
.table-actions input {
  min-height: 46px;
  border-color: rgba(21, 32, 54, .18);
  border-radius: var(--ays-radius-sm);
  background: #fff;
  color: var(--ays-primary-dark);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.form-field input:hover, .form-field select:hover, .form-field textarea:hover,
.form-card input:hover, .form-card select:hover, .form-card textarea:hover,
.timeline-filter-grid input:hover, .timeline-filter-grid select:hover,
.report-config-form input:hover, .report-config-form select:hover {
  border-color: rgba(0, 124, 255, .48);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.form-card input:focus, .form-card select:focus, .form-card textarea:focus,
.timeline-filter-grid input:focus, .timeline-filter-grid select:focus,
.report-config-form input:focus, .report-config-form select:focus {
  border-color: var(--ays-primary);
  outline: 0;
  box-shadow: var(--ays-focus);
}
.choice-grid label, .choice-card, .check-control {
  border-color: var(--ays-border);
  border-radius: var(--ays-radius-sm) var(--ays-radius-sm) var(--ays-radius-sm) 4px;
  background: rgba(0, 124, 255, .035);
}
.choice-grid label:hover, .choice-card:hover, .check-control:hover { border-color: rgba(0, 124, 255, .44); }
.choice-grid input, .choice-card input, .check-control input, .advanced-checks input { accent-color: var(--ays-primary-strong); }
.field-help, .security-note { color: var(--ays-muted); }
.security-note { display: block; margin-top: 2px; font-size: .68rem; line-height: 1.5; }
.field-error, .errorlist, .required-mark { color: var(--ays-danger); }
.form-errors, .warning-box {
  border-color: var(--ays-danger);
  background: rgba(253, 48, 107, .075);
  color: var(--ays-primary-dark);
}
.manual-key, .recovery-grid code, .note-box, .info-note { background: rgba(0, 124, 255, .065); }
.warning-box {
  margin-top: 20px;
  padding: 15px 17px;
  border: 1px solid rgba(253, 48, 107, .28);
  border-left: 4px solid var(--ays-danger);
  border-radius: 12px 12px 12px 4px;
  font-size: .75rem;
  line-height: 1.55;
}
.protected-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ays-border);
}
.protected-field small { grid-column: 1 / -1; color: var(--ays-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.protected-field strong { min-width: 0; overflow-wrap: anywhere; color: var(--ays-primary-dark); font-size: 1.05rem; letter-spacing: .045em; }
.protected-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.protected-data-panel { max-width: 920px; }
.cardholder-summary {
  display: flex;
  width: min(100%, 920px);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 124, 255, .16);
  border-radius: var(--ays-radius-sm);
  background: rgba(0, 124, 255, .045);
}
.cardholder-copy { min-width: 0; }
.cardholder-copy small {
  display: block;
  margin-bottom: 4px;
  color: var(--ays-muted);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.cardholder-copy strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ays-primary-dark);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.4;
  user-select: text;
}
.cardholder-copy-button { flex: 0 0 auto; }
.operation-window-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(0, 124, 255, .2); border-radius: 999px; background: rgba(0, 124, 255, .08); color: var(--ays-primary-dark); font-size: .76rem; font-weight: 700; }
.operation-window-status::before { width: 8px; height: 8px; border-radius: 50%; background: var(--ays-accent); content: ""; box-shadow: 0 0 0 4px rgba(0, 255, 223, .14); }
.protected-value-state { margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--ays-border); border-radius: var(--ays-radius-sm); background: var(--ays-soft-blue); }
.card-admin-form { display: grid; gap: 18px; }
.card-admin-form .form-section { margin-bottom: 0; }
.card-administrative-grid { align-items: start; }
.card-administrative-grid .form-field { display: flex; min-width: 0; flex-direction: column; align-self: start; }
.card-administrative-grid .form-field input:not([type="checkbox"]):not([type="radio"]),
.card-administrative-grid .form-field select { min-height: 44px; height: 44px; }
.protected-create-grid, .protected-edit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.protected-edit-grid { display: grid; gap: 18px; align-items: start; }
.protected-edit-card { min-width: 0; padding: 14px; border: 1px solid var(--ays-border); border-radius: 12px 12px 12px 4px; background: #f9fbfd; }
.protected-edit-card .field-label { display: block; margin-bottom: 7px; color: #405068; font-size: 12px; font-weight: 750; }
.protected-edit-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 10px 8px 12px; border: 1px solid #ccd7e4; border-radius: 11px; background: #fff; color: var(--ays-primary-dark); font-weight: 750; letter-spacing: .04em; }
.protected-edit-input { margin-top: 12px; }
.protected-edit-input[hidden] { display: none; }
.protected-edit-input .form-field > label { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.card-security-note { margin-top: 14px; }
.vault-search-panel { margin-bottom: 18px; }
.vault-search { display: grid; gap: 8px; }
.vault-search-control { position: relative; }
.vault-search-control input { width: 100%; min-height: 52px; padding: 12px 86px 12px 16px; border: 1px solid var(--ays-border); border-radius: 14px 14px 14px 4px; background: var(--ays-surface); color: var(--ays-text); font: inherit; }
.vault-search-control input:focus { outline: 3px solid rgba(0, 204, 255, .22); border-color: var(--ays-primary); }
.search-clear { position: absolute; top: 50%; right: 44px; width: 34px; height: 34px; padding: 0; transform: translateY(-50%); border: 0; border-radius: 50%; background: rgba(21, 32, 54, .07); color: var(--ays-primary-dark); cursor: pointer; font-size: 1.25rem; }
.search-spinner { position: absolute; top: calc(50% - 10px); right: 15px; width: 20px; height: 20px; border: 2px solid rgba(0, 124, 255, .18); border-top-color: var(--ays-primary); border-radius: 50%; animation: vault-spin .75s linear infinite; }
.result-count { color: var(--ays-muted); font-size: .78rem; font-weight: 700; }
.vault-results-table { min-width: 940px; table-layout: fixed; }
.vault-results-table th:nth-child(1) { width: 10%; }
.vault-results-table th:nth-child(2) { width: 16%; }
.vault-results-table th:nth-child(3) { width: 18%; }
.vault-results-table th:nth-child(4) { width: 15%; }
.vault-results-table th:nth-child(5) { width: 11%; }
.vault-results-table th:nth-child(6) { width: 12%; }
.vault-results-table th:nth-child(7) { width: 8%; }
.vault-results-table th:nth-child(8) { width: 10%; }
.vault-results-table td { vertical-align: middle; line-height: 1.35; }
.cell-truncate { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-ending { white-space: nowrap; font-variant-numeric: tabular-nums; }
.vault-results-table .btn.compact { min-height: 34px; padding: 7px 10px; white-space: nowrap; }
.vault-empty-results {
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  padding: clamp(28px, 5vw, 52px) 20px;
  text-align: center;
  color: var(--ays-muted);
  overflow: visible;
}
.vault-empty-results h3 { margin: 8px 0 4px; color: var(--ays-primary-dark); font-size: clamp(1.25rem, 2vw, 1.55rem); }
.vault-empty-results p { margin: 0 0 10px; }
.vault-empty-results ul { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px 16px; margin: 0; padding: 0; list-style: none; }
.vault-empty-results li { white-space: nowrap; }
.vault-empty-results li::before { content: "•"; margin-right: 7px; color: var(--ays-accent); }
.vault-empty-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(0, 204, 255, .12); color: var(--ays-primary-strong); font-size: 1.55rem; line-height: 1; }
.modal-backdrop { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 18px; background: rgba(21, 32, 54, .72); backdrop-filter: blur(4px); }
.modal-backdrop[hidden] { display: none; }
.protected-modal { width: min(620px, 100%); max-height: calc(100vh - 36px); overflow: auto; padding: 0; background: var(--ays-surface); }
.modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 14px; border-bottom: 1px solid var(--ays-border); background: var(--ays-surface); }
.modal-header h2 { margin-bottom: 0; }
.modal-close { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--ays-border); border-radius: 50%; background: var(--ays-surface); color: var(--ays-primary-dark); cursor: pointer; font-size: 1.45rem; }
#protected-modal-content { padding: 22px 24px 24px; }
#protected-modal-content form { display: grid; gap: 16px; }
.modal-open { overflow: hidden; }
.inline-action-status { position: fixed; right: 22px; bottom: 22px; z-index: 2100; max-width: min(420px, calc(100vw - 44px)); }
.btn[aria-busy="true"] { position: relative; cursor: wait; opacity: .76; }
.btn[aria-busy="true"]::after { width: 14px; height: 14px; margin-left: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; content: ""; animation: vault-spin .75s linear infinite; }
@keyframes vault-spin { to { transform: rotate(360deg); } }
.reveal-panel {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(0, 204, 255, .26);
  border-radius: 16px 16px 16px 5px;
  background: rgba(0, 204, 255, .055);
}
.reveal-panel form { display: grid; gap: 15px; }
.login-card details { margin: 12px 0 18px; }
.login-card details > summary { color: var(--ays-primary-strong); font-size: .75rem; font-weight: 700; cursor: pointer; }
.login-card > a { display: inline-flex; margin-top: 18px; font-size: .75rem; font-weight: 700; }
.portal-return-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 14px;
  color: var(--ays-muted);
  font-size: .73rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.portal-return-link:hover {
  color: var(--ays-primary-strong);
  text-decoration-color: currentColor;
}
.enroll-card { width: min(100%, 560px); }

.table-panel { border-radius: var(--ays-radius) var(--ays-radius) var(--ays-radius) 6px; }
.table-wrap { scrollbar-color: rgba(0, 124, 255, .36) transparent; }
.table th {
  padding: 13px 15px;
  background: #152036;
  color: rgba(255, 255, 255, .82);
  font-size: .62rem;
  letter-spacing: .075em;
}
.table td { padding: 15px; border-bottom-color: rgba(21, 32, 54, .09); }
.table tbody tr:hover { background: rgba(0, 204, 255, .045); }
.table tbody tr:hover td:last-child { background: rgba(0, 204, 255, .045); }
.table th:last-child { background: #152036; }
.table td:last-child { background: #fff; }
.table td small { color: var(--ays-muted); }

.badge {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .58rem;
  letter-spacing: .04em;
}
.badge.success, .badge.ACTIVE, .badge.SENT, .badge.CLOSED, .badge.JUSTIFIED, .badge.SUCCESS,
.badge.APROBADO, .badge.CONFIRMADO, .badge.CERRADO, .badge.ACTIVA, .badge.ACTIVO {
  border-color: rgba(0, 255, 223, .5);
  background: rgba(0, 255, 223, .14);
  color: var(--ays-primary-dark);
}
.badge.danger, .badge.CRITICAL, .badge.FAILED, .badge.BLOCKED, .badge.DENIED,
.badge.RECHAZADO, .badge.FALLIDO, .badge.VENCIDA, .badge.CANCELADO {
  border-color: rgba(253, 48, 107, .35);
  background: rgba(253, 48, 107, .10);
  color: var(--ays-danger);
}
.badge.HIGH, .badge.ESCALATED, .badge.RETRY,
.badge.MEDIUM, .badge.IN_REVIEW, .badge.REOPENED {
  border-color: rgba(255, 140, 159, .52);
  background: rgba(255, 140, 159, .16);
  color: var(--ays-primary-dark);
}

.filter-panel, .quick-filter-bar, .advanced-filters, .filter-summary {
  border-color: var(--ays-border);
  background: rgba(0, 124, 255, .035);
}
.quick-filter-bar, .filter-summary { border-radius: 16px 16px 16px 5px; }
.quick-chip, .quick-clear, .active-filter-chip {
  border-color: rgba(0, 124, 255, .23);
  background: #fff;
  color: var(--ays-primary-dark);
}
.quick-chip:hover { border-color: var(--ays-primary); color: var(--ays-primary-strong); }
.quick-chip.active { border-color: var(--ays-primary-strong); background: var(--ays-primary-strong); box-shadow: 0 5px 14px rgba(39, 0, 255, .16); }
.active-filter-chip b, .quick-clear { color: var(--ays-danger); }
.advanced-filters > summary, .event-detail summary { color: var(--ays-primary-strong); }

.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 20px 0; }
.status-list { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); margin: 0; }
.status-list dt, .status-list dd { margin: 0; padding: 11px 4px; border-bottom: 1px solid var(--ays-border); }
.status-list dt { color: var(--ays-muted); font-size: .72rem; }
.status-list dd { color: var(--ays-primary-dark); font-size: .76rem; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.alert-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.alert-summary span { display: flex; justify-content: space-between; gap: 10px; padding: 13px; border-radius: 13px 13px 13px 4px; background: rgba(0, 124, 255, .055); color: var(--ays-muted); font-size: .72rem; }
.alert-summary b { color: var(--ays-primary-dark); }
.health {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid rgba(0, 124, 255, .24);
  border-radius: 999px;
  background: rgba(0, 124, 255, .08);
  color: var(--ays-primary-dark);
  font-size: 1.05rem;
}
.health-saludable { border-color: rgba(0, 255, 223, .54); background: rgba(0, 255, 223, .14); }
.health-atención, .health-atencion, .health-riesgo { border-color: rgba(255, 140, 159, .52); background: rgba(255, 140, 159, .15); }
.health-crítico, .health-critico { border-color: rgba(253, 48, 107, .42); background: rgba(253, 48, 107, .10); color: var(--ays-danger); }
.health-panel { border-left: 4px solid var(--ays-accent); }

.timeline::before { background: rgba(0, 124, 255, .17); }
.timeline-mark, .activity-dot { background: var(--ays-primary); color: #fff; }
.timeline article { padding-block: 14px; }
.timeline article time { color: var(--ays-muted); font-variant-numeric: tabular-nums; }
.event-detail dl, .timeline-item p { background: rgba(0, 124, 255, .045); border-radius: 12px 12px 12px 4px; }

.report-card-icon {
  border-radius: 50% 50% 50% 10px;
  background: linear-gradient(145deg, var(--ays-primary-strong), var(--ays-primary));
  box-shadow: 0 8px 18px rgba(0, 43, 255, .18);
}
.report-meta { border: 1px solid rgba(0, 124, 255, .10); background: rgba(0, 124, 255, .04); }
.report-config-form { border-top-color: var(--ays-border); }
.report-open { grid-column: 1 / -1; justify-self: start; }
.report-dialog { width: min(720px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: hidden; background: var(--ays-surface); color: var(--ays-text); }
.report-dialog::backdrop { background: rgba(21, 32, 54, .72); backdrop-filter: blur(4px); }
.report-dialog .report-config-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; max-height: calc(100vh - 118px); padding: 0; border: 0; }
.report-dialog-body { overflow: auto; padding: 22px 24px; }
.report-dialog-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--ays-border); background: var(--ays-surface); }
.form-error-summary { margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(253, 48, 107, .3); border-radius: 12px; background: rgba(253, 48, 107, .08); color: var(--ays-danger); }

.pagination { gap: 12px; }
.pagination .btn { min-width: 108px; }
.empty-state { border-color: rgba(0, 124, 255, .28); background: rgba(255, 255, 255, .76); }
.empty-state > span { background: rgba(0, 204, 255, .13); color: var(--ays-primary-strong); }
.toast { border-color: rgba(0, 124, 255, .18); border-radius: 16px 16px 16px 5px; box-shadow: var(--ays-shadow); }
.toast-mark { background: var(--ays-primary); }
.toast.success .toast-mark { background: var(--ays-turquoise); }
.toast.warning .toast-mark { background: var(--ays-warning); }
.toast.error .toast-mark { background: var(--ays-danger); }
.modal, dialog { border: 1px solid var(--ays-border); border-radius: var(--ays-radius) var(--ays-radius) var(--ays-radius) 6px; box-shadow: var(--ays-shadow); }

.login-shell { position: relative; overflow: hidden; }
.login-shell::before, .login-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.login-shell::before {
  width: min(42vw, 580px);
  aspect-ratio: 1;
  left: -18vw;
  bottom: -30vw;
  border: clamp(30px, 5vw, 74px) solid rgba(0, 204, 255, .14);
  border-radius: 50%;
}
.login-shell::after {
  width: 150px;
  height: 360px;
  right: 7vw;
  top: -220px;
  border-radius: 999px;
  background: rgba(0, 255, 223, .11);
  transform: rotate(22deg);
}
.login-shell .content-container { position: relative; z-index: 1; }
.login-card img { width: min(176px, 54%); margin-bottom: 26px; }
.login-card h1 { margin: 6px 0 10px; }

@keyframes ays-content-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.content-container { animation: ays-content-enter .24s ease-out both; }

@media (max-width: 1199px) {
  .app-shell { padding-inline: 22px; }
  .metric-grid.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advanced-checks { grid-column: span 2; }
}

@media (max-width: 991px) {
  :root { --ays-sidebar-width: 0px; }
  .mobile-header {
    position: sticky; top: 0; z-index: 35; display: flex; align-items: center; gap: 12px;
    min-height: 64px; margin: 0; padding: 9px 16px; background: #fff; border-bottom: 1px solid rgba(0, 124, 255, .16);
  }
  .menu-toggle { width: 42px; height: 42px; border: 1px solid rgba(0, 124, 255, .2); border-radius: 50% 50% 50% 9px; background: rgba(0, 124, 255, .055); color: var(--ays-primary-dark); font-size: 22px; cursor: pointer; }
  .mobile-brand { display: flex; align-items: center; color: var(--ays-primary-dark); font-weight: 800; }
  .mobile-brand-logo { position: relative; display: block; width: 118px; height: 42px; overflow: hidden; }
  .mobile-brand-logo img {
    position: absolute; top: 50%; left: 50%; display: block;
    width: 176px; max-width: none; height: auto; object-fit: contain;
    transform: translate(-50%, -50%);
  }
  .sidebar { inset: 64px auto 0 0; display: flex; width: min(284px, 88vw); height: calc(100vh - 64px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 40px rgba(21, 32, 54, .26); }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(21, 32, 54, .62); backdrop-filter: blur(2px); }
  .sidebar-backdrop:not([hidden]) { display: block; }
  body.sidebar-open { overflow: hidden; }
  .app-shell { width: 100%; margin-left: 0; padding: 20px; }
  .login-shell { padding: 20px; }
  .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 1; }
  .control-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .vault-results .panel-head { padding-inline: 17px; }
  .vault-results-wrap { overflow: visible; padding: 0 12px 12px; }
  .vault-results-table { display: block; min-width: 0; }
  .vault-results-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vault-results-table tbody { display: grid; gap: 12px; }
  .vault-results-table tr { display: grid; width: 100%; padding: 13px 14px; border: 1px solid var(--ays-border); border-radius: 13px 13px 13px 4px; background: #fff; box-shadow: var(--ays-shadow-soft); }
  .vault-results-table td { position: static !important; display: grid; grid-template-columns: minmax(92px, 35%) minmax(0, 1fr); gap: 10px; width: 100%; padding: 6px 0; border: 0; background: transparent !important; overflow-wrap: normal; word-break: normal; }
  .vault-results-table td::before { content: attr(data-label); color: var(--ays-muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .vault-results-table .cell-truncate { white-space: normal; overflow-wrap: anywhere; }
  .vault-results-table td:last-child { margin-top: 6px; }
  .vault-results-table td:last-child .btn { width: 100%; }
  .vault-empty-results { padding: 28px 16px; }
  .vault-empty-results ul { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); text-align: left; }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .protected-create-grid, .protected-edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .content-container > .panel + .panel,
  .content-container > .form-panel + .panel,
  .content-container > .panel + .control-grid,
  .content-container > .control-grid + .panel,
  .content-container > .metric-grid + .panel {
    margin-block-start: 16px;
  }
  .mobile-brand-logo { display: block; }
  .app-shell { padding: 16px 14px 22px; }
  .page-heading, .detail-header { gap: 14px; margin-bottom: 18px; }
  .page-heading h1, .detail-header h1 { font-size: clamp(27px, 9vw, 34px); }
  .heading-actions, .hero-actions, .form-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .heading-actions .btn, .hero-actions .btn, .form-actions .btn { width: 100%; }
  .form-grid, .choice-grid, .filter-grid, .status-list, .protected-create-grid, .protected-edit-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: span 1; }
  .form-section { padding: 17px; }
  .metric-grid.five, .metric-grid.four { grid-template-columns: 1fr; }
  .panel { padding: 17px; }
  .table-panel { padding-inline: 0; }
  .table-wrap { margin-inline: 0; }
  .table, .table-wrap table { min-width: 640px; }
  .vault-results-table, .vault-results-wrap .vault-results-table { min-width: 0; }
  .timeline article { grid-template-columns: 1fr; gap: 6px; }
  .pagination { align-items: stretch; flex-direction: column; text-align: center; }
  .pagination > div { width: 100%; }
  .pagination .btn { flex: 1; }
  .protected-field { grid-template-columns: 1fr; }
  .protected-field small { grid-column: 1; }
  .protected-actions { justify-content: stretch; }
  .protected-actions .btn { flex: 1 1 120px; }
  .cardholder-summary { align-items: stretch; flex-direction: column; gap: 12px; padding: 15px 16px; }
  .cardholder-copy-button { align-self: flex-start; }
  .modal-backdrop { align-items: end; padding: 0; }
  .protected-modal { width: 100%; max-height: calc(100vh - 20px); border-radius: 22px 22px 0 0; }
  .modal-header, #protected-modal-content { padding-left: 18px; padding-right: 18px; }
  .vault-search-control input { font-size: 16px; }
  .toast-stack { top: 72px; right: 12px; }
  .security-row { align-items: stretch; flex-direction: column; }
  .security-row form, .security-row form .btn, .security-row form input { width: 100%; }
  .recovery-grid { grid-template-columns: 1fr; }
  .timeline-filter-panel .panel-head, .timeline-filter-panel > form:first-of-type { padding-inline: 16px; }
  .timeline-filter-grid, .two-cols { grid-template-columns: 1fr; }
  .advanced-checks { grid-column: span 1; grid-template-columns: 1fr; }
  .quick-filter-bar { align-items: stretch; }
  .quick-filter-label { flex-basis: 100%; }
  .quick-filter-separator { display: none; }
  .quick-clear { margin-left: 0; }
  .timeline-actions, .result-preferences { display: grid; grid-template-columns: 1fr; }
  .timeline-actions .btn, .timeline-actions a, .result-preferences label { width: 100%; }
  .timeline-results .table-wrap { overflow: visible; }
  .timeline-table { display: block; min-width: 0; padding: 0 12px 14px; }
  .timeline-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .timeline-table tbody, .timeline-table tr, .timeline-table td { display: block; width: 100%; }
  .timeline-table tr { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--ays-border); border-radius: 13px; background: #fff; box-shadow: 0 5px 16px rgba(18, 61, 106, .06); }
  .timeline-table td { position: static !important; display: grid; grid-template-columns: minmax(92px, 36%) 1fr; gap: 8px; padding: 7px 0; border: 0; background: transparent !important; }
  .timeline-table td::before { content: attr(data-label); color: var(--ays-muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
  .timeline-table td[colspan] { display: block; text-align: center; }
  .timeline-table td[colspan]::before { content: none; }
  .report-card { grid-template-columns: 42px minmax(0, 1fr); padding: 16px; }.report-card-icon { width: 42px; height: 42px; }.report-meta { grid-template-columns: 1fr; }
  .report-dialog { width: 100%; max-width: none; max-height: calc(100vh - 18px); margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .report-dialog-footer { display: grid; grid-template-columns: 1fr; padding: 14px 18px; }
  .report-dialog-footer .btn { width: 100%; }
}

@media (max-width: 480px) {
  .login-shell { padding: 18px 14px; }
  .login-card { padding: 26px 24px; border-radius: 24px 24px 24px 7px; }
  .login-card img { width: min(165px, 58%); margin-bottom: 22px; }
  .panel-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .alert-summary { grid-template-columns: 1fr; }
  .status-list { grid-template-columns: 1fr; }
  .status-list dt { padding-bottom: 2px; border-bottom: 0; }
  .status-list dd { padding-top: 2px; text-align: left; }
  .metric-card { min-height: 122px; }
  .quick-chip, .quick-clear { flex: 1 1 auto; }
  .vault-empty-results ul { grid-template-columns: 1fr; }
}

.sensitive-window-status {
  margin: 10px 0 2px;
  padding: 8px 10px;
  border: 1px solid rgba(49, 220, 211, .38);
  border-radius: 10px;
  color: #d9fffc;
  background: rgba(49, 220, 211, .08);
  font-size: .76rem;
  line-height: 1.25;
}
.sensitive-window-status.warning { border-color: rgba(255, 193, 7, .55); color: #fff0b3; }
.sensitive-window-status.expired { border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.7); background: rgba(255,255,255,.04); }

.recipient-form { max-width: 860px; }
.compact-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.compact-actions form { margin: 0; }
.compact-actions .btn { min-height: 38px; padding: 8px 13px; }
.empty-cell { color: var(--ays-muted); padding: 28px 20px !important; text-align: center; }
.secondary-tool { padding: 0; overflow: hidden; }
.email-test-panel .panel-head { padding: 18px 20px 0; }
.secondary-tool summary {
  padding: 16px 20px;
  color: var(--ays-primary-dark);
  cursor: pointer;
  font-weight: 750;
}
.secondary-tool summary:focus-visible { outline: 3px solid rgba(0, 124, 255, .28); outline-offset: -3px; }
.compact-test-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 0 20px 20px;
}
.compact-test-form .form-field { margin: 0; }
.compact-test-form .btn { min-height: 44px; }

@media (max-width: 767px) {
  .recipient-table-wrap, .notification-history-wrap { overflow: visible; padding: 0 12px 14px; }
  .recipient-table, .notification-history { display: block; min-width: 0 !important; }
  .recipient-table thead, .notification-history thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .recipient-table tbody, .notification-history tbody { display: grid; gap: 12px; }
  .recipient-table tr, .notification-history tr {
    display: grid;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--ays-border);
    border-radius: 13px 13px 13px 4px;
    background: #fff;
    box-shadow: var(--ays-shadow-soft);
  }
  .recipient-table td, .notification-history td {
    position: static !important;
    display: grid;
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    gap: 9px;
    width: 100%;
    padding: 6px 0;
    border: 0;
    background: transparent !important;
    overflow-wrap: anywhere;
  }
  .recipient-table td::before, .notification-history td::before {
    content: attr(data-label);
    color: var(--ays-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .recipient-table td[colspan], .notification-history td[colspan] { display: block; text-align: center; }
  .recipient-table td[colspan]::before, .notification-history td[colspan]::before { content: none; }
  .compact-actions { display: grid; grid-template-columns: 1fr; }
  .compact-actions .btn, .compact-actions form { width: 100%; }
  .compact-test-form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
