/* LinsCare EHR — plain CSS, no build step. Edit this file directly and
   refresh the page to see changes — nothing to compile. */

:root {
  /* Lins Medcare brand blue, taken from the logo and website. */
  --brand: #5271FF;
  --brand-btn: #3F58E0;        /* slightly deeper, so white text on buttons stays easy to read */
  --brand-btn-hover: #3147BF;
  --brand-dark: #3F58E0;
  --brand-light: #EEF1FF;
  --urgent: #dc2626;
  --urgent-light: #fef2f2;
  --warn: #d97706;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--brand-dark); }

.topbar {
  background: white;
  border-bottom: 3px solid var(--brand);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar .brand { display: flex; align-items: center; text-decoration: none; }
.topbar .brand img { height: 54px; width: auto; display: block; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; }
.topbar nav a { text-decoration: none; color: var(--text); font-size: 0.95rem; font-weight: 600; padding: 10px 12px; }
.topbar nav a:hover { color: var(--brand-dark); }
.topbar .user { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; }

.container { max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }
.container.narrow { max-width: 480px; }

h1 { font-size: 1.5rem; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-header p { color: var(--text-muted); margin: 4px 0 0; font-size: 0.92rem; }

.card { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.card h2 { border-bottom: 1px solid var(--border); padding-bottom: 10px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat .num { font-size: 1.6rem; font-weight: 700; }
.stat .label { font-size: 0.8rem; color: var(--text-muted); }
.stat.alert .num { color: var(--urgent); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--brand-btn); background: var(--brand-btn); color: white; text-decoration: none; font-size: 0.9rem; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--brand-btn-hover); border-color: var(--brand-btn-hover); }
.btn.secondary { background: white; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--urgent); border-color: var(--urgent); }
.btn.small { padding: 5px 10px; font-size: 0.8rem; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge.ok { background: #d1fae5; color: #047857; }
.badge.muted { background: #f1f5f9; color: var(--text-muted); }
.badge.urgent { background: var(--urgent-light); color: var(--urgent); }
.badge.warn { background: #fef3c7; color: #b45309; }

form .field { margin-bottom: 14px; }
label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local],
input[type=number], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 0.95rem; font-family: inherit; background: white;
}
textarea { min-height: 80px; resize: vertical; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.alert-box { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-box.error { background: var(--urgent-light); color: var(--urgent); border: 1px solid #fecaca; }
.alert-box.success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.alert-box.info { background: var(--brand-light); color: var(--brand-dark); border: 1px solid #b6e6e1; }

.empty { color: var(--text-muted); text-align: center; padding: 30px 10px; font-size: 0.9rem; }
.muted { color: var(--text-muted); }
.small { font-size: 0.82rem; }

.timeline-item { border-left: 2px solid var(--border); padding: 4px 0 4px 16px; margin-left: 4px; margin-bottom: 14px; }
.timeline-item .when { font-size: 0.78rem; color: var(--text-muted); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-light), var(--bg)); padding: 20px; }
.login-box { background: white; border-radius: 12px; padding: 32px; max-width: 380px; width: 100%; box-shadow: 0 4px 20px rgba(82,113,255,0.12); border-top: 4px solid var(--brand); }
.login-box .logo { text-align: center; margin-bottom: 24px; }
.login-box .logo img { width: 150px; height: auto; display: block; margin: 0 auto 10px; }
.login-box .logo span { color: var(--text-muted); font-size: 0.85rem; }

/* ---- additions: notes, corrections, medication ---- */
.badge.info { background: var(--brand-light); color: var(--brand-dark); }
.addendum { background: #fffbeb; border-left: 3px solid var(--warn); padding: 8px 12px; margin-top: 8px; font-size: 0.85rem; border-radius: 0 6px 6px 0; }
details.addendum-form { margin-top: 8px; font-size: 0.85rem; }
details.addendum-form summary { cursor: pointer; color: var(--brand-dark); }
details.addendum-form form { margin-top: 8px; }
.note-body { white-space: normal; margin: 4px 0; }
.note-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 8px; }
.med-row { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: white; }
.med-row .med-title { font-weight: 600; }
.med-inputs { display: grid; grid-template-columns: 1.2fr 0.8fr 1.5fr; gap: 8px; margin-top: 8px; }
.other-med-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr 0.8fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 600px) { .med-inputs, .other-med-row { grid-template-columns: 1fr; } }
.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.checklist input { width: auto; }

/* ---- live-in shifts ---- */
details.entry-box { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: white; }
details.entry-box summary { cursor: pointer; padding: 12px 14px; font-weight: 600; color: var(--brand-dark); }
details.entry-box[open] { border-color: var(--brand); }
details.entry-box form { padding: 4px 14px 14px; }
.day-heading { font-size: 0.95rem; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-light); color: var(--brand-dark); }
