:root { color-scheme: light; --ink:#16213a; --muted:#697386; --line:#e5e9f2; --surface:#fff; --canvas:#f5f7fb; --navy:#101b35; --blue:#3a63ee; --blue-dark:#294bc2; --red:#b42318; --shadow:0 12px 32px rgba(25,35,60,.07); }
* { box-sizing:border-box; }
html { min-height:100%; }
body { margin:0; min-height:100vh; color:var(--ink); background:var(--canvas); font:15px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
a { color:var(--blue-dark); text-decoration:none; }
a:hover { text-decoration:underline; }
h1,h2,h3,p { margin-top:0; }
h1 { margin-bottom:.35rem; font-size:clamp(1.75rem,3vw,2.35rem); line-height:1.15; letter-spacing:-.035em; }
h2 { margin-bottom:.2rem; font-size:1.15rem; }
h3 { margin-bottom:.25rem; font-size:1rem; }
.muted,.panel-heading p { color:var(--muted); }
.eyebrow { margin-bottom:.45rem; color:var(--blue); font-size:.72rem; font-weight:800; letter-spacing:.11em; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.language-form { display:flex; width:fit-content; align-items:center; gap:.35rem; margin:0; }
.language-form select { width:auto; min-width:0; min-height:2.15rem; padding:.3rem 1.5rem .3rem .3rem; border:0; color:inherit; background:transparent; font-size:.82rem; cursor:pointer; }
.language-form select:focus { outline:2px solid #8da4ff; }
.language-globe { flex:none; font-size:.95rem; }
.guest-content > .language-form { margin:1rem auto 1.25rem; padding:.35rem .55rem; border:1px solid var(--line); border-radius:.55rem; background:#fff; color:var(--ink); }
.app-shell { display:grid; grid-template-columns:240px minmax(0,1fr); min-height:100vh; }
.sidebar { position:sticky; top:0; display:flex; height:100vh; min-height:0; flex-direction:column; padding:1.5rem 1rem; color:#dbe3f5; background:var(--navy); }
.brand,.login-brand { display:flex; align-items:center; gap:.65rem; color:inherit; font-size:1.2rem; font-weight:800; letter-spacing:-.02em; }
.brand:hover { text-decoration:none; }
.brand-mark { display:inline-grid; width:2rem; height:2rem; place-items:center; border-radius:.6rem; color:#fff; background:linear-gradient(145deg,#6686ff,#3858db); box-shadow:0 7px 18px rgba(71,105,234,.3); }
.sidebar nav { display:grid; min-height:0; gap:.3rem; margin-top:2.2rem; overflow-y:auto; }
.sidebar nav a { padding:.68rem .8rem; border-radius:.55rem; color:#c9d3ea; font-weight:600; }
.sidebar nav a:hover { color:#fff; background:rgba(255,255,255,.08); text-decoration:none; }
.sidebar nav a[aria-current="page"] { color:#fff; background:rgba(103,132,255,.25); box-shadow:inset 3px 0 #8da4ff; }
.nav-label { margin:.85rem .8rem .15rem; color:#8998b8; font-size:.67rem; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.sidebar-footer { display:grid; gap:.7rem; margin-top:auto; padding-top:1.5rem; border-top:1px solid rgba(255,255,255,.12); }
.signed-in { overflow:hidden; color:#9faccc; font-size:.78rem; text-overflow:ellipsis; }
.logout-form { margin:0; }
.content { width:min(1180px,100%); padding:2.4rem clamp(1.2rem,4vw,3.2rem) 4rem; }
.page-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1.7rem; }
.panel,.stat-card,.choice-card,.empty-state,.login-card { border:1px solid var(--line); border-radius:.85rem; background:var(--surface); box-shadow:var(--shadow); }
.panel { margin-bottom:1.25rem; padding:1.25rem; }
.table-panel { padding:0; overflow:hidden; }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.panel-heading p { margin-bottom:0; font-size:.88rem; }
.stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin-bottom:1.25rem; }
.stat-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.stat-card { display:grid; gap:.3rem; padding:1.2rem; }
.stat-card span { color:var(--muted); font-size:.84rem; font-weight:600; }
.stat-card strong { font-size:1.8rem; line-height:1; }
.stat-grid-four { grid-template-columns:repeat(4,minmax(0,1fr)); }
.alert-filters { display:flex; align-items:end; flex-wrap:wrap; gap:1rem; }
.alert-filters label { display:grid; gap:.3rem; min-width:10rem; font-weight:600; }
.alert-filters select { min-height:2.5rem; padding:.45rem; border:1px solid var(--line); border-radius:.45rem; background:#fff; }
.alert-severity { display:inline-block; padding:.15rem .5rem; border:1px solid currentColor; border-radius:999px; font-size:.78rem; font-weight:800; }
.alert-critical { color:#9b1c1c; background:#fff0ef; }
.alert-warning { color:#825300; background:#fff7df; }
.alert-info { color:#234e9b; background:#edf4ff; }
.alert-preview { display:grid; gap:.65rem; margin:0; padding-left:1.1rem; }
.welcome-panel { padding:1.7rem; }
.table-wrap { max-width:100%; overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th,td { padding:.85rem 1rem; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
th { color:var(--muted); background:#fafbfe; font-size:.72rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
tbody tr:last-child td { border-bottom:0; }
tbody tr:hover { background:#fafbff; }
.align-right { text-align:right; }
.destination-list { display:grid; gap:.15rem; overflow-wrap:anywhere; }
.status { display:inline-flex; align-items:center; padding:.17rem .48rem; border-radius:999px; color:#3f4c65; background:#edf0f5; font-size:.72rem; font-weight:750; text-transform:capitalize; }
.status-active { color:#096a4c; background:#e5f6ef; }
.status-suspended,.status-disabled,.status-inactive { color:#9d2b21; background:#fee9e7; }
.button { display:inline-flex; width:fit-content; min-height:2.3rem; align-items:center; justify-content:center; padding:.48rem .8rem; border:1px solid transparent; border-radius:.5rem; font:inherit; font-size:.85rem; font-weight:700; cursor:pointer; }
.button:hover { text-decoration:none; }
.button-primary { color:#fff; background:var(--blue); }
.button-primary:hover { background:var(--blue-dark); }
.button-secondary { color:var(--ink); border-color:var(--line); background:#fff; }
.button-danger { min-height:2rem; padding:.32rem .62rem; color:var(--red); border-color:#f2c5c1; background:#fff8f7; }
.danger-link { color:var(--red); font-weight:700; }
.button:disabled { cursor:not-allowed; opacity:.55; }
.button-quiet { padding:0; color:#c9d3ea; background:transparent; }
.inline-form { display:inline; margin:0; }
label { display:grid; gap:.35rem; color:#36425a; font-size:.84rem; font-weight:700; }
input,select { min-height:2.6rem; padding:.55rem .7rem; border:1px solid #cbd2df; border-radius:.5rem; color:var(--ink); background:#fff; font:inherit; }
.password-visibility-toggle { display:flex; align-items:center; gap:.5rem; margin:.7rem 0 1rem; cursor:pointer; }
.password-visibility-toggle input { width:1rem; min-height:1rem; margin:0; accent-color:var(--blue); }
input:focus,select:focus { border-color:var(--blue); outline:3px solid rgba(58,99,238,.13); }
.assignment-box { margin-top:1.2rem; padding:1rem; border:1px dashed #cbd4e5; border-radius:.65rem; background:#fafbfe; }
.assignment-form { display:flex; align-items:end; gap:.75rem; }
.assignment-form label { min-width:min(260px,100%); }
.notice { margin-bottom:1rem; padding:.75rem .9rem; border:1px solid #c9d7ff; border-radius:.55rem; color:#29458f; background:#edf2ff; }
.notice-error { color:#8d271f; border-color:#f0c2bd; background:#fff0ef; }
.notice-warning { color:#825300; border-color:#f0d58a; background:#fff7df; }
.dns-value { display:inline-block; max-width:34rem; white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.notice-success { color:#086344; border-color:#b7dfd0; background:#eaf8f2; }
.unavailable-copy { padding:1rem; color:var(--muted); background:#fafbfe; }
.empty-state { padding:3rem 1.3rem; text-align:center; }
.empty-state p { margin-bottom:0; color:var(--muted); }
.empty-state.compact { box-shadow:none; padding:1.5rem; border-style:dashed; }
.card-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:1rem; }
.choice-card { display:grid; gap:.8rem; padding:1.2rem; color:var(--ink); }
.choice-card:hover { border-color:#b8c5ee; text-decoration:none; transform:translateY(-1px); }
.choice-card .status { width:fit-content; }
.choice-card>span:last-child { color:var(--blue-dark); font-size:.85rem; font-weight:700; }
.guest-shell { display:grid; min-height:100vh; place-items:center; padding:1.2rem; background:radial-gradient(circle at top left,#eaf0ff,transparent 38%),var(--canvas); }
.guest-content { width:min(430px,100%); }
.login-card { padding:2rem; }
.login-brand { margin-bottom:2rem; }
.login-card form { display:grid; gap:1rem; margin-top:1.5rem; }
.login-card .button { width:100%; margin-top:.35rem; }
.customer-form-panel { width:min(850px,100%); padding:1.35rem; }
.profile-section { min-width:0; margin:0 0 1.2rem; padding:0 0 1.1rem; border:0; border-bottom:1px solid var(--line); }
.profile-section legend { width:100%; margin-bottom:.8rem; padding:0; font-size:1rem; font-weight:800; }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.85rem 1.1rem; }
.profile-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.profile-grid-service label:first-child { max-width:13rem; }
.profile-grid label { min-width:0; gap:.32rem; }
.profile-grid input,.profile-grid textarea { width:100%; min-height:2.35rem; padding:.46rem .62rem; }
.profile-grid textarea { resize:vertical; }
.profile-grid .field-wide { grid-column:1 / -1; }
.setting-checkbox { grid-template-columns:auto 1fr; align-items:center; gap:.35rem .55rem; }
.setting-checkbox input { grid-column:1; grid-row:1; width:1rem; min-height:1rem; margin:0; accent-color:var(--blue); }
.setting-checkbox>span { grid-column:2; }
.required-mark { margin-left:.35rem; color:var(--muted); font-size:.72rem; font-weight:500; }
.field-error { color:var(--red); font-size:.78rem; font-weight:600; }
.form-actions { display:flex; justify-content:flex-end; align-items:center; gap:.7rem; margin-top:.1rem; }
.form-actions .button { min-height:2.25rem; height:2.25rem; display:inline-flex; align-items:center; justify-content:center; }
.profile-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.2rem 2rem; }
.profile-summary-grid dl { display:grid; grid-template-columns:minmax(135px,.7fr) minmax(0,1.3fr); gap:.4rem .8rem; margin:.65rem 0 0; font-size:.88rem; }
.profile-summary-grid dt { color:var(--muted); }
.profile-summary-grid dd { margin:0; overflow-wrap:anywhere; }
.preserve-lines { white-space:pre-wrap; }
.customer-controls .panel-heading { align-items:center; margin-bottom:.5rem; }
.dashboard-metrics { grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); }
.section-title { margin:0 0 .8rem; }
.system-status { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1.35rem; padding:1.25rem 1.4rem; border:1px solid var(--line); border-left:5px solid #087a57; border-radius:.8rem; background:#fff; box-shadow:var(--shadow); }
.system-status h2 { margin:0; font-size:1.4rem; }.system-status p:last-child { margin:.25rem 0 0; color:var(--muted); }
.system-status.status-attention-required { border-left-color:#a66b00; }.system-status.status-degraded { border-left-color:#b42318; }
.summary-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(155px,1fr)); gap:.8rem; margin-bottom:1.3rem; }
.summary-card { display:grid; gap:.28rem; min-width:0; padding:1rem; border:1px solid var(--line); border-radius:.75rem; color:var(--ink); background:#fff; box-shadow:var(--shadow); }
.summary-card:hover { border-color:#b8c5ee; text-decoration:none; }.summary-card>span { color:var(--muted); font-size:.8rem; font-weight:700; }.summary-card strong { font-size:1.55rem; line-height:1.2; }.summary-card small { color:var(--muted); font-size:.75rem; }
.health-list { display:grid; }.health-row { display:grid; grid-template-columns:minmax(155px,1fr) auto minmax(100px,auto); align-items:center; gap:.75rem; padding:.8rem 0; border-top:1px solid var(--line); }.health-row:first-child { border-top:0; }.health-row p { margin:.1rem 0 0; color:var(--muted); font-size:.82rem; }
.status-badge { display:inline-flex; width:max-content; align-items:center; padding:.18rem .55rem; border:1px solid transparent; border-radius:999px; font-size:.76rem; font-weight:800; }
.badge-healthy { color:#096a4c; border-color:#b9e5d5; background:#e9f8f1; }.badge-warning { color:#825300; border-color:#f0dda7; background:#fff7df; }.badge-degraded { color:#9b1c1c; border-color:#f0c2bd; background:#fff0ef; }.badge-disabled { color:#536078; border-color:#dce1e9; background:#f2f4f7; }
.attention-list { display:grid; gap:.2rem; margin:0; padding:0; list-style:none; }.attention-list li { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:start; gap:.8rem; padding:.8rem 0; border-top:1px solid var(--line); }.attention-list li:first-child { border-top:0; }.attention-list p { margin:.15rem 0 0; font-size:.86rem; }
.provider-health { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.provider-health .eyebrow { margin-bottom:.2rem; }
.provider-health h2 { margin:0; }
.panel-inset { padding:1.25rem 1.25rem 0; }
.quick-actions { display:flex; flex-wrap:wrap; gap:.65rem; }
.quota-state { color:var(--muted); font-size:.78rem; font-weight:700; }
.audit-filters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:end; gap:.85rem; }
.audit-filter-actions,.audit-pagination { display:flex; align-items:center; gap:.55rem; }
.audit-pagination { justify-content:space-between; padding:1rem; color:var(--muted); }
.audit-pagination div { display:flex; gap:.5rem; }
.audit-metadata { max-width:100%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font: .82rem/1.5 ui-monospace,SFMono-Regular,monospace; }
.quota-warning { color:#946200; }.quota-reached,.quota-exceeded { color:var(--red); }.quota-normal,.quota-unlimited { color:#096a4c; }
@media (max-width:760px) {
  .app-shell { display:block; }
  .sidebar { position:static; height:auto; min-height:0; padding:1rem; }
  .sidebar nav { display:flex; margin-top:1rem; gap:.15rem; overflow-x:auto; }
  .sidebar nav a { white-space:nowrap; }
  .sidebar-footer { display:grid; margin-top:1rem; padding-top:.8rem; }
  .content { padding:1.3rem 1rem 3rem; }
  .page-header { align-items:flex-start; }
  .system-status { align-items:flex-start; flex-direction:column; }
  .health-row { grid-template-columns:minmax(0,1fr) auto; }.health-row>a,.health-row>.muted { grid-column:1 / -1; }
  .attention-list li { grid-template-columns:auto minmax(0,1fr); }.attention-list li>a { grid-column:2; }
  .stat-grid,.stat-grid-three { grid-template-columns:1fr; }
  .assignment-form { align-items:stretch; flex-direction:column; }
  .profile-grid,.profile-grid-three,.profile-summary-grid { grid-template-columns:1fr; }
  .profile-grid-service label:first-child { max-width:none; }
  .profile-grid .field-wide { grid-column:auto; }
  .form-actions { justify-content:flex-start; flex-wrap:wrap; }
  .profile-summary-grid dl { grid-template-columns:minmax(110px,.75fr) minmax(0,1.25fr); }
  .audit-filters { grid-template-columns:1fr; }
  th,td { padding:.7rem .75rem; }
}
.mailbox-password-grid { margin-top: 1rem; }
.destructive-confirmation { border-color: #f2c5c1; background: #fff8f7; }

/* Mailix branding */
.brand-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.login-brand-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}


/* Center login branding and heading */
.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
}

.login-brand-logo {
  margin-left: auto;
  margin-right: auto;
}

.guest-content .eyebrow,
.guest-content h1 {
  text-align: center;
}


.guest-content .page-header p {
  text-align: center;
}


/* Login heading refinement */
.guest-content .page-header h1 {
  font-size: clamp(2.5rem, 4.2vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-align: center;
}

/* Keep the welcome heading on one line when there is enough room */
@media (min-width: 760px) {
  .guest-content .page-header h1 {
    white-space: nowrap;
  }
}

@media (max-width: 759px) {
  .guest-content .page-header h1 {
    font-size: clamp(2.1rem, 9vw, 2.8rem);
    white-space: normal;
  }
}


/* Final login heading sizing */
.guest-content .page-header h1 {
  font-size: 2.65rem !important;
  line-height: 1.05 !important;
  letter-spacing: -0.04em !important;
  text-align: center !important;
  white-space: nowrap !important;
}

@media (max-width: 760px) {
  .guest-content .page-header h1 {
    font-size: 2.15rem !important;
    white-space: normal !important;
  }
}


.guest-content .page-header h1 {
  font-size: 2.35rem !important;
}

/* Final exact login title rule */
.login-card > h1 {
  font-size: 1.75rem !important;
  line-height: 1.1 !important;
  letter-spacing: -0.03em !important;
  text-align: center !important;
  white-space: nowrap !important;
}

@media (max-width: 480px) {
  .login-card > h1 {
    font-size: 1.45rem !important;
  }
}


/* Fully center guest/login screen */
.guest-shell {
  min-height: 100vh;
}

.guest-content {
  min-height: 100vh;
  width: min(430px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

/* Keep language selector centered above login card */
.guest-content > .language-form {
  align-self: center;
  margin: 0 0 1.25rem;
}

/* Login card itself */
.login-card {
  width: 100%;
  margin: 0 auto;
}
