@import url("/assets/tabler.css");

:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #69758a;
  --line: #e1e6ef;
  --canvas: #f4f6fa;
  --paper: #ffffff;
  --nav: #0b1424;
  --nav-soft: #18243a;
  --blue: #5268e9;
  --blue-dark: #3549c6;
  --blue-soft: #edf0ff;
  --cyan: #2bc4bd;
  --success: #168765;
  --success-soft: #e7f7f1;
  --warning: #b97618;
  --warning-soft: #fff3dc;
  --danger: #b84455;
  --shadow: 0 14px 40px rgba(24, 39, 75, .07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 278px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 10; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px 18px; color: #d6dcec; background: radial-gradient(circle at 20% -10%, rgba(82, 104, 233, .24), transparent 33%), linear-gradient(180deg, #0b1424 0%, #0e192a 100%); border-right: 1px solid rgba(255, 255, 255, .04); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand strong, .login-wordmark strong { display: block; color: #fff; font-size: 19px; letter-spacing: -.025em; }
.brand small, .login-wordmark small { display: block; margin-top: 2px; color: #7f8ca5; font-size: 9px; font-weight: 750; letter-spacing: .16em; }
.brand-mark { display: inline-grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #6479f6, #4256d4); box-shadow: 0 10px 26px rgba(63, 84, 220, .3); }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.brand-mark.large { width: 46px; height: 46px; border-radius: 14px; }
.brand-mark.large svg { width: 26px; height: 26px; }

.workspace-card { display: flex; align-items: center; gap: 10px; margin: 0 2px 22px; padding: 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 11px; background: rgba(255, 255, 255, .035); }
.workspace-card div { min-width: 0; }
.workspace-card small, .workspace-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-card small { margin-bottom: 4px; color: #697891; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.workspace-card strong { color: #dce3f2; font-size: 11px; font-weight: 650; }
.workspace-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 4px rgba(43, 196, 189, .1); }
.sidebar nav { display: grid; gap: 3px; }
.nav-section { margin: 17px 11px 7px; color: #586781; font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-section:first-child { margin-top: 0; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; color: #98a5bb; font-size: 13px; font-weight: 620; transition: color .16s ease, background .16s ease; }
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .045); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(82, 104, 233, .22), rgba(82, 104, 233, .08)); }
.nav-link.active::before { position: absolute; left: -18px; width: 3px; height: 23px; border-radius: 0 3px 3px 0; background: #6d80ff; content: ""; }
.nav-icon { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; color: #71809a; }
.nav-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; }
.nav-link.active .nav-icon { color: #8293ff; }
.engine-card { margin-top: auto; padding: 14px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .035); }
.engine-card > div { display: flex; align-items: center; gap: 8px; }
.engine-card strong { color: #e5e9f4; font-size: 12px; }
.engine-card p { margin: 8px 0 10px; color: #7f8ca2; font-size: 10px; line-height: 1.5; }
.engine-card > span { color: #9ca8ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.engine-pulse { width: 7px; height: 7px; border-radius: 50%; background: #efa94c; box-shadow: 0 0 0 4px rgba(239, 169, 76, .1); }

.workspace { min-width: 0; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(24px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 9px; min-width: 0; color: #9aa3b2; font-size: 12px; }
.breadcrumb b { color: #c5cbd4; font-weight: 400; }
.breadcrumb strong { overflow: hidden; color: #3b4559; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.environment { display: inline-flex; align-items: center; gap: 7px; padding-right: 16px; border-right: 1px solid var(--line); color: #667085; font-size: 10px; font-weight: 650; }
.environment i { width: 7px; height: 7px; border-radius: 50%; background: #21a77b; box-shadow: 0 0 0 4px rgba(33, 167, 123, .09); }
.user-chip { display: flex; min-width: 0; align-items: center; gap: 9px; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: #4052ca; background: #e9edff; font-size: 12px; font-weight: 800; }
.user-chip div { min-width: 0; }
.user-chip strong, .user-chip small { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: #30394b; font-size: 11px; }
.user-chip small { margin-top: 2px; color: #929bab; font-size: 9px; }
.logout { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #7c8798; background: #fff; font-size: 16px; }
.logout:hover { color: var(--blue); border-color: #cbd2fa; background: var(--blue-soft); }

.main-content { min-width: 0; max-width: 1600px; margin: 0 auto; padding: 34px clamp(24px, 4vw, 52px) 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin: 0 0 25px; }
.page-head.compact { max-width: 760px; }
.page-head h1 { margin: 5px 0 8px; color: #162037; font-size: clamp(28px, 3.2vw, 39px); line-height: 1.08; letter-spacing: -.04em; }
.page-head p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0; color: var(--blue); font-size: 9px; font-weight: 850; letter-spacing: .17em; text-transform: uppercase; }
.head-actions { display: flex; align-items: center; gap: 12px; }
.status { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 8px 11px; border-radius: 8px; font-size: 10px; font-weight: 750; }
.status span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-ok { color: var(--success); background: var(--success-soft); }
.status-active { color: var(--success); background: var(--success-soft); }
.status-dev { color: #a46510; background: var(--warning-soft); }
.compact-button { min-height: 36px !important; padding: 8px 13px !important; font-size: 11px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric { position: relative; padding: 19px 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); box-shadow: 0 6px 20px rgba(34, 50, 84, .035); }
.metric::after { position: absolute; top: 0; right: 0; width: 55px; height: 55px; border-radius: 0 0 0 100%; background: linear-gradient(135deg, transparent, rgba(82, 104, 233, .055)); content: ""; }
.metric > span { display: block; color: #7a8598; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .11em; }
.metric strong { display: block; margin: 10px 0 4px; color: #1d2840; font-size: 27px; letter-spacing: -.04em; }
.metric small { color: #8b95a6; font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .85fr); gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid #e9edf3; }
.panel-head h2 { margin: 0 0 3px; color: #273149; font-size: 15px; letter-spacing: -.02em; }
.panel-head p { margin: 0; color: #8993a4; font-size: 10px; }
.panel-head .panel-kicker { margin-bottom: 5px; color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .14em; }
.text-link { color: var(--blue); font-size: 10px; font-weight: 750; }
.pill { display: inline-block; padding: 5px 8px; border-radius: 6px; color: #5b6678; background: #eef1f5; font-size: 9px; font-weight: 750; }
.pill-ok { color: var(--success); background: var(--success-soft); }
.pill-warn, .pill-dev { color: var(--warning); background: var(--warning-soft); }
.pill-muted { color: #697486; background: #eef1f5; }

.flow-map { display: grid; grid-template-columns: 1fr minmax(30px, .3fr) 1fr minmax(30px, .3fr) 1fr; align-items: center; padding: 29px 24px 25px; }
.flow-node { display: flex; align-items: center; gap: 9px; min-width: 0; }
.flow-node > div { min-width: 0; }
.flow-node strong, .flow-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-node strong { color: #364157; font-size: 11px; }
.flow-node small { margin-top: 3px; color: #98a1b1; font-size: 9px; }
.flow-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid #e1e6ef; border-radius: 10px; color: #667289; background: #f7f8fb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 800; }
.primary-node .flow-icon { color: #fff; border-color: var(--blue); background: linear-gradient(145deg, #6679f4, #4559d7); box-shadow: 0 8px 19px rgba(73, 93, 218, .22); }
.flow-link { height: 1px; margin: 0 9px; background: repeating-linear-gradient(90deg, #ccd3df 0, #ccd3df 4px, transparent 4px, transparent 8px); }
.flow-link span { display: block; width: 6px; height: 6px; margin: -2.5px 0 0 auto; border-top: 1px solid #aeb7c7; border-right: 1px solid #aeb7c7; transform: rotate(45deg); }
.flow-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 20px 20px; border: 1px solid #e7eaf0; border-radius: 10px; background: #f8f9fc; }
.flow-stats div { padding: 11px 13px; border-right: 1px solid #e7eaf0; }
.flow-stats div:last-child { border: 0; }
.flow-stats span, .flow-stats strong { display: block; }
.flow-stats span { color: #9099a9; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.flow-stats strong { margin-top: 4px; color: #5f6a7d; font-size: 10px; }
.health-list { padding: 4px 20px 8px; }
.health-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.health-row:last-child { border: 0; }
.service-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: #5d6bd1; background: #f0f2ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 850; }
.health-row strong, .health-row small { display: block; }
.health-row strong { color: #354057; font-size: 10px; }
.health-row small { margin-top: 3px; color: #99a2b1; font-size: 8px; }
.health-state { display: inline-flex; align-items: center; gap: 5px; font-size: 8px; font-weight: 800; }
.health-state::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.health-state.online { color: var(--success); }
.health-state.building { color: var(--warning); }
.health-state.planned { color: #8a94a7; }

.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; gap: 18px; }
.form-panel { padding-bottom: 21px; }
.form-panel .panel-head { margin-bottom: 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th { padding: 11px 15px; color: #8791a3; background: #f8f9fb; text-align: left; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
td { padding: 13px 15px; border-top: 1px solid #edf0f4; vertical-align: middle; }
tbody tr:hover { background: #fafbfc; }
td strong { font-size: 11px; }
.sub { display: block; margin-top: 4px; color: #929bab; font-size: 9px; }
.empty { padding: 34px; color: var(--muted); text-align: center; }
.details { max-width: 390px; color: #667185; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; word-break: break-word; }
code { padding: 2px 5px; border-radius: 5px; color: #4556c7; background: #eef0ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.usage { width: 110px; height: 5px; margin-right: 8px; border: 0; border-radius: 10px; overflow: hidden; background: #e9edf3; vertical-align: middle; }
.usage::-webkit-progress-bar { background: #e9edf3; }
.usage::-webkit-progress-value { background: var(--blue); }
.usage::-moz-progress-bar { background: var(--blue); }

.stack-form { display: grid; gap: 14px; padding: 0 20px; }
.stack-form label { display: grid; gap: 7px; color: #465168; font-size: 10px; font-weight: 750; }
.stack-form input, .stack-form select, .stack-form textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #d2d8e3; border-radius: 8px; outline: none; color: #202a3e; background: #fff; font-size: 12px; font-weight: 520; transition: .15s ease; }
.stack-form input::placeholder { color: #b2b9c5; }
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: #7b8cf0; box-shadow: 0 0 0 3px rgba(82, 104, 233, .11); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack-form .check { display: flex; align-items: center; grid-template-columns: auto 1fr; gap: 9px; }
.stack-form .check input { width: 17px; min-height: 17px; accent-color: var(--blue); }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 12px; padding: 10px 16px; border: 0; border-radius: 8px; font-size: 11px; font-weight: 780; transition: transform .15s ease, filter .15s ease; }
.button.primary { color: #fff; background: linear-gradient(135deg, #6175ef, #4053ce); box-shadow: 0 9px 20px rgba(64, 83, 206, .19); }
.button.primary:hover { filter: brightness(.97); transform: translateY(-1px); }
.button.secondary { color: #4053c6; border: 1px solid #ccd4f5; background: #f0f3ff; }
.button.danger { color: #a43b4c; border: 1px solid #efcbd2; background: #fff2f4; }
.button.wide { width: 100%; }
.button.wide span { margin-left: auto; font-size: 17px; font-weight: 400; }
.notice { padding: 11px 12px; border-left: 3px solid #d19a42; border-radius: 7px; color: #75531f; background: #fff8e9; font-size: 10px; line-height: 1.5; }

.login-body { display: grid; min-height: 100vh; place-items: center; padding: 30px; background: radial-gradient(circle at 8% 10%, rgba(82, 104, 233, .11), transparent 30%), radial-gradient(circle at 92% 85%, rgba(43, 196, 189, .09), transparent 28%), #eef1f7; }
.login-shell { width: min(100%, 1060px); min-height: 650px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border: 1px solid rgba(255, 255, 255, .82); border-radius: 22px; background: #fff; box-shadow: 0 34px 90px rgba(19, 31, 58, .17); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(38px, 6vw, 70px); color: #fff; background: radial-gradient(circle at 12% 8%, rgba(102, 123, 244, .3), transparent 35%), radial-gradient(circle at 90% 90%, rgba(43, 196, 189, .15), transparent 38%), linear-gradient(145deg, #0a1425, #101d33); }
.login-brand::after { position: absolute; top: -90px; right: -100px; width: 300px; height: 300px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255, 255, 255, .018), 0 0 0 90px rgba(255, 255, 255, .012); content: ""; }
.login-wordmark { display: flex; align-items: center; gap: 12px; margin-bottom: 52px; }
.login-brand .eyebrow { color: #8194ff; }
.login-brand h1 { max-width: 510px; margin: 13px 0 16px; font-size: clamp(34px, 4.7vw, 49px); line-height: 1.04; letter-spacing: -.05em; }
.login-brand > p:not(.eyebrow) { max-width: 510px; margin: 0; color: #9ba9bf; font-size: 12px; line-height: 1.7; }
.login-flow { display: grid; grid-template-columns: 1fr 26px 1fr 26px 1fr; align-items: center; margin-top: 40px; padding: 14px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 12px; background: rgba(255, 255, 255, .035); }
.login-flow div { min-width: 0; }
.login-flow span, .login-flow strong, .login-flow small { display: block; }
.login-flow span { margin-bottom: 7px; color: #7487f6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 800; }
.login-flow strong { color: #e5e9f4; font-size: 10px; }
.login-flow small { margin-top: 3px; color: #748199; font-size: 8px; }
.login-flow i { height: 1px; margin: 0 5px; background: repeating-linear-gradient(90deg, #4f5f78 0, #4f5f78 3px, transparent 3px, transparent 6px); }
.mail-preview { margin-top: 38px; padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .075); border-radius: 13px; background: rgba(255, 255, 255, .04); box-shadow: 0 18px 45px rgba(0, 0, 0, .12); }
.preview-head { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px; padding: 8px 2px 11px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.preview-head span { width: 7px; height: 7px; border-radius: 50%; background: #6579f3; box-shadow: 0 0 0 4px rgba(101, 121, 243, .1); }
.preview-head strong { color: #dfe5ef; font-size: 9px; }
.preview-head small { color: #65738a; font-size: 7px; }
.preview-row { display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 9px; padding: 11px 2px; border-bottom: 1px solid rgba(255, 255, 255, .055); }
.preview-row:last-child { border: 0; }
.preview-row i { width: 27px; height: 27px; border-radius: 8px; background: linear-gradient(145deg, rgba(98, 119, 239, .35), rgba(69, 87, 207, .12)); }
.preview-row strong, .preview-row small { display: block; }
.preview-row strong { color: #d2d9e7; font-size: 8px; }
.preview-row small { margin-top: 4px; color: #6e7b91; font-size: 7px; }
.preview-row.muted-row { opacity: .62; }
.security-note { display: flex; align-items: center; gap: 11px; margin-top: 30px; }
.shield { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: #57d9c2; background: rgba(43, 196, 189, .1); }
.shield svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.security-note strong, .security-note small { display: block; }
.security-note strong { color: #d9dfeb; font-size: 10px; }
.security-note small { margin-top: 4px; color: #748199; font-size: 9px; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 5vw, 63px); }
.login-card h2 { margin: 10px 0 8px; color: #1c263b; font-size: 30px; letter-spacing: -.04em; }
.login-card > div > p:not(.eyebrow) { margin: 0 0 30px; color: var(--muted); font-size: 11px; }
.login-card .stack-form { padding: 0; }
.mobile-wordmark { display: none; }
.alert { margin: 0 0 18px; padding: 11px 12px; border: 1px solid #f0c7cf; border-radius: 8px; color: #8f3448; background: #fff3f5; font-size: 10px; }
.muted { color: var(--muted); }
.center { display: block; margin-top: 18px; text-align: center; }
.login-card .center { font-size: 9px; line-height: 1.5; }
.login-mode-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; padding: 11px; border: 1px solid #e8ebf3; border-radius: 9px; background: #f8f9fc; }
.login-mode-note > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: #5268e9; background: #edf0ff; }
.login-mode-note svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.login-mode-note p { margin: 0; color: #7b8597; font-size: 8px; line-height: 1.55; }
.error-card { width: min(100%, 520px); padding: 48px; border-radius: 20px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.error-card .brand-mark { margin: 0 auto 20px; }
.error-card h1 { margin: 9px 0; font-size: 30px; }
.error-card p:not(.eyebrow) { margin: 0 0 25px; color: var(--muted); line-height: 1.6; }

/* Mailbox users land in a mail-client workspace, separate from the admin console. */
.webmail-body { overflow: hidden; background: #f5f7fb; }
.webmail-app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.mail-sidebar { min-height: 100vh; display: flex; flex-direction: column; padding: 22px 15px 18px; border-right: 1px solid #e2e6ee; background: #fff; }
.mail-brand { padding: 0 8px 26px; }
.mail-brand strong { color: #202b40; }
.mail-brand small { color: #929bad; }
.compose-button { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; margin: 0 3px 22px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #667af1, #4357d1); box-shadow: 0 10px 23px rgba(67, 87, 209, .2); font-size: 11px; font-weight: 750; }
.compose-button:disabled { opacity: .68; }
.compose-button span { font-size: 19px; font-weight: 350; line-height: 1; }
.folder-nav { display: grid; gap: 3px; }
.folder-link { display: flex; min-height: 38px; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 8px; color: #778196; font-size: 11px; font-weight: 620; }
.folder-link.disabled { cursor: default; opacity: .72; }
.folder-link.active { color: #4255c8; background: #eef1ff; }
.folder-link b { display: grid; width: 18px; height: 18px; place-items: center; color: #929cad; font-size: 15px; font-weight: 500; }
.folder-link b svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.folder-link em { font-style: normal; }
.folder-link.active b { color: #586de5; }
.folder-link i { min-width: 19px; margin-left: auto; padding: 2px 5px; border-radius: 10px; color: #5c6ed7; background: #dfe4ff; font-size: 8px; font-style: normal; text-align: center; }
.mail-storage { margin-top: auto; padding: 14px 11px 5px; border-top: 1px solid #edf0f4; }
.mail-storage div { display: flex; justify-content: space-between; gap: 8px; color: #727d90; font-size: 8px; }
.mail-storage strong { color: #505b70; font-size: 8px; }
.mail-storage progress { width: 100%; height: 5px; margin: 9px 0 6px; border: 0; border-radius: 9px; overflow: hidden; background: #e9edf4; }
.mail-storage progress::-webkit-progress-bar { background: #e9edf4; }
.mail-storage progress::-webkit-progress-value { background: #5c70e8; }
.mail-storage progress::-moz-progress-bar { background: #5c70e8; }
.mail-storage small { color: #a0a8b7; font-size: 7px; }
.mail-stage { min-width: 0; }
.mail-topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 0 clamp(22px, 3vw, 42px); border-bottom: 1px solid #e3e7ef; background: rgba(255, 255, 255, .91); backdrop-filter: blur(12px); }
.mail-search { width: min(100%, 500px); min-width: 180px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #e0e5ed; border-radius: 9px; color: #98a1b1; background: #f7f8fb; }
.mail-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.mail-search input { width: 100%; height: 38px; border: 0; outline: 0; color: #69758a; background: transparent; font-size: 10px; }
.mail-account { display: flex; min-width: 0; align-items: center; gap: 9px; }
.mail-account > div { min-width: 0; }
.mail-account strong, .mail-account small { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-account strong { color: #344056; font-size: 10px; }
.mail-account small { margin-top: 3px; color: #98a1b1; font-size: 8px; }
.inbox { padding: 31px clamp(22px, 3vw, 42px) 50px; }
.inbox-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.inbox-head h1 { margin: 5px 0 5px; color: #1e293f; font-size: 30px; letter-spacing: -.04em; }
.inbox-head p:not(.eyebrow) { margin: 0; color: #8b95a6; font-size: 10px; }
.mail-engine-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #f0d8b3; border-radius: 8px; color: #a76a16; background: #fff8e9; font-size: 9px; font-weight: 720; }
.mail-engine-badge i { width: 6px; height: 6px; border-radius: 50%; background: #d38d29; box-shadow: 0 0 0 3px rgba(211, 141, 41, .1); }
.mail-engine-badge.active { border-color: #cce9da; color: #25865a; background: #f0fbf5; }
.mail-engine-badge.active i { background: #31a36e; box-shadow: 0 0 0 3px rgba(49, 163, 110, .12); }
.message-panel { min-height: calc(100vh - 186px); border: 1px solid #e1e6ee; border-radius: 13px; background: #fff; box-shadow: 0 12px 35px rgba(29, 42, 72, .05); overflow: hidden; }
.message-toolbar { height: 51px; display: flex; align-items: center; gap: 12px; padding: 0 17px; border-bottom: 1px solid #e9edf3; }
.select-box { width: 15px; height: 15px; border: 1px solid #cfd6e2; border-radius: 4px; }
.message-toolbar button { border: 0; color: #8c96a7; background: transparent; font-size: 9px; font-weight: 650; }
.toolbar-separator { width: 1px; height: 19px; background: #e4e8ef; }
.message-toolbar small { margin-left: auto; color: #a0a8b7; font-size: 8px; }
.mail-refresh { color: #657188; font-size: 9px; font-weight: 700; }
.message-list { display: grid; }
.message-row { min-width: 0; display: grid; grid-template-columns: 38px minmax(120px, .65fr) minmax(240px, 2fr) 22px 112px; align-items: center; gap: 13px; padding: 13px 17px; border-bottom: 1px solid #eef1f5; color: #536076; transition: background .15s ease; }
.message-row:hover { background: #f8f9fd; }
.message-row.unread { background: #f8f9ff; }
.message-row.unread:hover { background: #f2f4ff; }
.message-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #5165d8; background: #edf0ff; font-size: 11px; font-weight: 800; }
.message-avatar.large { width: 42px; height: 42px; border-radius: 12px; font-size: 13px; }
.message-sender { overflow: hidden; color: #465167; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.message-row.unread .message-sender, .message-row.unread .message-copy strong { color: #1f2a43; font-weight: 800; }
.message-copy { min-width: 0; }
.message-copy strong, .message-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-copy strong { color: #3c485e; font-size: 10px; font-weight: 650; }
.message-copy small { margin-top: 4px; color: #929cad; font-size: 8px; }
.message-attachment { color: #8c96a9; font-size: 15px; }
.message-meta { text-align: right; }
.message-meta time, .message-meta small { display: block; white-space: nowrap; }
.message-meta time { color: #5d687b; font-size: 8px; font-weight: 650; }
.message-meta small { margin-top: 4px; color: #9aa3b2; font-size: 7px; }
.message-view { max-width: 1120px; margin: 0 auto; }
.message-back { display: inline-flex; margin-bottom: 16px; color: #5266d8; font-size: 10px; font-weight: 750; }
.message-detail { overflow: hidden; border: 1px solid #e1e6ee; border-radius: 13px; background: #fff; box-shadow: 0 12px 35px rgba(29, 42, 72, .05); }
.message-detail > header { padding: 27px 30px 22px; border-bottom: 1px solid #e9edf3; }
.message-detail h1 { margin: 0 0 21px; color: #202b41; font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -.035em; overflow-wrap: anywhere; }
.message-addresses { display: flex; align-items: center; gap: 12px; }
.message-addresses > div { min-width: 0; }
.message-addresses strong, .message-addresses small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-addresses strong { color: #3b465b; font-size: 10px; }
.message-addresses small { margin-top: 4px; color: #8f99aa; font-size: 8px; }
.message-addresses time { margin-left: auto; color: #7e899c; font-size: 8px; white-space: nowrap; }
.message-body { min-height: 260px; padding: 32px 30px 42px; color: #303b50; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; line-height: 1.75; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-attachments { padding: 19px 30px 25px; border-top: 1px solid #e9edf3; }
.message-attachments h2 { margin: 0 0 12px; color: #4a566d; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.message-attachments > div { display: flex; flex-wrap: wrap; gap: 9px; }
.attachment-chip { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid #e0e5ed; border-radius: 9px; background: #f8f9fc; }
.attachment-chip > b { color: #5d70df; font-size: 16px; }
.attachment-chip strong, .attachment-chip small { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip strong { color: #4a566b; font-size: 8px; }
.attachment-chip small { margin-top: 3px; color: #929bab; font-size: 7px; }
.mail-empty { min-height: calc(100vh - 238px); display: flex; align-items: center; flex-direction: column; justify-content: center; padding: 45px 25px; text-align: center; }
.empty-mail-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 17px; color: #5368df; background: #eef1ff; box-shadow: 0 12px 30px rgba(76, 96, 217, .1); }
.empty-mail-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.mail-empty h2 { margin: 18px 0 7px; color: #2b364c; font-size: 18px; letter-spacing: -.025em; }
.mail-empty > p { max-width: 510px; margin: 0; color: #8c96a7; font-size: 10px; line-height: 1.65; }
.development-notice { display: flex; align-items: center; gap: 9px; margin-top: 22px; padding: 9px 12px; border: 1px solid #e5e9f1; border-radius: 9px; background: #f8f9fc; color: #7e889a; font-size: 8px; }
.development-notice strong { color: #4d596e; }
.development-notice i { width: 3px; height: 3px; border-radius: 50%; background: #a9b0bd; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .split-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 22px 12px; }
  .brand { justify-content: center; padding: 0 0 24px; }
  .brand > span:last-child, .workspace-card, .nav-section, .nav-link > span:last-child, .engine-card { display: none; }
  .sidebar nav { gap: 8px; }
  .nav-link { justify-content: center; padding: 11px; }
  .nav-link.active::before { left: -12px; }
  .topbar { padding: 0 20px; }
  .environment, .user-chip div { display: none; }
  .main-content { padding: 28px 20px 48px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; max-width: 520px; }
  .login-brand { display: none; }
  .mobile-wordmark { display: flex; align-items: center; gap: 10px; margin-bottom: 42px; }
  .mobile-wordmark strong { color: #24304a; font-size: 18px; }
  .webmail-app { grid-template-columns: 76px minmax(0, 1fr); }
  .mail-sidebar { padding: 18px 11px; }
  .mail-brand { justify-content: center; padding: 0 0 24px; }
  .mail-brand > span:last-child, .folder-link:not(.active), .folder-link em, .folder-link i, .mail-storage { display: none; }
  .compose-button { width: 44px; min-height: 42px; margin: 0 auto 22px; font-size: 0; }
  .compose-button span { font-size: 19px; }
  .folder-link { justify-content: center; padding: 10px; }
  .mail-account > div { display: none; }
  .message-row { grid-template-columns: 38px minmax(100px, .6fr) minmax(180px, 1.4fr) 22px 100px; }
}
@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; display: block; padding: 12px 15px; }
  .brand { justify-content: flex-start; padding: 0; }
  .brand > span:last-child { display: block; }
  .sidebar nav { grid-template-columns: repeat(5, 1fr); margin-top: 12px; }
  .nav-link { padding: 8px; }
  .nav-link.active::before { display: none; }
  .topbar { height: 58px; }
  .breadcrumb span, .breadcrumb b { display: none; }
  .main-content { padding: 24px 14px 42px; }
  .head-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .status, .compact-button { justify-content: center; }
  .metric-grid, .field-grid { grid-template-columns: 1fr; }
  .flow-map { grid-template-columns: 1fr; gap: 10px; }
  .flow-link { width: 1px; height: 15px; margin: 0 0 0 18px; background: repeating-linear-gradient(180deg, #ccd3df 0, #ccd3df 4px, transparent 4px, transparent 8px); }
  .flow-link span { display: none; }
  .flow-stats { grid-template-columns: 1fr; }
  .flow-stats div { border-right: 0; border-bottom: 1px solid #e7eaf0; }
  .health-state { font-size: 0; }
  .login-body { padding: 13px; }
  .login-card { padding: 36px 24px; }
  .webmail-body { overflow: auto; }
  .webmail-app { display: block; }
  .mail-sidebar { min-height: auto; display: block; padding: 11px 14px; border-right: 0; border-bottom: 1px solid #e2e6ee; }
  .mail-brand { justify-content: flex-start; padding: 0; }
  .mail-brand > span:last-child { display: block; }
  .compose-button, .folder-nav { display: none; }
  .mail-topbar { height: 58px; padding: 0 14px; }
  .mail-search { min-width: 0; }
  .mail-account .avatar { display: none; }
  .inbox { padding: 23px 14px 35px; }
  .inbox-head { align-items: flex-start; flex-direction: column; }
  .message-panel { min-height: 520px; }
  .mail-empty { min-height: 470px; }
  .development-notice { max-width: 320px; align-items: flex-start; flex-direction: column; }
  .development-notice i { display: none; }
  .message-row { grid-template-columns: 36px minmax(0, 1fr) 76px; gap: 10px; padding: 12px 13px; }
  .message-sender { grid-column: 2; }
  .message-copy { grid-column: 2 / 4; }
  .message-avatar { grid-row: 1 / 3; }
  .message-attachment { display: none; }
  .message-meta { grid-column: 3; grid-row: 1; }
  .message-meta small { display: none; }
  .message-detail > header, .message-body, .message-attachments { padding-right: 18px; padding-left: 18px; }
  .message-addresses { align-items: flex-start; flex-wrap: wrap; }
  .message-addresses time { width: 100%; margin: 2px 0 0 54px; }
}

/* Tabler-based admin refresh and SmarterMail-style photo login. */
.login-body {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px;
  background-color: #152033;
  background-position: center;
  background-size: cover;
}
.login-photo-0 { background-image: url("/assets/login-background/0"); }
.login-photo-1 { background-image: url("/assets/login-background/1"); }
.login-photo-2 { background-image: url("/assets/login-background/2"); }
.login-photo-3 { background-image: url("/assets/login-background/3"); }
.login-photo-4 { background-image: url("/assets/login-background/4"); }
.login-photo-5 { background-image: url("/assets/login-background/5"); }
.login-shade { position: fixed; inset: 0; background: linear-gradient(120deg, rgba(7, 15, 29, .52), rgba(9, 17, 31, .18)); }
.login-only-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 38px 38px 30px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 9px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 28px 80px rgba(5, 13, 27, .32);
  backdrop-filter: blur(14px);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-logo strong, .login-logo small { display: block; }
.login-logo strong { color: #1f2a3d; font-size: 21px; letter-spacing: -.025em; }
.login-logo small { margin-top: 2px; color: #8b95a7; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.login-title h1 { margin: 0 0 8px; color: #1f293b; font-size: 26px; letter-spacing: -.035em; }
.login-title p { margin: 0 0 27px; color: #788397; font-size: 12px; }
.login-only-card .stack-form { padding: 0; }
.login-form label { color: #424d61; font-size: 11px; }
.login-form .form-control { min-height: 48px; border-radius: 7px; font-size: 13px; }
.login-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; color: #6e798d !important; font-weight: 550 !important; }
.login-check .form-check-input { width: 16px; min-height: 16px; margin: 0; }
.login-check small { color: #a0a8b5; }
.login-submit { min-height: 47px; margin-top: 3px; border-radius: 7px; font-weight: 720; }
.login-submit span { margin-left: auto; font-size: 18px; }
.login-foot { display: grid; grid-template-columns: 25px auto 1fr; align-items: center; gap: 7px; margin-top: 25px; padding-top: 18px; border-top: 1px solid #e8ebf0; }
.login-foot > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 7px; color: #18866a; background: #e9f7f2; }
.login-foot svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.login-foot p { margin: 0; color: #556074; font-size: 9px; font-weight: 700; }
.login-foot small { overflow: hidden; color: #99a2b1; font-size: 8px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.login-only-card .alert { font-size: 11px; }

.app-shell { grid-template-columns: 272px minmax(0, 1fr); }
.sidebar {
  color: #526076;
  background: #fff;
  border-right: 1px solid #e3e7ee;
  box-shadow: 3px 0 18px rgba(32, 43, 68, .025);
}
.sidebar .brand strong { color: #1e293d; }
.sidebar .brand small { color: #98a1b1; }
.workspace-card { border-color: #e5e9f0; background: #f7f8fb; }
.workspace-card small { color: #9099a8; }
.workspace-card strong { color: #3b465b; }
.nav-section { color: #a0a8b6; }
.nav-link { color: #637087; }
.nav-link:hover { color: #2f3d57; background: #f4f6fa; }
.nav-link.active { color: #3653c8; background: #edf1ff; }
.nav-link.active::before { background: #4f6ee8; }
.nav-icon { color: #8994a7; }
.nav-link.active .nav-icon { color: #4f68d8; }
.engine-card { border-color: #e4e8ef; background: #f8f9fb; }
.engine-card strong { color: #39445a; }
.engine-card p { color: #8a94a5; }
.engine-card > span { color: #687add; }
.topbar { height: 64px; box-shadow: 0 1px 0 rgba(31, 43, 68, .02); }
.main-content { padding-top: 30px; }
.panel.card, .metric { border-color: #e1e6ed; border-radius: 9px; box-shadow: 0 8px 24px rgba(35, 48, 74, .045); }
.panel-head.card-header { min-height: auto; }
.card-title { margin: 0; }
.table { margin-bottom: 0; }
.table > :not(caption) > * > * { border-bottom-color: #edf0f4; }
.stack-form .btn { min-height: 42px; font-size: 11px; font-weight: 700; }
.notice.alert { margin: 0; border: 0; }

.domain-name-link { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.domain-name-link strong, .domain-name-link small { display: block; }
.domain-name-link strong { color: #29364d; font-size: 11px; }
.domain-name-link small { margin-top: 3px; color: #929cac; font-size: 9px; }
.domain-avatar, .domain-hero-icon { display: grid; place-items: center; color: #5067da; background: #edf1ff; }
.domain-avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px; }
.domain-avatar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.row-action { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: #77849a; background: #f3f5f8; font-size: 15px; }
.row-action:hover { color: #3d57cc; background: #e9edff; }
.back-link { display: inline-flex; margin-bottom: 18px; color: #69758a; font-size: 10px; font-weight: 700; }
.back-link:hover { color: #4059cc; }
.domain-detail-head { align-items: center; }
.domain-title-row { display: flex; align-items: center; gap: 15px; }
.domain-hero-icon { width: 54px; height: 54px; border-radius: 13px; }
.domain-hero-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.domain-title-row h1 { margin-top: 3px; }
.domain-metrics { margin-bottom: 0; }
.domain-tabs { display: flex; gap: 25px; margin: 22px 0 17px; border-bottom: 1px solid #dfe4ec; }
.domain-tabs span { position: relative; padding: 0 2px 11px; color: #858fa0; font-size: 10px; font-weight: 700; }
.domain-tabs span.active { color: #3d56c8; }
.domain-tabs span.coming-soon { color: #a2aaba; cursor: default; }
.domain-tabs span.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: #4e68dd; content: ""; }
.domain-detail-layout { grid-template-columns: minmax(0, 1fr) 370px; }
.mailbox-identity { display: flex; align-items: center; gap: 10px; }
.mailbox-identity > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: #4760d0; background: #eaf0ff; font-size: 10px; font-weight: 800; }
.mailbox-identity strong, .mailbox-identity small { display: block; }
.mailbox-identity strong { color: #303c51; font-size: 10px; }
.mailbox-identity small { margin-top: 3px; color: #99a2b1; font-size: 8px; }
.row-menu { border: 0; color: #8893a5; background: transparent; letter-spacing: 1px; }
.domain-empty strong, .domain-empty span { display: block; }
.domain-empty strong { color: #4a566b; }
.domain-empty span { margin-top: 5px; color: #949dac; font-size: 9px; }

@media (max-width: 1180px) {
  .domain-detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 22px 12px; }
  .sidebar .brand { justify-content: center; }
  .domain-tabs { gap: 16px; overflow-x: auto; }
  .domain-tabs span { flex: 0 0 auto; }
}
@media (max-width: 620px) {
  .login-body { padding: 14px; }
  .login-only-card { padding: 30px 24px 24px; }
  .login-foot { grid-template-columns: 25px 1fr; }
  .login-foot small { grid-column: 1 / -1; text-align: left; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 12px 15px; }
  .domain-detail-head { align-items: flex-start; }
  .domain-metrics { grid-template-columns: 1fr; }
}

/* Full-width management workspaces: no horizontal page or table scrolling. */
html, body { max-width: 100%; overflow-x: hidden; }
.workspace, .main-content, .data-panel { min-width: 0; }
.table-wrap { width: 100%; overflow: visible; }
.responsive-table { width: 100%; table-layout: auto; }
.responsive-table th, .responsive-table td { min-width: 0; overflow-wrap: anywhere; }
.responsive-table th { white-space: normal; }
.domain-name-link { min-width: 0; }
.data-panel { margin-top: 18px; }
.details { max-width: none; }

/* Creation forms stay out of the data table and open only when needed. */
.create-panel {
  margin: 0 0 18px;
  border-color: #dce3ed;
  background: #fff;
  box-shadow: 0 9px 28px rgba(31, 45, 72, .045);
}
.create-panel summary {
  display: flex;
  min-height: 70px;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(135deg, #fff, #f8faff);
}
.create-panel summary::-webkit-details-marker { display: none; }
.create-panel[open] summary { border-bottom: 1px solid #e7ebf1; }
.create-summary-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #6479f6, #4358d4);
  box-shadow: 0 9px 21px rgba(67, 88, 212, .2);
  font-size: 20px;
  font-weight: 400;
}
.create-summary-copy { min-width: 0; }
.create-summary-copy strong, .create-summary-copy small { display: block; }
.create-summary-copy strong { color: #273349; font-size: 13px; }
.create-summary-copy small { margin-top: 4px; color: #8792a4; font-size: 10px; line-height: 1.45; }
.create-summary-action {
  margin-left: auto;
  padding: 7px 10px;
  border: 1px solid #d8def1;
  border-radius: 7px;
  color: #4a5fc9;
  background: #f1f4ff;
  font-size: 9px;
  font-weight: 800;
}
.create-panel[open] .create-summary-action::before { content: "Formu kapat"; }
.create-panel[open] .create-summary-action { font-size: 0; }
.create-panel[open] .create-summary-action::before { font-size: 9px; }
.create-panel-body { padding: 20px; background: #fbfcfe; }
.create-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 15px; padding: 0; }
.create-form > input[type="hidden"] { display: none; }
.create-form .span-2 { grid-column: span 2; }
.create-form .form-submit { min-width: 170px; min-height: 42px; justify-self: end; align-self: end; }
.create-form .notice { min-height: 42px; display: flex; align-items: center; margin: 0; }
.tenant-create-form .check { min-height: 42px; }
.domain-create-form { grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr) minmax(260px, 1.25fr) auto; }
.mailbox-create-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.source-create-form { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(260px, 1.25fr) auto; }
.gateway-create-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.compact-gateway-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gateway-create-form textarea { min-height: 112px; resize: vertical; }
.gateway-advanced { overflow: hidden; border: 1px solid #e1e6ef; border-radius: 11px; background: #f8f9fc; }
.gateway-advanced > summary { padding: 12px 14px; color: #46536a; font-size: 9px; font-weight: 750; cursor: pointer; }
.gateway-advanced > div { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0 14px 12px; color: #788397; font-size: 8px; }
.gateway-advanced > div strong { color: #344158; }
.gateway-advanced > label { display: block; padding: 0 14px 14px; }

/* System configuration lives behind one sidebar entry and a clear local tab bar. */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 24px;
  padding: 6px;
  border: 1px solid #e0e5ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(28, 42, 72, .04);
}
.settings-tabs a { padding: 9px 13px; border-radius: 8px; color: #707c90; font-size: 9px; font-weight: 750; }
.settings-tabs a:hover { color: #4257c9; background: #f4f6ff; }
.settings-tabs a.active { color: #fff; background: linear-gradient(135deg, #6276ed, #4458d1); box-shadow: 0 7px 17px rgba(68, 88, 209, .18); }
.settings-head { margin-bottom: 22px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.settings-card { min-width: 0; display: flex; flex-direction: column; padding: 22px; border: 1px solid #dfe5ee; border-radius: 14px; color: inherit; background: #fff; box-shadow: 0 11px 32px rgba(29, 42, 72, .05); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.settings-card:hover { transform: translateY(-2px); border-color: #cfd7f0; box-shadow: 0 16px 38px rgba(29, 42, 72, .09); }
.settings-card-icon { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 20px; border-radius: 13px; }
.settings-card-icon.security { color: #16775a; background: #e8f7f1; }
.settings-card-icon.gateway { color: #4f63d7; background: #edf0ff; }
.settings-card-icon.dns { color: #0d7890; background: #e8f7fa; }
.settings-card-icon.account { color: #9b681b; background: #fff4df; }
.settings-card-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.settings-card-copy { flex: 1; }
.settings-card-copy > span { color: #758197; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.settings-card-copy h2 { margin: 8px 0 8px; color: #27344b; font-size: 15px; letter-spacing: -.02em; }
.settings-card-copy p { margin: 0; color: #7e899a; font-size: 10px; line-height: 1.6; }
.settings-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 15px; border-top: 1px solid #edf0f5; color: #8390a3; font-size: 8px; }
.settings-card-foot strong { color: #344158; font-size: 10px; }
.settings-card-foot b { color: #4d62d2; font-size: 9px; white-space: nowrap; }
.settings-policy { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 19px 22px; }
.settings-policy > div:first-child { display: flex; min-width: 0; align-items: center; gap: 14px; }
.settings-policy-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #17795c; background: #e8f7f1; }
.settings-policy-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.settings-policy h2 { margin: 0 0 5px; color: #2d394f; font-size: 12px; }
.settings-policy p { max-width: 660px; margin: 0; color: #7f8a9b; font-size: 9px; line-height: 1.55; }
.settings-policy-states { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
.settings-policy-states span { display: inline-flex; align-items: center; gap: 6px; color: #667286; font-size: 8px; white-space: nowrap; }
.settings-policy-states i { width: 6px; height: 6px; border-radius: 50%; background: #34a370; box-shadow: 0 0 0 3px rgba(52, 163, 112, .1); }

/* PMG profiles use staged verification and cutover instead of one-step replacement. */
.gateway-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr) auto);
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 17px 20px;
}
.gateway-flow div { min-width: 0; }
.gateway-flow div:last-child { grid-column: auto; }
.gateway-flow strong, .gateway-flow small { display: block; }
.gateway-flow strong { color: #28354c; font-size: 11px; }
.gateway-flow small { margin-top: 4px; color: #8994a5; font-size: 9px; line-height: 1.45; }
.gateway-flow i { color: #a8b1c2; font-style: normal; }
.gateway-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.gateway-secret-update { flex: 0 0 100%; border-top: 1px solid #e5e9f1; padding-top: 7px; text-align: left; }
.gateway-secret-update > summary { color: #4454c5; font-size: 9px; font-weight: 750; cursor: pointer; list-style: none; text-align: right; }
.gateway-secret-update > summary::-webkit-details-marker { display: none; }
.gateway-secret-form { display: grid; grid-template-columns: minmax(170px, 1fr) auto; gap: 7px; margin-top: 8px; }
.gateway-secret-form small { grid-column: 1 / -1; color: #7c879a; font-size: 8px; line-height: 1.4; }
.gateway-action-form { display: grid; grid-template-columns: minmax(120px, 155px) auto; gap: 6px; }
.gateway-action-form input {
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid #dce1eb;
  border-radius: 6px;
  background: #fff;
  color: #243047;
  font: inherit;
}
.gateway-action-form input:focus { border-color: #5570e7; outline: 2px solid rgba(85, 112, 231, .13); }
.gateway-error { display: block; max-width: 440px; margin-top: 6px; color: #a23d4b; font-size: 9px; line-height: 1.45; }
.pill-danger { color: #a23d4b; background: #fcebed; }

/* Domain DNS policy and activation checks. */
.dns-policy-guide { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 18px 20px; }
.dns-policy-guide strong { display: block; color: #26334a; font-size: 12px; }
.dns-policy-guide p { max-width: 760px; margin: 5px 0 0; color: #7b8799; font-size: 10px; line-height: 1.55; }
.dns-policy-guide > div:last-child { display: grid; grid-template-columns: auto auto; align-items: center; gap: 6px 9px; flex: 0 0 auto; color: #7d889a; font-size: 8px; }
.dns-rule-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dns-policy-table code, .dns-rule-table code { display: inline-block; max-width: 390px; overflow-wrap: anywhere; white-space: normal; }
.dns-onboarding { margin-bottom: 18px; }
.dns-panel-actions { display: flex; flex: 0 0 auto; align-items: flex-end; flex-direction: column; gap: 8px; }
.dns-panel-actions small { color: #8994a5; font-size: 8px; }
.dns-panel-actions form { margin: 0; }
.dns-flow-note { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #e9edf3; color: #768296; background: #fafbfe; font-size: 9px; }
.dns-flow-note strong { color: #344158; }
.dns-flow-note span { flex: 1; }
.dns-flow-note i { color: #4f63d7; font-style: normal; font-weight: 750; }
.dns-last-error { margin: 14px 20px 0; }
.dns-observed { display: block; max-width: 330px; margin-top: 5px; overflow-wrap: anywhere; color: #8a95a7; font-size: 8px; }

/* SMTP ingress allowlist is visible only to the platform super administrator. */
.source-summary { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; margin-bottom: 18px; }
.source-security-card { display: flex; align-items: center; gap: 15px; padding: 18px 20px; }
.source-security-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 12px; color: #187c60; background: #e8f7f1; }
.source-security-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.source-security-card strong, .source-security-card p { display: block; }
.source-security-card strong { color: #26334a; font-size: 13px; }
.source-security-card p { margin: 5px 0 0; color: #7d8899; font-size: 10px; line-height: 1.55; }
.source-count-card { padding: 17px 20px; }
.source-count-card span, .source-count-card strong, .source-count-card small { display: block; }
.source-count-card span { color: #7c8799; font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.source-count-card strong { margin: 6px 0 2px; color: #253149; font-size: 27px; }
.source-count-card small { color: #929cab; font-size: 9px; }
.inline-form { margin: 0; }
.source-toggle { min-height: 32px; padding: 6px 10px; font-size: 9px; white-space: nowrap; }

/* Domain tabs wrap instead of becoming another horizontal scroller. */
.domain-tabs { flex-wrap: wrap; gap: 8px 22px; overflow: visible; }
.domain-tabs span { flex: 0 0 auto; }
.domain-tabs span.coming-soon { padding-right: 8px; padding-left: 8px; border-radius: 6px 6px 0 0; background: #f1f3f7; }

@media (max-width: 1180px) {
  .create-form, .domain-create-form, .mailbox-create-form, .source-create-form, .gateway-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-form .notice, .domain-create-form .notice { grid-column: span 2; }
  .create-form .form-submit { grid-column: span 2; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dns-rule-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .main-content { width: 100%; padding-right: 14px; padding-left: 14px; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: clamp(27px, 9vw, 34px); overflow-wrap: anywhere; }
  .panel-head { align-items: flex-start; padding: 16px; }
  .create-panel summary { min-height: 64px; padding: 12px 14px; }
  .create-summary-action { display: none; }
  .create-panel-body { padding: 16px 14px; }
  .create-form, .domain-create-form, .mailbox-create-form, .source-create-form { grid-template-columns: 1fr; }
  .create-form .span-2, .create-form .notice, .domain-create-form .notice, .create-form .form-submit { grid-column: auto; }
  .create-form .form-submit { width: 100%; min-width: 0; justify-self: stretch; }

  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tbody { padding: 7px 14px 11px; }
  .responsive-table tr { padding: 9px 0; border-bottom: 1px solid #e9edf3; }
  .responsive-table tr:last-child { border-bottom: 0; }
  .responsive-table tr:hover { background: transparent; }
  .responsive-table td {
    position: relative;
    min-height: 34px;
    padding: 8px 0 8px 112px;
    border: 0;
    line-height: 1.5;
  }
  .responsive-table td::before {
    position: absolute;
    top: 9px;
    left: 0;
    width: 98px;
    color: #8a95a7;
    content: attr(data-label);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .responsive-table td:first-child { padding-top: 11px; padding-bottom: 11px; }
  .responsive-table td:first-child::before { top: 12px; }
  .responsive-table td.row-action-cell { min-height: 36px; display: flex; justify-content: flex-end; padding: 3px 0 0; }
  .responsive-table td.row-action-cell::before, .responsive-table td.empty::before { display: none; }
  .responsive-table td.empty { padding: 28px 10px; }
  .responsive-table .usage { width: min(110px, 48%); }
  .responsive-table .details { font-size: 8px; word-break: break-word; }
  .domain-name-link { width: 100%; }
  .domain-tabs { margin-top: 18px; }
  .domain-tabs span { padding-bottom: 9px; }
  .source-summary { grid-template-columns: 1fr; }
  .source-count-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .source-count-card strong { grid-row: span 2; margin: 0; }
  .gateway-flow { grid-template-columns: 1fr; }
  .gateway-flow i { display: none; }
  .gateway-actions { justify-content: stretch; }
  .gateway-actions .inline-form, .gateway-actions .gateway-action-form, .gateway-actions .button { width: 100%; }
  .gateway-secret-form { grid-template-columns: 1fr; }
  .gateway-action-form { grid-template-columns: 1fr; }
  .settings-tabs { margin-bottom: 18px; }
  .settings-tabs a { flex: 1 1 160px; text-align: center; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-policy { align-items: flex-start; flex-direction: column; }
  .settings-policy-states { justify-content: flex-start; }
  .dns-policy-guide, .dns-flow-note { align-items: flex-start; flex-direction: column; }
  .dns-policy-guide > div:last-child { width: 100%; }
  .dns-panel-actions { width: 100%; align-items: stretch; }
  .dns-panel-actions .button { width: 100%; }
  .dns-rule-form { grid-template-columns: 1fr; }
}

.compose-button { text-decoration: none; }
.compose-view { max-width: 1050px; margin: 0 auto; }
.compose-form { background: #fff; border: 1px solid #e0e6ef; border-radius: 18px; padding: 24px; display: grid; gap: 18px; box-shadow: 0 14px 40px rgba(30, 48, 80, .07); }
.compose-form label { display: grid; gap: 8px; color: #3c4960; font-weight: 700; }
.compose-form input, .compose-form textarea { width: 100%; border: 1px solid #ccd6e5; border-radius: 11px; padding: 13px 15px; font: inherit; color: #172238; background: #fff; }
.compose-form textarea { resize: vertical; min-height: 260px; line-height: 1.55; }
.compose-form input:focus, .compose-form textarea:focus { outline: 3px solid rgba(76, 98, 238, .14); border-color: #5a6cec; }
.compose-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compose-actions { display: flex; justify-content: flex-end; gap: 12px; }
.compose-error { margin: 0 0 16px; padding: 14px 16px; border: 1px solid #f4bec5; border-radius: 12px; color: #a82f41; background: #fff2f4; }

@media (max-width: 720px) {
  .compose-grid { grid-template-columns: 1fr; }
  .compose-form { padding: 16px; border-radius: 14px; }
  .compose-actions { flex-direction: column-reverse; }
  .compose-actions .button { width: 100%; text-align: center; }
}

@media (max-width: 620px) {
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .nav-link { min-width: 0; }
  .topbar-actions { gap: 8px; }
  .main-content { padding-top: 22px; }
  .domain-title-row { align-items: flex-start; }
  .domain-title-row > div { min-width: 0; }
  .domain-hero-icon { width: 45px; height: 45px; flex: 0 0 auto; }
}

@media (max-width: 420px) {
  .main-content { padding-right: 10px; padding-left: 10px; }
  .metric-grid { grid-template-columns: 1fr; }
  .responsive-table tbody { padding-right: 12px; padding-left: 12px; }
  .responsive-table td { padding-left: 92px; }
  .responsive-table td::before { width: 80px; }
  .create-summary-icon { width: 34px; height: 34px; }
  .create-summary-copy small { font-size: 9px; }
  .domain-tabs span.coming-soon { display: none; }
}

/* Search and secure mailbox password utilities. */
.panel-tools { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.table-search {
  width: min(300px, 100%);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  color: #8b96a8;
  background: #f8f9fc;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.table-search:focus-within { border-color: #7b8cf0; background: #fff; box-shadow: 0 0 0 3px rgba(82, 104, 233, .1); }
.table-search svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.table-search input { width: 100%; min-width: 0; height: 36px; padding: 0; border: 0; outline: 0; color: #303c51; background: transparent; font-size: 10px; }
.table-search input::placeholder { color: #98a2b3; }
.responsive-table tr[hidden] { display: none !important; }
.search-empty { margin: 0; padding: 30px 18px; color: #7c8799; text-align: center; font-size: 10px; }
.search-empty[hidden] { display: none; }

.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 7px; }
.stack-form .password-field input { min-width: 0; }
.password-generate {
  min-width: 86px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #cfd7f4;
  border-radius: 8px;
  color: #4058c8;
  background: #eef2ff;
  font-size: 10px;
  font-weight: 800;
  transition: background .15s ease, border-color .15s ease;
}
.password-generate:hover { border-color: #aebaf0; background: #e5ebff; }
.has-generated-password .password-generate { color: #15785b; border-color: #c3e7db; background: #eaf8f3; }
.password-note { color: #8c96a7; font-size: 8px; font-weight: 550; line-height: 1.4; }

@media (max-width: 760px) {
  .data-panel .panel-head { flex-direction: column; }
  .panel-tools, .table-search { width: 100%; }
  .panel-tools { align-items: stretch; flex-direction: column-reverse; }
  .password-field { grid-template-columns: minmax(0, 1fr) 82px; }
  .password-generate { min-width: 0; padding-right: 8px; padding-left: 8px; }
}
