@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/IBMPlexSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/IBMPlexSans-SemiBold.woff2") format("woff2");
}

:root {
  color-scheme: light;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --color-bg: #f3f5f8;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafb;
  --color-border: #e4e7ec;
  --color-control-border: #8794a6;
  --color-text: #182230;
  --color-text-muted: #667085;
  --color-graphite: #111b27;
  --color-primary: #087f65;
  --color-primary-hover: #06654f;
  --color-primary-soft: #e9f5f1;
  --color-success: #087554;
  --color-success-bg: #eaf8f1;
  --color-warning: #885800;
  --color-warning-bg: #fff7e6;
  --color-danger: #b42332;
  --color-danger-bg: #fff0f1;
  --color-info: #285da8;
  --color-info-bg: #eef4ff;
  --color-nav: #111b27;
  --color-nav-muted: #a5b1c2;
  --color-nav-active: #213e3a;
  --sidebar-width: 240px;
  --radius-control: 9px;
  --radius-card: 14px;
  --radius-panel: 18px;
  --shadow-card: 0 1px 3px rgb(16 24 40 / 4%);
  --focus-ring: 0 0 0 3px #087f65, 0 0 0 5px #ffffff;
}

* { box-sizing: border-box; }
html { min-width: 0; -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-size: 14px; line-height: 1.55; }
body[data-nav-open="true"] { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { min-width: 0; }
img, svg { vertical-align: middle; }
img { max-width: 100%; }
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--color-primary-hover); }
button, a, input, select, textarea, summary { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { color: var(--color-text); font-weight: 600; }
h1 { margin: 0; font-size: 28px; line-height: 1.2; letter-spacing: -0.8px; }
h2 { margin: 0; font-size: 17px; line-height: 1.4; letter-spacing: -0.25px; }
h3 { margin: 0; font-size: 15px; line-height: 1.4; }
strong { font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }
::selection { background: #ccebe0; color: #123c30; }
.icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; color: inherit; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; clip-path: inset(50%); }
.skip-link { position: fixed; z-index: 200; top: 12px; left: 16px; transform: translateY(-180%); padding: 12px 18px; border-radius: 8px; background: white; color: var(--color-primary); box-shadow: 0 8px 24px #10182824; font-weight: 600; }
.skip-link:focus { transform: translateY(0); }

/* Application navigation */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; display: flex; flex-direction: column; width: var(--sidebar-width); height: 100dvh; padding: 28px 16px 20px; background: var(--color-nav); color: #e7edf5; overflow-y: auto; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #12b886; color: #fff; font-size: 22px; font-weight: 600; }
.brand-copy { display: grid; min-width: 0; gap: 2px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.3px; line-height: 1.25; }
.brand-caption { color: var(--color-nav-muted); font-size: 11px; line-height: 1.5; }
.sidebar > .brand { margin: 0 8px 34px; }
.primary-nav { min-width: 0; }
.nav-heading { margin: 0 12px 10px; color: #9da9ba; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; }
.nav-list { display: grid; gap: 5px; padding: 0; margin: 0; list-style: none; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 11px 14px; border: 1px solid transparent; border-radius: 9px; color: #b9c4d3; font-size: 14px; font-weight: 400; line-height: 1.4; }
.nav-link:hover { background: #1d2a3a; color: #fff; }
.nav-link.is-current { border-color: #31534a; background: var(--color-nav-active); color: #b0f0d8; font-weight: 600; }
.nav-link.is-current::after { position: absolute; right: 13px; width: 5px; height: 5px; border-radius: 50%; background: #65dbb5; content: ""; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; color: #96a6ba; }
.nav-link:hover .nav-icon { color: #dce7f5; }
.nav-link.is-current .nav-icon { color: #7fe2bd; }
.nav-link:focus-visible { outline-color: #7ce5c2; }
.nav-marker { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; }
.nav-note { padding: 20px 12px 0; margin: 0; color: #9da9ba; font-size: 12px; line-height: 1.6; }
.sidebar-footer { display: grid; gap: 9px; margin-top: auto; padding: 22px 10px 0; border-top: 1px solid #2b3748; }
.account-label, .account-role { color: #a5b1c2; font-size: 11px; }
.account-name { display: block; overflow: hidden; color: #e7edf5; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-avatar, .user-avatar { display: grid; flex: 0 0 34px; place-items: center; width: 34px; height: 34px; border: 1px solid #405166; border-radius: 50%; background: #29394c; color: #d7e4f4; font-size: 12px; font-weight: 600; }
.account-copy { min-width: 0; }
.logout-form { margin: 0; }
.sidebar .button--quiet { justify-content: flex-start; width: 100%; min-height: 40px; padding-inline: 0; color: #aebdce; font-weight: 400; }
.sidebar .button--quiet:hover { color: #fff; background: transparent; }
.sidebar .button--quiet:focus-visible { outline-color: #7ce5c2; }
.admin-main { grid-column: 2; min-width: 0; }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 70px; padding: 12px 36px; border-bottom: 1px solid var(--color-border); background: #fff; }
.topbar-caption { color: var(--color-text-muted); font-size: 13px; }
.breadcrumbs { min-width: 0; color: var(--color-text-muted); font-size: 13px; }
.breadcrumbs ol { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0; margin: 0; list-style: none; }
.breadcrumbs li { min-width: 0; }
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs .icon { color: #98a2b3; }
.breadcrumbs li:last-child { overflow: hidden; color: var(--color-text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account { display: flex; align-items: center; gap: 12px; min-width: 0; margin-left: auto; }
.topbar-user { max-width: 200px; overflow: hidden; color: var(--color-text-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account .user-avatar { border-color: #d9e7e1; background: #eff7f3; color: var(--color-primary); }
.logout-form--top, .mobile-menu { display: none; }
.page-content { width: 100%; max-width: 1440px; min-width: 0; padding: 32px 36px 48px; margin: 0 auto; }

/* Page hierarchy and surfaces */
.page-heading, .page-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 26px; }
.page-heading > div, .page-header > div { min-width: 0; }
.page-heading--actions, .page-header--actions { align-items: center; }
.page-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-description { max-width: 76ch; margin: 9px 0 0; color: var(--color-text-muted); font-size: 14px; line-height: 1.6; }
.eyebrow { margin: 0 0 8px; color: var(--color-text-muted); font-size: 11px; font-weight: 600; letter-spacing: 0.75px; line-height: 1.4; text-transform: uppercase; }
.heading-status { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.panel, .surface { min-width: 0; padding: 24px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); box-shadow: var(--shadow-card); }
.surface--compact { padding: 20px; }
.surface--flush { padding: 0; }
.page-content > .panel + .panel, .page-content > .surface + .surface { margin-top: 22px; }
.panel-heading, .section-header, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 20px; }
.panel-heading > div, .section-header > div { min-width: 0; }
.panel-heading p:not(.eyebrow), .section-header p:not(.eyebrow), .section-heading p { margin: 5px 0 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.5; }
.panel-heading--action, .section-header--action { align-items: center; }
.section-header-title { display: flex; align-items: center; gap: 9px; }
.section-count, .count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 25px; height: 23px; padding: 1px 7px; border: 1px solid var(--color-border); border-radius: 6px; background: #f8fafc; color: #596579; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.content-stack { display: grid; gap: 22px; }
.text-muted { color: var(--color-text-muted); }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--color-primary); font-size: 13px; font-weight: 600; }

/* Actions */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 10px 15px; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; color: var(--color-text); font-size: 13px; font-weight: 600; line-height: 1.45; text-align: center; text-decoration: none; vertical-align: middle; }
.button--primary { border-color: var(--color-primary); background: var(--color-primary); color: #fff; box-shadow: 0 1px 2px #087f651a; }
.button--primary:hover:not(:disabled) { border-color: var(--color-primary-hover); background: var(--color-primary-hover); color: #fff; }
.button--secondary { border-color: #c6cdd7; background: #fff; color: #344054; box-shadow: 0 1px 2px #10182805; }
.button--secondary:hover:not(:disabled) { border-color: #a5b0bf; background: #f7f9fb; color: #182230; }
.button--quiet { background: transparent; color: #596579; }
.button--quiet:hover:not(:disabled) { background: #eef2f6; color: #182230; }
.button--danger { border-color: var(--color-danger); background: var(--color-danger); color: #fff; }
.button--danger:hover:not(:disabled) { border-color: #91202c; background: #91202c; color: #fff; }
.button--danger-outline { border-color: #efc0c6; background: #fff; color: var(--color-danger); }
.button--danger-outline:hover:not(:disabled) { border-color: #db8c97; background: var(--color-danger-bg); color: #91202c; }
.button--wide { width: 100%; }
.button--small { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.button--icon { width: 44px; padding: 10px; }
.button:disabled { opacity: 0.48; box-shadow: none; }
.table-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 7px 10px; border-radius: 7px; color: var(--color-primary); font-size: 12px; font-weight: 600; white-space: nowrap; }
.table-action:hover { background: var(--color-primary-soft); color: var(--color-primary-hover); }
.form-actions, .empty-actions, .overview-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.form-actions { padding-top: 8px; }
.empty-actions { justify-content: inherit; margin-top: 18px; }
.overview-links { margin-top: 20px; }

/* State is always conveyed through text as well as color. */
.status-badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; min-height: 26px; padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; color: #596579; background: #f2f4f7; font-size: 11px; font-weight: 600; line-height: 1.4; vertical-align: middle; }
.status-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: currentColor; }
.status-badge--success { border-color: #c6e9d7; background: var(--color-success-bg); color: var(--color-success); }
.status-badge--warning { border-color: #efdbac; background: var(--color-warning-bg); color: var(--color-warning); }
.status-badge--danger { border-color: #f2c7ce; background: var(--color-danger-bg); color: var(--color-danger); }
.status-badge--info { border-color: #d3e1fa; background: var(--color-info-bg); color: var(--color-info); }
.status-badge--muted { border-color: #e1e5eb; background: #f2f4f7; color: #596579; }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.metric-card { position: relative; display: grid; align-content: start; gap: 14px; min-width: 0; padding: 22px 24px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #fff; box-shadow: var(--shadow-card); }
.metric-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; color: #596579; font-size: 13px; }
.metric-value { margin: 0; color: #182230; font-size: 34px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-caption { margin: -4px 0 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.5; }
.metric-icon { position: absolute; top: 24px; right: 24px; display: inline-flex; color: #8794a6; }
.metric-card .metric-label { padding-right: 30px; }
.metric-card > .icon { position: absolute; top: 24px; right: 24px; color: #8794a6; }
.service-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; margin-bottom: 24px; border: 1px solid #cce4da; border-radius: var(--radius-card); background: #f5fbf8; }
.service-copy { min-width: 0; }
.service-copy h2 { font-size: 17px; }
.service-copy p { margin: 5px 0 0; color: #53675f; font-size: 13px; }
.service-icon { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border: 1px solid #c7e6d6; border-radius: 50%; background: #e7f6ed; color: var(--color-success); }
.status-section { margin-bottom: 24px; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.status-card { min-width: 0; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #fff; box-shadow: var(--shadow-card); }
.status-card-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.status-card-heading h3 { font-size: 13px; font-weight: 600; }
.status-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: #f1f5f9; color: #667085; }
.status-symbol { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: #edf7f3; color: var(--color-primary); font-size: 13px; font-weight: 600; }
.status-symbol--muted { background: #f1f4f8; color: #667085; }
.status-symbol--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.status-value { margin: 0 0 6px; color: #263444; font-size: 16px; font-weight: 600; line-height: 1.4; letter-spacing: -0.2px; }
.status-detail { margin: 5px 0 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.6; }
.status-detail a { color: var(--color-primary); }
.status-detail--error { color: var(--color-danger); }
.connection-list { display: grid; gap: 14px; }
.connection-summary { padding: 18px 20px; border: 1px solid var(--color-border); border-radius: 10px; background: #fbfcfe; }
.connection-summary-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.connection-name { color: #263444; font-size: 14px; font-weight: 600; }
.connection-name:hover { color: var(--color-primary); }
.connection-projects { display: grid; gap: 8px; margin-top: 14px; }
.connection-projects h3 { color: var(--color-text-muted); font-size: 12px; font-weight: 400; }
.connection-project-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.connection-project-list li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid var(--color-border); border-radius: 7px; background: #fff; }
.connection-project-list a { color: #344054; font-size: 12px; font-weight: 600; }

/* Tables and entity identity */
.table-shell, .entity-table-wrap, .audit-table-wrap { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #b6c0ce transparent; }
.table-shell::-webkit-scrollbar, .entity-table-wrap::-webkit-scrollbar, .audit-table-wrap::-webkit-scrollbar { height: 7px; }
.table-shell::-webkit-scrollbar-thumb, .entity-table-wrap::-webkit-scrollbar-thumb, .audit-table-wrap::-webkit-scrollbar-thumb { border-radius: 7px; background: #b6c0ce; }
.surface > .table-shell:last-child, .panel > .entity-table-wrap:last-child { margin: 0 -24px -24px; max-width: calc(100% + 48px); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.data-table, .entity-table, .audit-table { width: 100%; border-spacing: 0; border-collapse: collapse; color: #344054; text-align: left; font-size: 13px; line-height: 1.5; }
.data-table th, .entity-table th, .audit-table th { padding: 12px 18px; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); background: #f8fafc; color: #667085; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.data-table td, .entity-table td, .audit-table td { padding: 16px 18px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.data-table tbody tr:last-child td, .entity-table tbody tr:last-child td, .audit-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover, .entity-table tbody tr:hover, .audit-table tbody tr:hover { background: #fafcfd; }
.entity-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.entity-avatar { display: grid; flex: 0 0 36px; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #dce6ed; border-radius: 10px; background: #f1f5f9; color: #5c7087; }
.entity-avatar--project { border-color: #dce2f1; background: #f0f3fc; color: #6575a0; }
.entity-avatar--instance { border-color: #d5e8df; background: #edf7f1; color: var(--color-primary); }
.entity-copy { display: grid; min-width: 0; gap: 3px; }
.entity-primary { display: block; color: #253347; font-size: 13px; font-weight: 600; line-height: 1.5; }
.entity-primary:hover { color: var(--color-primary); }
.entity-secondary { display: block; margin-top: 3px; color: var(--color-text-muted); font-size: 11px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
.entity-copy .entity-secondary { margin-top: 0; }
.page-description .entity-secondary { display: inline; margin: 0; font: inherit; }
.identifier, .token-prefix { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.identifier { color: #536278; }
.token-prefix { display: inline-block; padding: 5px 8px; border: 1px solid #e0e5ec; border-radius: 6px; background: #f6f8fb; color: #536278; }
.token-revoked { color: var(--color-danger); }
.data-table .status-badge, .entity-table .status-badge { white-space: nowrap; }
.message-table { min-width: 880px; }
.message-table td:first-child { min-width: 135px; font-size: 12px; font-variant-numeric: tabular-nums; }
.message-table td:nth-child(2) { min-width: 150px; max-width: 210px; }
.message-table td:nth-child(3) { min-width: 120px; }
.message-table td:nth-child(4) { min-width: 75px; }
.message-table td:nth-child(5) { min-width: 110px; white-space: nowrap; }
.message-table td:nth-child(6) { min-width: 145px; }
.message-table .entity-copy { flex: 1; max-width: 150px; }
.message-table a.entity-primary { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.audit-table td:first-child { min-width: 150px; font-size: 12px; font-variant-numeric: tabular-nums; }
.audit-table td:last-child { min-width: 100px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 20px; color: var(--color-text-muted); font-size: 12px; }
.pagination-info { margin-right: auto; }

/* Filters */
.archive-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-bar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.filter-surface { margin-bottom: 22px; }
.filter-actions--search { flex: 0 0 auto; }
.filter-clear { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 5px 2px; color: var(--color-text-muted); font-size: 12px; font-weight: 600; }
.filter-search { position: relative; display: flex; align-items: flex-end; gap: 12px; flex: 1 1 260px; min-width: 0; }
.filter-search > .form-field { flex: 1; }
.filter-search > .icon { position: absolute; z-index: 1; bottom: 12px; left: 13px; color: #7b8799; pointer-events: none; }
.filter-search input { padding-left: 42px !important; }
.filter-bar > .filter-details { flex: 1 0 100%; width: 100%; }
.filter-details > summary > .icon:last-child { display: none; }
.filter-details .filter-actions { margin-top: 18px; }
.filter-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.filter-actions, .message-filter-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-details, .message-filter-details { min-width: 0; }
.filter-details > summary, .message-filter-details > summary { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; list-style: none; color: #344054; font-size: 13px; font-weight: 600; }
.filter-details > summary::-webkit-details-marker, .message-filter-details > summary::-webkit-details-marker { display: none; }
.filter-details > summary::after, .message-filter-details > summary::after { width: 6px; height: 6px; margin-left: 4px; transform: rotate(45deg); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; }
.filter-details[open] > summary::after, .message-filter-details[open] > summary::after { transform: rotate(225deg); }
.message-filter-panel { margin-bottom: 22px; }
.message-filter-count { color: var(--color-text-muted); font-size: 12px; font-weight: 400; }
.message-filter-description { margin: 2px 0 16px; color: var(--color-text-muted); font-size: 13px; }
.message-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 16px; }
.message-filter-actions { grid-column: 1 / -1; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid #d5e6de; border-radius: 6px; background: #f1f8f5; color: #27634e; font-size: 11px; }

/* Forms */
.form-stack, .management-form { display: grid; gap: 20px; }
.form-field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.form-field > label, .form-field > .field-label { display: block; color: #344054; font-size: 13px; font-weight: 600; line-height: 1.5; }
.form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select, .form-field textarea { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--color-control-border); border-radius: var(--radius-control); background: #fff; color: var(--color-text); font-size: 14px; line-height: 1.5; }
.form-field select { padding-right: 32px; }
.form-field textarea { min-height: 100px; resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #788498; opacity: 1; }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: #65768b; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px #087f6517; }
.form-field input:read-only { background: #f7f9fc; color: #596579; }
.form-field [aria-invalid="true"] { border-color: var(--color-danger) !important; background: #fffafb; }
.form-field [aria-invalid="true"]:focus-visible { outline-color: var(--color-danger); }
.field-hint { margin: 0; color: var(--color-text-muted); font-size: 12px; font-weight: 400; line-height: 1.6; }
.field-hint:empty { display: none; }
.required-label { color: var(--color-danger); }
.form-grid, .notification-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid--numbers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field--narrow { max-width: 350px; }
.form-section { display: grid; gap: 18px; min-width: 0; padding: 0 0 24px; border-bottom: 1px solid var(--color-border); }
.form-section:last-child { padding-bottom: 0; border-bottom: 0; }
.form-section-header, .form-section-heading { display: grid; gap: 5px; }
.form-section-header h2, .form-section-header h3, .form-section-heading h2, .form-section-heading h3 { font-size: 15px; }
.form-section-header p, .form-section-heading p { margin: 0; color: var(--color-text-muted); font-size: 12px; }
.form-section--disclosure { padding-bottom: 0; border-bottom: 0; }
.form-details { min-width: 0; border: 1px solid var(--color-border); border-radius: 10px; background: #fbfcfe; }
.form-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 16px; list-style: none; color: #344054; font-size: 13px; font-weight: 600; }
.form-details > summary::-webkit-details-marker { display: none; }
.form-details > summary > span { display: grid; gap: 4px; min-width: 0; }
.form-details > summary small { display: block; color: var(--color-text-muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
.form-details > summary::after { width: 6px; height: 6px; transform: rotate(45deg); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; content: ""; }
.form-details[open] > summary::after { transform: rotate(225deg); }
.form-details[open] > summary { border-bottom: 1px solid var(--color-border); }
.form-details-content { display: grid; gap: 18px; padding: 18px; }
.form-details > .form-grid, .form-details > .form-section, .form-details > .form-field { margin: 18px; }
.form-fieldset { display: grid; gap: 6px; min-width: 0; padding: 0; margin: 0; border: 0; }
.form-fieldset legend { margin-bottom: 8px; color: #344054; font-size: 13px; font-weight: 600; }
.form-fieldset[data-invalid-group] legend { color: var(--color-danger); }
.check-control { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: #344054; cursor: pointer; font-size: 13px; line-height: 1.55; }
.check-control input[type="checkbox"], .check-control input[type="radio"] { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; margin: 0; accent-color: var(--color-primary); }
.check-control input[aria-invalid="true"] { outline: 2px solid var(--color-danger); outline-offset: 3px; }
.check-control--warning { align-items: flex-start; }
.check-control--warning input { margin-top: 3px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.password-control { position: relative; display: flex; align-items: stretch; min-width: 0; }
.password-control input { padding-right: 54px !important; }
.password-toggle { position: absolute; top: 1px; right: 1px; display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: calc(100% - 2px); padding: 0 10px; border: 0; border-radius: 0 8px 8px 0; background: transparent; color: #667085; font-size: 11px; }
.password-toggle:hover { background: #f1f5f8; color: #344054; }
.form-status { flex: 1 1 200px; margin: 0; color: var(--color-text-muted); font-size: 12px; }
.form-status:empty { display: none; }
.form-panel { max-width: 960px; }
.project-form, .password-form-full { max-width: 100%; }
.password-panel { max-width: 760px; }
.rebind-warning[hidden] { display: none; }

/* Feedback and contextual notices */
.feedback { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; margin-bottom: 22px; border: 1px solid; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.feedback p { margin: 0; }
.feedback p + p { margin-top: 3px; }
.feedback--error { border-color: #f0c6cc; background: #fff7f8; color: #922937; }
.feedback--success { border-color: #c6e8d7; background: #f0faf5; color: #146344; }
.feedback-icon { display: grid; flex: 0 0 23px; place-items: center; width: 23px; height: 23px; border: 1px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 600; }
.feedback-icon:has(.icon) { border: 0; }
.feedback-title { font-weight: 600; }
.request-id { color: inherit; font-size: 11px; opacity: 0.9; overflow-wrap: anywhere; }
.request-id code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border: 1px solid #d8e4f6; border-radius: 9px; background: #f3f7fe; color: #315886; font-size: 13px; line-height: 1.6; }
.notice p { margin: 0; }
.notice p + p { margin-top: 5px; }
.notice .field-hint { margin-top: 6px; color: inherit; }
.notice--info { border-color: #d8e4f6; background: #f3f7fe; color: #315886; }
.notice--warning { border-color: #eddbb3; background: #fffaf0; color: #805300; }
.notice--danger { border-color: #f0c6cc; background: #fff7f8; color: #922937; }
.notice-icon { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px; flex: 0 0 21px; font-weight: 600; }
.notice-icon:has(.icon) { border: 0; }
.instance-required-notice { margin-bottom: 22px; }
.instance-required-notice .text-link { margin-top: 10px; }
.instance-error { margin-top: 16px; }
.archived-note { padding: 12px 14px; border-radius: 8px; background: #f4f6f9; color: #667085; font-size: 12px; }

/* Entity detail */
.detail-layout, .detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr); align-items: start; gap: 22px; }
.detail-main-column, .detail-side-column, .detail-main, .detail-rail { display: grid; align-content: start; gap: 22px; min-width: 0; }
.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(125px, 0.75fr) minmax(0, 1.4fr); align-items: start; gap: 16px; padding: 13px 0; border-bottom: 1px solid #edf0f4; }
.detail-list > div:first-child { padding-top: 0; }
.detail-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-list dt { color: var(--color-text-muted); font-size: 12px; }
.detail-list dd { min-width: 0; margin: 0; color: #344054; font-size: 13px; overflow-wrap: anywhere; }
.break-value { overflow-wrap: anywhere; word-break: break-word; }
.action-stack { display: grid; gap: 10px; }
.action-stack form { margin: 0; }
.action-stack .notice { margin-top: 4px; }
.linked-entity-list { display: grid; gap: 0; padding: 0; margin: 0; list-style: none; }
.linked-entity-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf0f4; }
.linked-entity-list li:first-child { padding-top: 0; }
.linked-entity-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.linked-entity-list a { min-width: 0; }
.linked-entity-name { display: block; color: #344054; font-size: 13px; font-weight: 600; }
.linked-entity-list a:hover .linked-entity-name { color: var(--color-primary); }
.queue-count { margin: 0 0 6px; color: #253347; font-size: 32px; font-weight: 600; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.queue-unavailable { color: var(--color-text-muted); font-size: 14px; font-weight: 600; }
.message-summary-panel .notice { margin-bottom: 18px; }
.message-status-timeline-wrap { margin-bottom: 24px; }
.message-subheading { margin: 26px 0 14px; font-size: 14px; }
.message-safe-note { padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--color-border); font-size: 12px; }
.audit-panel { margin-top: 22px; }

/* Empty and no-match states */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 210px; padding: 36px 24px; text-align: center; }
.empty-state > div { max-width: 480px; }
.empty-state h3 { margin: 0; font-size: 16px; }
.empty-state p { margin: 7px 0 0; color: var(--color-text-muted); font-size: 13px; line-height: 1.65; }
.empty-state--compact { align-items: flex-start; min-height: 0; padding: 20px; text-align: left; }
.empty-state--compact > div { max-width: none; }
.empty-mark { display: grid; align-items: center; justify-content: center; width: 48px; height: 48px; flex: 0 0 48px; border: 1px solid #dce5ed; border-radius: 14px; background: #f4f7fa; color: #7c8da2; font-size: 18px; font-weight: 600; }
.management-empty { min-height: 240px; }

/* Confirmation, QR and token disclosure */
.confirm-panel { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; max-width: 780px; margin: 0 auto; padding: 28px; }
.confirm-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #eedab0; border-radius: 12px; background: #fff7e4; color: #885800; }
.confirm-copy h2 { font-size: 19px; }
.confirm-message { margin: 10px 0 20px; color: #596579; font-size: 14px; }
.confirm-message-context { padding-bottom: 14px; }
.confirm-actions { display: flex; grid-column: 2; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.confirm-actions form { display: grid; justify-items: start; gap: 12px; }
.confirm-check { align-items: flex-start; }
.webhook-target { display: grid; gap: 6px; padding: 14px; margin-top: 15px; border: 1px solid #eddbb3; border-radius: 9px; background: #fffaf0; }
.webhook-target p { margin: 0; }
.webhook-target-label { color: #805300; font-size: 12px; font-weight: 600; }
.webhook-target-url { color: #596579; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.qr-content { display: grid; justify-items: center; gap: 14px; padding: 22px; border: 1px solid var(--color-border); border-radius: 12px; background: #f7f9fb; }
.qr-image { display: block; width: min(100%, 280px); height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 6px; }
.qr-expiry, .qr-expired { margin: 0; color: var(--color-text-muted); font-size: 12px; text-align: center; }
.qr-expired { color: var(--color-warning); font-weight: 600; }
.token-fallback { margin-bottom: 22px; border-color: #ead5a5; background: #fffcf5; }
.token-fallback > label, .token-dialog-content > label { display: block; margin-bottom: 7px; color: #344054; font-size: 13px; font-weight: 600; }
.token-value { display: block; width: 100%; min-height: 100px; padding: 14px; border: 1px solid var(--color-control-border); border-radius: 9px; background: #f8fafc; color: #344054; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; resize: vertical; }
.token-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.token-actions form { margin: 0; }
.token-dialog { width: min(calc(100% - 32px), 620px); max-width: 620px; max-height: min(90dvh, 760px); padding: 0; border: 1px solid var(--color-border); border-radius: 18px; background: #fff; color: var(--color-text); box-shadow: 0 20px 70px #10182840; }
.token-dialog::backdrop { background: #10182899; backdrop-filter: blur(3px); }
.token-dialog-content { display: grid; gap: 14px; padding: 28px; }
.token-dialog-heading h2 { margin: 5px 0 0; font-size: 22px; }
.token-dialog-heading p:not(.eyebrow) { margin: 8px 0 0; color: var(--color-text-muted); font-size: 13px; }
.token-action-error { margin-bottom: 20px; }

/* SMTP */
.notification-status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 22px; }
.notification-status-grid > .panel { margin: 0; }
.notification-status-card { padding: 20px 24px; }
.notification-status-card .section-header, .notification-status-card .panel-heading { margin-bottom: 10px; }
.notifications-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, 0.8fr); align-items: start; gap: 22px; margin-bottom: 22px; }
.notification-settings-form { gap: 22px; }
.notification-actions-column { position: sticky; top: 92px; min-width: 0; }
.notification-test-panel > p { color: var(--color-text-muted); font-size: 13px; }
.notification-test-panel .button { width: 100%; margin-top: 14px; }
.notification-retention { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(210px, 1fr); align-items: start; gap: 18px; padding-top: 22px; border-top: 1px solid var(--color-border); }
.notification-retention h3 { margin: 0; font-size: 14px; }
.notification-replace-warning { align-items: flex-start; }
.notification-replace-warning input { margin-top: 3px !important; }
.notification-history-panel { margin-top: 22px; }
.notification-table td { font-size: 12px; }
.notification-table td:first-child { min-width: 135px; font-variant-numeric: tabular-nums; }

/* Authentication */
.auth-page { display: grid; place-items: center; min-height: 100dvh; padding: 40px; background: #f1f4f7; }
.auth-layout { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(380px, 1.1fr); width: min(1120px, 100%); min-height: 660px; border: 1px solid #dce3eb; border-radius: 24px; background: #fff; box-shadow: 0 20px 64px #1018280a; overflow: hidden; }
.auth-aside { display: flex; flex-direction: column; gap: 36px; min-width: 0; padding: 42px; background: var(--color-nav); color: #fff; }
.auth-aside .brand { color: #fff; }
.auth-brand { margin-bottom: 16px; }
.auth-aside-content { display: grid; align-content: center; gap: 22px; flex: 1; }
.auth-aside h2 { color: #fff; font-size: 34px; line-height: 1.16; letter-spacing: -1px; }
.auth-aside p { max-width: 34ch; margin: 0; color: #b1c0d1; font-size: 14px; line-height: 1.75; }
.auth-aside .eyebrow { color: #70dcb7; font-size: 11px; letter-spacing: 1px; }
.auth-aside-points { display: grid; gap: 16px; padding: 8px 0 0; margin: 0; list-style: none; }
.auth-aside-points li { display: flex; align-items: center; gap: 12px; color: #d4dfec; font-size: 13px; }
.auth-aside-points .icon { color: #70dcb7; }
.auth-visual { margin: 16px 0; color: #70dcb7; }
.auth-aside-footer { display: flex; align-items: center; gap: 10px; padding-top: 22px; border-top: 1px solid #2c3c4f; color: #9eafc2; font-size: 12px; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 56px; }
.auth-card { width: 100%; max-width: 410px; padding: 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; }
.auth-card--wide { max-width: 460px; }
.auth-intro { margin-bottom: 30px; }
.auth-intro h1 { font-size: 30px; letter-spacing: -0.8px; }
.auth-description { margin: 10px 0 0; color: var(--color-text-muted); font-size: 14px; line-height: 1.7; }
.auth-card .form-stack { gap: 20px; }
.auth-card .form-field input { min-height: 48px; font-size: 15px; }
.auth-card .button--primary { min-height: 48px; }
.auth-card .form-actions .button { width: 100%; }
.auth-footnote { margin: 26px 0 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.6; }
.auth-logout { margin-top: 20px; }
.auth-card .feedback { margin-bottom: 24px; }

/* Tablet and compact desktop */
@media (max-width: 1180px) {
  :root { --sidebar-width: 220px; }
  .page-content { padding: 28px 26px 40px; }
  .topbar { padding-inline: 26px; }
  .sidebar { padding-inline: 12px; }
  .sidebar > .brand { margin-inline: 8px; }
  .brand-name { font-size: 14px; }
  .detail-layout, .detail-grid { grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.9fr); gap: 18px; }
  .panel, .surface { padding: 20px; }
  .surface > .table-shell:last-child, .panel > .entity-table-wrap:last-child { margin-inline: -20px; margin-bottom: -20px; max-width: calc(100% + 40px); }
  .data-table td, .entity-table td, .audit-table td { padding-inline: 14px; }
  .data-table th, .entity-table th, .audit-table th { padding-inline: 14px; }
  .form-grid--numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notifications-layout { grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.8fr); gap: 18px; }
  .notification-form-grid { grid-template-columns: minmax(0, 1fr); }
  .notification-retention { grid-template-columns: minmax(0, 1fr); }
  .metric-card { padding: 20px; }
}

@media (max-width: 960px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .admin-main { width: 100%; }
  .topbar { min-height: 66px; padding: 10px 22px; gap: 14px; }
  .mobile-menu { position: relative; z-index: 60; display: block; flex: 0 0 auto; }
  .mobile-menu > summary { display: inline-flex; align-items: center; gap: 7px; list-style: none; }
  .mobile-menu > summary::-webkit-details-marker { display: none; }
  .mobile-menu-toggle { width: 44px; padding-inline: 10px; }
  .mobile-menu-panel { position: fixed; z-index: 62; top: 76px; left: 12px; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 92px); overflow-y: auto; padding: 20px 16px; border: 1px solid #344456; border-radius: 14px; background: var(--color-nav); color: #e7edf5; box-shadow: 0 18px 48px #10182833; }
  .mobile-menu-panel .nav-note { display: none; }
  .nav-backdrop { position: fixed; z-index: 25; inset: 66px 0 0; width: 100%; height: calc(100dvh - 66px); padding: 0; border: 0; border-radius: 0; background: #10182866; cursor: default; }
  .mobile-menu-panel .logout-form { padding-top: 16px; margin: 16px 12px 0; border-top: 1px solid #344456; }
  .mobile-menu-panel .button--quiet { justify-content: flex-start; width: 100%; padding-left: 0; color: #b9c4d3; }
  .mobile-menu-panel .button--quiet:hover { color: #fff; background: transparent; }
  .topbar-account { gap: 10px; }
  .logout-form--top { display: block; }
  .topbar-account .button--logout { min-width: 44px; padding-inline: 10px; }
  .page-content { padding: 28px 24px 40px; }
  .detail-layout, .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr); }
  .notifications-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.75fr); }
  .auth-page { padding: 24px; }
  .auth-layout { grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr); min-height: 620px; }
  .auth-aside { padding: 32px; }
  .auth-main { padding: 36px; }
  .auth-aside h2 { font-size: 30px; }
}

@media (max-width: 767px) {
  html { scroll-padding-top: 84px; }
  body { font-size: 14px; }
  .topbar { gap: 10px; padding: 9px 16px; min-height: 64px; }
  .breadcrumbs { font-size: 12px; }
  .breadcrumbs ol { gap: 6px; }
  .breadcrumbs li:not(:last-child) { display: none; }
  .nav-backdrop { top: 64px; height: calc(100dvh - 64px); }
  .topbar-caption { display: none; }
  .topbar-account { gap: 6px; }
  .topbar-user { display: none; }
  .topbar-account .user-avatar { display: none; }
  .topbar-account .button--logout { font-size: 12px; }
  .page-content { padding: 24px 16px 36px; }
  .page-heading, .page-header { gap: 16px; margin-bottom: 22px; }
  h1 { font-size: 25px; letter-spacing: -0.6px; }
  .page-description { margin-top: 8px; font-size: 13px; }
  .page-header > .button, .page-heading--actions > .button { min-height: 44px; }
  .panel, .surface, .surface--compact { padding: 18px; border-radius: 12px; }
  .panel-heading, .section-header { gap: 12px; margin-bottom: 18px; }
  .panel-heading--action, .section-header--action { align-items: flex-start; }
  .section-header .archive-filter { width: 100%; justify-content: space-between; }
  .archive-filter .button { min-height: 40px; padding: 8px 12px; }
  .metric-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 20px; }
  .metric-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 18px 20px; }
  .metric-card .metric-label { padding-right: 0; }
  .metric-label { grid-column: 1; }
  .metric-value { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 30px; }
  .metric-caption { grid-column: 1; margin: 0; }
  .metric-card > .icon, .metric-icon { display: none; }
  .status-grid, .notification-status-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .status-card { padding: 18px; }
  .status-card-heading { margin-bottom: 10px; }
  .service-panel { align-items: flex-start; flex-wrap: wrap; gap: 14px; padding: 18px; margin-bottom: 20px; }
  .service-copy { flex: 1 1 200px; }
  .service-copy h2 { font-size: 16px; }
  .service-panel > .status-badge { margin-left: auto; }
  .detail-layout, .detail-grid, .notifications-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .detail-main-column, .detail-side-column, .detail-main, .detail-rail { gap: 18px; }
  .notification-actions-column { position: static; }
  .notification-form-grid, .form-grid, .form-grid--numbers, .check-grid, .filter-fields, .message-filters { grid-template-columns: minmax(0, 1fr); }
  .form-field--narrow { max-width: none; }
  .form-field input:not([type="checkbox"]):not([type="radio"]), .form-field select, .form-field textarea { font-size: 16px; }
  .form-stack, .management-form { gap: 19px; }
  .form-section { padding-bottom: 20px; gap: 16px; }
  .form-details-content { padding: 16px; }
  .form-details > .form-grid, .form-details > .form-section, .form-details > .form-field { margin: 16px; }
  .form-actions { gap: 8px; }
  .form-actions .button { flex: 1 1 auto; }
  .form-actions .form-status { flex-basis: 100%; }
  .filter-bar { align-items: stretch; gap: 10px; }
  .filter-details > summary { max-width: 100%; flex-wrap: wrap; }
  .filter-search { flex-basis: 100%; }
  .filter-actions { width: 100%; }
  .filter-actions .button { flex: 1; }
  .notification-retention { grid-template-columns: minmax(0, 1fr); }
  .detail-list > div { grid-template-columns: minmax(90px, 0.75fr) minmax(0, 1.25fr); gap: 12px; padding-block: 12px; }
  .detail-list dt { font-size: 11px; }
  .detail-list dd { font-size: 12px; }
  .linked-entity-list li { align-items: flex-start; flex-wrap: wrap; }
  .connection-summary { padding: 16px; }
  .connection-project-list { display: grid; }
  .connection-project-list li { justify-content: space-between; }
  .overview-links > .button { flex: 1 1 auto; }
  .empty-state { min-height: 210px; padding: 26px 10px; }
  .empty-state--compact { min-height: 0; padding: 16px; }
  .feedback { padding: 13px 14px; gap: 10px; }
  .table-shell, .entity-table-wrap, .audit-table-wrap { overflow: visible; }
  .surface > .table-shell:last-child, .panel > .entity-table-wrap:last-child { margin: 0; max-width: 100%; border-radius: 0; }
  .data-table, .entity-table, .audit-table { display: block; min-width: 0; width: 100%; }
  .data-table thead, .entity-table thead, .audit-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
  .data-table tbody, .entity-table tbody, .audit-table tbody { display: grid; gap: 14px; width: 100%; }
  .data-table tbody tr, .entity-table tbody tr, .audit-table tbody tr { display: grid; gap: 0; width: 100%; padding: 4px 14px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
  .data-table td, .entity-table td, .audit-table td, .message-table td:nth-child(n), .notification-table td:nth-child(n) { display: grid; grid-template-columns: minmax(80px, 0.72fr) minmax(0, 1.28fr); gap: 10px; align-items: start; width: 100%; min-width: 0; max-width: none; padding: 11px 0; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
  .data-table td::before, .entity-table td::before, .audit-table td::before { color: var(--color-text-muted); font-size: 11px; font-weight: 400; content: attr(data-label); }
  .data-table td > *, .entity-table td > *, .audit-table td > * { grid-column: 2; }
  .data-table td::before, .entity-table td::before, .audit-table td::before { grid-column: 1; grid-row: 1; }
  .data-table td:last-child, .entity-table td:last-child, .audit-table td:last-child { border-bottom: 0; }
  .data-table .status-badge, .entity-table .status-badge { justify-self: start; white-space: normal; }
  .entity-avatar { width: 30px; height: 30px; flex-basis: 30px; border-radius: 8px; }
  .entity-primary { font-size: 12px; }
  .entity-secondary { font-size: 10px; }
  .message-table .entity-copy { max-width: none; }
  .message-table a.entity-primary { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
  .table-action { min-height: 44px; padding: 10px 8px; justify-self: start; }
  .pagination { justify-content: space-between; }
  .pagination-info { flex-basis: 100%; }
  .confirm-panel { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .confirm-actions { grid-column: 1; align-items: stretch; flex-direction: column; }
  .confirm-actions > .button, .confirm-actions form, .confirm-actions form .button { width: 100%; }
  .token-dialog { max-height: calc(100dvh - 32px); }
  .token-dialog-content { padding: 22px; }
  .token-actions .button { flex: 1 1 auto; }
  .auth-page { padding: 24px; }
  .auth-layout { display: block; width: min(480px, 100%); min-height: 0; border-radius: 18px; }
  .auth-aside { padding: 26px 28px 0; background: #fff; color: var(--color-text); }
  .auth-aside .brand { color: var(--color-text); }
  .auth-aside .brand-caption { color: var(--color-text-muted); }
  .auth-brand { margin: 0; }
  .auth-aside-content, .auth-visual, .auth-aside-footer { display: none; }
  .auth-main { padding: 30px 28px; }
  .auth-intro { margin-bottom: 26px; }
  .auth-intro h1 { font-size: 28px; }
}

@media (max-width: 390px) {
  .page-content { padding-inline: 14px; }
  .topbar { padding-inline: 14px; gap: 8px; }
  .breadcrumbs { max-width: 150px; }
  .page-header > .button, .page-heading--actions > .button { width: 100%; }
  .panel, .surface { padding: 16px; }
  .metric-card { padding: 16px; }
  .detail-list > div { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .data-table td, .entity-table td, .audit-table td, .message-table td:nth-child(n), .notification-table td:nth-child(n) { grid-template-columns: minmax(72px, 0.7fr) minmax(0, 1.3fr); gap: 8px; }
  .auth-page { padding: 16px; background: #fff; }
  .auth-layout { border: 0; border-radius: 0; box-shadow: none; }
  .auth-aside { padding: 16px 0 0; }
  .auth-main { padding: 28px 0 12px; }
}

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

.template-panel, .template-form-panel { display: grid; gap: 18px; min-width: 0; }
.template-list { display: grid; gap: 12px; min-width: 0; }
.template-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; min-width: 0; padding: 16px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
.template-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 14px; min-width: 0; margin: 0; }
.template-details > div { min-width: 0; }
.template-details dt { color: var(--color-text-muted); font-size: 12px; }
.template-details dd { min-width: 0; margin: 5px 0 0; color: var(--color-text); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.template-details dd code, .template-variables code { overflow-wrap: anywhere; }
.template-variables { display: flex; flex-wrap: wrap; gap: 5px; }
.template-state { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.template-state--success { background: var(--color-success-bg); color: var(--color-success); }
.template-state--muted { background: #f2f4f7; color: var(--color-text-muted); }
.template-edit { flex: 0 0 auto; }
.template-empty { display: grid; justify-items: start; gap: 8px; padding: 16px; border: 1px dashed var(--color-border); border-radius: 10px; background: var(--color-surface-subtle); }
.template-empty h3, .template-empty p { margin: 0; }
.template-empty p { color: var(--color-text-muted); font-size: 13px; line-height: 1.6; }
.template-editor-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); align-items: start; gap: 20px; min-width: 0; }
.template-preview { display: grid; gap: 14px; min-width: 0; padding: 18px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-subtle); }
.template-preview-heading { display: grid; gap: 5px; }
.template-preview-heading h3, .template-preview-heading p, .template-preview-label { margin: 0; }
.template-preview-heading h3 { font-size: 15px; }
.template-preview-heading p, .template-preview-status { color: var(--color-text-muted); font-size: 12px; line-height: 1.5; }
.template-preview-variables { display: grid; gap: 12px; min-width: 0; }
.template-preview-variable { display: grid; gap: 5px; min-width: 0; }
.template-preview-variable label, .template-preview-label { color: var(--color-text-muted); font-size: 12px; font-weight: 600; }
.template-preview-variable textarea { display: block; width: 100%; min-width: 0; min-height: 64px; padding: 10px 12px; border: 1px solid var(--color-control-border); border-radius: var(--radius-control); background: #fff; color: var(--color-text); font-size: 14px; line-height: 1.5; resize: vertical; }
.template-preview-variable textarea:hover { border-color: #65768b; }
.template-preview-variable textarea:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px #087f6517; }
.template-preview-result { display: grid; gap: 7px; min-width: 0; }
.template-preview-output { min-height: 110px; max-height: 320px; margin: 0; padding: 12px; overflow: auto; border: 1px solid var(--color-border); border-radius: 8px; background: #fff; color: var(--color-text); font: inherit; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.template-preview-status { min-height: 18px; margin: 0; }
.template-preview-status[data-state="error"] { color: var(--color-danger); }

/* Statistics */
.statistics-filter-panel { display: grid; gap: 20px; }
.statistics-filter-panel > .section-header { margin-bottom: 0; }
.statistics-filters { display: grid; gap: 18px; min-width: 0; }
.statistics-primary-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.statistics-advanced { min-width: 0; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-surface-subtle); }
.statistics-advanced > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 15px; color: #344054; font-size: 13px; font-weight: 600; list-style: none; }
.statistics-advanced > summary::-webkit-details-marker { display: none; }
.statistics-advanced > summary .icon { color: var(--color-text-muted); transition: transform 140ms ease; }
.statistics-advanced[open] > summary .icon { transform: rotate(180deg); }
.statistics-advanced-content { padding: 16px; border-top: 1px solid var(--color-border); }
.statistics-advanced-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.statistics-filter-actions { align-items: center; }
.statistics-filter-actions .button { min-width: 120px; }
.field-error { margin: 0; color: var(--color-danger); font-size: 12px; line-height: 1.5; }
.statistics-report-note { margin: 16px 2px 18px; color: var(--color-text-muted); font-size: 13px; line-height: 1.6; }
.statistics-report-note strong { color: #344054; }
.statistics-summary { display: grid; gap: 14px; margin-bottom: 22px; }
.statistics-primary-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.statistics-kpi { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 20px 22px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: #fff; box-shadow: var(--shadow-card); }
.statistics-kpi--delivered { border-color: #c6e9d7; background: #fbfefc; }
.statistics-kpi--undelivered { border-color: #f2c7ce; background: #fffdfd; }
.statistics-kpi-label { margin: 0; color: var(--color-text-muted); font-size: 13px; font-weight: 600; }
.statistics-kpi-value { margin: 0; color: var(--color-text); font-size: 34px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.statistics-kpi--delivered .statistics-kpi-value { color: var(--color-success); }
.statistics-kpi--undelivered .statistics-kpi-value { color: var(--color-danger); }
.statistics-kpi-caption { margin: 0; color: var(--color-text-muted); font-size: 12px; }
.statistics-secondary-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0; }
.statistics-secondary-kpis > div { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 9px; background: #fff; }
.statistics-secondary-kpis dt { color: var(--color-text-muted); font-size: 11px; line-height: 1.4; }
.statistics-secondary-kpis dd { margin: 0; color: #344054; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.statistics-chart-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
.statistics-chart-card { display: grid; gap: 14px; min-width: 0; }
.statistics-chart-card .section-header { margin-bottom: 0; }
.statistics-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 0; margin: 0; color: #596579; font-size: 12px; list-style: none; }
.statistics-legend li { display: inline-flex; align-items: center; gap: 7px; }
.statistics-legend-swatch { width: 11px; height: 11px; flex: 0 0 11px; border-radius: 3px; }
.statistics-legend-swatch--delivered { background: #087f65; }
.statistics-legend-swatch--undelivered { background: #b42332; }
.statistics-chart-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #b6c0ce transparent; }
.statistics-chart-scroll::-webkit-scrollbar, .statistics-table-scroll::-webkit-scrollbar { height: 7px; }
.statistics-chart-scroll::-webkit-scrollbar-thumb, .statistics-table-scroll::-webkit-scrollbar-thumb { border-radius: 7px; background: #b6c0ce; }
.statistics-svg { display: block; width: auto; min-width: 100%; max-width: none; height: auto; overflow: visible; color: #596579; }
.statistics-gridline { stroke: #e4e7ec; stroke-width: 1; }
.statistics-axis-line { stroke: #98a2b3; stroke-width: 1; }
.statistics-axis-label { fill: #667085; font-family: inherit; font-size: 12px; }
.statistics-point-label { fill: #596579; font-family: inherit; font-size: 11px; }
.statistics-bar--delivered { fill: #087f65; }
.statistics-bar--undelivered { fill: #b42332; }
.statistics-chart-mark { cursor: default; outline: none; }
.statistics-chart-mark:focus .statistics-bar { stroke: #182230; stroke-width: 2; }
.statistics-chart-mark:focus-visible { outline: none; }
.statistics-chart-mark:focus-visible .statistics-bar { stroke: #111b27; stroke-width: 3; }
.statistics-breakdown-list { display: grid; gap: 4px; min-width: 0; }
.statistics-breakdown-row { display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(220px, max-content); grid-template-areas: "name bar values"; align-items: center; gap: 14px; min-width: 0; padding: 10px 2px; border-bottom: 1px solid #edf0f4; border-radius: 4px; }
.statistics-breakdown-row:last-child { border-bottom: 0; }
.statistics-breakdown-row:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.statistics-breakdown-name { grid-area: name; min-width: 0; color: #344054; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.statistics-breakdown-bar { grid-area: bar; display: block; width: 100%; height: 20px; overflow: visible; }
.statistics-bar-track { fill: #eef2f6; }
.statistics-breakdown-values { grid-area: values; display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 12px; color: var(--color-text-muted); font-size: 11px; line-height: 1.4; }
.statistics-breakdown-values strong { color: #344054; font-variant-numeric: tabular-nums; }
.statistics-chart-readout { min-height: 22px; margin: 0; color: #344054; font-size: 12px; line-height: 1.6; }
.statistics-chart-scroll-hint { margin: -7px 0 0; color: var(--color-text-muted); font-size: 11px; line-height: 1.5; }
.statistics-data-details { min-width: 0; border-top: 1px solid var(--color-border); }
.statistics-data-details > summary { display: flex; align-items: center; min-height: 44px; color: var(--color-primary); font-size: 12px; font-weight: 600; list-style: none; }
.statistics-data-details > summary::-webkit-details-marker { display: none; }
.statistics-data-details > summary::after { width: 8px; height: 8px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); content: ""; }
.statistics-data-details[open] > summary::after { transform: rotate(225deg) translateY(-2px); }
.statistics-table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; scrollbar-color: #b6c0ce transparent; }
.statistics-data-table { min-width: 860px; font-size: 12px; }
.statistics-data-table th, .statistics-data-table td { padding: 10px 12px; white-space: nowrap; }
.statistics-empty { display: flex; align-items: flex-start; gap: 16px; margin-top: 20px; }
.statistics-empty-icon { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--color-primary-soft); color: var(--color-primary); }
.statistics-empty h2 { margin: 1px 0 5px; }
.statistics-empty p { max-width: 72ch; color: var(--color-text-muted); font-size: 13px; line-height: 1.6; }
.statistics-empty-reset { margin-top: 12px !important; }
.statistics-empty-reset a { font-weight: 600; }
.statistics-retention-note { margin: 18px 2px 0; color: var(--color-text-muted); font-size: 12px; line-height: 1.6; }
.service-panel--warning { border-color: #efdbac; background: var(--color-warning-bg); }
.service-panel--warning .service-copy p { color: #69501f; }

@media (max-width: 1180px) {
  .template-card { grid-template-columns: minmax(0, 1fr); }
  .template-edit { justify-self: start; }
  .statistics-primary-filters, .statistics-advanced-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .template-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .template-preview-variable textarea { font-size: 16px; }
  .template-card { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .template-details { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .template-edit { width: 100%; }
  .statistics-primary-filters, .statistics-advanced-grid { grid-template-columns: minmax(0, 1fr); }
  .statistics-primary-kpis { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .statistics-secondary-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statistics-kpi { padding: 17px 18px; }
  .statistics-kpi-value { font-size: 30px; }
  .statistics-filter-actions { align-items: stretch; }
  .statistics-filter-actions .button { flex: 1 1 120px; }
  .statistics-svg { width: auto; max-width: none; }
  .statistics-chart-scroll { margin-inline: -18px; max-width: calc(100% + 36px); padding-inline: 18px; }
  .statistics-table-scroll { margin-inline: -18px; max-width: calc(100% + 36px); padding-inline: 18px; }
  .statistics-data-table { display: table; width: auto; min-width: 860px; }
  .statistics-data-table thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; clip-path: none; }
  .statistics-data-table tbody { display: table-row-group; width: auto; }
  .statistics-data-table tbody tr { display: table-row; width: auto; padding: 0; border: 0; border-radius: 0; }
  .statistics-data-table th, .statistics-data-table td { display: table-cell; width: auto; max-width: none; padding: 10px 12px; font-size: 12px; white-space: nowrap; }
  .statistics-data-table th::before, .statistics-data-table td::before { content: none; }
  .statistics-data-table td > * { grid-column: auto; }
  .statistics-empty { gap: 12px; }
  .statistics-breakdown-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "values" "bar"; gap: 7px; padding: 12px 2px; }
  .statistics-breakdown-values { grid-template-columns: repeat(2, minmax(0, max-content)); }
  .statistics-breakdown-bar { width: 100%; }
}

@media (max-width: 390px) {
  .statistics-chart-scroll, .statistics-table-scroll { margin-inline: -16px; max-width: calc(100% + 32px); padding-inline: 16px; }
}
