/* ─────────────────────────────────────────────────────────────
   통합돌봄 — Design tokens (Warm Care palette)
   ───────────────────────────────────────────────────────────── */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  /* Palette — warm beige/orange + soft green */
  --bg: #FAF6EE;
  --bg-sub: #F4EEDF;
  --bg-deep: #ECE3CF;
  --surface: #FFFFFF;
  --surface-2: #FBF7EE;

  --ink-1: #2A241F;      /* primary text */
  --ink-2: #4F4740;      /* secondary text */
  --ink-3: #8A8079;      /* muted */
  --ink-4: #C6BDB1;      /* very muted */

  --border: #E8DFC9;
  --border-soft: #F1E9D5;

  /* Brand colors */
  --orange-50:  #FCEEE3;
  --orange-100: #F9DDC4;
  --orange-300: #EFB287;
  --orange-500: #E8825B;     /* primary */
  --orange-600: #D26A44;
  --orange-700: #A8512F;

  --green-50:  #E8F1EA;
  --green-100: #D2E5D7;
  --green-300: #9BC3A6;
  --green-500: #6FA88F;      /* secondary */
  --green-600: #4F8A72;
  --green-700: #356554;

  --rose-50:  #F8E0DD;
  --rose-100: #F2C9C3;
  --rose-300: #DC8B82;
  --rose-500: #C9594F;       /* danger */
  --rose-600: #A8453C;
  --rose-700: #823129;

  --amber-50:  #F9EEDA;
  --amber-100: #F2DFB6;
  --amber-300: #E5BF72;
  --amber-500: #D9A24A;      /* warning */
  --amber-600: #B07F2E;
  --amber-700: #8A6326;

  --sky-50:  #E4ECF4;
  --sky-100: #C9D7E5;
  --sky-300: #92AAC6;
  --sky-500: #5C82A8;        /* info */
  --sky-600: #436A8E;
  --sky-700: #2F4F6E;

  --ink-50: #F1ECDE;
  --ink-100: #E3DCC8;

  /* Type */
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radius / shadow */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(42,36,31,.04), 0 1px 1px rgba(42,36,31,.03);
  --shadow-md: 0 4px 12px rgba(42,36,31,.06), 0 1px 3px rgba(42,36,31,.04);
  --shadow-lg: 0 18px 40px rgba(42,36,31,.10), 0 4px 12px rgba(42,36,31,.06);
}

* { box-sizing: border-box; }

.app {
  font-family: var(--font-sans);
  color: var(--ink-1);
  background: var(--bg);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.01em;
  font-feature-settings: "ss06" 1;
  -webkit-font-smoothing: antialiased;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-weight: 600; border: 1px solid transparent; cursor: pointer;
  border-radius: 10px; transition: all .15s; white-space: nowrap; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-md { padding: 9px 16px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn-primary { background: var(--orange-500); color: #fff; }
.btn-primary:hover { background: var(--orange-600); }
.btn-secondary { background: var(--green-500); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-1); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-sub); }
.btn-soft { background: var(--orange-50); color: var(--orange-700); }

/* ── Cards / surfaces ────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-pad-lg { padding: 26px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; font-size: 11px; font-weight: 600; border-radius: 999px; line-height: 1.4; }
.badge-orange { background: var(--orange-50); color: var(--orange-700); }
.badge-green  { background: var(--green-50);  color: var(--green-700); }
.badge-rose   { background: var(--rose-50);   color: var(--rose-500); }
.badge-amber  { background: var(--amber-50);  color: #8a6326; }
.badge-sky    { background: var(--sky-50);    color: var(--sky-500); }
.badge-gray   { background: #F1ECDE;          color: var(--ink-2); }
.dot { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }

/* ── Inputs ──────────────────────────────────────────────── */
.input, .select {
  font-family: inherit; font-size: 13px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--ink-1); width: 100%;
}
.input::placeholder { color: var(--ink-3); }
.label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; display: block; }

/* ── Generic typography helpers ──────────────────────────── */
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── App shell ───────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; height: 100%; overflow: hidden; }
.sidebar { background: linear-gradient(180deg, #2A241F 0%, #1F1A16 100%); color: #EFE5D4; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--orange-500); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.12); }
.brand-name { font-weight: 800; font-size: 15px; color: #fff; letter-spacing: -0.01em; }
.brand-sub { font-size: 10px; color: #A89A7C; margin-top: -2px; letter-spacing: 0.04em; }

.nav-group { font-size: 10px; font-weight: 700; color: #6E6253; letter-spacing: 0.1em; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 13px; color: #D4C9B2; cursor: pointer; }
.nav-item:hover { background: rgba(255,255,255,.04); }
.nav-item.active { background: rgba(232,130,91,.16); color: #FBD9C2; }
.nav-item .ico { width: 16px; height: 16px; opacity: 0.85; }
.nav-item .count { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.08); color: #D4C9B2; font-variant-numeric: tabular-nums; }
.nav-item.active .count { background: var(--orange-500); color: #fff; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border-soft); }
.searchbar { flex: 1; max-width: 480px; position: relative; }
.searchbar input { padding-left: 36px; background: var(--bg-sub); border-color: transparent; }
.searchbar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

.main { flex: 1; overflow: auto; padding: 24px; background: var(--bg); }

.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 4px; }

.kpi { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.kpi .lbl { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.kpi .val { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 11px; font-weight: 600; }
.kpi .delta.up { color: var(--green-600); }
.kpi .delta.down { color: var(--rose-500); }

/* ── Table ───────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; padding: 11px 14px; font-weight: 600; font-size: 11px; color: var(--ink-3); background: var(--bg-sub); letter-spacing: 0.02em; }
.tbl td { padding: 13px 14px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:hover td { background: var(--surface-2); }

/* ── Avatar ──────────────────────────────────────────────── */
.avatar { width: 32px; height: 32px; border-radius: 999px; background: linear-gradient(135deg, var(--orange-300), var(--orange-500)); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.avatar.green { background: linear-gradient(135deg, var(--green-300), var(--green-500)); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }

/* ── Misc ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border-soft); }
hr { border: 0; border-top: 1px solid var(--border-soft); margin: 16px 0; }

.bar { height: 6px; border-radius: 999px; background: var(--bg-deep); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--orange-500); }
.bar.green > span { background: var(--green-500); }
.bar.rose  > span { background: var(--rose-500); }

/* scrollbar hide inside artboards */
.app *::-webkit-scrollbar { display: none; }
.app * { scrollbar-width: none; }
