/* ============================================================
   Pacifico Timecards — light theme
   Teal-on-white, mirroring the live Pacifico RMS visual language
   (teal accent-bar field labels, clean cards, quiet chrome).
   ============================================================ */

:root {
  --teal: #12969e;
  --teal-deep: #0d7c83;
  --teal-ink: #0a5c61;
  --teal-soft: #e3f2f3;
  --teal-wash: #f2f9f9;
  --ink: #17272a;
  --ink-2: #45585c;
  --ink-3: #5d7276;
  --line: #dde7e8;
  --line-soft: #eaf1f1;
  --bg: #f6f9f9;
  --card: #ffffff;
  --amber: #b9770e;
  --amber-soft: #fdf3e3;
  --red: #b3403a;
  --red-soft: #faeceb;
  --shadow: 0 1px 2px rgba(23, 39, 42, 0.05), 0 4px 16px rgba(23, 39, 42, 0.06);
  --shadow-lift: 0 2px 4px rgba(23, 39, 42, 0.06), 0 10px 28px rgba(23, 39, 42, 0.1);
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", ui-sans-serif, system-ui, 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;
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
a { color: var(--teal-deep); text-decoration: none; }

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

/* ============ header ============ */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand img { height: 38px; display: block; }
.header-nav { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
}
.nav-link.is-active { color: var(--teal-ink); background: var(--teal-soft); }
.nav-link:hover { color: var(--teal-ink); }

.user-menu { position: relative; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 12px 5px 5px;
  color: var(--ink-2);
}
.user-chip:hover { border-color: var(--line); background: var(--bg); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teal-deep);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.chev { color: var(--ink-3); }
.user-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  min-width: 210px;
  padding: 6px;
  display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 1px;
}
.user-dropdown-head span { font-size: 12.5px; color: var(--ink-3); }
.user-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
}
.user-dropdown-item:hover { background: var(--teal-wash); color: var(--teal-ink); }

/* ============ layout ============ */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
.page-sub { color: var(--ink-3); font-size: 14px; margin-top: 3px; }

/* ============ buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 14px;
  padding: 10px 18px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal-deep); color: #fff; }
.btn-primary:hover { background: var(--teal-ink); }
.btn-ghost { background: var(--card); color: var(--teal-ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); background: var(--teal-wash); }
.btn-danger-ghost { background: var(--card); color: var(--red); border-color: var(--line); }
.btn-danger-ghost:hover { border-color: var(--red); background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ============ field blocks (live-RMS accent-bar style) ============ */
.field-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow);
}
.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-ink);
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 9px;
}
.field-label::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: var(--teal);
  flex: 0 0 auto;
}
.control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.control:hover:not(:disabled) { border-color: #c3d3d5; }
.control:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18, 150, 158, 0.14); }
.control:disabled { background: var(--bg); color: var(--ink-3); cursor: not-allowed; }
select.control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='11' height='7' viewBox='0 0 11 7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4.5 4.5L10 1' fill='none' stroke='%237a8c8f' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
textarea.control { min-height: 118px; resize: vertical; line-height: 1.55; }
.control-static {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 10px 12px;
  color: var(--ink-3);
}
.control-static.is-set {
  border-style: solid;
  background: var(--teal-wash);
  color: var(--teal-ink);
  font-weight: 600;
}
.field-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 7px; }
.field-error { font-size: 12.5px; color: var(--red); margin-top: 7px; display: none; }
.field-block.has-error .control { border-color: var(--red); }
.field-block.has-error .field-error { display: block; }

/* ============ hours stepper ============ */
.hours-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0 2px;
}
.stepper { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.step-btn {
  width: 34px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.step-btn:hover { border-color: var(--teal); color: var(--teal-ink); background: var(--teal-wash); }
.step-input {
  width: 62px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  background: #fff;
}
.step-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18, 150, 158, 0.14); }
.step-caption { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 650; }
.hours-colon { font-size: 24px; font-weight: 700; color: var(--ink-3); padding-bottom: 22px; }

/* ============ add-task layout ============ */
/* DOM order follows the cascade (Client → Disaster → Project →
   Category → Hours → Describe → Date) so tab order matches the
   workflow; grid areas recreate the live-RMS two-column look. */
.task-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 280px;
  grid-template-areas:
    "client  disaster cal"
    "project category cal"
    "hours   desc     cal";
  gap: 18px;
  align-items: start;
}
#fb-client { grid-area: client; }
#fb-disaster { grid-area: disaster; }
#fb-project { grid-area: project; }
#fb-category { grid-area: category; }
#fb-hours { grid-area: hours; }
#fb-desc { grid-area: desc; }
.task-grid .cal { grid-area: cal; }
.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============ calendar ============ */
.cal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 18px;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
}
.cal-title { font-weight: 700; font-size: 14.5px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { border-color: var(--teal); color: var(--teal-ink); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}
.cal-dow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 5px 0;
}
.cal-day {
  aspect-ratio: 1;
  border: 0;
  background: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.cal-day:hover { background: var(--teal-wash); }
.cal-day.other { color: var(--ink-3); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--teal); }
.cal-day.selected { background: var(--teal-deep); color: #fff; font-weight: 700; }
.cal-day:disabled { color: #b9c6c8; cursor: not-allowed; background: none; }
.cal-day.has-dot::after {
  content: "";
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--teal);
}
.cal-day.selected.has-dot::after { background: #fff; }
.cal-selected-label {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: center;
}
.cal-selected-label strong { color: var(--ink); }

/* ============ summary cards ============ */
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.summary-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.summary-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.summary-value { font-size: 26px; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.summary-note { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

/* ============ timecard day list ============ */
.week-block { margin-bottom: 30px; }
.week-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.week-title { font-size: 15.5px; font-weight: 700; }
.week-total { font-size: 13.5px; color: var(--ink-2); font-weight: 650; }
.day-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.day-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(to bottom, #fdfefe, #fafcfc);
}
.day-date { display: flex; flex-direction: column; line-height: 1.15; min-width: 64px; }
.day-dow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-ink); }
.day-num { font-size: 16px; font-weight: 700; }
.day-total { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.day-empty {
  padding: 14px 18px;
  color: var(--ink-3);
  font-size: 13.5px;
  font-style: italic;
}
.entry-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.entry-row:last-child { border-bottom: 0; }
.entry-main { min-width: 0; flex: 1; }
.entry-project { font-weight: 650; font-size: 14.5px; margin-bottom: 3px; }
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  margin-bottom: 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-ink);
}
.chip-muted { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.entry-desc {
  font-size: 13.5px;
  color: var(--ink-2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.entry-hours {
  font-size: 17px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 58px;
  text-align: right;
}
.entry-hours span { display: block; font-size: 11px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.entry-actions { display: flex; gap: 8px; }

/* delete confirm strip */
.confirm-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  background: var(--red-soft);
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--red);
  font-weight: 600;
}

/* empty state */
.empty-state {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty-state strong { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 6px; }

/* ============ login ============ */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(18, 150, 158, 0.09), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(18, 150, 158, 0.07), transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  padding: 38px 34px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card img { width: 210px; margin: 0 auto 8px; display: block; }
.login-title { text-align: center; font-size: 15px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; margin-bottom: 6px; }
.btn-login {
  background: var(--teal-deep);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin-top: 4px;
  transition: background 0.15s ease;
}
.btn-login:hover { background: var(--teal-ink); }
.login-hint {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

/* ============ toast ============ */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 200;
  max-width: calc(100vw - 48px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ demo flag ============ */
.demo-flag {
  position: fixed;
  bottom: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-3);
  padding: 5px 12px;
  z-index: 100;
}
.demo-flag .d { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* ============ page load reveal ============ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 0.4s ease both; }
  .reveal-1 { animation-delay: 0.04s; }
  .reveal-2 { animation-delay: 0.1s; }
  .reveal-3 { animation-delay: 0.16s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: none; }
  }
}

/* ============ responsive ============ */
@media (max-width: 980px) {
  .task-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "client  disaster"
      "project category"
      "hours   desc"
      "cal     cal";
  }
  .task-grid .cal { max-width: 360px; }
}
@media (max-width: 700px) {
  .header-inner { padding: 0 16px; gap: 14px; }
  .brand img { height: 30px; }
  .user-name { display: none; }
  .page { padding: 20px 16px 60px; }
  .page-title { font-size: 22px; }
  /* single column: DOM order is already the cascade order */
  .task-grid { grid-template-columns: 1fr; grid-template-areas: none; }
  #fb-client, #fb-disaster, #fb-project, #fb-category, #fb-hours, #fb-desc,
  .task-grid .cal { grid-area: auto; }
  .task-grid .cal { max-width: none; }
  .summary-row { grid-template-columns: 1fr; gap: 10px; }
  .summary-card { display: flex; align-items: baseline; gap: 12px; }
  .summary-label { margin-bottom: 0; }
  .summary-value { font-size: 20px; }
  .summary-note { display: none; }
  .entry-row { flex-wrap: wrap; gap: 10px; }
  .entry-hours { order: -1; margin-left: auto; }
  .entry-main { flex: 1 1 100%; }
  .entry-actions { margin-left: auto; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { justify-content: center; }
}

/* ============ phase 3: login error ============ */
.login-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #ecc8c5;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ============ phase 3: reimbursement readiness ============ */
.ready-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.ready-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(to bottom, #fdfefe, #fafcfc);
}
.ready-title {
  font-size: 12.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-2);
}
.ready-score {
  margin-left: auto;
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-ink);
}
.ready-score.warn { background: var(--amber-soft); color: var(--amber); }
.ready-row {
  display: flex;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
  align-items: flex-start;
}
.ready-row:last-of-type { border-bottom: 0; }
.ready-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.ready-icon.ok { background: #e2f3e8; color: #1e7a3e; }
.ready-icon.warn { background: var(--amber-soft); color: var(--amber); }
.ready-row-title { font-size: 14px; font-weight: 650; margin-bottom: 1px; }
.ready-row-note { font-size: 12.5px; color: var(--ink-3); }
.ready-strip {
  padding: 9px 18px;
  background: var(--bg);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
}

/* ============ phase 4: admin dashboard ============ */
.admin-actions { display: flex; gap: 10px; align-items: center; }

.week-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.week-bar-label {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  min-width: 220px;
}
.week-bar .btn-sm { margin-left: 6px; }

.summary-value.pending-num { color: var(--amber); }

/* pills */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.pill-ok { background: #e2f3e8; color: #1e7a3e; }
.pill-pending { background: var(--amber-soft); color: var(--amber); }

/* employee section */
.adm-emp {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.adm-emp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(to bottom, #fdfefe, #fafcfc);
}
.adm-emp-head .user-avatar { width: 34px; height: 34px; font-size: 15px; }
.adm-emp-id { display: flex; flex-direction: column; line-height: 1.2; }
.adm-emp-name { font-weight: 700; font-size: 15.5px; }
.adm-emp-role { font-size: 12.5px; color: var(--ink-3); }
.adm-emp-total {
  margin-left: auto;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.adm-emp-head .pill { margin-left: 10px; }
.adm-emp-head .btn { margin-left: 4px; }
.adm-emp-total + .btn { margin-left: 12px; }

/* task rows in admin */
.adm-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.adm-row:last-child { border-bottom: 0; }
.adm-date { display: flex; flex-direction: column; line-height: 1.15; min-width: 62px; }
.adm-date .day-dow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-ink); }
.adm-day { font-size: 14px; font-weight: 650; }
.adm-main { flex: 1; min-width: 0; }
.adm-hours {
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
}
.adm-hours span { display: block; font-size: 11px; font-weight: 650; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.adm-row-action { min-width: 92px; display: flex; justify-content: flex-end; }
.entry-desc-empty { color: var(--amber); font-style: italic; }

@media (max-width: 700px) {
  .admin-actions { gap: 8px; }
  .week-bar-label { min-width: 0; font-size: 13px; flex: 1; }
  .week-bar .btn-sm span { display: none; }
  .adm-emp-head { flex-wrap: wrap; }
  .adm-emp-total { margin-left: auto; }
  .adm-emp-head .btn { margin-left: auto; margin-top: 4px; }
  .adm-row { flex-wrap: wrap; gap: 10px; }
  .adm-hours { order: -1; margin-left: auto; }
  .adm-main { flex: 1 1 100%; }
  .adm-row-action { flex: 1 1 100%; justify-content: flex-start; }
}

/* ============ print packet ============ */
#print-area { display: none; }
@media print {
  body { background: #fff; }
  .site-header, .page-head, .week-bar, .summary-row, #roster, .demo-flag, .toast { display: none !important; }
  #print-area { display: block; padding: 0; color: #000; }
  .print-head h1 { font-size: 18px; margin-bottom: 2px; }
  .print-head h2 { font-size: 13px; font-weight: 500; color: #333; margin-bottom: 14px; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 11px; }
  .print-table th, .print-table td { border: 1px solid #bbb; padding: 5px 7px; text-align: left; }
  .print-table th { background: #eee; font-weight: 700; }
  .print-total { margin-top: 12px; font-weight: 700; font-size: 12px; }
}

/* ============ phase 4.5: admin toolbar + filter modal ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.period { display: flex; align-items: center; gap: 8px; }
.period-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  min-width: 128px;
  text-align: center;
}
.toolbar-search { flex: 1; min-width: 200px; max-width: 420px; }
.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--teal-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 39, 42, 0.42);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  z-index: 300;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 620px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  animation: modal-in 0.16s ease both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0 4px;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; }
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.modal-field { box-shadow: none; padding: 0; border: 0; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
}
.modal-foot .btn-primary { margin-left: auto; }

@media (max-width: 620px) {
  .modal-grid { grid-template-columns: 1fr; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn-primary { margin-left: 0; }
  .toolbar-search { order: 3; flex: 1 1 100%; max-width: none; }
}

/* ============ phase 5: CSV import ============ */
.import-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.import-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.import-step {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-ink);
  font-weight: 750;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.import-head > div { flex: 1; min-width: 0; }
.import-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.import-note { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.import-head .btn { flex: 0 0 auto; }

.import-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.import-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.import-file-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-ink);
  cursor: pointer;
  background: var(--teal-wash);
}
.import-file-label:hover { border-color: var(--teal); }
.import-file:focus-visible + .import-file-label { outline: 2px solid var(--teal); outline-offset: 2px; }
.import-file-name { font-size: 13.5px; color: var(--ink-3); }

.import-preview { padding: 0 20px 8px; }
.import-summary { display: flex; gap: 14px; font-size: 13.5px; font-weight: 650; margin-bottom: 10px; }
.import-ok { color: #1e7a3e; }
.import-bad { color: var(--amber); }
.import-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.import-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.import-table th, .import-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.import-table th { background: var(--bg); font-weight: 700; color: var(--ink-2); }
.import-table tr:last-child td { border-bottom: 0; }
.import-errlist { margin-top: 10px; display: flex; flex-direction: column; gap: 3px; }
.import-errrow { font-size: 12.5px; color: var(--red); }
.import-warnrow { font-size: 12.5px; color: var(--amber); }
.import-error { font-size: 13.5px; color: var(--red); padding: 6px 0; }
.import-done { font-size: 14.5px; font-weight: 700; color: #1e7a3e; padding: 6px 0; }
.import-after { margin-top: 10px; }
.import-actions { padding: 0 20px 18px; }
