:root {
  --primary: #274494;
  --primary-dark: #1c326e;
  --primary-soft: #edf2ff;
  --background: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --border: #e2e7f0;
  --text: #172033;
  --muted: #667085;
  --success: #067647;
  --success-bg: #ecfdf3;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --sidebar-width: 276px;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--background);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 15% 5%, rgba(39, 68, 148, .18), transparent 35%),
    var(--background);
}
.boot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 26px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.boot-card strong, .boot-card span { display: block; }
.boot-card span { margin-top: 4px; color: var(--muted); font-size: 13px; }

.app { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 22px 18px;
  color: #fff;
  background: linear-gradient(180deg, var(--primary), #14275b);
  z-index: 50;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 6px 24px;
}
.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: #fff;
  background: rgba(255, 255, 255, .15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; }
.brand span { margin-top: 3px; font-size: 12px; color: rgba(255,255,255,.66); }

.navigation { display: grid; gap: 7px; }
.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 13px;
  padding: 11px 13px;
  color: rgba(255,255,255,.76);
  background: transparent;
  text-align: left;
  font-weight: 720;
}
.nav-link:hover, .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,.14);
}
.nav-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 6px 0;
  border-top: 1px solid rgba(255,255,255,.13);
}
.identity { margin-bottom: 12px; }
.identity strong, .identity span { display: block; }
.identity span { color: rgba(255,255,255,.62); font-size: 12px; margin-top: 3px; }

.main { margin-left: var(--sidebar-width); min-height: 100vh; padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0; font-size: 24px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--primary);
  background: var(--surface);
}

.section { display: none; }
.section.active { display: block; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric {
  min-height: 130px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.metric-value { font-size: 31px; line-height: 1; font-weight: 900; color: var(--primary); }
.metric-label { margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-note { margin-top: 8px; font-size: 12px; color: #98a2b3; }

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .8fr);
  gap: 16px;
}
.card {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}
.card-header h2 { margin: 0; font-size: 17px; }
.card-header p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.card-header.responsive { align-items: flex-end; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.control {
  min-height: 40px;
  min-width: 160px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 8px 11px;
  color: var(--text);
  background: #fff;
}
.control:focus { outline: 3px solid rgba(39,68,148,.12); border-color: var(--primary); }

.button {
  min-height: 40px;
  border: 1px solid var(--primary);
  border-radius: 11px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  font-weight: 760;
}
.button:hover { background: var(--primary-dark); }
.button-secondary { color: var(--primary); background: #fff; border-color: var(--border); }
.button-secondary:hover, .button-ghost:hover { background: var(--primary-soft); color: var(--primary); }
.button-ghost {
  color: #fff;
  background: transparent;
  border-color: rgba(255,255,255,.22);
}
.button-block { width: 100%; }
.text-button { border: 0; color: var(--primary); background: transparent; font-weight: 780; }

.status, .badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 800;
}
.status-neutral, .badge-neutral { background: #f2f4f7; color: #475467; }
.status-ok, .badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.table-shell {
  min-height: 100px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
}
table { width: 100%; min-width: 820px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: var(--surface-soft);
  text-transform: uppercase;
  letter-spacing: .035em;
  font-size: 11px;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcff; }
.row-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

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

.stack-list { display: grid; gap: 10px; }
.stack-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.stack-item-main { min-width: 0; flex: 1; }
.stack-item strong, .stack-item span { display: block; }
.stack-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack-item span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.pagination span { color: var(--muted); font-size: 12px; }

.alert-area { margin-bottom: 14px; }
.alert {
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16,24,40,.55);
}
.modal {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(16,24,40,.28);
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 22px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.modal-close {
  margin-left: auto;
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 25px;
}
.modal-body { padding: 22px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 11px;
}
.detail-item {
  min-height: 82px;
  padding: 13px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.detail-item label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .035em; }
.detail-item strong { display: block; margin-top: 7px; font-size: 13px; overflow-wrap: anywhere; }

.subsection { margin-top: 20px; }
.subsection h3 { margin: 0 0 10px; font-size: 15px; }
.asset-card {
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.finding-card {
  margin-top: 9px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}
.hash { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
.download-button {
  display: inline-flex;
  margin-top: 8px;
  border: 0;
  color: var(--primary);
  background: transparent;
  padding: 0;
  font-weight: 800;
}

.permissions-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.permission-card {
  padding: 11px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}
.permission-card strong { display: block; font-size: 12px; }
.permission-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.toast-area {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: grid;
  gap: 9px;
}
.toast {
  max-width: 360px;
  padding: 12px 15px;
  border-radius: 12px;
  color: #fff;
  background: #101828;
  box-shadow: 0 14px 36px rgba(16,24,40,.28);
  font-size: 13px;
}

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .access-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 16px; }
  .menu-button { display: grid; place-items: center; }
  .card-header.responsive { align-items: stretch; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .control { flex: 1 1 180px; min-width: 0; }
  .detail-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .topbar-actions { width: 100%; margin-left: 0; justify-content: space-between; }
  .metric-grid, .detail-grid, .permissions-grid { grid-template-columns: 1fr; }
  .main { padding: 12px; }
  .card { padding: 14px; }
}


/* PHASE_D11_DASHBOARD_LOGIN_HOTFIX */
.login-shell {
  width: min(430px, calc(100vw - 32px));
}
.login-card {
  display: block;
  padding: 26px;
}
.login-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}
.login-heading strong,
.login-heading span {
  display: block;
}
.login-heading strong {
  font-size: 19px;
}
.login-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}
.login-form {
  display: grid;
  gap: 14px;
}
.login-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}
.login-field .control {
  width: 100%;
  min-width: 0;
}
.login-message {
  margin-bottom: 14px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid #fecdca;
  color: var(--danger);
  background: var(--danger-bg);
  font-size: 12.5px;
}
.login-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}
