/* Lindcare Care Management — design system */
:root {
  --navy: #0f2e4c;
  --navy-2: #163e63;
  --teal: #0e9e8e;
  --teal-dark: #0b8577;
  --teal-soft: #e3f5f3;
  --gold: #e8a33d;
  --bg: #f4f7fa;
  --card: #ffffff;
  --ink: #1c2b3a;
  --muted: #64748b;
  --line: #e3e9f0;
  --red: #d64545;
  --red-soft: #fdecec;
  --green: #1f9d55;
  --green-soft: #e6f6ec;
  --amber-soft: #fdf3e3;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 46, 76, .07), 0 8px 24px rgba(15, 46, 76, .06);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: var(--teal); text-decoration: none; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px;
  background: linear-gradient(135deg, var(--teal) 0%, #14b8a6 100%);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 19px;
  box-shadow: 0 4px 12px rgba(14, 158, 142, .35);
}
.brand-name { font-weight: 800; letter-spacing: .5px; font-size: 17px; }
.brand-tag { font-size: 11.5px; color: var(--muted); margin-top: -2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 10px; padding: 11px 18px; font-size: 14.5px; font-weight: 600;
  background: var(--teal); color: #fff; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--teal-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #eef2f6; color: var(--ink); }
.btn.secondary:hover { background: #e3e9f0; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #b93a3a; }
.btn.ghost { background: transparent; color: var(--muted); padding: 8px 10px; }
.btn.ghost:hover { background: #eef2f6; color: var(--ink); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 158, 142, .14);
}
.field textarea { resize: vertical; min-height: 76px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* Cards, tables, badges */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: #b47716; }
.badge.blue { background: #e7f0fb; color: #2563a8; }
.badge.grey { background: #eef2f6; color: var(--muted); }
.badge.teal { background: var(--teal-soft); color: var(--teal-dark); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 46, 76, .45); display: none;
  align-items: flex-start; justify-content: center; padding: 4vh 16px; z-index: 100; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 560px;
  box-shadow: 0 24px 60px rgba(15, 46, 76, .3); animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin-bottom: 16px; font-size: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* Toast */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 14px;
  font-weight: 600; box-shadow: var(--shadow); transition: transform .25s ease; z-index: 200; max-width: 90vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--red); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }
.empty .big { font-size: 34px; margin-bottom: 8px; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--teal); }
.stat.gold::before { background: var(--gold); }
.stat.navy::before { background: var(--navy); }
.stat.red::before { background: var(--red); }
.stat .num { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 3px; }
