/* ===== Dorsain's Family Care — Phase 1 styles ===== */
:root {
  --brand:        #2e5b9c;   /* Dorsain's script blue */
  --brand-deep:   #22467a;
  --brand-soft:   #dbe6f5;
  --accent:       #e0342a;   /* heart red */
  --accent-soft:  #fbe0de;
  --ink:          #2f3437;   /* charcoal (FAMILY CARE LLC) */
  --muted:        #6b7683;
  --line:         #e4e8ee;
  --bg:           #eef1f6;   /* one notch deeper so the white cards visibly lift off the page */
  --card:         #ffffff;
  --danger:       #d12a1f;
  --ok:           #16a34a;
  --shadow:       0 1px 2px rgba(34,70,122,.05), 0 6px 18px rgba(34,70,122,.08);
  --shadow-hover: 0 2px 6px rgba(34,70,122,.08), 0 14px 32px rgba(34,70,122,.13);
  --radius:       14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
h1,h2,h3 { font-family: "Plus Jakarta Sans", system-ui, sans-serif; margin: 0; letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 22px;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.16); color: #fff;
  display: grid; place-items: center;
}
.brand-logo-img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.15rem; font-weight: 800; letter-spacing: .2px; }
.brand-sub { font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: 1.2px; }

.who-am-i { display: flex; align-items: center; gap: 12px; font-size: .82rem; }
.id-badge { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.id-name { font-weight: 800; font-size: .92rem; }
.id-role { font-size: .68rem; opacity: .8; text-transform: uppercase; letter-spacing: 1px; }
.btn-signout {
  border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff;
  padding: 7px 12px; border-radius: 10px; font-weight: 700; font-size: .8rem;
}
.btn-signout:hover { background: rgba(255,255,255,.22); }

/* ---------- Login screen ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-deep) 100%);
}
.login-screen.show { display: flex; }
.login-card {
  width: 100%; max-width: 380px; background: var(--card); border-radius: 22px;
  padding: 30px 26px; box-shadow: 0 30px 70px rgba(0,0,0,.3); animation: pop .2s ease;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-mark { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 12px; background: var(--brand-soft); color: var(--brand); }
.login-logo { width: 230px; max-width: 90%; height: auto; object-fit: contain; margin: 0 auto 4px; display: block; }
.login-title { font-size: 1.3rem; color: var(--brand-deep); }
.login-sub { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
.login-btn { width: 100%; padding: 13px; font-size: 1rem; margin-top: 4px; }
.login-error { color: var(--danger); font-size: .82rem; font-weight: 700; text-align: center; min-height: 18px; margin: 8px 0 0; }
.login-error.is-success { color: var(--brand-deep); }
.forgot-line { text-align: right; margin: 8px 2px 0; }
.forgot-line a { color: var(--brand); font-size: .78rem; font-weight: 700; text-decoration: none; }
.forgot-line a:hover { text-decoration: underline; }
.login-hint { color: var(--muted); font-size: .74rem; text-align: center; margin: 14px 0 0; }

.login-hint a { color: var(--brand); font-weight: 800; text-decoration: none; }
.login-hint a:hover { text-decoration: underline; }
.pending-emoji { font-size: 3rem; }

/* pending approvals in Team tab */
.pending-box { background: #fff9f0; border: 1px solid #f2d9b3; border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.pending-title { font-size: .95rem; color: #92600a; margin-bottom: 10px; }
.pending-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid #f2e2c8; }
.pending-row:first-of-type { border-top: none; }
.pending-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pending-actions .btn-primary { padding: 7px 14px; font-size: .82rem; }

/* role-based hiding */
body.role-staff [data-access="admin"] { display: none !important; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px; padding: 0 14px;
  background: var(--card); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  border: none; background: none; padding: 14px 16px;
  font-size: .92rem; font-weight: 700; color: var(--muted);
  border-bottom: 3px solid transparent; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab-ico { font-size: 1.05rem; line-height: 1; }
.tab:hover { color: var(--brand); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Layout ---------- */
.content { padding: 22px; max-width: 1200px; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1;transform:none;} }

.view-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.week-label { font-size: 1.25rem; color: var(--brand-deep); }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--brand); color: #fff; border: none;
  padding: 10px 16px; border-radius: 11px; font-weight: 800; font-size: .9rem;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .95rem;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger {
  background: #fff; color: var(--danger); border: 1px solid #f3c9c9;
  padding: 9px 14px; border-radius: 10px; font-weight: 700;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

/* ---------- Week nav ---------- */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav .btn-ghost { min-width: 40px; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.legend-dot { width: 12px; height: 12px; border-radius: 4px; }

.hint { font-size: .8rem; color: var(--muted); margin: 4px 0 14px; }

/* focus bar (admin viewing one caregiver) */
.focus-bar { display: flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand-deep); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: .88rem; }
.focus-bar #clearFocusBtn { margin-left: auto; }

/* tap-to-move mode */
.move-bar { display: flex; align-items: center; gap: 8px; background: #fff4e6; color: #92600a; border: 1px solid #f2d9b3; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: .9rem; font-weight: 700; }
.move-bar #cancelMoveBtn { margin-left: auto; }
#calendar.move-mode .chip, #calendar.move-mode .shift { pointer-events: none; }
#calendar.move-mode .month-cell, #calendar.move-mode .day-col { cursor: pointer; outline: 2px dashed transparent; }
#calendar.move-mode .month-cell:hover, #calendar.move-mode .day-col:hover { outline-color: var(--brand); background: var(--brand-soft); }
#calendar.move-mode .mc-add, #calendar.move-mode .day-add { display: none; }
.name-link, .avatar-btn { cursor: pointer; }
.name-link:hover { text-decoration: underline; }
.avatar-btn:hover { filter: brightness(1.08); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- View head extras ---------- */
.head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-toggle { display: inline-flex; background: #eef1f6; border-radius: 10px; padding: 3px; }
.cal-toggle button {
  border: none; background: none; padding: 7px 14px; border-radius: 8px;
  font-weight: 800; font-size: .85rem; color: var(--muted);
}
.cal-toggle button.is-active { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }

/* ---------- Month grid ---------- */
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px;
}
.cal-weekday {
  text-align: center; font-size: .72rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px; padding: 4px 0;
}
.cal-month {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
}
.month-cell {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  min-height: 108px; min-width: 0; overflow: hidden; padding: 6px;
  display: flex; flex-direction: column; gap: 4px;
  transition: background .15s, border-color .15s;
}
.month-cell.other-month { background: #fafbfc; }
.month-cell.other-month .mc-date { color: #c3cbd6; }
.month-cell.is-today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.month-cell.drag-over { background: var(--brand-soft); border-color: var(--brand); }
.mc-head { display: flex; align-items: center; justify-content: space-between; }
.mc-date { font-size: .82rem; font-weight: 800; color: var(--ink); }
.month-cell.is-today .mc-date {
  background: var(--brand); color: #fff; border-radius: 50%;
  width: 22px; height: 22px; display: grid; place-items: center; font-size: .74rem;
}
.mc-add { border: none; background: none; color: var(--muted); font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.mc-add:hover { color: var(--brand); }
.mc-body { display: flex; flex-direction: column; gap: 3px; overflow: hidden; min-width: 0; }
.chip {
  border-radius: 5px; padding: 2px 5px; color: #fff; font-size: .72rem; font-weight: 600;
  cursor: pointer; overflow: hidden; white-space: nowrap;
  display: flex; align-items: center; gap: 4px; line-height: 1.35;
  user-select: none; -webkit-user-select: none;
}
.chip.dragging { opacity: .4; }
.chip-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip-time { font-weight: 700; font-size: .62rem; background: rgba(0,0,0,.18); padding: 0 3px; border-radius: 3px; flex: 0 0 auto; }
.mc-more { font-size: .68rem; color: var(--muted); font-weight: 700; padding-left: 2px; }
.mc-more-btn { cursor: pointer; }
.mc-more-btn:hover { color: var(--brand); text-decoration: underline; }
.mc-date-btn { cursor: pointer; border-radius: 6px; padding: 0 3px; }
.mc-date-btn:hover { background: var(--brand-soft); color: var(--brand-deep); }

/* day view popup */
.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #fbfdfc; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: pointer; font-family: inherit; }
.day-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.day-row-time { font-weight: 800; font-size: .82rem; color: var(--brand-deep); white-space: nowrap; min-width: 92px; }
.day-row-who { display: flex; flex-direction: column; gap: 3px; }
.dr-line { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; }
.dr-client { font-weight: 600; color: var(--muted); }

/* time-off blocks (vacation / off / sick) — distinct muted look */
.timeoff { background: repeating-linear-gradient(45deg, #eef1f6, #eef1f6 6px, #e4e8ee 6px, #e4e8ee 12px); color: #5a6572; border: 1px dashed #c3ccd6; cursor: pointer; }
.timeoff-chip { border-radius: 6px; padding: 2px 6px; font-size: .7rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeoff-card { border-radius: 9px; padding: 7px 9px; font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.timeoff .to-emoji { font-size: 1rem; }
.timeoff:hover { border-color: var(--muted); }

/* floating copy that follows the finger/mouse while dragging a shift */
.drag-ghost {
  position: fixed; z-index: 200; pointer-events: none; opacity: .92;
  transform: translate(-50%, -120%); box-shadow: 0 8px 24px rgba(0,0,0,.28);
  border-radius: 8px;
}

/* ---------- Week calendar ---------- */
.calendar {
  display: grid; grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 10px;
}
.day-col {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 220px; display: flex; flex-direction: column; overflow: hidden;
  transition: background .15s, border-color .15s;
}
.day-col.drag-over { background: var(--brand-soft); border-color: var(--brand); }
.day-col.is-today .day-head { background: var(--brand-soft); }
.day-head {
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between;
}
.day-name { font-weight: 800; font-size: .8rem; color: var(--brand-deep); text-transform: uppercase; letter-spacing: .5px; }
.day-date { font-size: .78rem; color: var(--muted); font-weight: 700; }
.day-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.day-add {
  margin-top: auto; border: 1px dashed var(--line); background: none; color: var(--muted);
  border-radius: 9px; padding: 6px; font-weight: 700; font-size: .8rem;
}
.day-add:hover { border-color: var(--brand); color: var(--brand); }

/* Shift card */
.shift {
  border-radius: 10px; padding: 8px 10px; color: #fff; cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,.12); position: relative;
  border-left: 5px solid rgba(0,0,0,.18);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.shift:active { cursor: grabbing; }
.shift.dragging { opacity: .45; }
.shift-time { font-size: .72rem; font-weight: 700; opacity: .95; }
.shift-name { font-size: .9rem; font-weight: 800; line-height: 1.2; }
.shift-client { font-size: .78rem; opacity: .95; display: flex; align-items: center; gap: 4px; }
.shift.conflict::after {
  content: "⚠ overlap"; position: absolute; top: 6px; right: 6px;
  font-size: .62rem; background: rgba(0,0,0,.28); padding: 1px 5px; border-radius: 6px;
}

/* ---------- Needs attention (owner) ---------- */
.needs-attn { margin-bottom: 16px; }
.needs-attn:empty { display: none; }
.na-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase;
  color: #9a3412; margin: 2px 2px 10px;
}
.na-head i { font-size: 1.15rem; color: var(--accent); }
.na-count {
  margin-left: 2px; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem;
}
.na-list { display: flex; flex-direction: column; gap: 10px; }
.na-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 13px 14px; box-shadow: var(--shadow);
}
.na-item.na-warn { border-left-color: #e0a41f; background: linear-gradient(90deg, #fff9ec 0%, var(--card) 55%); }
.na-item.na-bad  { border-left-color: var(--accent); background: linear-gradient(90deg, #fdeeed 0%, var(--card) 55%); }
.na-ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.na-warn .na-ico { background: #fdf0d3; color: #b7791f; }
.na-bad  .na-ico { background: #fbdedb; color: var(--accent); }
.na-main { flex: 1; min-width: 0; }
.na-title { font-weight: 800; font-size: .92rem; color: #1f2937; line-height: 1.25; }
.na-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.na-btn {
  flex: 0 0 auto; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .82rem;
  padding: 9px 15px; border-radius: 10px; white-space: nowrap;
}
.na-btn:hover { filter: brightness(1.06); }
.na-btn-ghost { background: #fff; color: var(--brand-deep); border: 1px solid var(--line); }
.na-clear {
  display: flex; align-items: center; gap: 10px;
  background: #f0fbf4; border: 1px solid #bfe6cd; color: #166534;
  border-radius: 14px; padding: 13px 16px; font-weight: 600; font-size: .9rem;
}
.na-clear i { font-size: 1.35rem; }

/* ---------- Time clock ---------- */
.clock-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }
.card-title { font-size: 1.05rem; color: var(--brand-deep); margin-bottom: 12px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.punch-card { text-align: center; }
.punch-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.punch-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: .8rem;
}
.punch-headtext { text-align: left; line-height: 1.3; }
.punch-eyebrow { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.punch-who { display: block; color: var(--ink); font-size: .9rem; font-weight: 600; margin: 0; }
.punch-who strong { font-weight: 800; }

.punch-ring {
  width: 172px; height: 172px; border-radius: 50%; margin: 4px auto 18px;
  border: none; cursor: pointer; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  transition: transform .1s ease, box-shadow .18s ease, filter .15s ease;
}
.punch-ring:active { transform: scale(.97); }
.punch-ring-ico { font-size: 2.7rem; line-height: 1; }
.punch-ring-lbl { font-size: 1.18rem; font-weight: 800; letter-spacing: .01em; }
.punch-ring.punch-in  { background: var(--ok);     box-shadow: 0 0 0 8px rgba(34,160,90,.13),  0 14px 30px -10px rgba(21,128,61,.55); }
.punch-ring.punch-in:hover  { filter: brightness(1.05); }
.punch-ring.punch-out { background: var(--accent); box-shadow: 0 0 0 8px rgba(224,52,42,.13), 0 14px 30px -10px rgba(224,52,42,.55); }
.punch-ring.punch-out:hover { filter: brightness(1.05); }

.punch-status {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: 999px;
  background: #eef1f5; color: var(--muted); font-weight: 800; font-size: .88rem;
}
.punch-status.on { background: #e7f7ee; color: #1a7a41; }
.punch-status.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #1fa257; animation: pulse-dot 1.6s infinite; }
.punch-timer {
  font-size: 1.7rem; font-weight: 800; color: var(--brand-deep);
  font-variant-numeric: tabular-nums; letter-spacing: .01em; margin: 10px 0 2px;
}
.punch-timer:empty { display: none; }
.gps-note { font-size: .76rem; color: var(--muted); min-height: 16px; margin-top: 8px; }
.btn-punch {
  width: 100%; border: none; padding: 18px; border-radius: 14px;
  font-size: 1.2rem; font-weight: 800; color: #fff; box-shadow: var(--shadow);
}
.btn-punch.punch-in { background: var(--ok); }
.btn-punch.punch-in:hover { background: #15803d; }
.btn-punch.punch-out { background: var(--accent); color: #fff; }
.btn-punch.punch-out:hover { filter: brightness(.95); }

.on-clock { display: flex; flex-direction: column; gap: 10px; }
.on-clock-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: #f6faf9; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.oc-name { font-weight: 800; font-size: .9rem; }
.oc-client { font-weight: 700; font-size: .78rem; color: var(--muted); }
.oc-meta { font-size: .76rem; color: var(--muted); margin-left: auto; text-align: right; }
.empty { color: var(--muted); font-size: .88rem; padding: 10px 2px; }

.hours-summary { font-size: .82rem; color: var(--muted); font-weight: 700; }
.entries-head-right { display: flex; align-items: center; gap: 10px; }
.entries-head-right .btn-ghost { padding: 6px 12px; font-size: .82rem; }
.time-entries { display: flex; flex-direction: column; gap: 0; }
.entry-group {
  font-size: .78rem; font-weight: 800; color: var(--muted);
  letter-spacing: .01em; padding: 14px 4px 6px;
}
.entry-group:first-child { padding-top: 2px; }
.entry {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 6px; border-bottom: 1px solid var(--line);
  border-radius: 10px; transition: background .12s;
}
.time-entries .entry:last-child { border-bottom: none; }
.entry-editable { cursor: pointer; }
.entry-editable:hover { background: var(--brand-soft); }
.entry-avatar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .02em;
}
.entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.entry-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.entry-name { font-weight: 800; font-size: .95rem; color: #1f2937; }
.entry-client {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%;
  font-size: .73rem; font-weight: 700; color: var(--brand-deep);
  background: var(--brand-soft); padding: 2px 9px; border-radius: 999px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-client i { font-size: .85rem; flex: 0 0 auto; }
.entry-time { display: flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); }
.entry-time i { font-size: .92rem; opacity: .65; }
.entry-arrow { font-size: .82rem !important; }
.vpill {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 1px; width: fit-content;
  font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
}
.vpill i { font-size: .88rem; }
.vpill-ok { background: #eaf7ef; color: #1a7a41; }
.vpill-bad { background: #fdeeed; color: var(--accent); }
.vpill-gray { background: #eef1f5; color: #6b7683; }
.entry-right { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.entry-hours {
  font-weight: 800; font-size: .9rem; color: var(--brand-deep); white-space: nowrap;
  background: var(--brand-soft); padding: 5px 11px; border-radius: 10px;
}
.entry-hours.is-active {
  background: #eaf7ef; color: #1a7a41; display: inline-flex; align-items: center; gap: 6px;
}
.entry-hours.is-active::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1fa257;
  animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(31,162,87,.5); }
  70% { box-shadow: 0 0 0 6px rgba(31,162,87,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,162,87,0); }
}
.entry-edit { font-size: 1.05rem; color: var(--muted); opacity: .55; }
.entry-editable:hover .entry-edit { opacity: 1; color: var(--brand); }
.fence-ok { color: #166534; font-weight: 700; }
.fence-bad { color: #9a2019; font-weight: 700; }
.loc-none { color: var(--muted); font-weight: 600; }
.loc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-status { font-size: .85rem; font-weight: 700; }
.detect-note { font-size: .88rem; font-weight: 700; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; background: #eef1f6; color: var(--muted); }
.detect-note.ok { background: #dcfce7; color: #166534; }
.detect-note.warn { background: #fff4e6; color: #92600a; }

/* ---------- Team / Clients lists ---------- */
.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; }
.person-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start;
}
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 800; font-size: .98rem; }
.person-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.person-actions { display: flex; gap: 6px; margin-top: 10px; }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 700; font-size: .8rem; padding: 2px 4px; }
.link-btn.danger { color: var(--danger); }

/* ---------- Modal ---------- */
.modal-root { position: fixed; inset: 0; display: none; z-index: 50; }
.modal-root.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(19,78,74,.35); backdrop-filter: blur(2px); }
.modal {
  position: relative; max-width: 460px; margin: 6vh auto 0; background: var(--card);
  border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0;} to {transform:none;opacity:1;} }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { color: var(--brand-deep); font-size: 1.1rem; }
.modal-close { border: none; background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); }
.modal-body { padding: 18px; max-height: 70vh; overflow-y: auto; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; font-weight: 800; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: .92rem; color: var(--ink); background: #fbfdfc;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.detail-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--muted); font-weight: 700; flex-shrink: 0; }
.detail-row strong { text-align: right; }
.role-tag { font-size: .64rem; background: var(--brand-soft); color: var(--brand-deep); padding: 2px 7px; border-radius: 999px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; vertical-align: middle; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; border: 3px solid transparent; }
.color-swatch.sel { border-color: var(--ink); }
.modal-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* ---------- Daily check-out form ---------- */
.co-intro { font-size: .9rem; color: var(--muted); margin: 0 0 14px; }
.lbl-hint { font-weight: 600; color: var(--muted); text-transform: none; letter-spacing: 0; }
.care-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.care-chip {
  border: 1.5px solid var(--line); background: #fbfdfc; color: var(--ink);
  border-radius: 10px; padding: 9px 10px; font-size: .82rem; font-weight: 700; text-align: left;
}
.care-chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1; min-width: 60px; border: 1.5px solid var(--line); background: #fbfdfc; color: var(--ink);
  border-radius: 10px; padding: 9px 8px; font-size: .85rem; font-weight: 700;
}
.seg-btn.sel { border-color: var(--brand); background: var(--brand); color: #fff; }
label.req, #co_concernsLbl.req { color: var(--danger); }
.attest { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; color: var(--ink); margin: 4px 0 14px; cursor: pointer; }
.attest input { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- Notes list ---------- */
.notes-list { display: flex; flex-direction: column; gap: 12px; }
.note-card { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.note-card.flagged { border-left-color: var(--accent); background: #fffaf9; }
.note-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.note-client { font-weight: 800; font-size: .95rem; margin-right: 8px; }
.note-by { font-size: .82rem; font-weight: 700; }
.note-date { font-size: .78rem; color: var(--muted); font-weight: 700; white-space: nowrap; }
.note-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge { font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: #eef1f6; color: var(--muted); }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.bad { background: var(--accent-soft); color: #9a2019; }
.badge.cond-good { background: #dcfce7; color: #166534; }
.badge.cond-fair { background: #fef3c7; color: #92600a; }
.badge.cond-declined { background: var(--accent-soft); color: #9a2019; }
.note-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tag { font-size: .72rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-deep); padding: 3px 8px; border-radius: 7px; }
.note-line { font-size: .85rem; color: var(--ink); margin-top: 4px; }
.note-line strong { color: var(--muted); }

/* ---------- Payroll ---------- */
.pay-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pay-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1.2fr; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pay-row:last-child { border-bottom: none; }
.pay-head { background: #f6f8fb; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pay-name { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; }
.pay-hours { font-weight: 700; color: var(--ink); }
.pay-rate { display: flex; align-items: center; gap: 4px; }
.pay-rate .dollar { color: var(--muted); font-weight: 800; }
.pay-rate input { width: 90px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-family: inherit; font-size: .9rem; background: #fbfdfc; }
.pay-rate input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.pay-total { font-weight: 800; color: var(--brand-deep); }
.pay-foot { background: #f6f8fb; font-weight: 800; }
.pay-foot .pay-total, .pay-foot span:last-child { color: var(--brand-deep); font-size: 1.05rem; }
@media (max-width: 620px) {
  .pay-row { grid-template-columns: 1.6fr .8fr 1fr 1fr; gap: 6px; padding: 10px; font-size: .85rem; }
  .pay-rate input { width: 64px; padding: 6px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--brand-deep); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: all .25s ease; z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .clock-grid { grid-template-columns: 1fr; }
  .calendar { grid-template-columns: 1fr; }   /* week view stacks */
  .day-col { min-height: auto; }
}
/* month grid stays 7 columns on phones, just more compact */
@media (max-width: 620px) {
  .cal-month, .cal-weekdays { gap: 3px; }
  .month-cell { min-height: 68px; padding: 4px; border-radius: 8px; }
  .chip { padding: 1px 4px; font-size: .6rem; border-radius: 4px; }
  .chip-time { display: none; }
  .cal-weekday { font-size: .6rem; }
  .mc-add { display: none; }
}

/* ===================== Visual polish pass ===================== */
.btn-primary, .btn-ghost, .btn-danger, .btn-signout, .link-btn, .tab, .cal-toggle button {
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .18s ease, transform .09s ease;
}
.btn-primary:active, .btn-ghost:active, .btn-danger:active, .btn-signout:active { transform: translateY(1px); }
.btn-primary { box-shadow: 0 2px 6px rgba(34,70,122,.16); }
.btn-primary:hover { box-shadow: 0 5px 14px rgba(34,70,122,.24); }

.tab { border-radius: 10px 10px 0 0; }
.tab:hover { background: rgba(46,91,156,.06); }

.card { transition: box-shadow .2s ease; }
.person-card { transition: box-shadow .18s ease, border-color .18s ease, transform .12s ease; }
.person-card:hover { box-shadow: var(--shadow-hover); border-color: var(--brand-soft); transform: translateY(-1px); }

.modal { border-radius: 18px; }
.brand-name { font-weight: 700; }

.btn-punch { transition: filter .15s ease, transform .09s ease, box-shadow .15s ease; }
.btn-punch:active { transform: translateY(1px); }
.month-cell.is-today { box-shadow: 0 0 0 2px var(--brand-soft), var(--shadow); }
.tabs { box-shadow: 0 1px 0 var(--line); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); border-color: var(--brand); }

/* ============ Native-app feel: bottom tab bar on phones ============ */
@media (max-width: 700px) {
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    gap: 2px; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line); border-bottom: none; overflow: visible;
    box-shadow: 0 -3px 14px rgba(34,70,122,.07); justify-content: space-around;
    background: var(--card);
  }
  .tab {
    flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 2px 5px; border-bottom: none; border-radius: 12px;
    font-size: .6rem; font-weight: 700;
  }
  .tab-ico { font-size: 1.35rem; }
  .tab-lbl { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab.is-active { color: var(--brand-deep); background: var(--brand-soft); border-bottom: none; }
  .content { padding: 16px 14px 92px; }
  .toast { bottom: 92px; }
  .topbar { padding: 12px 16px; }
}

/* ============ Professional refresh ============ */
.tab-ico { display: inline-flex; align-items: center; justify-content: center; }
.tab-ico i { line-height: 1; }
.tab-lbl { font-weight: 600; }

/* Flatter, cleaner app header */
.topbar { background: var(--brand); }
.brand-name { font-weight: 700; font-size: 1.08rem; }
.brand-sub { opacity: .72; font-size: .66rem; letter-spacing: 1.4px; }
.brand-mark, .brand-logo-img, .login-logo { border-radius: 12px; }

/* Consistent rounded cards */
.card, .pay-table, .note-card, .person-card, .pending-box { border-radius: 16px; }

/* Calmer, more modern weights */
.btn-primary { font-weight: 600; border-radius: 12px; }
.btn-ghost, .btn-danger, .btn-signout, .tab { font-weight: 600; }
.week-label, .card-title, .login-title { font-weight: 700; }
.badge, .pay-head, .id-name, .day-name, .cal-weekday { font-weight: 700; }

/* buttons that carry an icon line up cleanly */
.btn-primary, .btn-ghost, .btn-danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn-primary i, .btn-ghost i, .btn-danger i, .card-title i, .week-label i { font-size: 1.05em; line-height: 1; }

/* friendlier empty states */
.empty { font-weight: 500; color: var(--muted); text-align: center; padding: 22px 12px; font-size: .9rem; }
.card-title i, .week-label i { color: var(--brand); margin-right: 2px; }

/* active tab uses the heart-red accent (a subtle on-brand pop) */
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 700px) {
  .tab.is-active { color: #9a2019; background: var(--accent-soft); border-bottom: none; }
}

/* ---------- Today (home) ---------- */
.today-greeting { margin: 2px 0 16px; }
.today-greeting h2 { font-size: 1.5rem; color: var(--brand-deep); font-weight: 700; }
.today-greeting p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.today-hero { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); text-align: center; margin-bottom: 22px; }
.today-hero.on { background: #f0fbf4; border-color: #bbe7cb; }
.th-status { font-size: 1.05rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 8px; }
.today-hero.on .th-status { color: #166534; }
.th-since { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.today-hero .btn-punch { margin: 16px auto 0; max-width: 340px; }
.today-h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.today-shifts { display: flex; flex-direction: column; gap: 10px; }
.today-shift { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.ts-time { font-weight: 700; color: var(--brand-deep); font-size: 1rem; }
.ts-next { font-size: .7rem; color: var(--accent); font-weight: 800; }
.ts-client { font-size: .95rem; font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.ts-dir { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; color: var(--brand); font-size: .85rem; font-weight: 600; text-decoration: none; }
.ts-dir:hover { text-decoration: underline; }
.today-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 10px; text-align: center; box-shadow: var(--shadow); }
.tile-num { font-size: 1.8rem; font-weight: 700; color: var(--brand-deep); line-height: 1; }
.tile-lbl { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: 5px; text-transform: uppercase; letter-spacing: .4px; }
.today-rows { display: flex; flex-direction: column; gap: 8px; }
.today-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.tr-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.tr-main { flex: 1; min-width: 0; }
.tr-name { font-weight: 700; font-size: .95rem; }
.tr-sub { font-size: .8rem; color: var(--muted); }
.tr-badge { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.tr-badge.ok { background: #dcfce7; color: #166534; }
.tr-badge.done { background: #eef1f6; color: #6b7683; }
.tr-badge.upcoming { background: var(--brand-soft); color: var(--brand-deep); }
.tr-badge.late { background: var(--accent-soft); color: #9a2019; }

/* ---------- Schedule header (clear month navigation) ---------- */
.sched-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.month-nav { display: flex; align-items: center; gap: 10px; }
.navbtn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--brand-deep); display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; box-shadow: var(--shadow); flex: 0 0 auto; }
.navbtn:hover { border-color: var(--brand); color: var(--brand); }
.month-nav .week-label { font-size: 1.2rem; font-weight: 700; color: var(--brand-deep); text-align: center; margin: 0; white-space: nowrap; }
.today-btn { margin-left: auto; }
.sched-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-controls .cal-toggle { margin-right: auto; }

/* ---------- Tidier month grid on phones ---------- */
@media (max-width: 620px) {
  .month-cell { min-height: 88px; }
  .chip { padding: 1px 4px; font-size: .6rem; gap: 3px; }
  .chip-time { font-size: .56rem; }
}

/* ---------- Invoices (owner-only) ---------- */
.inv-form .field select, .inv-form .field input { width: 100%; }
.inv-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 14px; }
.inv-preview {
  display: flex; align-items: center; gap: 7px; margin-top: 8px;
  background: var(--brand-soft); color: var(--brand-deep);
  border-radius: 10px; padding: 8px 12px; font-size: .84rem; font-weight: 600;
}
.inv-preview:empty { display: none; }
.inv-preview i { font-size: 1.05rem; flex: 0 0 auto; }

.inv-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 26px 28px; max-width: 820px; margin: 0 auto 20px;
  color: #24303c;
}
.inv-head { text-align: center; margin-bottom: 18px; }
.inv-logo { display: block; width: 250px; max-width: 70%; height: auto; margin: 0 auto 8px; }
.inv-logo-sm { display: block; width: 110px; height: auto; margin: 14px 0 0; }
.inv-brand { font-size: 1.25rem; font-weight: 800; letter-spacing: .06em; color: var(--brand-deep); }
.inv-title { font-size: .95rem; font-weight: 700; color: var(--accent); margin-top: 3px; letter-spacing: .04em; }

.inv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 620px) { .inv-cols { grid-template-columns: 1fr; } }
.inv-block { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.inv-block-title {
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800;
  letter-spacing: .07em; padding: 6px 12px;
}
.inv-block .inv-kv { padding: 6px 12px; border-top: 1px solid #eef1f5; }
.inv-kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: .82rem; }
.inv-kv > span:first-child { color: var(--muted); font-weight: 600; white-space: nowrap; }
.inv-kv b { font-weight: 700; text-align: right; }
.inv-kv input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-weight: 700; text-align: right; max-width: 170px; background: #fbfdff; }

.inv-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 620px) { .inv-meta { grid-template-columns: 1fr; } }
.inv-meta .inv-kv { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.inv-rates { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.inv-rates .inv-kv { padding: 6px 12px; border-top: 1px solid #eef1f5; }

.inv-table-wrap { overflow-x: auto; margin: 8px 0 16px; }
.inv-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 560px; }
.inv-table th {
  background: var(--brand); color: #fff; font-weight: 700; font-size: .72rem;
  padding: 7px 8px; text-align: right; white-space: nowrap;
}
.inv-table th:first-child { text-align: left; }
.inv-table td { border: 1px solid #e6eaf0; padding: 5px 8px; text-align: right; }
.inv-table td:first-child { text-align: left; white-space: nowrap; }
.inv-day { font-weight: 600; }
.inv-date { color: var(--muted); font-weight: 600; font-size: .74rem; }
.inv-flag { color: #b7791f; font-size: .95rem; vertical-align: -2px; }
.inv-band td { background: #eef2f8; color: var(--brand-deep); font-weight: 800; font-size: .72rem; letter-spacing: .06em; }
.inv-table input { width: 64px; border: 1px solid transparent; border-radius: 6px; padding: 3px 5px; font: inherit; text-align: right; background: #f4f8ff; font-weight: 600; }
.inv-table input:focus { border-color: var(--brand); outline: none; background: #fff; }
.inv-due { border: none; border-bottom: 1.5px solid var(--line); border-radius: 0; padding: 2px 4px; font: inherit; font-weight: 700; background: #f4f8ff; cursor: pointer; }
.inv-due:focus { outline: none; border-bottom-color: var(--brand); background: #fff; }
.inv-hsel { width: 64px; border: 1px solid transparent; border-radius: 6px; padding: 3px 4px; font: inherit; font-weight: 600; background: #f4f8ff; cursor: pointer; }
.inv-hsel:focus { border-color: var(--brand); outline: none; background: #fff; }
.inv-kv select#invNo { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; font-weight: 700; background: #fbfdff; cursor: pointer; }
.inv-money { font-variant-numeric: tabular-nums; }
.inv-totals td { font-weight: 800; background: #f7f9fc; border-top: 2px solid var(--brand); }

.inv-summary { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-width: 360px; margin-left: auto; margin-bottom: 18px; }
.inv-summary .inv-kv { padding: 7px 12px; border-top: 1px solid #eef1f5; }
.inv-adj-wrap { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.inv-adj-wrap input { width: 90px; }
.inv-grand { background: #fdf3f2; }
.inv-grand > span:first-child { color: var(--accent); font-weight: 800; }
.inv-grand b { color: var(--accent); font-size: 1.05rem; font-weight: 800; }

.inv-footer { border-top: 1px solid var(--line); padding-top: 12px; font-size: .82rem; }
.inv-footer .inv-block-title { display: inline-block; border-radius: 6px; margin-bottom: 8px; }
.inv-footer p { margin: 3px 0; }
.inv-thanks { color: var(--muted); font-style: italic; margin-top: 10px !important; }

/* ---------- "More" tab: desktop shows every tab, phones collapse office tabs ---------- */
.tab-more { display: none; }
@media (max-width: 700px) {
  body.role-admin .tab-extra { display: none !important; }
  body.role-admin .tab-more { display: flex; }
}
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 10px; cursor: pointer; font-weight: 700; font-size: .86rem; color: var(--ink);
  font-family: inherit;
}
.more-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.more-item i { font-size: 1.5rem; color: var(--brand-deep); }
.more-item.is-here { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- Time-off requests strip (Schedule) ---------- */
#toRequests:empty { display: none; }
.tor-box {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid #e0a41f;
  border-radius: 14px; padding: 13px 15px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.tor-box.tor-mine { border-left-color: var(--brand); }
.tor-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tor-title i { font-size: 1.1rem; color: #b7791f; }
.tor-mine .tor-title i { color: var(--brand); }
.tor-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.tor-row:first-of-type { border-top: none; }
.tor-main { flex: 1; min-width: 0; }
.tor-name { font-weight: 800; font-size: .9rem; display: block; }
.tor-sub { font-size: .8rem; color: var(--muted); }
.tor-btn { padding: 7px 13px; font-size: .8rem; }
.tor-status { font-size: .74rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tor-status.pending  { background: #fdf0d3; color: #b7791f; }
.tor-status.approved { background: #e7f7ee; color: #1a7a41; }
.tor-status.denied   { background: #fdeeed; color: #9a2019; }
.ts-info { font-size: .78rem; margin-left: 6px; }
.appt-past { opacity: .55; }
.ts-appt {
  margin-top: 7px; font-size: .82rem; font-weight: 700; color: #7c3aed;
  background: #f3eefe; border-radius: 9px; padding: 6px 10px;
}
.ts-appt-note { font-weight: 500; color: #8b6fc7; }

/* language picker (staff choose their own on their device) */
.lang-row {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  margin-top: 18px; font-size: .8rem; color: var(--muted);
}
.lang-row i { font-size: 1rem; }
.lang-row button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-family: inherit; font-size: .76rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.lang-row button.sel { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand); }

/* announcements */
.ann-banner {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  background: #fff8e6; border: 1px solid #f2dfae; border-radius: 12px; padding: 11px 14px;
  font-size: .88rem; font-weight: 600; color: #7a5b12;
}
.ann-banner i, .ann-row i { font-size: 1.15rem; color: #b7791f; flex: 0 0 auto; }
.ann-banner .ann-body { flex: 1; }
.ann-admin { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.ann-row {
  display: flex; align-items: center; gap: 9px; background: var(--card);
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; font-size: .84rem;
}
.ann-row .ann-body { flex: 1; }
.ann-date { font-size: .74rem; color: var(--muted); white-space: nowrap; }
.ann-post { align-self: flex-start; }

/* care plan editor: per-task day/time scheduling */
.cpr { border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin-bottom: 9px; background: #fbfcfe; }
.cpr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.cpr-t { font-weight: 700; font-size: .86rem; }
.cpr-x { font-size: .8rem; }
.cpr-days { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.dp {
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: .72rem; font-weight: 800; padding: 5px 8px; border-radius: 999px;
}
.dp.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.dp-wide { font-size: .7rem; }
.cpr-when { display: flex; gap: 8px; align-items: center; }
.cpr-when select, .cpr-when input { border: 1.5px solid var(--line); border-radius: 9px; padding: 6px 9px; font-family: inherit; font-size: .82rem; background: #fff; }
.cpr-addrow { display: flex; gap: 8px; }
.cpr-addrow input { flex: 1; }
.cpr-addrow .btn-ghost { padding: 8px 14px; }

/* care plan checklist */
.cp-box { margin-top: 10px; background: #f6faf7; border: 1px solid #d8eadd; border-radius: 11px; padding: 10px 12px; }
.cp-title { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #1a7a41; margin-bottom: 6px; }
.cp-task { display: flex; align-items: flex-start; gap: 7px; font-size: .84rem; color: var(--ink); padding: 3px 0; }
.cp-task i { color: #1a7a41; font-size: 1rem; margin-top: 1px; flex: 0 0 auto; }
.cp-when { color: #1a7a41; font-weight: 700; font-size: .78rem; }
.cp-prn { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-top: 7px; padding-top: 6px; border-top: 1px dashed #cfe3d6; }

/* ---------- Care notes report (same letterhead family as invoices) ---------- */
.notes-report-bar { margin-bottom: 16px; }
.nr-controls { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: end; }
@media (max-width: 620px) { .nr-controls { grid-template-columns: 1fr 1fr; } }
.nr-controls .field { margin: 0; }
.nr-controls .btn-primary { height: 42px; white-space: nowrap; }
#notesReport { margin-bottom: 18px; }
#notesReport:empty { display: none; }
.nr-note { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; page-break-inside: avoid; }
.nr-note-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.nr-date { font-weight: 800; font-size: .92rem; color: var(--brand-deep); }
.nr-who { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.nr-who b { color: #24303c; }
.nr-visit { font-size: .78rem; color: #1a7a41; font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.nr-flags { font-size: .78rem; font-weight: 700; color: #1a7a41; white-space: nowrap; }
.nr-flags.bad { color: var(--accent); }
.nr-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.nr-table td { padding: 4px 8px; border: 1px solid #eef1f5; vertical-align: top; }
.nr-table td:first-child { width: 130px; color: var(--muted); font-weight: 600; white-space: nowrap; background: #fafbfd; }
.nr-attest { font-size: .72rem; color: var(--muted); margin-top: 7px; font-style: italic; }

/* ---------- Forms (protected records) ---------- */
.frm-lock { text-align: center; padding: 40px 24px; max-width: 430px; margin: 30px auto; }
.frm-lock-ico { width: 62px; height: 62px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 14px; }
.frm-lock h2 { font-size: 1.15rem; color: var(--brand-deep); margin-bottom: 6px; }
.frm-lock .btn-primary { margin-top: 14px; }
.frm-newbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.frm-new { flex: 1; min-width: 160px; justify-content: center; padding: 12px; }
.frm-list { display: flex; flex-direction: column; gap: 10px; }
.frm-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.frm-row:hover { border-color: var(--brand); }
.frm-row-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-deep); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: 0 0 auto; }
.frm-row-main { flex: 1; min-width: 0; }
.frm-row-title { font-weight: 800; font-size: .92rem; }
.frm-row-sub { font-size: .78rem; color: var(--muted); }
.frm-sheet .field { margin-bottom: 10px; }
.frm-sheet .field label { font-size: .72rem; }
.frm-sec { margin-top: 18px; }
.frm-biz { font-size: .74rem; color: var(--muted); margin-top: 4px; }
.frm-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 10px; }
.frm-chk { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.frm-chk input { width: 16px; height: 16px; accent-color: var(--brand); }
.frm-legal { font-size: .8rem; color: #3a4450; line-height: 1.55; margin: 6px 0 10px; }
.frm-inline { border: none; border-bottom: 1.5px solid var(--line); font-family: inherit; font-size: .8rem; padding: 1px 4px; background: transparent; }
.frm-grid { width: 100%; border-collapse: collapse; font-size: .78rem; margin-bottom: 8px; }
.frm-grid th { background: var(--brand); color: #fff; padding: 6px 6px; font-size: .68rem; text-align: center; }
.frm-grid th:first-child { text-align: left; }
.frm-grid td { border: 1px solid #e2e7ee; padding: 4px 6px; text-align: center; }
.frm-grid-act { text-align: left !important; font-weight: 600; }
.frm-grid input[type="radio"] { width: 15px; height: 15px; accent-color: var(--brand); }
.frm-grid-note { width: 100%; border: none; font-family: inherit; font-size: .76rem; background: transparent; }
.sig-wrap { margin: 10px 0 14px; }
.sig-lbl { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.sig-pad { width: 100%; max-width: 520px; height: 130px; border: 1.5px dashed #b9c3cf; border-radius: 10px; background: #fbfcfe; touch-action: none; display: block; }
.sig-clear { font-size: .74rem; margin-top: 3px; }

/* ---------- Final polish pass (consistency sweep) ---------- */
.btn-ghost { border-radius: 12px; }                    /* match btn-primary */
.on-clock-row { background: #f6f8fb; }                 /* retire the old mint tint — blue family like everything else */
.chip-time { font-size: .68rem; }                      /* was below the 10px readability floor */
.pay-row { font-size: .8rem; }
.pay-name { font-weight: 700; }
.empty {
  border: 1.5px dashed var(--line); border-radius: 14px;
  background: #fbfcfe; padding: 26px 14px;
}

/* ---------- Print: only the invoice sheet, clean like paper ---------- */
@media print {
  .topbar, .tabs, .inv-controls, .inv-actions, .toast, .modal-root, .no-print { display: none !important; }
  .view-head, .notes-report-bar, .notes-list { display: none !important; }   /* notes view: print only the report sheet */
  .frm-controls { display: none !important; }        /* forms: print only the document */
  .frm-sheet input, .frm-sheet textarea { border-color: transparent !important; background: transparent !important; }
  .sig-pad { border-style: solid !important; }
  .frm-grid th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .frm-grid tr, .sig-wrap, .frm-sheet .field-row { page-break-inside: avoid; }
  .inv-flag { display: none !important; }   /* internal no-visit marker — never on the client's copy */
  .inv-table tr { page-break-inside: avoid; }
  .content { padding: 0 !important; }
  body { background: #fff !important; }
  .inv-sheet { border: none; box-shadow: none; border-radius: 0; padding: 0; max-width: none; margin: 0; }
  .inv-table input, .inv-kv input { border: none !important; background: transparent !important; }
  .inv-block-title, .inv-table th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-band td, .inv-totals td, .inv-grand { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-logo, .inv-logo-sm { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-due { background: transparent !important; }   /* prints as a clean date on the line */
}
