:root {
  color-scheme: light;
  --purple: #583689;
  --purple-700: #45256f;
  --purple-800: #341954;
  --purple-050: #f5f1fa;
  --ink: #17131c;
  --muted: #716a77;
  --line: #e5e0e8;
  --canvas: #f6f5f7;
  --card: #fff;
  --green: #16805b;
  --green-bg: #eaf8f2;
  --red: #b43b45;
  --red-bg: #fff0f1;
  --amber: #9a6714;
  --amber-bg: #fff8e8;
  --blue: #2875c8;
  --shadow: 0 14px 40px rgb(39 27 52 / 7%);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-width: 320px; min-height: 100svh; margin: 0; color: var(--ink); background: var(--canvas); font-family: "Segoe UI Variable", "Aptos", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Login */
.login-page { overflow: hidden; background: #f7f5f8; }
.login-layout { display: grid; grid-template-columns: minmax(520px, 1.25fr) minmax(360px, .75fr); min-height: 100svh; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: flex-start; min-height: 100svh; padding: clamp(34px, 5vw, 72px); overflow: hidden; color: #fff; background: linear-gradient(145deg, #624098 0%, #4c2b7a 55%, #351955 100%); }
.login-brand::before { position: absolute; inset: auto -16vw -28vw auto; width: 52vw; height: 52vw; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; content: ""; }
.login-brand::after { position: absolute; top: 18%; right: -24%; width: 58%; aspect-ratio: 1; border: 1px solid rgb(255 255 255 / 9%); border-radius: 50%; content: ""; }
.login-brand-top, .login-mobile-brand { display: flex; align-items: center; gap: 15px; }
.login-brand-top { position: relative; z-index: 1; }
.login-brand-top img { display: block; width: clamp(150px, 12vw, 178px); height: auto; }
.login-brand-top span, .login-mobile-brand span { padding-left: 15px; border-left: 1px solid rgb(255 255 255 / 32%); font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.login-statement { position: relative; z-index: 1; max-width: 570px; margin: auto 0; padding: 12vh 0; }
.overline { margin: 0 0 11px; color: var(--purple); font-size: .69rem; font-weight: 750; letter-spacing: .16em; line-height: 1.4; text-transform: uppercase; }
.overline.light { color: rgb(255 255 255 / 64%); }
.login-statement h1 { max-width: 560px; margin: 0; font-size: clamp(3rem, 5vw, 5.8rem); font-weight: 540; letter-spacing: -.067em; line-height: .94; }
.login-statement > p:last-child { max-width: 460px; margin: 30px 0 0; color: rgb(255 255 255 / 68%); font-size: clamp(1rem, 1.3vw, 1.17rem); line-height: 1.65; }
.login-access { display: grid; place-items: center; min-width: 0; padding: clamp(28px, 4.5vw, 72px); background: #faf9fb; }
.login-form-wrap { width: min(100%, 370px); }
.login-mobile-brand { display: none; margin-bottom: 54px; }
.login-mobile-brand img { display: block; width: 144px; height: auto; }
.login-mobile-brand span { border-color: var(--line); color: var(--muted); }
.login-form-wrap h2 { margin: 0; font-size: clamp(2.1rem, 3vw, 3.05rem); font-weight: 590; letter-spacing: -.052em; line-height: 1; }
.login-help { margin: 17px 0 34px; color: var(--muted); font-size: .98rem; line-height: 1.6; }
.login-form { display: grid; }
.login-form label, .form-card label > span, .inline-create label > span, .filter-bar label > span { display: block; margin: 0 0 8px; color: #433d48; font-size: .79rem; font-weight: 690; }
.login-form label:not(:first-of-type) { margin-top: 20px; }
input, select { width: 100%; min-height: 48px; padding: 0 14px; color: var(--ink); border: 1px solid #d9d3dd; border-radius: 8px; outline: none; background: #fff; transition: border-color .16s ease, box-shadow .16s ease; }
input::placeholder { color: #a7a0aa; }
input:focus, select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgb(88 54 137 / 10%); }
.login-form input { min-height: 54px; padding: 0 16px; border-radius: 9px; }
.login-form button { min-height: 54px; margin-top: 28px; color: #fff; border: 0; border-radius: 9px; background: var(--purple); font-weight: 720; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.login-form button:hover { background: var(--purple-700); }
.login-form button:active { transform: translateY(1px); }
.login-form button:disabled { cursor: wait; opacity: .82; transform: none; }
.login-error { margin: 0 0 22px; }

/* Application shell */
.app-shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); min-height: 100svh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100svh; padding: 28px 20px 22px; color: #fff; background: linear-gradient(180deg, #4f2d7d 0%, #3a205c 100%); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 10px; }
.sidebar-brand img { display: block; width: 126px; height: auto; }
.sidebar-brand > span { padding-left: 11px; border-left: 1px solid rgb(255 255 255 / 26%); color: rgb(255 255 255 / 62%); font-size: .6rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.primary-nav { display: grid; gap: 5px; margin-top: 58px; }
.primary-nav a { display: flex; align-items: center; gap: 13px; min-height: 44px; padding: 0 13px; border-radius: 8px; color: rgb(255 255 255 / 63%); font-size: .88rem; font-weight: 570; transition: color .15s ease, background .15s ease; }
.primary-nav a:hover { color: #fff; background: rgb(255 255 255 / 7%); }
.primary-nav a.active { color: #fff; background: rgb(255 255 255 / 12%); }
.nav-dot { width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; }
.primary-nav a.active .nav-dot { border-color: #bfa8e5; background: #bfa8e5; box-shadow: 0 0 0 4px rgb(191 168 229 / 12%); }
.sidebar-footer { display: grid; gap: 18px; margin-top: auto; }
.sidebar-mobile-app { padding: 9px 12px; color: #d9cbea; border: 1px solid rgb(255 255 255 / 11%); border-radius: 8px; background: rgb(255 255 255 / 6%); font-size: .72rem; font-weight: 650; text-align: center; }
.sidebar-mobile-app:hover { color: #fff; background: rgb(255 255 255 / 10%); }
.environment-status { display: flex; align-items: center; gap: 11px; padding: 15px 12px; border: 1px solid rgb(255 255 255 / 10%); border-radius: 9px; background: rgb(255 255 255 / 5%); }
.environment-status > span { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #72dfb8; box-shadow: 0 0 0 5px rgb(114 223 184 / 11%); }
.environment-status strong, .environment-status small { display: block; }
.environment-status strong { font-size: .75rem; }
.environment-status small { margin-top: 3px; color: rgb(255 255 255 / 48%); font-size: .63rem; }
.sidebar-signout { width: 100%; padding: 8px 12px; color: rgb(255 255 255 / 53%); border: 0; background: none; text-align: left; font-size: .74rem; cursor: pointer; }
.sidebar-signout:hover { color: #fff; }
.stalwart-section { margin-top: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.stalwart-object-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
.stalwart-object-grid a { position: relative; min-width: 0; min-height: 84px; padding: 14px; border: 1px solid #eee9f0; border-radius: 9px; background: #fcfbfd; }
.stalwart-object-grid a:hover { border-color: #cbbadb; background: var(--purple-050); }
.stalwart-object-grid strong, .stalwart-object-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stalwart-object-grid strong { padding-right: 20px; font-size: .78rem; }.stalwart-object-grid small { margin-top: 6px; color: var(--muted); font-size: .64rem; }.stalwart-object-grid a > span { position: absolute; top: 13px; right: 12px; display: flex; align-items: center; gap: 2px; color: var(--purple); font-size: .67rem; }.stalwart-object-grid a > span svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.object-record-list > a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, auto) 12px; align-items: center; gap: 16px; min-height: 68px; padding: 11px 20px; border-top: 1px solid var(--line); }
.object-record-list > a:first-child { border-top: 0; }.object-record-list strong, .object-record-list small { display: block; }.object-record-list strong { font-size: .82rem; }.object-record-list small { margin-top: 4px; color: var(--muted); font-size: .68rem; }.object-record-list code { max-width: 240px; overflow: hidden; color: var(--muted); font-size: .67rem; text-overflow: ellipsis; white-space: nowrap; }.object-record-list b { display: grid; place-items: center; color: var(--purple); }.object-record-list b svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.raw-object-card pre { max-height: 620px; margin: 16px 0 0; padding: 16px; overflow: auto; color: #ddd4e6; border-radius: 9px; background: #21162b; font: .72rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }.raw-object-card > p, .advanced-editor p { color: var(--muted); font-size: .72rem; line-height: 1.55; }
.advanced-editor { margin-top: 18px; }.advanced-editor > summary { cursor: pointer; color: var(--purple); font-weight: 720; }.advanced-editor form { margin-top: 18px; }.advanced-editor textarea { width: 100%; min-height: 220px; padding: 14px; resize: vertical; color: #eee8f4; border: 1px solid #3f2a4d; border-radius: 9px; outline: none; background: #21162b; font: .75rem/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; }.advanced-editor textarea:focus { border-color: #a98ac9; box-shadow: 0 0 0 4px rgb(88 54 137 / 10%); }
.delegated-domain-row { padding: 11px 0; border-top: 1px solid #eee9f0; }.delegated-domain-row:first-of-type { border-top: 0; }.delegated-domain-row .check-row { padding-top: 0; padding-bottom: 9px; }.quota-limit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-left: 31px; }.quota-limit-fields input { min-height: 42px; }
.delegated-limit-note { display: grid; gap: 5px; margin-top: 15px; padding: 12px 14px; color: var(--muted); border-radius: 8px; background: var(--purple-050); font-size: .7rem; }.delegated-limit-note strong { color: var(--purple); }
.workspace { min-width: 0; }
.mobile-header, .mobile-nav { display: none; }
.content-shell { width: min(100%, 1500px); min-height: 100svh; margin: 0 auto; padding: clamp(30px, 4vw, 62px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 31px; }
.page-heading.compact { align-items: center; }
.page-heading h1 { margin: 0; font-size: clamp(2.15rem, 3.2vw, 3.55rem); font-weight: 600; letter-spacing: -.058em; line-height: 1; }
.page-heading > div > p:last-child { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.breadcrumbs { display: flex; align-items: center; gap: 9px; margin: 0 0 14px !important; color: var(--muted); font-size: .75rem; }
.breadcrumbs a { color: var(--purple); font-weight: 670; }
.heading-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px; color: #fff; border: 1px solid var(--purple); border-radius: 8px; background: var(--purple); font-size: .82rem; font-weight: 690; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { border-color: var(--purple-700); background: var(--purple-700); }
.button:active { transform: translateY(1px); }
.button.secondary { color: var(--purple); border-color: #d9cfe6; background: #fff; }
.button.secondary:hover, .button.ghost:hover { background: var(--purple-050); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.danger { border-color: var(--red); background: var(--red); }
.button.danger:hover { border-color: #96303a; background: #96303a; }
.button.full { width: 100%; }
.flash { display: flex; align-items: center; gap: 11px; margin: 0 0 20px; padding: 13px 15px; border: 1px solid; border-radius: 8px; font-size: .83rem; line-height: 1.45; }
.flash > span { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; }
.flash.success { color: #176849; border-color: #c8e8dc; background: var(--green-bg); }
.flash.success > span { background: var(--green); }
.flash.error { color: #8f2f37; border-color: #f0c8cc; background: var(--red-bg); }
.flash.error > span { background: var(--red); }
.flash.warning { color: #7d5718; border-color: #eedcae; background: var(--amber-bg); }
.flash.warning > span { background: var(--amber); }

/* Dashboard */
.service-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.service-strip > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 16px 19px; border-right: 1px solid var(--line); }
.service-strip > div:last-child { border-right: 0; }
.service-light { grid-row: 1 / 3; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgb(180 59 69 / 8%); }
.service-light.online { background: var(--green); box-shadow: 0 0 0 5px rgb(22 128 91 / 8%); }
.service-strip strong { font-size: .78rem; }
.service-strip small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.metric-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.metric-card, .panel-card { border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow); }
.metric-card { min-width: 0; padding: 19px; }
.metric-card p { margin: 0; color: var(--muted); font-size: .72rem; font-weight: 650; }
.metric-card > strong { display: block; margin-top: 13px; font-size: clamp(1.65rem, 2.3vw, 2.35rem); font-weight: 610; letter-spacing: -.055em; }
.metric-card small { display: block; margin-top: 7px; overflow: hidden; color: #948d98; font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(280px, .72fr); gap: 16px; }
.panel-card { min-width: 0; padding: 22px; }
.span-two { grid-column: span 1; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.card-heading h2 { margin: 0; font-size: 1.08rem; font-weight: 680; letter-spacing: -.025em; }
.card-heading > strong { font-size: 1.3rem; font-weight: 650; letter-spacing: -.03em; }
.card-heading > span { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 7px; color: var(--purple); background: var(--purple-050); font-size: .72rem; font-weight: 730; }
.card-heading > a { color: var(--purple); font-size: .75rem; font-weight: 690; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: .66rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend span::before { width: 13px; height: 2px; content: ""; background: currentColor; }
.legend .smtp { color: var(--purple); }.legend .delivered { color: var(--green); }.legend .spam { color: var(--red); }
.activity-chart { display: block; width: 100%; height: 210px; overflow: visible; }
.activity-chart line { stroke: #eeeaf0; stroke-width: 1; }
.activity-chart polyline { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.chart-smtp { stroke: var(--purple); }.chart-delivered { stroke: var(--green); }.chart-spam { stroke: var(--red); }
.chart-axis { display: flex; justify-content: space-between; color: #9b949f; font-size: .62rem; }
.storage-card progress, .resource-row progress, .detail-summary progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; background: #eeeaf0; }
progress::-webkit-progress-bar { border-radius: 99px; background: #eeeaf0; }
progress::-webkit-progress-value { border-radius: 99px; background: var(--purple); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--purple); }
.storage-total { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; color: var(--muted); font-size: .68rem; }
.storage-total strong { color: var(--ink); }
.compact-list { display: grid; margin-top: 23px; }
.compact-list a { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-width: 0; padding: 11px 0; border-top: 1px solid var(--line); }
.compact-list a > span:first-child { min-width: 0; }
.compact-list strong, .compact-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-list strong { font-size: .74rem; font-weight: 660; }.compact-list small { margin-top: 4px; color: var(--muted); font-size: .64rem; }.compact-list a > span:last-child { color: var(--purple); font-size: .68rem; font-weight: 700; }
.resource-row { margin-top: 20px; }
.resource-row > div { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .72rem; }.resource-row span { color: var(--muted); }.resource-row strong { font-weight: 680; }
.resource-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 27px; padding-top: 20px; border-top: 1px solid var(--line); }
.resource-stats strong, .resource-stats small { display: block; }.resource-stats strong { font-size: 1.2rem; font-weight: 620; }.resource-stats small { margin-top: 5px; color: var(--muted); font-size: .6rem; line-height: 1.35; }
.quick-actions { display: grid; align-content: start; }
.quick-actions > a { display: block; padding: 14px 0; border-top: 1px solid var(--line); }
.quick-actions > a span, .quick-actions > a small { display: block; }.quick-actions > a span { font-size: .78rem; font-weight: 680; }.quick-actions > a small { margin-top: 4px; color: var(--muted); font-size: .66rem; }

/* Analytics */
.analytics-heading { align-items: center; }
.period-switch { display: flex; flex: 0 0 auto; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.period-switch a { min-height: 34px; padding: 0 13px; border-radius: 6px; color: var(--muted); font-size: .7rem; font-weight: 690; line-height: 34px; }
.period-switch a:hover { color: var(--purple); background: var(--purple-050); }
.period-switch a.active { color: #fff; background: var(--purple); }
.monitor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.monitor-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.monitor-icon { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; border-radius: 9px; font-size: .75rem; font-weight: 800; }.monitor-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.monitor-icon.prometheus { background: #e6522c; }.monitor-icon.grafana { background: linear-gradient(145deg, #f6a821, #e4572e); }
.monitor-card p, .monitor-card h2, .monitor-card small { margin: 0; }
.monitor-card p { color: var(--muted); font-size: .6rem; font-weight: 690; letter-spacing: .08em; text-transform: uppercase; }
.monitor-card h2 { margin-top: 3px; font-size: .9rem; }.monitor-card small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.source-status, .endpoint-status { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-size: .63rem; font-weight: 700; }
.source-status::before, .endpoint-status::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgb(180 59 69 / 8%); content: ""; }
.source-status.online, .endpoint-status.online { color: var(--green); }
.analytics-metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.analytics-metric-grid .metric-card.featured { color: #fff; border-color: var(--purple); background: linear-gradient(145deg, #624098, #4b2878); }
.analytics-metric-grid .featured p, .analytics-metric-grid .featured small { color: rgb(255 255 255 / 68%); }
.quality-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.quality-grid article { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); }.quality-grid article:last-child { border-right: 0; }
.quality-grid span, .quality-grid strong, .quality-grid small { display: block; }.quality-grid span { color: var(--muted); font-size: .65rem; }.quality-grid strong { margin-top: 7px; font-size: 1.1rem; font-weight: 660; }.quality-grid small { margin-top: 8px; color: var(--muted); font-size: .6rem; }
.quality-grid progress, .composition-row progress, .storage-analytics-card > progress, .domain-usage-list progress { width: 100%; height: 5px; margin-top: 10px; overflow: hidden; border: 0; border-radius: 99px; background: #eeeaf0; }
.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(290px, .66fr); gap: 16px; }
.analytics-wide { grid-column: 1; }.composition-card, .resource-analytics-card, .database-card, .domain-analytics-card { grid-column: 2; }
.legend .rejected { color: var(--amber); }.legend .auth-errors { color: var(--red); }.legend .blocked { color: var(--purple); }
.chart-rejected { stroke: var(--amber); }.chart-auth-errors { stroke: var(--red); }.chart-blocked { stroke: var(--purple); }.chart-cpu { stroke: var(--purple); }.chart-memory { stroke: var(--blue); }
.compact-chart { height: 165px; }
.resource-legend { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }.legend .cpu { color: var(--purple); }.legend .memory { color: var(--blue); }.resource-trend-chart { height: 92px; margin-top: 8px; }
.composition-row { margin-top: 23px; }.composition-row:first-of-type { margin-top: 0; }.composition-row > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: .72rem; }.composition-row span { color: var(--muted); }.composition-row small { display: block; margin-top: 6px; color: var(--muted); font-size: .61rem; }
.composition-row .danger-progress::-webkit-progress-value { background: var(--red); }.composition-row .danger-progress::-moz-progress-bar { background: var(--red); }
.composition-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 27px; padding-top: 20px; border-top: 1px solid var(--line); }.composition-summary strong, .composition-summary small { display: block; }.composition-summary strong { font-size: 1.25rem; }.composition-summary small { margin-top: 5px; color: var(--muted); font-size: .61rem; line-height: 1.4; }
.network-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--line); }.network-summary span, .network-summary strong { display: block; }.network-summary span { color: var(--muted); font-size: .61rem; }.network-summary strong { margin-top: 5px; font-size: .84rem; }
.endpoint-card, .storage-analytics-card { padding-bottom: 4px; overflow: hidden; }.endpoint-card .card-heading, .storage-analytics-card .card-heading { padding: 0 0; }.endpoint-card table, .storage-analytics-card table { margin-inline: -22px; width: calc(100% + 44px); }.endpoint-card th:first-child, .endpoint-card td:first-child, .storage-analytics-card th:first-child, .storage-analytics-card td:first-child { padding-left: 22px; }.endpoint-card th:last-child, .endpoint-card td:last-child, .storage-analytics-card th:last-child, .storage-analytics-card td:last-child { padding-right: 22px; }
.database-stats { display: grid; grid-template-columns: repeat(2, 1fr); }.database-stats > div { padding: 16px 0; border-top: 1px solid var(--line); }.database-stats > div:nth-child(odd) { padding-right: 12px; }.database-stats > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }.database-stats span, .database-stats strong { display: block; }.database-stats span { color: var(--muted); font-size: .61rem; line-height: 1.35; }.database-stats strong { margin-top: 7px; font-size: .93rem; }
.domain-usage-list { display: grid; gap: 18px; }.domain-usage-list > div > div { display: flex; justify-content: space-between; gap: 12px; }.domain-usage-list strong { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }.domain-usage-list span { color: var(--muted); font-size: .65rem; }.domain-usage-list small { display: block; margin-top: 5px; color: var(--muted); font-size: .59rem; }

/* Tables and lists */
.list-card { padding: 0; overflow: hidden; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.list-toolbar > span { color: var(--muted); font-size: .72rem; }
.search-form { display: flex; width: min(100%, 480px); }
.search-form input { min-height: 40px; border-radius: 8px 0 0 8px; }
.search-form button { padding: 0 16px; color: #fff; border: 0; border-radius: 0 8px 8px 0; background: var(--purple); font-size: .76rem; font-weight: 680; cursor: pointer; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 19px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #8c8590; background: #fbfafc; font-size: .64rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
td { color: #4b4550; font-size: .76rem; }
tbody tr:last-child td { border-bottom: 0; }
.management-table td:first-child { min-width: 270px; }
.identity-cell { display: flex; align-items: center; gap: 12px; }
.avatar, .domain-mark { display: grid; place-items: center; flex: 0 0 auto; color: var(--purple); background: var(--purple-050); font-weight: 740; }
.avatar { width: 34px; height: 34px; border-radius: 9px; font-size: .74rem; }
.identity-cell strong, .identity-cell small { display: block; }.identity-cell strong { color: var(--ink); font-size: .77rem; }.identity-cell small { max-width: 320px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.row-action { color: var(--purple); font-weight: 700; }
.empty-state { margin: 0; color: var(--muted); font-size: .75rem; }

/* Forms and detail */
.form-layout { display: grid; gap: 16px; max-width: 1040px; }.form-layout.narrow { max-width: 720px; }
.form-card { display: grid; gap: 19px; }
.form-card .card-heading { margin-bottom: 4px; }
.form-card label, .inline-create label { display: block; min-width: 0; }
.form-card label small, .inline-create label small { display: block; margin-top: 7px; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.form-grid { display: grid; gap: 16px; }.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }.form-grid.email-grid { grid-template-columns: minmax(0, 1fr) auto minmax(200px, .8fr); align-items: end; }.at-sign { display: grid; place-items: center; min-height: 48px; color: var(--muted); font-size: 1.05rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; }.form-actions.inner { margin-top: 3px; }
.detail-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.detail-summary article { min-width: 0; padding: 18px 20px; border-right: 1px solid var(--line); }.detail-summary article:last-child { border-right: 0; }.detail-summary span, .detail-summary strong, .detail-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.detail-summary span { color: var(--muted); font-size: .65rem; }.detail-summary strong { margin-top: 10px; font-size: 1rem; font-weight: 680; }.detail-summary small { margin-top: 4px; color: #938b97; font-size: .63rem; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; }.settings-grid .span-two { grid-column: span 1; }
.status-badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; color: var(--green); border-radius: 99px; background: var(--green-bg); font-size: .65rem; font-weight: 740; }.status-badge.inactive { color: var(--red); background: var(--red-bg); }
.alias-list { display: grid; }.alias-list > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }.alias-list strong, .alias-list small { display: block; }.alias-list strong { font-size: .77rem; }.alias-list small { margin-top: 4px; color: var(--muted); font-size: .65rem; }.text-danger { color: var(--red); border: 0; background: none; font-size: .7rem; font-weight: 690; cursor: pointer; }
.inline-create { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; align-items: end; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.danger-card { border-color: #edcfd2; background: #fffafa; }.danger-card p { margin: -3px 0 18px; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.access-card { border-color: #d9cde9; background: linear-gradient(145deg, #fff 20%, #f6f1fb 100%); }.access-card p { margin: -3px 0 18px; color: var(--muted); font-size: .75rem; line-height: 1.55; }.secure-mark { color: var(--purple); border: 1px solid #d9cde9; border-radius: 999px; padding: 5px 8px; background: #fff; font-size: .58rem; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.check-row { display: flex !important; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }.check-row input { width: 17px; min-height: 17px; margin: 2px 0 0; accent-color: var(--purple); }.check-row span { margin: 0 !important; }.check-row strong, .check-row small { display: block; }.check-row small { margin-top: 4px !important; }
.dns-card { overflow: hidden; }.dns-card > p { margin: -4px 0 16px; color: var(--muted); font-size: .75rem; }.dns-card pre { max-height: 360px; margin: 0; padding: 14px; overflow: auto; border: 1px solid #e4dfe7; border-radius: 8px; background: #f8f6fa; font: .66rem/1.55 "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }

/* Mailbox migrations */
.migration-tool-status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; color: var(--green); border: 1px solid #c8e8dc; border-radius: 99px; background: var(--green-bg); font-size: .68rem; font-weight: 720; }
.migration-tool-status > span, .migration-status > span { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.migration-tool-status.unavailable { color: var(--red); border-color: #f0c8cc; background: var(--red-bg); }
.migration-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.migration-summary-grid article { padding: 18px 20px; }
.migration-summary-grid span, .migration-summary-grid strong, .migration-summary-grid small { display: block; }
.migration-summary-grid span { color: var(--muted); font-size: .64rem; }
.migration-summary-grid strong { margin-top: 8px; font-size: .92rem; }
.migration-summary-grid small { margin-top: 6px; color: var(--muted); font-size: .65rem; line-height: 1.45; }
.migration-create-layout { max-width: none; margin-bottom: 16px; }
.migration-server-grid { grid-template-columns: minmax(0, 1fr) 150px 180px; }
.migration-history .list-toolbar > div strong, .migration-history .list-toolbar > div small, .table-subtitle { display: block; }
.migration-history .list-toolbar > div strong { font-size: .78rem; }
.migration-history .list-toolbar > div small { margin-top: 4px; color: var(--muted); font-size: .65rem; }
.table-subtitle { margin-top: 4px; color: var(--muted); font-size: .63rem; }
.migration-status { display: inline-flex; align-items: center; gap: 7px; min-height: 27px; padding: 0 10px; color: var(--muted); border-radius: 99px; background: #f1eef3; font-size: .64rem; font-weight: 740; white-space: nowrap; }
.migration-status.large { min-height: 34px; padding: 0 13px; font-size: .69rem; }
.migration-status.status-completed { color: var(--green); background: var(--green-bg); }
.migration-status.status-importing, .migration-status.status-exporting, .migration-status.status-queued { color: var(--purple); background: var(--purple-050); }
.migration-status.status-partial { color: #7d5718; background: var(--amber-bg); }
.migration-status.status-failed, .migration-status.status-cancelled { color: var(--red); background: var(--red-bg); }
.migration-detail-summary { margin-bottom: 16px; }
.migration-page-heading > div:first-child, .migration-detail-summary article { min-width: 0; }
.migration-page-heading h1, .migration-page-heading .breadcrumbs, .migration-page-heading > div:first-child > p:last-child, .migration-detail-summary strong { overflow-wrap: anywhere; word-break: break-word; }
.migration-detail-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); align-items: start; gap: 16px; }
.migration-side-column { display: grid; gap: 16px; }
.migration-progress-card { min-width: 0; }
.migration-progress-overview { margin: 0 0 16px; padding: 14px 16px; border: 1px solid #e5dcec; border-radius: 10px; background: #fbf9fd; }
.migration-progress-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.migration-progress-heading span { min-width: 0; color: var(--ink); font-size: .73rem; font-weight: 720; overflow-wrap: anywhere; }
.migration-progress-heading strong { flex: 0 0 auto; color: var(--purple); font-size: 1rem; }
.migration-progress-track { height: 9px; margin-top: 11px; overflow: hidden; border-radius: 99px; background: #e9e2f0; }
.migration-progress-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7651a5, var(--purple)); transition: width .25s ease; }
.migration-progress-overview > p { margin: 9px 0 0; color: var(--muted); font-size: .66rem; line-height: 1.45; }
.migration-output { max-height: 620px; min-height: 260px; margin: 0; padding: 16px; overflow: auto; color: #e9e1ef; border: 1px solid #3f2a4d; border-radius: 9px; background: #21162b; font: .69rem/1.55 "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.migration-live { display: inline-flex; align-items: center; gap: 6px; color: var(--purple); font-size: .65rem; font-weight: 760; text-transform: uppercase; letter-spacing: .06em; }
.migration-live::before { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 5px rgb(88 54 137 / 10%); content: ""; }
.migration-cancel-form { display: flex; justify-content: flex-end; margin-top: 16px; }
.migration-help, .migration-safety-card > p:last-child { margin: -2px 0 17px; color: var(--muted); font-size: .73rem; line-height: 1.55; }
.migration-retry-form { display: grid; gap: 16px; }
.migration-retry-form label span, .migration-retry-form label small { display: block; }
.migration-retry-form label small { margin-top: 7px; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.migration-safety-card h2 { margin: 8px 0 12px; font-size: 1rem; }

/* Domains */
.domain-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.domain-card { display: block; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }.domain-card:hover { border-color: #cfc2de; transform: translateY(-2px); box-shadow: 0 18px 44px rgb(39 27 52 / 10%); }
.domain-card-head { display: flex; align-items: center; justify-content: space-between; }.domain-mark { width: 39px; height: 39px; border-radius: 10px; }
.domain-card h2 { margin: 22px 0 7px; font-size: 1.05rem; }.domain-card > p { min-height: 38px; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.5; }.domain-card > div:last-child { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }.domain-card > div:last-child strong, .domain-card > div:last-child small { display: block; }.domain-card > div:last-child strong { font-size: .9rem; }.domain-card > div:last-child small { margin-top: 4px; color: var(--muted); font-size: .62rem; }
.empty-card { display: grid; place-items: start; min-height: 190px; }.empty-card.inline { min-height: 140px; place-items: center; text-align: center; }.empty-card p { color: var(--muted); }.empty-card small { color: #97909a; }

/* Logs and audit */
.filter-bar { display: grid; grid-template-columns: minmax(240px, 1fr) 160px auto auto; align-items: end; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.log-list { display: grid; }
.log-entry { border-bottom: 1px solid var(--line); }.log-entry:last-child { border-bottom: 0; }.log-entry summary { display: grid; grid-template-columns: 58px 165px minmax(160px, .55fr) minmax(240px, 1fr); align-items: center; gap: 13px; min-height: 54px; padding: 8px 19px; list-style: none; cursor: pointer; }.log-entry summary::-webkit-details-marker { display: none; }.log-entry summary:hover { background: #fbfafc; }.log-level { display: inline-flex; align-items: center; justify-content: center; min-height: 23px; border-radius: 5px; color: var(--muted); background: #f1eef3; font-size: .58rem; font-weight: 780; }.level-error .log-level { color: var(--red); background: var(--red-bg); }.level-warn .log-level { color: var(--amber); background: var(--amber-bg); }.level-info .log-level { color: var(--blue); background: #edf5ff; }.log-entry time { color: var(--muted); font-size: .66rem; }.log-entry strong { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }.log-preview { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }.log-entry pre, .audit-table pre { margin: 0 19px 15px; padding: 14px; overflow: auto; border-radius: 7px; color: #e8e0ee; background: #21172a; font: .68rem/1.6 "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.audit-table td:first-child { min-width: 190px; }.audit-table td:nth-child(2) { min-width: 190px; }.audit-action { color: var(--purple); font-weight: 680; }.audit-action.failed { color: var(--red); }.audit-table details summary { color: var(--purple); cursor: pointer; font-weight: 680; }.audit-table pre { min-width: 320px; margin: 10px 0 0; }

@media (min-width: 1260px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); }
  .dashboard-grid .chart-card, .dashboard-grid > .panel-card:nth-last-child(2) { grid-column: 1; }
  .dashboard-grid .storage-card, .dashboard-grid .system-card, .dashboard-grid .quick-actions { grid-column: 2; }
  .dashboard-grid .storage-card { grid-row: 1 / span 1; }
}

@media (max-width: 1180px) {
  .metric-grid, .analytics-metric-grid { grid-template-columns: repeat(3, 1fr); }
  .stalwart-object-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .domain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-create { grid-template-columns: repeat(2, minmax(0, 1fr)); }.inline-create .button { align-self: end; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; min-height: 70px; padding: 0 22px; border-bottom: 1px solid var(--line); background: #fff; }.mobile-header img { width: 122px; height: auto; }.mobile-header span { color: var(--muted); font-size: .62rem; font-weight: 740; letter-spacing: .13em; text-transform: uppercase; }
  .mobile-nav { display: flex; gap: 4px; padding: 8px 14px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fff; }.mobile-nav a { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border-radius: 7px; color: var(--muted); font-size: .7rem; font-weight: 650; line-height: 34px; }.mobile-nav a.active { color: var(--purple); background: var(--purple-050); }
  .content-shell { min-height: auto; padding: 28px 22px 48px; }
  .dashboard-grid, .settings-grid, .analytics-grid { grid-template-columns: 1fr; }.settings-grid .span-two, .analytics-wide, .composition-card, .resource-analytics-card, .database-card, .domain-analytics-card { grid-column: auto; }
  .service-strip { grid-template-columns: repeat(2, 1fr); }.service-strip > div:nth-child(2) { border-right: 0; }.service-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .detail-summary { grid-template-columns: repeat(2, 1fr); }.detail-summary article:nth-child(2) { border-right: 0; }.detail-summary article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .login-page { overflow: auto; }
  .login-layout { grid-template-columns: 1fr; min-height: 100svh; }
  .login-brand { display: none; }
  .login-access { min-height: 100svh; padding: 34px 24px; }
  .login-mobile-brand { display: flex; }
  .login-form-wrap { width: min(100%, 410px); }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }.page-heading h1 { font-size: 2.25rem; }.heading-actions { width: 100%; }.heading-actions .button { flex: 1; }
  .period-switch { width: 100%; }.period-switch a { flex: 1; text-align: center; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .quality-grid { grid-template-columns: repeat(2, 1fr); }.quality-grid article:nth-child(2) { border-right: 0; }.quality-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .form-grid.two-columns, .form-grid.email-grid, .form-grid.migration-server-grid, .inline-create { grid-template-columns: 1fr; }.at-sign { display: none; }
  .migration-summary-grid, .migration-detail-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }.filter-bar label:first-child { grid-column: span 2; }
  .log-entry summary { grid-template-columns: 54px 1fr; gap: 7px 12px; padding: 11px 15px; }.log-entry time { text-align: right; }.log-entry strong, .log-preview { grid-column: span 2; }.log-entry pre { margin: 0 15px 14px; }
  .domain-grid { grid-template-columns: 1fr; }
  .stalwart-object-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.object-record-list > a { grid-template-columns: minmax(0, 1fr) 12px; }.object-record-list code { display: none; }
}

@media (max-width: 540px) {
  .content-shell { padding: 25px 14px 42px; }
  .mobile-header { min-height: 64px; padding: 0 16px; }.mobile-nav { padding-inline: 9px; }
  .metric-grid, .analytics-metric-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }.metric-card { padding: 15px; }.metric-card > strong { font-size: 1.75rem; }
  .monitor-grid { grid-template-columns: 1fr; }.monitor-card { grid-template-columns: auto minmax(0, 1fr); }.monitor-card .source-status { grid-column: 2; }
  .service-strip { grid-template-columns: 1fr 1fr; }.service-strip > div { padding: 14px; }
  .panel-card { padding: 17px; }.list-card { padding: 0; }
  .endpoint-card table, .storage-analytics-card table { margin-inline: -17px; width: calc(100% + 34px); }.endpoint-card th:first-child, .endpoint-card td:first-child, .storage-analytics-card th:first-child, .storage-analytics-card td:first-child { padding-left: 17px; }.endpoint-card th:last-child, .endpoint-card td:last-child, .storage-analytics-card th:last-child, .storage-analytics-card td:last-child { padding-right: 17px; }
  .card-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .legend { gap: 10px; }.activity-chart { height: 170px; }
  .resource-stats { grid-template-columns: 1fr 1fr; }
  .detail-summary { grid-template-columns: 1fr 1fr; }.detail-summary article { padding: 15px; }
  .form-actions { flex-direction: column-reverse; }.form-actions .button { width: 100%; }
  .list-toolbar { align-items: stretch; flex-direction: column; padding: 15px; }.search-form { width: 100%; }
  th, td { padding: 12px 14px; }
  .filter-bar { grid-template-columns: 1fr; padding: 15px; }.filter-bar label:first-child { grid-column: auto; }.filter-bar .button { width: 100%; }
  .login-access { padding: 28px 20px; }.login-mobile-brand { margin-bottom: 44px; }.login-form-wrap h2 { font-size: 2.15rem; }
  .stalwart-section { padding: 16px; }.stalwart-object-grid, .quota-limit-fields { grid-template-columns: 1fr; }.quota-limit-fields { padding-left: 0; }
}

@media (max-height: 650px) and (min-width: 781px) {
  .login-brand, .login-layout { min-height: 650px; }.login-statement { padding: 45px 0; }.login-statement h1 { font-size: 3.6rem; }.login-access { min-height: 650px; padding-block: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
