:root {
  color-scheme: light;
  --ink: #152227;
  --muted: #65747a;
  --line: #dbe3e4;
  --surface: #ffffff;
  --soft: #f2f6f5;
  --teal: #0d5c63;
  --teal-dark: #083f45;
  --green: #62a744;
  --amber: #a96900;
  --red: #a33b35;
  --shadow: 0 14px 44px rgba(15, 42, 47, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--soft); }
button, input { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 0.72rem; font-weight: 800; letter-spacing: 0; }
.brand-mark { display: grid; width: 52px; height: 52px; place-items: center; color: white; background: var(--teal); border-radius: 7px; font-size: 1.65rem; font-weight: 900; }
.brand-mark.small { width: 34px; height: 34px; font-size: 1.05rem; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(120deg, #eef5f3 0 58%, #dceae7 58%); }
.login-panel { width: min(100%, 410px); padding: 38px; background: var(--surface); border-top: 5px solid var(--green); box-shadow: var(--shadow); }
.login-panel h1 { margin: 20px 0 5px; font-size: 2.15rem; line-height: 1; }
.login-copy { margin: 0 0 28px; color: var(--muted); }
label { display: block; margin: 15px 0 7px; font-size: 0.86rem; font-weight: 700; }
input { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #bdcacc; border-radius: 6px; color: var(--ink); background: white; outline: none; }
input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 92, 99, 0.14); }
.form-error { min-height: 22px; margin: 9px 0; color: var(--red); font-size: 0.84rem; }
.primary-button, .danger-button, .quiet-button { min-height: 44px; padding: 0 17px; border-radius: 6px; font-weight: 750; }
.primary-button { width: 100%; border: 0; color: white; background: var(--teal); }
.primary-button:hover { background: var(--teal-dark); }
.danger-button { border: 1px solid #e2b5b1; color: var(--red); background: white; }
.quiet-button { border: 1px solid #a8bcbe; color: var(--teal); background: transparent; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 2; width: 232px; display: flex; flex-direction: column; padding: 23px 16px; color: white; background: #102f34; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 30px; font-size: 1.2rem; }
.nav-list { display: grid; gap: 5px; }
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 0 12px; border: 0; border-radius: 5px; color: #c7d7d8; background: transparent; text-align: left; }
.nav-button:hover, .nav-button.active { color: white; background: #1e4b51; }
.nav-icon { width: 22px; font-weight: 900; text-align: center; }
.sidebar .quiet-button { margin-top: auto; color: white; border-color: #66888c; }

.workspace { min-height: 100vh; margin-left: 232px; padding: 0 34px 36px; }
.topbar { height: 91px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 1.45rem; }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.status-dot.offline::before { background: var(--amber); }
.page { display: none; max-width: 1040px; min-height: calc(100vh - 127px); padding-top: 26px; }
.page.active { display: block; }

#view-chat.active { display: grid; grid-template-rows: 1fr auto; }
.messages { min-height: 0; display: flex; flex-direction: column; gap: 13px; overflow: auto; padding: 0 0 23px; }
.message { max-width: min(76%, 690px); padding: 13px 15px; border-radius: 7px; background: white; border: 1px solid var(--line); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.operator { align-self: flex-end; color: white; background: var(--teal); border-color: var(--teal); }
.message time { display: block; margin-top: 7px; color: inherit; opacity: 0.65; font-size: 0.7rem; }
.diagnostic-link { margin-top: 10px; padding: 0; border: 0; color: var(--teal); background: none; font-weight: 750; }
.operator .diagnostic-link { color: white; }
.composer { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 47px; gap: 9px; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); background: var(--soft); }
.composer input { min-height: 49px; }
.send-button { width: 47px; height: 47px; border: 0; border-radius: 6px; color: white; background: var(--teal); font-size: 1.35rem; }

.data-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.data-row { padding: 17px 18px; background: white; }
.data-row header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.data-row h2 { margin: 0; font-size: 1rem; line-height: 1.35; }
.data-row p { margin: 7px 0 0; color: var(--muted); font-size: 0.85rem; line-height: 1.45; overflow-wrap: anywhere; }
.badge { flex: none; padding: 4px 8px; border-radius: 999px; color: var(--teal); background: #e2f0ed; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.badge.critical, .badge.high { color: var(--red); background: #f9e7e5; }
.badge.medium { color: var(--amber); background: #f9efd9; }
.empty-state { padding: 38px 16px; color: var(--muted); text-align: center; background: white; }
.profile-data { display: grid; grid-template-columns: 180px 1fr; margin: 0 0 25px; border-top: 1px solid var(--line); }
.profile-data dt, .profile-data dd { margin: 0; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.profile-data dt { color: var(--muted); }
.profile-data dd { font-weight: 650; overflow-wrap: anywhere; }
.mobile-nav { display: none; }

@media (max-width: 720px) {
  .login-shell { place-items: stretch; padding: 0; background: white; }
  .login-panel { width: 100%; min-height: 100vh; padding: 58px 25px; box-shadow: none; }
  .sidebar { display: none; }
  .workspace { margin: 0; padding: 0 16px 76px; }
  .topbar { height: 79px; }
  .topbar h1 { font-size: 1.25rem; }
  .page { min-height: calc(100vh - 155px); padding-top: 18px; }
  .message { max-width: 88%; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 4; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 66px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: white; }
  .mobile-nav .nav-button { display: grid; min-width: 0; height: 64px; place-items: center; align-content: center; gap: 2px; padding: 2px; border-radius: 0; color: var(--muted); font-size: 0.64rem; text-align: center; }
  .mobile-nav .nav-button.active { color: var(--teal); background: #edf5f3; }
  .profile-data { grid-template-columns: 1fr; }
  .profile-data dt { padding-bottom: 3px; border-bottom: 0; }
  .profile-data dd { padding-top: 0; }
}
