:root {
  color-scheme: dark;
  --background: #0f172a;
  --background-deep: #090f1d;
  --surface: #1b2336;
  --surface-raised: #222c42;
  --surface-muted: #272f42;
  --foreground: #f8fafc;
  --muted: #a7b3c6;
  --border: #43516a;
  --border-soft: rgba(148, 163, 184, 0.2);
  --accent: #22c55e;
  --accent-hover: #2dd46a;
  --accent-ink: #07160d;
  --danger: #f87171;
  --warning: #fbbf24;
  --ring: #ffffff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-md: 0 14px 35px rgba(3, 7, 18, 0.28);
  --shadow-lg: 0 24px 60px rgba(3, 7, 18, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background-deep); }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--foreground); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
svg { display: block; fill: currentColor; }
code, pre, .eyebrow, .environment-badge { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -0.035em; }
h2 { margin-bottom: 6px; font-size: 1.1rem; }
h3 { margin-bottom: 4px; font-size: 1rem; }
p { color: var(--muted); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink); font-weight: 700; transform: translateY(-150%); transition: transform 180ms ease; }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px; border-right: 1px solid var(--border-soft); background: rgba(9, 15, 29, 0.94); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px; color: var(--foreground); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 12px; background: linear-gradient(145deg, var(--surface-raised), #152033); color: var(--accent); box-shadow: inset 0 1px rgba(255, 255, 255, 0.08); }
.brand strong, .brand small, .account-copy strong, .account-copy small { display: block; }
.brand strong { letter-spacing: -0.02em; }
.brand small, .account-copy small { color: var(--muted); font-size: 0.75rem; text-transform: capitalize; }
.main-navigation { margin-top: 28px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; transition: color 180ms ease, background 180ms ease; }
.nav-link:hover { color: var(--foreground); background: rgba(255, 255, 255, 0.05); }
.nav-link.is-active { background: rgba(34, 197, 94, 0.11); color: #80ea9f; box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2); }
.nav-link svg, .button svg { width: 20px; height: 20px; }
.sidebar-account { display: grid; grid-template-columns: 38px minmax(0, 1fr) 44px; align-items: center; gap: 9px; margin-top: auto; padding: 12px 6px 0; border-top: 1px solid var(--border-soft); }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-raised); color: #b8f7cb; font-weight: 800; }
.account-copy { min-width: 0; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.875rem; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: color 180ms ease, background 180ms ease; }
.icon-button:hover { background: var(--surface-muted); color: var(--foreground); }
.icon-button svg { width: 21px; height: 21px; }
.page-column { min-width: 0; }
.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--border-soft); background: rgba(15, 23, 42, 0.78); backdrop-filter: blur(16px); color: var(--muted); font-size: 0.8rem; }
.topbar > div { display: flex; align-items: center; gap: 8px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12); }
.environment-badge { padding: 3px 8px; border: 1px solid var(--border-soft); border-radius: 6px; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; }
.page-content { width: min(100%, 1440px); margin-inline: auto; padding: 28px 32px 48px; }
.page-heading, .app-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading p, .app-heading p { margin-bottom: 0; }
.compact-heading { align-items: flex-start; }
.eyebrow { display: block; margin-bottom: 8px; color: #86efac; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 10px; color: #a7f3d0; font-size: 0.82rem; text-decoration: none; }
.back-link::before { content: "←"; margin-right: 6px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease; }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(34, 197, 94, 0.18); }
.button-primary:hover { background: var(--accent-hover); box-shadow: 0 10px 28px rgba(34, 197, 94, 0.25); }
.button-secondary { border-color: var(--border); background: rgba(255, 255, 255, 0.025); color: var(--foreground); }
.button-secondary:hover { border-color: #64748b; background: var(--surface-raised); }
.button-ghost { color: var(--muted); }
.button-ghost:hover { background: var(--surface-muted); color: var(--foreground); }
.button-block { width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.metric-card, .panel, .application-card { border: 1px solid var(--border-soft); background: linear-gradient(145deg, rgba(34, 44, 66, 0.82), rgba(27, 35, 54, 0.92)); box-shadow: var(--shadow-md); }
.metric-card { min-height: 132px; padding: 18px; border-radius: var(--radius-md); }
.metric-card > span, .metric-card small { display: block; color: var(--muted); }
.metric-card > span { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.055em; }
.metric-card strong { display: block; margin: 8px 0 2px; font-size: 2rem; line-height: 1; }
.metric-card small { font-size: 0.78rem; }
.section-block { margin-top: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-heading p { margin-bottom: 0; font-size: 0.875rem; }
.application-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.application-card { display: flex; flex-direction: column; gap: 16px; min-height: 340px; padding: 18px; border-radius: var(--radius-md); }
.application-card-top { display: flex; align-items: center; justify-content: space-between; }
.app-symbol { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 13px; background: linear-gradient(145deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.06)); color: #b8f7cb; font-weight: 800; letter-spacing: -0.04em; box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.22); }
.app-symbol-large { width: 58px; height: 58px; border-radius: 16px; }
.application-card code, .inline-metadata code { color: #86efac; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 8px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 0.72rem; text-transform: capitalize; }
.status-pill > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active, .status-sent { background: rgba(34, 197, 94, 0.1); color: #86efac; }
.status-queued { background: rgba(251, 191, 36, 0.1); color: #fde68a; }
.status-failed, .status-archived, .status-error { background: rgba(248, 113, 113, 0.1); color: #fca5a5; }
.compact-details, .detail-list { margin: 0; }
.compact-details { flex: 1; }
.compact-details div, .detail-list div { display: grid; grid-template-columns: minmax(90px, 0.4fr) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); }
dt { color: var(--muted); font-size: 0.78rem; }
dd { margin: 0; overflow-wrap: anywhere; font-size: 0.82rem; }
.panel { padding: 22px; border-radius: var(--radius-lg); }
.form-panel { max-width: 1040px; }
.form-section-heading { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 18px; padding-top: 20px; border-top: 1px solid var(--border-soft); }
.form-section-heading:first-of-type { padding-top: 0; border-top: 0; }
.form-section-heading > span { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; background: rgba(34, 197, 94, 0.1); color: #86efac; font-family: monospace; font-size: 0.75rem; }
.form-section-heading p { margin: 0; font-size: 0.82rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.field-group { min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-group label { display: block; margin-bottom: 6px; color: #dbe4f1; font-size: 0.8rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #101827; color: var(--foreground); transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease; }
textarea { resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #64748b; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: #86efac; box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.16); background: #0c1422; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-error { margin: 5px 0 0; color: #fecaca; font-size: 0.78rem; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 0.76rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.toggle-card { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: rgba(9, 15, 29, 0.34); cursor: pointer; }
.toggle-card strong, .toggle-card small { display: block; }
.toggle-card small { margin-top: 2px; color: var(--muted); }
.toggle-card input { width: 20px; min-height: 20px; accent-color: var(--accent); }
.app-heading { align-items: center; }
.app-heading-identity { display: flex; align-items: center; gap: 14px; }
.app-heading h1 { margin-bottom: 5px; }
.inline-metadata { display: flex; align-items: center; gap: 9px; }
.tab-navigation { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; padding: 5px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: rgba(9, 15, 29, 0.45); }
.tab-navigation a { min-height: 42px; display: inline-flex; align-items: center; padding: 8px 13px; border-radius: var(--radius-sm); color: var(--muted); font-size: 0.82rem; font-weight: 700; text-decoration: none; transition: color 180ms ease, background 180ms ease; }
.tab-navigation a:hover { color: var(--foreground); background: var(--surface-muted); }
.tab-navigation a.is-active { background: var(--surface-raised); color: #a7f3d0; box-shadow: inset 0 0 0 1px var(--border-soft); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr); gap: 14px; }
.integration-grid { display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr); gap: 14px; }
.notification-compose { margin-bottom: 14px; }
.section-separated { margin-top: 14px; }
.delivery-error { color: #fecaca; }
.overview-primary h2 { overflow-wrap: anywhere; font-family: monospace; font-size: clamp(1.05rem, 2vw, 1.4rem); color: #a7f3d0; }
.notice { margin-top: 18px; padding: 14px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: rgba(34, 197, 94, 0.07); }
.notice p { margin: 3px 0 0; font-size: 0.82rem; }
.empty-state { display: grid; place-items: center; min-height: 220px; padding: 30px; border: 1px dashed var(--border); border-radius: var(--radius-md); text-align: center; }
.empty-state p { max-width: 460px; margin-bottom: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; font-size: 0.82rem; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
td small { display: block; max-width: 500px; margin-top: 3px; color: var(--muted); }
.audit-list { margin: 0; padding: 0; list-style: none; }
.audit-list li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border-soft); }
.audit-marker { width: 9px; height: 9px; margin-top: 6px; border: 2px solid var(--accent); border-radius: 50%; }
.audit-header { display: flex; justify-content: space-between; gap: 20px; }
.audit-header time, .audit-list p { color: var(--muted); font-size: 0.78rem; }
.audit-list p { margin: 3px 0; }
details summary { width: fit-content; color: #a7f3d0; cursor: pointer; font-size: 0.78rem; }
pre { max-height: 340px; overflow: auto; padding: 12px; border-radius: var(--radius-sm); background: var(--background-deep); color: #dbe4f1; font-size: 0.75rem; }
.alert { margin-bottom: 18px; padding: 12px 14px; border-radius: var(--radius-sm); }
.alert-success { border: 1px solid rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.1); color: #bbf7d0; }
.alert-error { border: 1px solid rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.1); color: #fecaca; }
.alert-warning { border: 1px solid rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.08); color: #fde68a; }
.alert a { text-underline-offset: 3px; }

.auth-page { background: radial-gradient(circle at 18% 18%, rgba(34, 197, 94, 0.13), transparent 28%), radial-gradient(circle at 82% 70%, rgba(51, 65, 85, 0.38), transparent 36%), var(--background-deep); }
.auth-layout { width: min(1120px, calc(100% - 40px)); min-height: 100vh; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: center; gap: 70px; padding: 40px 0; }
.brand-large { padding: 0; }
.auth-message { max-width: 650px; margin-top: 100px; }
.auth-message h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 0.98; }
.auth-message p { max-width: 580px; margin-top: 24px; font-size: 1.05rem; }
.auth-card { padding: 30px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 20px; background: rgba(27, 35, 54, 0.78); box-shadow: var(--shadow-lg); backdrop-filter: blur(18px); }
.auth-card-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 28px; color: var(--muted); font-size: 0.78rem; }
.auth-card > p { margin-bottom: 24px; }
.form-stack { display: grid; gap: 15px; }
.error-page { display: grid; place-items: center; padding: 24px; }
.error-card { width: min(100%, 480px); padding: 32px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); text-align: center; box-shadow: var(--shadow-lg); }
.error-code { display: block; color: #86efac; font-family: monospace; font-size: 3rem; font-weight: 800; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; display: grid; grid-template-columns: minmax(190px, 1fr) auto; align-items: center; padding: 10px 18px; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .main-navigation { display: none; }
  .sidebar-account { grid-template-columns: 38px minmax(90px, 1fr) 44px; margin: 0; padding: 0; border: 0; }
  .topbar { display: none; }
  .overview-grid { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: 1fr; }
  .auth-layout { grid-template-columns: 1fr; gap: 30px; }
  .auth-intro { align-self: end; }
  .auth-message { margin-top: 50px; }
  .auth-card { width: min(100%, 520px); }
}

@media (max-width: 640px) {
  .sidebar { grid-template-columns: 1fr auto; padding-inline: 12px; }
  .sidebar-account { grid-template-columns: 38px 44px; }
  .account-copy { display: none; }
  .page-content { padding: 22px 16px 36px; }
  .page-heading, .app-heading { align-items: stretch; flex-direction: column; }
  .page-heading > .button, .app-heading > .button { width: 100%; }
  .metric-grid, .form-grid, .toggle-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .metric-card { min-height: 112px; }
  .application-grid { grid-template-columns: 1fr; }
  .panel { padding: 17px; border-radius: var(--radius-md); }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .app-heading-identity { align-items: flex-start; }
  .app-symbol-large { width: 50px; height: 50px; }
  .tab-navigation a { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .audit-header { flex-direction: column; gap: 3px; }
  .auth-layout { width: min(100% - 28px, 520px); padding: 24px 0; }
  .auth-message { margin-top: 36px; }
  .auth-message h1 { font-size: clamp(2rem, 12vw, 3.2rem); }
  .auth-card { padding: 22px; }
}

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