/* TanamBoss - clean responsive CSS
   - mobile first
   - white main background
   - dashboard, trip, perawatan, modal, sidebar
*/

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8faf9;
  --line: #e5ece8;
  --line-strong: #d5e0db;
  --text: #14352d;
  --muted: #667a73;
  --primary: #067d5f;
  --primary-2: #0a9b73;
  --warning: #f5a623;
  --danger: #d9534f;
  --shadow: 0 10px 30px rgba(20, 53, 45, 0.08);
  --shadow-soft: 0 6px 18px rgba(20, 53, 45, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar-w: 286px;
  --maxw: 1180px;
  --topbar-h: 62px;
  --bottom-nav-h: 74px;
  --tap: 46px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hide {
  display: none !important;
}

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

/* =========================
   APP LAYOUT
========================= */
#main {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
  padding: 16px 16px calc(var(--bottom-nav-h) + 18px);
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
}

.stack,
.dashboard-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* =========================
   SURFACES
========================= */
.card,
.auth-card,
.modal-box,
.tb-modal-content,
.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card,
.auth-card,
.modal-box,
.tb-modal-content {
  padding: 16px;
}

.section-card {
  padding: 16px;
}

.page-head {
  margin-bottom: 14px;
}

.page-head h2,
.page-head h3,
.section-head h3,
.card h3 {
  margin: 0;
}

.page-head p,
.section-head p,
.card p {
  margin: 4px 0 0;
}

/* =========================
   TOP BAR
========================= */
.topbar {
  max-width: var(--maxw);
  margin: 0 auto 14px;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.topbar h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.topbar .muted {
  font-size: 0.92rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.upgrade-topbar {
  max-width: var(--maxw);
  margin: 0 auto 10px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 2px 0;
}

/* =========================
   AUTH
========================= */
.brand {
  text-align: center;
  margin-bottom: 18px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #edf7f2;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 1.6rem;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

/* =========================
   FORMS
========================= */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(6, 125, 95, 0.45);
  box-shadow: 0 0 0 4px rgba(6, 125, 95, 0.08);
}

.field small {
  font-size: 0.82rem;
}

.row-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.grid-2 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.filters {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

/* =========================
   BUTTONS
========================= */
.btn {
  appearance: none;
  border: 1px solid transparent;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.btn:active {
  transform: translateY(1px);
}

.btn.full {
  width: 100%;
}

.btn.small {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 12px;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(6, 125, 95, 0.18);
}

.btn.primary:hover {
  background: #056a50;
}

.btn.warning {
  background: var(--warning);
  color: #1e1e1e;
}

.btn.ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.ghost:hover {
  background: #f7faf8;
}

.btn.warning,
.btn.primary,
.btn.ghost {
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

/* =========================
   SIDEBAR
========================= */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 20, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 70;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  padding: 18px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 30px rgba(20, 53, 45, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  z-index: 80;
}

.sidebar .logo {
  width: 100%;
  height: auto;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 800;
  margin-bottom: 14px;
  justify-content: flex-start;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav a {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid transparent;
  background: #fff;
}

.nav a:hover,
.nav a.active {
  border-color: var(--line);
  background: #f7faf8;
}

/* =========================
   DASHBOARD META
========================= */
.dashboard-meta-stack {
  margin-bottom: 16px;
}

.greeting-card,
.level-card,
.location-card {
  padding: 16px;
}

.greeting-copy h3 {
  margin: 4px 0 6px;
  font-size: 1.35rem;
}

.greeting-copy p {
  margin: 0;
}

.section-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf7f2;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.quota-title {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.quota-plan {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}

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

.meta-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfb 100%);
  box-shadow: var(--shadow-soft);
}

.location-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.location-list div,
.profile-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.location-list span,
.profile-row span {
  color: var(--muted);
  flex: 0 0 auto;
}

.location-list strong,
.profile-row strong {
  text-align: right;
  word-break: break-word;
}

/* =========================
   DASHBOARD CARDS
========================= */
.dashboard-hero {
  padding: 16px;
  margin-bottom: 14px;
}

.dashboard-hero-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.dashboard-hero h3 {
  margin: 0;
  font-size: 1.2rem;
}

.hero-badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f1f7f4;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.info-card {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.info-label {
  color: var(--muted);
  font-size: 0.88rem;
}

.info-card strong {
  font-size: 1.4rem;
}

.age-card,
.condition-card {
  min-height: 145px;
}

.radio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(8, 50, 37, 0.04);
  cursor: pointer;
  user-select: none;
}

.pill-radio input {
  accent-color: var(--primary);
  margin: 0;
}

.condition-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fcf9;
  border: 1px solid var(--line);
  font-weight: 700;
}

.care-needed-card {
  margin-bottom: 14px;
  padding: 18px;
  border-left: 5px solid var(--primary);
}

.care-type-grid .pill-radio {
  border-radius: 14px;
}

.modalout-card {
  margin-bottom: 14px;
}

.dashboard-progress-card {
  padding: 16px;
  margin-bottom: 14px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #edf1ef;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.section-head {
  margin-bottom: 12px;
}

.summary-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.summary-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

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

.summary-list strong {
  text-align: right;
}

/* =========================
   TABLES
========================= */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.compact-table {
  min-width: 560px;
}

.table thead th {
  text-align: left;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}

.table tbody tr:hover {
  background: #fafdfb;
}

.table .actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* =========================
   STEP CARDS
========================= */
.step-card {
  padding: 18px;
}

.step-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf8f2;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.step-card h3 {
  margin: 0;
}

.step-card p {
  margin: 4px 0 0;
}

.sticky-save-bar {
  position: sticky;
  bottom: calc(var(--bottom-nav-h) + 10px);
  z-index: 20;
}

/* =========================
   DETAIL SLIDE
========================= */
.detail-row td {
  padding: 0;
  border-bottom: 0;
}

.slide-panel {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
  padding: 0 14px;
  background: #fff;
}

.detail-row.show .slide-panel {
  max-height: 1200px;
  opacity: 1;
  padding: 14px;
}

.detail-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(8, 50, 37, 0.05);
  padding: 14px;
}

.detail-box h4 {
  margin: 0 0 10px;
}

.detail-box .summary-list {
  margin-top: 10px;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.meta-item {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fcf9;
}

.meta-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.meta-item strong {
  display: block;
  word-break: break-word;
}

/* =========================
   PROFILE / SETTINGS
========================= */
.profile-card,
.setting-card {
  min-height: 100%;
}

.profile-card,
.setting-card {
  padding: 16px;
}

.profile-card h3,
.setting-card h3 {
  margin: 0 0 12px;
}

.profile-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.profile-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* =========================
   MODALS
========================= */
.modal,
.tb-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(12, 27, 23, 0.52);
}

.modal-box,
.tb-modal-content {
  width: min(96vw, 780px);
  max-height: min(90vh, 920px);
  overflow: auto;
}

.tb-modal-content {
  width: min(96vw, 900px);
}

.tb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tb-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

.upgrade-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.plan-card {
  padding: 18px;
  box-shadow: none;
}

.plan-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.plan-card p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.plan-card ul {
  margin: 0 0 16px 18px;
  padding: 0;
}

.plan-card.premium {
  border-color: rgba(6, 125, 95, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf8 100%);
}

/* =========================
   BOTTOM NAV
========================= */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.bottom-nav-btn {
  min-height: 54px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text);
  cursor: pointer;
}

.bottom-nav-btn.active {
  border-color: rgba(6, 125, 95, 0.22);
  background: #edf7f2;
  color: var(--primary);
}

.bottom-nav-btn.center {
  font-size: 1.15rem;
  font-weight: 800;
}

.bottom-ico {
  font-size: 1rem;
  line-height: 1;
}

.bottom-label {
  font-size: 0.75rem;
  line-height: 1.1;
}

.fab-add-trip {
  position: fixed;
  right: 16px;
  bottom: calc(var(--bottom-nav-h) + 18px);
  z-index: 91;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 1.9rem;
  box-shadow: 0 12px 26px rgba(6, 125, 95, 0.25);
}

/* =========================
   EMPTY STATE
========================= */
.empty-dashboard {
  text-align: center;
  padding: 40px 20px;
}

.empty-dashboard h3 {
  margin-bottom: 8px;
}

.empty-dashboard p {
  color: var(--muted);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger-btn {
    min-width: 46px;
    padding: 0 12px;
  }

  .upgrade-topbar {
    justify-content: flex-start;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    padding: 10px 2px;
    margin-bottom: 10px;
  }

  .dashboard-hero-head {
    flex-direction: column;
  }

  .hero-badge {
    align-self: flex-start;
  }

  .summary-list li,
  .location-list div,
  .profile-row {
    gap: 10px;
  }

  .actions {
    justify-content: stretch;
  }

  .actions .btn {
    width: 100%;
  }

  .modal,
  .tb-modal {
    padding: 10px;
    align-items: end;
  }

  .modal-box,
  .tb-modal-content {
    width: 100%;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
  }

  .detail-actions {
    justify-content: stretch;
  }

  .detail-actions .btn {
    width: 100%;
  }

  .radio-grid {
    gap: 8px;
  }

  .pill-radio {
    width: 100%;
    justify-content: flex-start;
    border-radius: 14px;
  }

  .step-head {
    flex-direction: column;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  #main {
    margin-left: var(--sidebar-w);
    padding: 22px 22px 28px;
  }

  .page {
    max-width: none;
  }

  .topbar,
  .upgrade-topbar {
    max-width: none;
  }

  .hamburger-btn {
    display: none;
  }

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

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

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

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

  .bottom-nav {
    left: 18px;
    right: auto;
    bottom: 92px;
    width: calc(var(--sidebar-w) - 36px);
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: 0;
    backdrop-filter: none;
  }

  .bottom-nav-btn {
    min-height: 52px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 14px;
    border-radius: 14px;
    background: #fff;
  }

  .bottom-nav-btn.center {
    justify-content: center;
  }

  .bottom-nav-btn .bottom-label {
    font-size: 0.9rem;
  }

  .fab-add-trip {
    display: none;
  }

  .modal-box {
    width: min(92vw, 920px);
  }

  .detail-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #main {
    padding: 24px 28px 32px;
  }

  .summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
  }

  .summary-list li {
    border-bottom: 1px solid var(--line);
  }
}
.dashboard-core-grid {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.next-step-card {
  border: 1px solid rgba(6, 125, 95, 0.18);
  background: linear-gradient(180deg, #f7fffb 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.next-step-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

.next-step-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf7f2;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.next-step-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.next-step-card p {
  margin: 0;
}

.next-step-good {
  background: #f5fbf7;
}

.next-step-warning {
  background: #fffaf2;
  border-color: rgba(245, 166, 35, 0.25);
}

.next-step-danger {
  background: #fff7f7;
  border-color: rgba(217, 83, 79, 0.18);
}

.next-step-card .step-badge {
  margin-bottom: 8px;
}

.dashboard-core-grid .condition-card,
.dashboard-core-grid .age-card {
  min-height: 180px;
}

.condition-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fcf9;
  border: 1px solid var(--line);
  font-weight: 700;
}

.care-needed-card {
  margin: 0 0 14px;
  padding: 18px;
  border-left: 5px solid var(--primary);
}

.care-type-grid {
  margin-top: 10px;
}

.care-type-grid .pill-radio {
  border-radius: 14px;
}

#dashQuickCareCard .actions {
  justify-content: flex-end;
  margin-top: 14px;
}

#dashQuickCareCard .row-inline {
  justify-content: space-between;
}

#dashPhotoName {
  word-break: break-word;
}

@media (min-width: 768px) {
  .dashboard-core-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-core-grid .age-card,
  .dashboard-core-grid .condition-card,
  .dashboard-core-grid .next-step-card {
    min-height: 220px;
  }
}

@media (max-width: 767px) {
  .next-step-head {
    flex-direction: column;
  }

  .status-chip {
    align-self: flex-start;
  }

  .care-type-grid .pill-radio {
    width: 100%;
    justify-content: flex-start;
  }

  .next-step-actions {
    flex-direction: column;
  }

  .next-step-actions .btn {
    width: 100%;
  }
}
body[data-page="pageDashboard"] .dashboard-only {
  display: block;
}

body:not([data-page="pageDashboard"]) .dashboard-only {
  display: none !important;
}

.dashboard-core-grid {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.next-step-card {
  border: 1px solid rgba(6, 125, 95, 0.18);
  background: linear-gradient(180deg, #f7fffb 0%, #ffffff 100%);
  position: relative;
  overflow: hidden;
}

.next-step-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

.next-step-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf7f2;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.next-step-actions {
  justify-content: flex-start;
  margin-top: 14px;
}

.condition-message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fcf9;
  border: 1px solid var(--line);
  font-weight: 700;
}

.care-needed-card {
  margin: 0 0 14px;
  padding: 18px;
  border-left: 5px solid var(--primary);
}

.care-type-grid {
  margin-top: 10px;
}

.care-type-grid .pill-radio {
  border-radius: 14px;
  padding: 8px 10px;
}

.radio-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.pill-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1;
}

.pill-radio input {
  width: 16px;
  height: 16px;
  margin: 0;
  transform: none;
}

.progress-meta-stack {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.member-placeholder,
.dashboard-placeholder {
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  background: #fafdfb;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

@media (min-width: 768px) {
  .dashboard-core-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .care-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-core-grid .age-card,
  .dashboard-core-grid .condition-card,
  .dashboard-core-grid .next-step-card {
    min-height: 220px;
  }
}

@media (max-width: 767px) {
  .next-step-head {
    flex-direction: column;
  }

  .status-chip {
    align-self: flex-start;
  }

  .next-step-actions {
    flex-direction: column;
  }

  .next-step-actions .btn {
    width: 100%;
  }

  .care-type-grid .pill-radio,
  .radio-grid .pill-radio {
    width: 100%;
    justify-content: flex-start;
  }
}