/* CNART CRM shell — loaded after app.css */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --green: #1f7d5c;
  --green-strong: #12261e;
  --green-soft: #e7f3ee;
  --green-mid: #2c8a63;
  --forest: #0d1f18;
  --forest-deep: #0a1f17;
  --hero: #0f4834;
  --teal: #1f7d5c;
  --gold: #b8791f;
  --ink: #161c1a;
  --muted: #5c6b63;
  --muted-soft: #a8b3ac;
  --line: #e4e8e5;
  --line-strong: #d5ddd8;
  --surface: #ffffff;
  --surface-soft: #f4f5f3;
  --canvas: #eef1ed;
  --danger: #b3392c;
  --blue: #1f7d5c;
  --shadow: 0 12px 28px rgba(13, 31, 24, 0.08);
  --shadow-sm: 0 4px 14px rgba(13, 31, 24, 0.05);
  --radius: 18px;
  --radius-sm: 11px;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-display: "Inter", "Segoe UI", sans-serif;
  --topbar-h: 72px;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  padding-top: 0 !important;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  background: var(--canvas);
}

h1, h2, h3, .brand strong, .workspace-card > strong, .module-card h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; color: var(--ink); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(31, 125, 92, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--green-strong);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* —— Topbar —— */
.topbar {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  min-height: var(--topbar-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.embedded-chat,
body.auth-screen,
body.has-sidebar {
  padding-top: 0 !important;
}
body.embedded-chat .topbar,
body.embedded-chat .floating-chat {
  display: none !important;
}

.topbar-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}
.brand-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: var(--forest);
  box-shadow: none;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.45);
  transform-origin: center;
}
.brand-copy { display: grid; min-width: 0; }
.brand strong {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.module-context {
  margin-right: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}
.topbar nav form { margin: 0; }
.topbar nav a,
.topbar nav button {
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.topbar nav a:hover,
.topbar nav button:hover {
  background: var(--surface-soft);
  border-color: transparent;
}

.icon-tile {
  position: relative;
  width: 36px;
  height: 36px;
  min-height: 36px !important;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center;
  border-radius: 10px !important;
  background: var(--surface-soft) !important;
  color: var(--ink) !important;
}
.icon-tile strong {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.62rem;
}

.account-chip {
  min-width: 0;
  padding: 4px 10px 4px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  line-height: 1.15;
}
.account-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}
.account-meta {
  display: grid;
  min-width: 0;
}
.account-meta strong {
  font-size: 0.86rem;
  white-space: nowrap;
}
.account-chip small,
.account-meta small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.presence-control {
  min-height: 36px;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
}

body.has-sidebar .topbar > nav > .topbar-logout { display: none; }

.account-menu {
  position: relative;
  flex: 0 0 auto;
}
.account-menu > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 2px 4px 2px 2px;
  border-radius: 999px;
  cursor: pointer;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { background: var(--surface-soft); }
.account-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(280px, 80vw);
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}
.account-menu-panel a,
.account-menu-panel button {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-panel a:hover,
.account-menu-panel button:hover { background: var(--surface-soft); }
.account-menu-panel .presence-control {
  width: 100%;
  margin-bottom: 6px;
}
.account-menu-panel .topbar-logout { display: block; }

/* —— App frame / sidebar —— */
.app-frame {
  width: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: stretch;
  min-height: 100vh;
}
body:not(.has-sidebar) .app-frame { display: block; }
.app-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--canvas);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  border: 0;
  background: rgba(10, 24, 20, 0.45);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
body.nav-open .sidebar-backdrop { display: block; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  z-index: 35;
  height: 100vh;
  max-height: 100vh;
  padding: 22px 14px 24px;
  overflow-y: auto;
  color: #e8f0ec;
  background: var(--forest);
  border-right: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-home {
  margin-bottom: 18px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 0;
}
.sidebar-home:hover { background: rgba(255, 255, 255, 0.06); }
.sidebar-home span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
}
.sidebar-home strong { display: grid; gap: 2px; font-size: 0.92rem; }
.sidebar-home small { color: var(--muted-soft); font-size: 0.72rem; font-weight: 500; }

.nav-group {
  margin: 0 0 4px;
  border-bottom: 0;
}
.nav-group summary {
  padding: 10px 10px;
  cursor: pointer;
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style-position: inside;
}
.nav-group nav { padding: 0 0 8px; display: grid; gap: 2px; }
.nav-group nav a {
  padding: 10px 12px;
  border-left: 0;
  border-radius: 10px;
  color: #e8f0ec;
  font-size: 0.9rem;
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background 0.15s ease;
}
.nav-group nav a:hover { background: rgba(255, 255, 255, 0.06); }
.nav-group nav a.active {
  border-left-color: transparent;
  background: rgba(44, 138, 99, 0.28);
  color: #fff;
  font-weight: 600;
}

.nav-subgroups { padding: 0 0 10px 8px; display: grid; gap: 6px; }
.nav-subgroup { border-bottom: 0; }
.nav-subgroup > summary {
  margin: 0;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: #f4f8fa;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.nav-subgroup[open] > summary { background: rgba(31, 125, 92, 0.35); }
.nav-subgroup nav { padding: 6px 0 4px !important; }
.nav-subgroup nav a { padding-left: 14px !important; font-size: 0.86rem !important; }

.module-switch {
  margin-top: 14px;
  padding: 11px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  background: transparent;
}
.module-switch:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}
.sidebar-logout { margin-top: 8px; }
.sidebar-logout button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #ff8a75;
  text-align: left;
  cursor: pointer;
}
.sidebar-logout button:hover { background: rgba(255, 138, 117, 0.08); }

.page-shell {
  width: min(1480px, calc(100% - 40px));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 28px 0 64px;
  animation: cnart-fade-up 0.28s ease both;
}

@keyframes cnart-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .page-shell,
  .module-card,
  .workspace-card,
  .primary-command,
  .secondary-command {
    animation: none !important;
    transition: none !important;
  }
}

.page-heading { margin-bottom: 24px; }
.page-heading h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.15;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lead, .page-heading .lead {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 62ch;
}

/* —— Buttons / surfaces —— */
.primary-command,
.secondary-command,
.primary-link,
.danger-command {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.primary-command,
.primary-link {
  border: 1px solid var(--green-strong);
  background: var(--green-strong);
  color: #fff;
  box-shadow: none;
}
.primary-command:hover,
.primary-link:hover {
  transform: none;
  background: #0a1b15;
  border-color: #0a1b15;
}
.secondary-command {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--green-strong);
}
.secondary-command:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.primary-command.compact { width: auto; margin: 0; }

.content-section,
.table-shell,
.filter-bar,
.message {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
}
.content-section {
  border: 1px solid var(--line);
  background: #fff;
  backdrop-filter: none;
}

.workspace-card,
.module-card,
.metric-grid article,
.notification-item,
.family-grid a,
.questionnaire-launch-grid a {
  border-radius: var(--radius) !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.workspace-card:hover,
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 28px;
}
.module-card {
  min-height: 220px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.module-card.featured {
  background: var(--hero);
  color: #fff;
  border-color: transparent;
}
.module-card.featured p,
.module-card.featured strong { color: rgba(255, 255, 255, 0.82); }
.module-card.featured .module-mark {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.module-mark {
  width: fit-content;
  margin-bottom: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.module-card h2 { margin: 0 0 10px; font-size: 1.35rem; }
.module-card p { margin: 0; color: var(--muted); flex: 1; }
.module-card > strong {
  margin-top: 18px;
  color: var(--green);
  font-size: 0.92rem;
}

.workspace-card {
  border: 1px solid var(--line) !important;
  border-left-width: 1px !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm) !important;
}
.workspace-card.featured {
  border-color: transparent !important;
}
.workspace-section:first-of-type .workspace-card.featured:first-child {
  background: var(--hero) !important;
  color: #fff;
  border-color: transparent !important;
}
.workspace-section:first-of-type .workspace-card.featured:first-child span,
.workspace-section:first-of-type .workspace-card.featured:first-child p {
  color: rgba(255, 255, 255, 0.72);
}
.workspace-card.caution {
  border-color: #fbecd4 !important;
  background: #fffdf8 !important;
}

.form-grid p input:not([type="checkbox"]),
.form-grid p select,
.form-grid p textarea,
.compact-form input:not([type="checkbox"]),
.compact-form select,
.compact-form textarea,
.login-panel input,
.filter-bar input,
.filter-bar select {
  border-radius: 11px !important;
  border-color: var(--line-strong) !important;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-grid p input:focus,
.form-grid p select:focus,
.form-grid p textarea:focus,
.login-panel input:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 4px rgba(31, 125, 92, 0.12);
}

.data-table thead { background: #f3f6f4 !important; }
.data-table th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.data-table tbody tr:hover { background: #f6faf8; }

/* —— Login —— */
body.auth-screen {
  background: #eef1ed;
}
body.auth-screen .app-column,
body.auth-screen .page-shell {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  animation: none;
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.4fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  justify-items: stretch;
  place-items: stretch;
  width: 100%;
  margin: 0;
}
.login-showcase {
  padding: 36px 40px 28px;
  border-radius: 0;
  color: #f4fffa;
  background:
    radial-gradient(circle at 18% 88%, rgba(44, 138, 99, 0.42), transparent 42%),
    linear-gradient(180deg, #12352a 0%, #0a1f17 58%, #071610 100%);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}
.login-showcase-orb {
  position: absolute;
  width: 360px;
  height: 360px;
  right: -110px;
  bottom: -120px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  pointer-events: none;
}
.login-showcase-brand {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 58px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.login-showcase-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.login-showcase-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  max-width: min(100%, 22rem);
}
.login-showcase-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 2.7vw, 2.55rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  max-width: 12em;
}
.login-showcase-copy p {
  margin: 0;
  max-width: 36ch;
  color: rgba(244, 255, 250, 0.78);
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 400;
}
.login-showcase-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(244, 255, 250, 0.62);
  font-size: 0.78rem;
}
.login-stage {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 48px 24px;
  background: #eef1ed;
}
.login-panel {
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.login-panel h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.login-panel .login-lead {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.95rem;
}
.login-panel label {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  font-size: 0.88rem;
  color: #3d4a44;
}
.login-panel label + input,
.login-panel .password-visibility-control {
  margin-bottom: 16px;
}
.login-panel input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #d8dfda;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.login-panel input::placeholder {
  color: #a8b3ac;
}
.login-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 22px;
}
.login-remember {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-weight: 500 !important;
  color: var(--muted) !important;
  cursor: pointer;
}
.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--green-strong);
  border-radius: 4px;
}
.login-forgot {
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.login-forgot:hover { text-decoration: underline; }
.login-panel .primary-command {
  width: 100%;
  margin-top: 0;
  min-height: 48px;
  border-radius: 11px;
  background: #12261e;
  border-color: #12261e;
  font-size: 0.95rem;
}
.login-panel .primary-command:hover {
  background: #0a1b15;
  border-color: #0a1b15;
}
.login-note {
  margin: 18px 0 0;
  text-align: center;
  color: #a8b3ac;
  font-size: 0.82rem;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #a8b3ac;
  font-size: 0.78rem;
  font-weight: 600;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.google-login {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.google-login:hover {
  border-color: var(--green);
  background: var(--green-soft);
}
.google-access-card {
  margin-bottom: 18px;
  padding: 22px 24px;
  display: grid;
  gap: 14px;
}
.google-access-card textarea {
  width: 100%;
  min-height: 96px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  resize: vertical;
}
.google-access-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.dashboard-welcome {
  margin: 0 0 8px;
  max-width: 18em;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.floating-chat {
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.session-timeout-dialog {
  border-radius: 18px !important;
  box-shadow: var(--shadow);
}

/* —— Responsive —— */
@media (max-width: 1180px) {
  .brand-copy { display: none; }
  .account-meta { display: none; }
  .topbar-text-link { display: none; }
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .module-context { display: none; }
  .topbar nav > a:not(.icon-tile) { display: none !important; }

  .app-frame,
  body.has-sidebar .app-frame {
    display: block !important;
  }

  .sidebar,
  body.has-sidebar .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0;
    z-index: 50;
    width: min(86vw, 300px) !important;
    height: 100vh !important;
    padding: 18px 14px 28px !important;
    display: block !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    box-shadow: var(--shadow);
    background: var(--forest) !important;
  }
  body.nav-open .sidebar,
  body.nav-open.has-sidebar .sidebar {
    transform: translateX(0);
  }

  .sidebar-home,
  body.has-sidebar .sidebar-home {
    margin-bottom: 16px !important;
    padding: 12px !important;
  }
  .sidebar-home strong,
  body.has-sidebar .sidebar-home strong { display: grid !important; }

  .nav-group,
  .nav-subgroup {
    display: block !important;
    border-bottom: 0 !important;
  }
  .nav-group summary,
  .nav-subgroup > summary { display: list-item !important; }
  .nav-group nav,
  .nav-subgroup nav {
    display: grid !important;
    gap: 3px !important;
    flex-direction: unset !important;
  }
  .nav-group nav a,
  .nav-subgroup nav a {
    white-space: normal !important;
    border-left: 0 !important;
    border-radius: 10px !important;
  }
  .module-switch { margin: 14px 0 0 !important; }
  .sidebar-logout { display: block !important; }

  .page-shell,
  body.has-sidebar .page-shell {
    width: min(100% - 24px, 1480px);
    padding-top: 22px;
  }

  .module-grid,
  .workspace-grid,
  .metric-grid {
    grid-template-columns: 1fr !important;
  }

  .login-layout {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .login-showcase {
    min-height: auto;
    padding: 28px 24px 36px;
  }
  .login-showcase-copy {
    margin: 28px 0 24px;
    max-width: min(100%, 28rem);
  }
  .login-showcase-orb { width: 220px; height: 220px; }
  .login-stage { min-height: auto; padding: 36px 24px 48px; }
  .login-panel { padding: 0; }
}

@media (max-width: 720px) {
  .topbar { min-height: 64px; padding: 0 14px; }
  :root { --topbar-h: 64px; }
  .brand-logo { width: 40px; height: 40px; }
  .page-heading.with-action {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body { padding-top: 0 !important; }
}

/* Beat app.css module-shell leftovers */
body.has-sidebar {
  --canvas: #eef1ed;
  --surface-soft: #f4f5f3;
  --line: #e4e8e5;
  --line-strong: #d5ddd8;
  --ink: #161c1a;
  --muted: #5c6b63;
  padding-top: 0 !important;
  background: var(--canvas);
}
body.has-sidebar .topbar {
  min-height: var(--topbar-h);
  background: #fff !important;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
body.has-sidebar .app-frame {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}
body.has-sidebar .sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  max-height: 100vh;
  padding: 22px 14px 24px;
  background: var(--forest);
  border-right: 0;
  color: #e8f0ec;
}
body.has-sidebar .sidebar-home {
  margin: 0 0 18px;
  padding: 10px 8px;
  border-bottom: 0;
}
body.has-sidebar .sidebar-home span {
  background: var(--green);
  color: #fff;
}
body.has-sidebar .sidebar-home strong { color: #fff; }
body.has-sidebar .sidebar-home small { color: var(--muted-soft); }
body.has-sidebar .nav-group { border-bottom: 0; }
body.has-sidebar .nav-group summary {
  color: var(--muted-soft);
  font-size: 0.68rem;
  text-transform: uppercase;
}
body.has-sidebar .nav-group nav a { color: #e8f0ec; }
body.has-sidebar .nav-group nav a:hover { background: rgba(255, 255, 255, 0.06); }
body.has-sidebar .nav-group nav a.active {
  border-left-color: transparent;
  background: rgba(44, 138, 99, 0.28);
  color: #fff;
}
body.has-sidebar .module-switch {
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
}
body.has-sidebar .page-shell {
  width: min(1540px, calc(100% - 42px));
  padding-top: 28px;
}
body.has-sidebar .workspace-section:first-of-type { border-top-color: var(--green); }
body.has-sidebar .workspace-card {
  min-height: 142px;
  border-left-color: var(--line);
  box-shadow: var(--shadow-sm);
}
body.has-sidebar .workspace-card.featured { border-left-color: transparent; }
body.has-sidebar .workspace-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.home-sidebar {
  display: flex;
  flex-direction: column;
}
.home-brand {
  display: flex;
  align-items: center;
  margin: 4px 8px 22px;
  text-decoration: none;
}
.home-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.home-nav-label {
  margin: 8px 12px 6px;
  color: var(--muted-soft);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.home-nav {
  display: grid;
  gap: 2px;
  padding: 0 8px;
}
.home-nav a {
  min-height: 42px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  color: #e8f0ec;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.home-nav a svg { flex: 0 0 18px; opacity: 0.9; }
.home-nav a:hover { background: rgba(255, 255, 255, 0.06); }
.home-nav a.active {
  background: rgba(44, 138, 99, 0.32);
  color: #fff;
  font-weight: 600;
}
.home-sidebar .sidebar-logout { margin-top: auto; }

.dashboard-kicker {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.kpi-card {
  position: relative;
  min-height: 132px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.kpi-card.is-hero {
  background: var(--hero);
  color: #fff;
  border-color: transparent;
}
.kpi-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.kpi-card.is-hero span { color: rgba(255, 255, 255, 0.72); }
.kpi-card strong {
  display: block;
  margin: 10px 0 4px;
  font-size: 2rem;
  letter-spacing: -0.04em;
  line-height: 1;
}
.kpi-card small {
  color: var(--muted);
  font-size: 0.78rem;
}
.kpi-card.is-hero small { color: rgba(255, 255, 255, 0.7); }
.kpi-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  font-style: normal;
  background: #e7f3ee;
  color: var(--green);
}
.kpi-badge.is-warn { background: #fbecd4; color: #b8791f; }
.kpi-badge.is-down { background: #f8e4e1; color: var(--danger); }
.kpi-icon {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}
.kpi-icon.is-soft { background: var(--green-soft); color: var(--green); }
.kpi-icon.is-warn { background: #fbecd4; color: #b8791f; }
.kpi-icon.is-danger { background: #f8e4e1; color: var(--danger); }

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
  margin-bottom: 18px;
}
.dash-panel {
  padding: 20px 22px 22px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.dash-panel header { margin-bottom: 18px; }
.dash-panel h2 {
  margin: 0;
  font-size: 1.05rem;
}
.dash-panel header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.prime-chart {
  min-height: 180px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 12px;
}
.prime-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 160px;
}
.prime-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  background: #dfe6e1;
}
.prime-bar.is-current {
  background: linear-gradient(180deg, #2c8a63, #12261e);
}
.prime-col small { color: var(--muted); font-size: 0.72rem; }
.product-mix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: center;
}
.product-mix ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.product-mix li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
}
.product-mix li i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.product-mix li strong { margin-left: auto; color: var(--muted); font-weight: 600; }
.product-donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-left: auto;
}
.product-donut span {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--muted);
  font-size: 0.68rem;
  text-align: center;
  line-height: 1.15;
}
.product-donut strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}
.activity-panel { margin-bottom: 8px; }
.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.activity-list li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.92rem;
}
.activity-list li:first-child { border-top: 0; padding-top: 0; }
.activity-list time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* —— Operational pages: lists, forms, module dashboards —— */
body.has-sidebar .primary-command,
body.has-sidebar .primary-link,
.button-row .primary-command,
.page-heading .primary-command,
.form-actions .primary-command,
.filter-bar .primary-command,
.filter-bar .secondary-command,
.action-band .primary-command,
.messaging-heading .primary-command {
  width: auto;
  margin-top: 0;
}
.login-panel .primary-command {
  width: 100%;
  margin-top: 24px;
}

.page-heading.with-action,
.messaging-heading,
.transport-dashboard-heading,
.calculation-hero {
  align-items: flex-end;
  gap: 18px;
}
.page-heading h1,
.calculation-hero h1,
.chat-header h1 {
  letter-spacing: -0.04em;
}

.eyebrow {
  color: var(--green) !important;
}

.section-heading h2,
.section-heading-row h2,
.workspace-section h2,
.content-section > h2:first-child {
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.workspace-section {
  margin: 0 0 22px !important;
  padding: 4px 0 0 !important;
  border-top: 0 !important;
}
.workspace-grid {
  gap: 16px !important;
}
.workspace-card {
  min-height: 148px !important;
  padding: 18px 18px 16px !important;
  border-left-width: 1px !important;
  border-radius: 18px !important;
}
.workspace-card > span {
  color: var(--green);
  letter-spacing: 0.06em;
}
.workspace-card.featured {
  background: var(--hero) !important;
  color: #fff;
  border-color: transparent !important;
}
.workspace-card.featured > span,
.workspace-card.featured p { color: rgba(255, 255, 255, 0.72) !important; }
.workspace-card.featured > strong { color: #fff; }
.workspace-card.caution {
  border-color: #f3e2bf !important;
  background: #fffdf8 !important;
}

.kpi-strip,
.validation-summary {
  gap: 14px !important;
  margin-bottom: 18px !important;
  border: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}
.kpi-strip {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)) !important;
}
.kpi-strip div,
.validation-summary span {
  min-height: 118px;
  padding: 18px !important;
  border: 1px solid var(--line) !important;
  border-right: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm);
}
.kpi-strip div:first-child {
  background: var(--hero) !important;
  color: #fff;
  border-color: transparent !important;
}
.kpi-strip div:first-child span { color: rgba(255, 255, 255, 0.72) !important; }
.kpi-strip strong,
.validation-summary strong {
  font-size: 1.55rem !important;
  letter-spacing: -0.04em;
}
.metric-grid {
  gap: 14px !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.metric-grid article {
  min-height: 128px !important;
  border: 1px solid var(--line) !important;
  border-top: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm);
}
.metric-grid article:first-child {
  background: var(--hero) !important;
  color: #fff;
  border-color: transparent !important;
}
.metric-grid article:first-child span,
.metric-grid article:first-child small { color: rgba(255, 255, 255, 0.72) !important; }
.metric-grid strong {
  font-size: 1.7rem !important;
  letter-spacing: -0.04em;
}

.transport-kpi-grid { gap: 16px !important; }
.transport-kpi,
.transport-shortcut,
.transport-dashboard-section {
  border-radius: 18px !important;
  border: 1px solid var(--line) !important;
  border-top: 1px solid var(--line) !important;
  border-left: 1px solid var(--line) !important;
  box-shadow: var(--shadow-sm) !important;
}
.transport-kpi {
  background: #fff !important;
}
.transport-kpi::after { display: none; }
.transport-kpi-grid .transport-kpi:first-child {
  background: var(--hero) !important;
  color: #fff;
  border-color: transparent !important;
}
.transport-kpi-grid .transport-kpi:first-child span,
.transport-kpi-grid .transport-kpi:first-child small { color: rgba(255, 255, 255, 0.72) !important; }
.transport-kpi-grid .transport-kpi:first-child strong { color: #fff; }
.transport-shortcut {
  background: #fff !important;
}
.transport-shortcut span { color: var(--green) !important; }
.transport-shortcut:hover {
  border-color: var(--green) !important;
  background: var(--green-soft) !important;
}
.status-badge {
  border-radius: 999px !important;
  background: var(--green-soft) !important;
  color: var(--green-strong) !important;
  padding: 4px 10px !important;
}

.health-patient-search,
.health-priority-section,
.content-card,
.chat-shell,
.action-band,
.form-section,
.calculation-filters,
.calculation-notice,
.calculation-group,
.eligibility-panel,
.questionnaire-readiness,
.notification-item,
.family-grid a,
.contract-document-card,
.recent-strip {
  border-radius: 18px !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-sm);
}
.health-patient-search {
  border-left: 1px solid var(--line) !important;
  background: #fff !important;
  padding: 22px 24px !important;
}
.health-patient-search-form input {
  border-radius: 11px !important;
  border: 1px solid var(--line-strong) !important;
  min-height: 48px;
  padding: 0 14px;
}
.health-priority-grid {
  gap: 14px;
  border: 0 !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.health-priority-item {
  min-height: 112px;
  border: 1px solid var(--line) !important;
  border-radius: 16px;
  background: #fff;
}
.health-priority-item.has-items {
  border-color: #f3e2bf !important;
  background: #fffdf8;
}
.health-priority-item.has-items strong { color: var(--gold) !important; }
.health-priority-item:hover { background: var(--green-soft); }
.family-grid a,
.contract-document-card {
  border-left: 1px solid var(--line) !important;
  background: #fff !important;
}

.recent-strip {
  grid-template-columns: 220px minmax(0, 1fr) !important;
  padding: 18px 20px !important;
  background: #fff;
}
.recent-links a {
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line) !important;
  background: var(--surface-soft);
}

.filter-bar,
.calculation-filters {
  background: #fff !important;
  padding: 16px 18px !important;
}
.filter-bar label { font-weight: 600; color: var(--ink); }
.filter-bar input,
.filter-bar select,
.account-form input,
.account-form select,
.account-form textarea,
.compact-filter select,
.permission-toolbar input,
.document-meta-fields input[type="text"],
.document-editor,
.chat-composer textarea,
.health-consultation-form input,
.health-consultation-form select,
.health-consultation-form textarea {
  border-radius: 11px !important;
  border: 1px solid var(--line-strong) !important;
  background: #fff;
}
.filter-bar input:focus,
.filter-bar select:focus,
.account-form input:focus,
.account-form select:focus,
.form-grid p input:focus,
.form-grid p select:focus,
.form-grid p textarea:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 4px rgba(31, 125, 92, 0.12);
}

.form-section {
  background: #fff !important;
  padding: 22px 24px !important;
}
.form-section h2 { font-size: 1.12rem; letter-spacing: -0.03em; }
.form-section-navigation {
  top: 0 !important;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.form-section-navigation a {
  border-radius: 999px !important;
  background: var(--green-soft) !important;
  color: var(--green-strong) !important;
}
.choice-grid label,
.module-permission-columns label,
.module-permission-columns fieldset {
  border-radius: 12px !important;
}
.account-form > .form-actions {
  border-radius: 14px;
  border-color: var(--line) !important;
}

.table-shell,
.auto-table-shell {
  border-radius: 18px !important;
  overflow: hidden;
  background: #fff;
}
.content-section .table-shell,
.dash-panel .table-shell,
.transport-dashboard-section .table-shell {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 12px !important;
}
.data-table thead th {
  background: #f3f6f4 !important;
  font-weight: 700;
}
.data-table td,
.data-table th { padding: 14px 16px; }
.tag {
  border-radius: 999px !important;
  border-color: transparent !important;
  background: var(--green-soft) !important;
  color: var(--green-strong) !important;
  padding: 4px 10px !important;
}
.row-action {
  color: var(--green) !important;
  font-weight: 700;
}
.pagination a,
.pagination span {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
}
.empty-state {
  border-radius: 18px;
  border-color: var(--line) !important;
  background: #fff;
}

.message,
.notice,
.form-error,
.action-notice {
  border-radius: 12px !important;
  border-left-width: 3px !important;
}
.danger-command {
  border-radius: 11px !important;
}

.compact-list a {
  padding: 12px 4px;
  border-bottom-color: var(--line);
}
.compact-list a:hover { color: var(--green); }

.notification-item {
  border-left-width: 3px !important;
}
.notification-level { color: var(--green) !important; }

.questionnaire-launch-grid a {
  border-radius: 18px !important;
  border-left: 1px solid var(--line) !important;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.questionnaire-launch-grid a:hover {
  border-color: var(--green) !important;
  background: var(--green-soft) !important;
}
.readiness-pill {
  border-radius: 999px !important;
}
.questionnaire-readiness {
  border-left-width: 3px !important;
}

.bar-row i { background: var(--green) !important; }
.bar-row > div { border-radius: 999px; background: var(--green-soft); }

.calculation-hero { border-bottom-color: var(--line); }
.calculation-count {
  border-radius: 16px;
  border-left: 0 !important;
  background: var(--hero) !important;
  color: #fff !important;
}
.calculation-notice {
  border-left-width: 3px !important;
  background: #fff !important;
}

.messaging-inbox {
  overflow: hidden;
  background: #fff;
}
.conversation-avatar {
  background: var(--green) !important;
}
.conversation-row {
  border-top-color: var(--line) !important;
}
.conversation-row.unread { background: var(--green-soft) !important; }
.conversation-row:hover { background: #f6faf8 !important; }
.chat-shell {
  max-width: none;
  background: #fff !important;
}
.chat-thread { background: var(--canvas) !important; }
.chat-message > div { border-radius: 14px !important; }
.chat-message.mine > div {
  background: var(--green-soft) !important;
  border-color: #cfe6db !important;
}
.chat-message strong { color: var(--green) !important; }
.message-attachment { color: var(--green) !important; }
.floating-chat {
  border-radius: 18px !important;
  border-color: var(--line) !important;
}
.floating-chat > header { background: var(--forest) !important; }

body.health-module .sidebar,
body.transport-module .sidebar {
  background: var(--forest) !important;
}
body.health-module .workspace-card,
body.health-module .workspace-section:first-of-type {
  border-left-color: var(--line) !important;
  border-top-color: transparent !important;
}
.eligibility-panel {
  border-left-width: 3px !important;
}

.page-heading .dashboard-kicker { margin: 8px 0 0; }

/* Modern forms: filled fields, section cards, computed values */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="range"]):not([type="color"]),
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: #f3f6f4 !important;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2312261e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  background-color: #f3f6f4 !important;
  cursor: pointer;
}
select[multiple] {
  min-height: 168px;
  padding: 10px;
  background-image: none !important;
}
input::placeholder,
textarea::placeholder {
  color: #6b7a72;
  opacity: 1;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):hover,
select:hover,
textarea:hover {
  background-color: #eef2ef !important;
  border-color: #d5ddd8 !important;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus,
select:focus,
textarea:focus,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--green) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(31, 125, 92, 0.14);
}
input[readonly],
textarea[readonly],
input:disabled,
select:disabled,
textarea:disabled {
  background: #e8eeea !important;
  color: #4a5a53;
  font-weight: 600;
  cursor: default;
}
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger) !important;
  background: #fff7f6 !important;
  box-shadow: 0 0 0 4px rgba(179, 57, 44, 0.12);
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  min-width: 18px;
  margin: 0;
  accent-color: var(--green);
  cursor: pointer;
}
input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #f7f9f7;
  color: var(--muted);
  cursor: pointer;
}
.data-table input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.data-table select,
.data-table textarea,
.guarantee-table input:not([type="checkbox"]),
.provider-request-table input,
.provider-request-table select,
.provider-request-table textarea {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.92rem;
}
.data-table textarea {
  min-height: 64px;
}

.presence-control select {
  width: auto !important;
  min-height: 30px !important;
  padding: 2px 22px 2px 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2312261e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0 center !important;
  box-shadow: none !important;
  font-weight: 800;
}

.login-panel input:not([type="checkbox"]):not([type="hidden"]) {
  border: 1px solid #d8dfda !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-shadow: none;
}
.login-panel input:hover,
.login-panel input:focus,
.login-panel input:focus-visible {
  border-color: var(--green) !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(31, 125, 92, 0.12);
}

.form-grid,
.health-proposal-grid,
.account-form .form-grid,
.stacked-form,
.public-form-grid,
.compact-form {
  gap: 18px 20px !important;
}
.form-grid > label,
.form-grid p,
.form-grid p > label,
.health-proposal-grid > label,
.health-block-field,
.stacked-form > label,
.stacked-form p,
.account-form label,
.filter-bar label,
.permission-toolbar label {
  display: grid;
  gap: 8px !important;
  color: #3d4a44 !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}
.health-checkbox-field,
.check-field,
.inline-check,
.choice-grid label,
.module-permission-columns label {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
}
.choice-grid label,
.module-permission-columns label,
.module-permission-columns fieldset {
  padding: 12px 14px !important;
  border-radius: 14px !important;
  border: 1px solid var(--line) !important;
  background: #f7f9f7;
}
.choice-grid label:has(input:checked),
.module-permission-columns label:has(input:checked) {
  border-color: #cfe6db !important;
  background: var(--green-soft);
}
.helptext,
.form-grid .helptext,
.form-grid label small:not(.field-error) {
  color: var(--muted) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
}
.field-error,
.error-message {
  color: var(--danger) !important;
  font-size: 0.78rem;
  font-weight: 600;
}

.form-section,
.health-proposal-section,
.doctor-section,
.stacked-form .form-section {
  padding: 22px 24px 26px !important;
  border: 1px solid var(--line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm);
}
.health-direct-proposal,
.endorsement-v1-form,
.health-proposal-form {
  display: grid;
  gap: 18px !important;
}
.form-section > h2,
.form-section > .section-heading,
.health-section-heading,
.section-heading-row {
  margin: 0 0 18px !important;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}
.form-section > h2,
.health-section-heading h2,
.health-section-heading h3,
.section-heading h2,
.section-heading-row h2 {
  margin: 0 !important;
  font-size: 1.05rem !important;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.health-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.health-section-heading .tag,
.form-section .tag,
.section-heading .tag {
  flex: 0 0 auto;
  background: var(--green-soft) !important;
  color: var(--green-strong) !important;
}

.health-premium-summary {
  margin-top: 22px !important;
  gap: 10px !important;
  border: 0 !important;
  background: transparent !important;
}
.health-premium-summary div {
  min-height: 78px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: var(--shadow-sm);
}
.health-premium-summary span {
  color: var(--muted) !important;
  font-size: 0.72rem !important;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.health-premium-summary strong {
  margin-top: 6px;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.health-premium-summary .health-premium-total {
  background: var(--hero) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.health-premium-summary .health-premium-total span {
  color: rgba(255, 255, 255, 0.72) !important;
}
.health-premium-summary .health-premium-total strong {
  color: #fff;
}

.health-proposal-actions,
.account-form > .form-actions {
  position: sticky;
  bottom: 12px;
  z-index: 6;
  margin-top: 8px;
  padding: 12px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}
@supports (backdrop-filter: blur(12px)) {
  .health-proposal-actions,
  .account-form > .form-actions {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
  }
}
.form-actions {
  gap: 10px;
}
.form-actions .primary-command,
.health-proposal-actions .primary-command,
.health-proposal-actions .secondary-command {
  width: auto;
  margin: 0;
}

@media (prefers-reduced-transparency: reduce) {
  .health-proposal-actions,
  .account-form > .form-actions {
    background: #fff;
    backdrop-filter: none;
  }
}

.proposal-command-strip,
.document-channel-actions {
  border-radius: 16px !important;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.proposal-command-strip a:hover,
.proposal-command-strip > form button:hover {
  background: var(--green-soft) !important;
}
.proposal-command-strip a,
.proposal-command-strip > form button {
  border-left-color: var(--green) !important;
}
.money-highlight { color: var(--green) !important; }

.analytics-grid { gap: 16px; }
.analytics-grid > .content-section {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .module-grid { grid-template-columns: 1fr !important; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-split { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .workspace-grid,
  .transport-shortcut-grid,
  .transport-kpi-grid,
  .health-priority-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 720px) {
  .kpi-row { grid-template-columns: 1fr; }
  .product-mix { grid-template-columns: 1fr; }
  .product-donut { margin: 8px auto 0; }
  .activity-list li { grid-template-columns: 1fr; gap: 4px; }
  .metric-grid,
  .workspace-grid,
  .transport-shortcut-grid,
  .transport-kpi-grid,
  .health-priority-grid,
  .kpi-strip { grid-template-columns: 1fr !important; }
  .recent-strip,
  .health-patient-search,
  .analytics-grid { grid-template-columns: 1fr !important; }
}

@media (min-width: 781px) {
  body.has-sidebar .app-frame {
    display: block !important;
  }
  body.has-sidebar .sidebar {
    position: fixed !important;
    top: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 40;
    align-self: auto !important;
    transform: none !important;
    width: var(--sidebar-w) !important;
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
  }
  body.has-sidebar .app-column {
    margin-left: var(--sidebar-w) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
  body.has-sidebar .topbar,
  .topbar {
    position: relative !important;
    inset: auto !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
  }
  body.has-sidebar .topbar nav {
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }
  body.has-sidebar .page-shell {
    width: min(1540px, calc(100% - 42px));
  }
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--green-strong);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.back-to-top:hover {
  background: #0a1b15;
}
.back-to-top[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .back-to-top {
    transition: background 0.16s ease;
  }
}

html, body {
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 1180px) {
  .form-grid,
  .health-proposal-grid,
  .public-form-grid,
  .filter-grid,
  .export-form,
  .commission-filters,
  .decision-layout,
  .health-care-summary,
  .health-premium-summary,
  .kpi-row,
  .kpi-strip,
  .validation-summary,
  .family-grid,
  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .module-permission-columns {
    grid-template-columns: 1fr !important;
  }
  .page-heading.with-action,
  .health-proposal-heading,
  .messaging-heading {
    flex-wrap: wrap;
  }
}

@media (max-width: 780px) {
  .form-grid,
  .health-proposal-grid,
  .public-form-grid,
  .filter-grid,
  .export-form,
  .commission-filters,
  .decision-layout,
  .health-care-summary,
  .health-premium-summary,
  .kpi-row,
  .kpi-strip,
  .validation-summary,
  .family-grid,
  .choice-grid,
  .module-permission-columns,
  .dashboard-split,
  .product-mix,
  .metric-grid,
  .workspace-grid,
  .module-grid,
  .recent-strip,
  .health-patient-search,
  .health-patient-search-form,
  .health-priority-grid,
  .transport-kpi-grid,
  .transport-shortcut-grid,
  .analytics-grid {
    grid-template-columns: 1fr !important;
  }
  .form-grid .full-field,
  .health-proposal-grid .full-field {
    grid-column: 1 / -1 !important;
  }
  .page-heading,
  .page-heading.with-action,
  .health-proposal-heading,
  .messaging-heading,
  .button-row,
  .form-actions,
  .health-proposal-actions,
  .filter-bar,
  .calculation-filters {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px;
  }
  .form-actions .primary-command,
  .form-actions .secondary-command,
  .health-proposal-actions .primary-command,
  .health-proposal-actions .secondary-command,
  .button-row .primary-command,
  .button-row .secondary-command,
  .button-row .primary-link {
    width: 100%;
  }
  .table-shell,
  .auto-table-shell,
  .wide-table-shell {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .page-shell,
  body.has-sidebar .page-shell {
    width: calc(100% - 24px) !important;
    padding-left: 0;
    padding-right: 0;
  }
  body.has-sidebar .app-column {
    margin-left: 0 !important;
  }
  .page-heading h1,
  .calculation-hero h1,
  .chat-header h1 {
    font-size: 1.45rem !important;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px !important;
  }
  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
  .health-proposal-actions,
  .account-form > .form-actions {
    position: static;
  }
}

.guarantee-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.guarantee-tabs a {
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--hero);
  font-weight: 700;
  text-decoration: none;
}
.guarantee-tabs a.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.rd-guarantee-reference .panel {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
