/* ==========================================================================
   Medisiana — Shared UI Kit CSS
   Tema: latar krem hangat, aksen biru soft, font Poppins.
   Palet diselaraskan dengan mockup "Medisiana — UI Design" (2026-09-18).
   Ganti nilai di :root untuk reskin cepat.
   ========================================================================== */

:root {
  --accent: #2C6ECB;
  --accent-dark: #1D4E96;
  --accent-tint: #E3EEFC;
  --accent-tint-border: #DCE4EE;

  --bg: #FAF8F2;           /* latar krem hangat utama */
  --surface: #FFFFFF;      /* kartu / panel */
  --surface-muted: #F1F5F9;
  --border: #E7E2D6;
  --border-strong: #D8D2C2;

  --text: #5B6572;
  --text-strong: #1C2430;
  --text-muted: #8A93A0;
  --text-faint: #AEB6C2;

  --success: #0D9488;
  --success-tint: #E6F6F2;
  --warning: #B7791F;
  --warning-tint: #FFF3E2;
  --danger: #D64545;
  --danger-tint: #FDECEC;
  --purple: #6D28D9;
  --purple-tint: #F1E9FE;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ---------- App shell ----------
   height:100vh + overflow:hidden (not min-height) locks the shell to the
   viewport so topbar/sidebar stay put and ONLY .main-content scrolls —
   matches styles.css's .frame/.main pattern that this layout replaces. */
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-body { flex-grow: 1; display: flex; min-height: 0; overflow: hidden; }

/* Topbar */
.topbar {
  height: 76px; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 0 32px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-strong); }
.topbar .subtitle { font-size: 11.5px; color: var(--text-faint); }

/* Sidebar */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 22px 14px;
}
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px 10px; }
.sidebar .brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.sidebar .brand-name { font-size: 17px; font-weight: 800; color: var(--text-strong); letter-spacing: -0.2px; }

.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 10px;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: #F0F4FB; color: var(--text); }
.nav-link.active { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.nav-link svg { flex-shrink: 0; }

/* Main content area — the only element that actually scrolls */
.main-content { flex-grow: 1; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; min-width: 0; overflow-y: auto; overflow-x: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 10px; border: none;
  font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger-ghost { background: var(--danger-tint); color: var(--danger); border: 1px solid #F3C6C1; }
.btn-tint { background: var(--accent-tint); color: var(--accent); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer;
}
.icon-btn:hover { background: var(--bg); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; }
.card-tint { background: var(--accent-tint); border: 1px solid var(--accent-tint-border); border-radius: var(--radius-lg); padding: 20px 22px; }

/* ---------- Forms ---------- */
.field-label { font-size: 12.5px; font-weight: 600; color: #3A4A66; margin-bottom: 7px; display: block; }
.field-input {
  width: 100%; height: 46px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-muted); padding: 0 14px; font-family: 'Poppins', sans-serif; font-size: 14px; color: var(--text);
}
.field-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field-input::placeholder { color: var(--text-faint); }

/* ---------- Progress bars ---------- */
.bar-track { width: 100%; height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: var(--accent); }

/* ---------- Badges / chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-size: 11.5px; font-weight: 600; }
.chip-accent { background: var(--accent-tint); color: var(--accent); }
.chip-success { background: var(--success-tint); color: var(--success); }
.chip-warning { background: var(--warning-tint); color: var(--warning); }
.chip-purple { background: var(--purple-tint); color: var(--purple); }

/* ---------- Avatars ---------- */
.avatar {
  border-radius: 50%; color: #FFFFFF; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

/* ---------- Chat bubbles ---------- */
.bubble-user {
  align-self: flex-end; max-width: 560px; background: var(--accent); color: #FFFFFF;
  padding: 14px 18px; border-radius: 16px 16px 4px 16px; font-size: 13.5px; line-height: 1.6;
}
.bubble-ai {
  background: var(--surface); border: 1px solid var(--border); padding: 16px 18px;
  border-radius: 4px 16px 16px 16px; font-size: 13.5px; line-height: 1.7; color: #263450;
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }

/* Responsive helpers shared across migrated pages.
   Note: .sidebar's mobile off-canvas behavior (position/transform/.open) and
   .nav-toggle-btn's visibility are already fully handled by styles.css
   (which every migrated page still loads alongside this file) — don't
   redefine display/position for those here or it'll fight that mechanism. */
@media (max-width: 900px) {
  .hide-mobile { display: none !important; }
}
