:root {
  --primary: #0B7A75;
  --primary2: #12A594;
  --ink: #12313A;
  --muted: #66736f;
  --bg: #F1F8F7;
  --surface: #fff;
  --line: #D8EAE7;
  --danger: #b42318;
  --success: #067647;
  --shadow: 0 12px 35px rgba(11, 122, 117, 0.10);
  --radius: 20px;
}


/* =========================================================
   GLOBAL
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(18, 165, 148, .12), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(20, 184, 166, .08), transparent 30%),
    linear-gradient(145deg, #F1F9F7 0%, #F8FBFC 48%, #F0F7F8 100%);
  background-attachment: fixed;
  line-height: 1.55;
}

a {
  color: var(--primary);
  text-decoration: none;
}


/* =========================================================
   NIZHEALTH NAVBAR
   ========================================================= */

.health-navbar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 1030;
}

.health-navbar-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
}

.health-brand {
  display: flex;
  align-items: center;
  gap: 9px;

  color: var(--ink) !important;

  font-weight: 800;
  font-size: 18px;
}

.health-brand:hover {
  color: var(--primary) !important;
}

.health-brand-icon {
  font-size: 24px;
}

.health-nav-link {
  color: #43514d !important;

  font-size: 13px;
  font-weight: 600;

  border-radius: 10px;

  padding: 9px 10px !important;

  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.health-nav-link:hover {
  background: #E5F5F2;
  color: var(--primary) !important;
}

.health-logout {
  color: var(--danger) !important;
}


/* =========================================================
   MOBILE OFFCANVAS
   ========================================================= */

.health-offcanvas {
  width: min(360px, 88vw) !important;
}

.health-offcanvas-title {
  font-weight: 800;
  color: var(--ink);
}

.health-mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.health-mobile-link {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 14px 12px;

  border-radius: 13px;

  color: var(--ink) !important;
  text-decoration: none;

  font-weight: 650;

  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.health-mobile-link span:first-child {
  width: 26px;
  text-align: center;
  font-size: 19px;
}

.health-mobile-link:hover {
  background: #E5F5F2;
  color: var(--primary) !important;
}

.health-mobile-menu hr {
  margin: 10px 0;
  border-color: var(--line);
}

.health-mobile-logout {
  color: var(--danger) !important;
}

.health-mobile-logout:hover {
  background: #fff0ee;
  color: var(--danger) !important;
}


/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.container {
  max-width: 1240px;
  margin: auto;
  padding: 32px 20px 90px;
}

.narrow {
  max-width: 850px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--primary2);
}

h1 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  margin: 6px 0 10px;
}

h2 {
  font-size: 20px;
  margin: 0 0 14px;
}

h3 {
  margin: 0;
}

.muted {
  color: var(--muted);
}


/* =========================================================
   GRIDS
   ========================================================= */

.grid {
  display: grid;
  gap: 18px;
}

.cards {
  grid-template-columns: repeat(4, 1fr);
}

.two {
  grid-template-columns: repeat(2, 1fr);
}

.three {
  grid-template-columns: repeat(3, 1fr);
}


/* =========================================================
   PANELS / CARDS / TILES
   ========================================================= */

.panel,
.tile,
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
  margin: 18px 0;
}

.tile {
  padding: 20px;
  color: var(--ink);
  transition: 0.18s;
}

.tile:hover {
  transform: translateY(-2px);
  border-color: #b7d8d2;
}

.tile b {
  display: block;
  font-size: 17px;
  margin-bottom: 6px;
}

.tile span {
  color: var(--muted);
  font-size: 13px;
}


/* =========================================================
   STAT CARDS
   ========================================================= */

.stat {
  padding: 20px;
}

.stat .icon {
  font-size: 25px;
}

.stat .value {
  font-size: 29px;
  font-weight: 800;
  margin-top: 5px;
}

.stat .label {
  color: var(--muted);
  font-size: 13px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 0;
  border-radius: 12px;

  padding: 11px 16px;

  background: var(--primary);
  color: #fff;

  font-weight: 700;

  cursor: pointer;

  box-shadow: 0 5px 15px rgba(11, 107, 104, 0.2);
}

.btn:hover {
  background: #095b58;
}

.btn.secondary {
  background: #E5F5F2;
  color: var(--primary);
  box-shadow: none;
}

.btn.danger {
  background: #fff0ee;
  color: var(--danger);
  box-shadow: none;
}

.btn.small {
  padding: 7px 10px;
  font-size: 12px;
}


/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}

.full {
  grid-column: 1 / -1;
}

label {
  display: block;
  font-weight: 650;
  font-size: 14px;
  margin: 13px 0;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  margin-top: 7px;

  border: 1px solid #ccd8d4;
  border-radius: 12px;

  font: inherit;

  background: #fff;
  color: var(--ink);

  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary2);
  box-shadow: 0 0 0 3px rgba(15, 139, 133, 0.1);
}

textarea {
  resize: vertical;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert,
.success,
.warning {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 15px 0;
}

.alert {
  background: #fee4e2;
  color: var(--danger);
}

.success {
  background: #e7f8ef;
  color: var(--success);
}

.warning {
  background: #fff6d8;
  color: #735600;
}


/* =========================================================
   TABLES
   ========================================================= */

.table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e9efed;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}


/* =========================================================
   LISTS
   ========================================================= */

.list > div {
  padding: 14px 0;

  border-bottom: 1px solid #e9efed;

  display: flex;
  justify-content: space-between;

  gap: 20px;
}

.list span {
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}


/* =========================================================
   AI CHAT
   ========================================================= */

.chat {
  display: flex;
  flex-direction: column;
  gap: 12px;

  min-height: 280px;
  max-height: 540px;

  overflow: auto;

  margin: 20px 0;
  padding: 4px;
}

.bubble {
  padding: 14px 16px;

  border-radius: 17px;

  max-width: 85%;

  white-space: normal;

  line-height: 1.6;
}

.bubble.assistant {
  align-self: flex-start;

  background: #f0f3f2;

  border-bottom-left-radius: 5px;
}

.bubble.assistant p {
  margin: 8px 0;
}

.bubble.assistant p:first-child {
  margin-top: 0;
}

.bubble.assistant p:last-child {
  margin-bottom: 0;
}

.bubble.assistant ul,
.bubble.assistant ol {
  margin: 8px 0;
  padding-left: 24px;
}

.bubble.assistant li {
  margin: 4px 0;
}

.bubble.assistant h1,
.bubble.assistant h2,
.bubble.assistant h3 {
  margin: 14px 0 6px;
  line-height: 1.3;
}

.bubble.assistant h1:first-child,
.bubble.assistant h2:first-child,
.bubble.assistant h3:first-child {
  margin-top: 0;
}

.ai-compose {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.ai-compose textarea {
  margin: 0;
}


/* =========================================================
   DASHBOARD AI CARD
   ========================================================= */

.ai-dashboard-card {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 18px 0;
  padding: 20px 22px;

  background: linear-gradient(
    135deg,
    #E5F5F2,
    #f7fbfa
  );

  border: 1px solid #cfe5e1;
  border-radius: var(--radius);

  color: var(--ink);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.ai-dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.ai-dashboard-icon {
  width: 48px;
  height: 48px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background: #fff;

  font-size: 24px;
}

.ai-dashboard-card strong {
  display: block;

  font-size: 17px;

  margin-bottom: 3px;
}

.ai-dashboard-card span {
  color: var(--muted);
  font-size: 13px;
}

.ai-dashboard-arrow {
  margin-left: auto;

  font-size: 24px;

  color: var(--primary) !important;
}


/* =========================================================
   INSIGHT STATISTICS
   ========================================================= */

.insight-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 11px 0;

  border-bottom: 1px solid #e9efed;

  gap: 15px;
}

.insight-stat-row:last-child {
  border-bottom: 0;
}

.insight-stat-row span {
  color: var(--muted);
  font-size: 13px;
}

.insight-stat-row strong {
  font-size: 15px;
}


/* =========================================================
   AUTHENTICATION
   ========================================================= */

.auth {
  max-width: 480px;
  margin: 0 auto;
  padding: 70px 20px;
}

.auth .card {
  padding: 32px;
}

.auth-page {
  min-height: 100vh;

  display: flex;
  align-items: center;
}

.auth-card {
  width: 100%;
}

.auth-form {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.auth-form label,
.auth-form input,
.auth-form button {
  visibility: visible !important;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
}

.auth-brand {
  width: 54px;
  height: 54px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  background: #E5F5F2;

  font-size: 28px;

  margin-bottom: 14px;
}

.auth-footer {
  margin-bottom: 0;
}


/* =========================================================
   PROFILE
   ========================================================= */

.profile-section-title {
  margin-top: 18px;
  margin-bottom: 2px;
}

.profile-section-title h2 {
  margin: 0 0 5px;
  font-size: 1.15rem;
}

.profile-section-title p {
  margin: 0;
}


/* =========================================================
   MISC
   ========================================================= */

.center {
  text-align: center;
}

.bg {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 15% 10%,
      #dff4f1,
      transparent 30%
    ),
    var(--bg);
}

.empty {
  text-align: center;
  padding: 35px 15px;
  color: var(--muted);
}

.chart {
  width: 100%;
  height: 240px;
}

.danger-text {
  color: var(--danger);
}


/* =========================================================
   TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1050px) {

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero {
    gap: 18px;
  }

}


/* =========================================================
   BOOTSTRAP NAVBAR — TABLET / MOBILE
   ========================================================= */

@media (max-width: 991.98px) {

  .health-navbar-container {
    padding: 10px 15px;
  }

  .health-brand {
    font-size: 16px;
  }

  .health-brand-icon {
    font-size: 22px;
  }

  .health-navbar-toggler {
    border: 1px solid var(--line);

    border-radius: 10px;

    padding: 7px 9px;
  }

  .health-navbar-toggler:focus {
    box-shadow:
      0 0 0 3px
      rgba(15, 139, 133, 0.12);
  }

  .health-offcanvas {
    width: min(360px, 88vw) !important;
  }

}


/* =========================================================
   MOBILE / TABLET
   ========================================================= */

@media (max-width: 760px) {

  .container {
    width: 100%;

    padding:
      24px
      15px
      105px;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;

    margin-bottom: 20px;
  }

  .hero .btn {
    width: 100%;
  }

  .cards,
  .two,
  .three,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 17px;
    border-radius: 17px;
  }

  .tile {
    padding: 17px;
  }

  .stat {
    padding: 18px;
  }

  .stat .value {
    font-size: 26px;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head .btn {
    flex-shrink: 0;
  }

  .actions {
    width: 100%;
  }

  .actions .btn {
    flex: 1;
  }

  .list > div {
    flex-direction: column;
    gap: 9px;
  }

  .bubble {
    max-width: 94%;
  }

  .ai-compose {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-compose .btn {
    width: 100%;
  }

  .auth {
    padding: 28px 15px 100px;
  }

  .auth-card {
    padding: 24px !important;
  }

  .form-grid label {
    margin-top: 10px;
  }

  .form-grid .full .btn {
    width: 100%;
  }

}


/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 480px) {

  .health-navbar-container {
    padding-left: 11px;
    padding-right: 11px;
  }

  .health-brand {
    font-size: 15px;
  }

  .health-brand-icon {
    font-size: 21px;
  }

  .health-offcanvas {
    width: 90vw !important;
  }

  .container {
    padding-left: 11px;
    padding-right: 11px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 18px;
  }

  .eyebrow {
    font-size: 10px;
  }

  .muted {
    font-size: 14px;
  }

  .panel {
    padding: 15px;
  }

  .tile {
    padding: 15px;
  }

  .tile b {
    font-size: 16px;
  }

  .stat .value {
    font-size: 24px;
  }

  .btn {
    min-height: 44px;
  }

  .btn.small {
    min-height: 40px;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .section-head > a,
  .section-head > .btn {
    width: 100%;
  }

  .actions form {
    width: 100%;
  }

  .actions form .btn,
  .actions > .btn {
    width: 100%;
  }

  .ai-dashboard-card {
    padding: 17px;
  }

  .ai-dashboard-icon {
    width: 42px;
    height: 42px;
  }

  .ai-dashboard-card strong {
    font-size: 15px;
  }

}



/* v0.4 visual refresh */
body::before { content:""; position:fixed; inset:0; pointer-events:none; z-index:-1; opacity:.45; background-image: radial-gradient(rgba(15,23,42,.045) 1px, transparent 1px); background-size:24px 24px; mask-image:linear-gradient(to bottom, black, transparent 78%); }
.security-panel { max-width: 820px; margin-inline:auto; }
.security-panel .eyebrow { margin:0 0 8px; color:var(--primary); font-weight:800; letter-spacing:.14em; font-size:12px; }
.security-list { display:grid; gap:12px; margin-top:24px; }
.security-list > div { display:flex; gap:14px; padding:16px; border:1px solid var(--line); border-radius:16px; background:rgba(255,255,255,.82); }
.security-list strong { min-width:150px; }
.security-list span { color:var(--muted); }
@media(max-width:640px){ .security-list > div{display:block}.security-list span{display:block;margin-top:5px} }


/* =========================================================
   NIZHEALTH BRAND
   ========================================================= */
.health-brand-icon img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.login-brand img,
.auth-brand img {
  display: block;
  margin: 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 20px;
}
