/* Tide Care UI foundation. Brand: blue #1666FE on #F5F7FA, ink #0B1F3A. */
:root {
  --blue: #1666fe; --blue-600: #0f52d6; --blue-50: #eef4ff; --blue-100: #dbe7ff;
  --ink: #0b1f3a; --ink-2: #33445e; --muted: #6b7a90; --line: #e3e8ef; --line-2: #eef1f5;
  --bg: #f5f7fa; --card: #fff;
  --ok: #17703f; --ok-bg: #e8f7ee; --warn: #b4470b; --warn-bg: #fff1e6; --bad: #b42318; --bad-bg: #fee4e2;
  --info: #1666fe; --info-bg: #eef4ff; --muted-bg: #f0f2f5;
  --r: 12px; --r-sm: 8px;
  --shadow: 0 1px 2px rgba(11, 31, 58, .06), 0 1px 3px rgba(11, 31, 58, .06);
  --shadow-lg: 0 12px 32px rgba(11, 31, 58, .16);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: var(--r-sm); padding: 8px 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.danger { color: var(--bad); border-color: #f4c7c3; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { background: var(--blue-50); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 13px 18px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-body { padding: 14px 18px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.tone-ok { color: var(--ok); background: var(--ok-bg); }
.tone-warn { color: var(--warn); background: var(--warn-bg); }
.tone-bad { color: var(--bad); background: var(--bad-bg); }
.tone-info { color: var(--info); background: var(--info-bg); }
.tone-muted { color: var(--muted); background: var(--muted-bg); }

/* Tables */
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #f8faff; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
label.f { display: grid; gap: 5px; font-weight: 600; font-size: 13px; }
label.f > span.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; background: #fff; font-weight: 400; }
textarea.in { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--blue); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }

/* Notices */
.note { border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }
.note b { font-weight: 650; }
.problem { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--warn-bg); color: #7a2e05; font-size: 13px; }
.problem.hard { background: var(--bad-bg); color: #7a1610; }

/* Avatar */
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-100); color: var(--blue-600); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }

/* Progress bar */
.bar { height: 7px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.bar.warn > i { background: #f79009; } .bar.bad > i { background: var(--bad); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(11, 31, 58, .38); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: min(680px, 100%); }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 16px 20px 20px; display: grid; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; }
.x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.x:hover { background: var(--bg); }

/* Toast */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; width: min(440px, calc(100% - 24px)); }
.toast { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: tin .18s ease-out; }
.toast.bad { background: var(--bad); } .toast.ok { background: var(--ok); } .toast.warn { background: var(--warn); }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }

.empty { padding: 28px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.sandbox { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6941c6; background: #f4f0ff; padding: 2px 8px; border-radius: 6px; }
.demo-ribbon { background: #0b1f3a; color: #c9d6ea; font-size: 12px; text-align: center; padding: 6px 12px; }
.demo-ribbon b { color: #fff; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; justify-content: center; padding: 60px; }
