:root {
  /* DEPLOY_MARKER: sanitaer-portal-login-shell-20260816-01 */
  --ink: #152320;
  --muted: #5d6d68;
  --line: #d5e1dc;
  --panel: #ffffff;
  --wash: #e8f1ed;
  --accent: #08796d;
  --accent-dark: #075e55;
  --warm: #a85b10;
  --shadow: 0 20px 55px rgba(34, 54, 47, 0.14);
  --radius: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(8, 121, 109, 0.14), transparent 38%),
    linear-gradient(145deg, #f7faf8 0%, var(--wash) 64%, #f4efe4 100%);
}

button,
input,
select {
  font: inherit;
}

.login-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
  align-items: center;
  padding: 40px 0;
}

.brand-panel {
  padding: 22px 0;
}

.login-logo {
  display: block;
  width: min(520px, 100%);
  max-height: 150px;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 34px;
  mix-blend-mode: multiply;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

.brand-panel h1 {
  max-width: 720px;
  font-size: clamp(2.4rem, 5vw, 5rem);
}

h2 {
  font-size: 1.55rem;
}

.auth-card,
.work-card,
.metric-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card,
.work-card {
  padding: 28px;
}

.card-heading {
  margin-bottom: 22px;
}

.form-stack,
.create-user-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #40524d;
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #cddbd5;
  border-radius: 6px;
  background: #fbfdfc;
  color: var(--ink);
  padding: 8px 11px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

input:focus,
select:focus {
  border-color: var(--accent);
  background: #fff;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(8, 121, 109, 0.13);
}

input:hover,
select:hover {
  border-color: #aebfba;
}

button,
.primary-link,
.text-action {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 13px 16px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.primary-link:hover,
.text-action:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #eef5f2;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.secondary:hover {
  background: #dcebe5;
}

.hint,
.muted {
  color: var(--muted);
}

.message {
  min-height: 1.4em;
  margin: 16px 0 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.message.error {
  color: #9b2c2c;
}

.hidden {
  display: none !important;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  padding: 22px 18px;
}

.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand span,
.sidebar-user span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.sidebar-logo {
  width: 108px;
  height: 42px;
  object-fit: contain;
  object-position: left center;
  mix-blend-mode: multiply;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 12px 13px;
  text-align: left;
  text-decoration: none;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: #eef5f2;
  color: var(--accent-dark);
}

.sidebar-user {
  display: grid;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.workarea {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.work-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.work-header h1 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.metric-grid,
.content-grid {
  display: grid;
  gap: 16px;
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.metric-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.metric-card strong {
  font-size: 1.8rem;
}

.content-grid {
  grid-template-columns: 1fr 1fr;
}

.work-card p {
  color: var(--muted);
}

.text-action {
  display: inline-block;
  margin-top: 8px;
}

.create-user-form {
  gap: 16px;
}

.form-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  margin: 0;
  padding: 18px;
}

.form-section:first-of-type {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.form-section legend {
  width: auto;
  margin: 0;
  padding: 0 8px;
  background: #f8fbfa;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-section legend + * {
  margin-top: 8px;
}

.admin-grid,
.address-grid {
  display: grid;
  gap: 16px 20px;
  align-items: start;
}

.admin-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.address-grid {
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 16px 20px;
}

.address-grid label {
  min-width: 0;
}

.street-field {
  grid-column: 1 / 2;
}

.house-field {
  grid-column: 2 / 3;
}

.postal-field {
  grid-column: 1 / 2;
  max-width: 190px;
}

.city-field {
  grid-column: 2 / 3;
}

.admin-grid .wide,
.form-actions {
  grid-column: 1 / -1;
}

.toggle-line {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfa;
  padding: 8px 11px;
  color: var(--ink);
}

.toggle-line input {
  min-height: auto;
  width: 18px;
  height: 18px;
  padding: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.form-actions button {
  min-width: 240px;
}

@media (max-width: 920px) {
  .login-shell {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .address-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .street-field,
  .city-field {
    grid-column: 1 / -1;
  }

  .house-field {
    grid-column: 1 / span 3;
  }

  .postal-field {
    grid-column: 4 / span 3;
  }
}

@media (max-width: 680px) {
  .login-shell,
  .workarea {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .auth-card,
  .work-card {
    padding: 20px;
  }

  .work-header,
  .metric-grid,
  .content-grid,
  .side-nav {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .address-grid {
    grid-template-columns: 1fr;
  }

  .form-actions button {
    width: 100%;
  }

  .work-header {
    display: grid;
  }
}
