/* Texas Bone Health Specialists — LIMFA
   White ground, black Poppins, #027379 accent. */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --ink: #000000;
  --ink-60: #5a5a5a;
  --ink-40: #8b8b8b;
  --paper: #ffffff;
  --rule: #e4e4e4;
  --rule-soft: #f1f1f1;
  --teal: #027379;
  --teal-dark: #015b60;
  --teal-tint: #e6f1f2;
  --teal-wash: #f4f9f9;
  --warn: #b26a00;
  --warn-tint: #fdf3e4;
  --stop: #a41f1f;
  --stop-tint: #fbecec;
  --go: #1f6b3a;
  --go-tint: #ebf5ef;
  --r: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  --sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.015em; margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; max-width: 72ch; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 12.5px; color: var(--ink-60); }

::selection { background: var(--teal); color: #fff; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 3px; }

/* ---------- controls ---------- */

button, input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }

input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=time], input[type=number], input[type=password], input[type=search],
select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}
input::placeholder, textarea::placeholder { color: var(--ink-40); }
textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 5px; color: var(--ink-60); }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink); color: #fff;
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--teal); border-color: var(--teal); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn.teal { background: var(--teal); border-color: var(--teal); }
.btn.teal:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: #fff; color: var(--teal); border-color: var(--teal); }
.btn.danger { background: #fff; color: var(--stop); border-color: #e8c9c9; }
.btn.danger:hover { background: var(--stop); color: #fff; border-color: var(--stop); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }

/* ---------- surfaces ---------- */

.card {
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: #fff;
  padding: 20px;
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 100px;
  font-size: 11.5px; font-weight: 500; line-height: 1.7;
  background: var(--rule-soft); color: var(--ink-60);
  white-space: nowrap;
}
.pill.teal { background: var(--teal-tint); color: var(--teal-dark); }
.pill.go { background: var(--go-tint); color: var(--go); }
.pill.warn { background: var(--warn-tint); color: var(--warn); }
.pill.stop { background: var(--stop-tint); color: var(--stop); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-60);
  padding: 0 12px 8px; border-bottom: 1px solid var(--rule);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
tbody tr:hover { background: var(--teal-wash); }
tbody tr.is-selected { background: var(--teal-tint); }

.empty {
  border: 1px dashed var(--rule);
  border-radius: var(--r);
  padding: 34px 20px;
  text-align: center;
  color: var(--ink-60);
}
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 4px; }

.note {
  border-left: 2px solid var(--teal);
  background: var(--teal-wash);
  padding: 10px 14px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13.5px;
}
.note.warn { border-color: var(--warn); background: var(--warn-tint); }

.money { font-variant-numeric: tabular-nums; font-weight: 500; }
.strike { text-decoration: line-through; color: var(--ink-40); font-weight: 400; }

/* ---------- modal ---------- */

.scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 90;
}
.modal {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow);
  width: min(640px, 100%); max-height: 88vh; overflow: auto;
}
.modal.wide { width: min(880px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-body { padding: 22px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 22px; border-top: 1px solid var(--rule);
  position: sticky; bottom: 0; background: #fff;
}
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-40); padding: 4px; }
.x:hover { color: var(--ink); }

/* ---------- toast ---------- */

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r);
  font-size: 13.5px; box-shadow: var(--shadow); max-width: 340px;
}
.toast.err { background: var(--stop); }
.toast.ok { background: var(--teal); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
