:root {
  --brand: #00a74f;
  --blue: #0c2b6f;
  --blue-2: #122e7a;
  --blue-3: #0b1b47;
  --blue-deep: #0d0d2a;
  --ink: #0a0a0a;
  --muted: #5f6b76;
  --line: #e6e8eb;
  --line-2: #dfe6ef;
  --ghost: #f6f7f8;
  --tint: #f8faff;
  --soft-2: #dfe7ff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* The hidden attribute should always win, regardless of class display rules. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Sticky white header + gradient divider ========== */
header.site {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: linear-gradient(90deg, #ffffff 0%, var(--tint) 100%);
  color: var(--blue);
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.nav { height: 70px; display: flex; align-items: center; justify-content: space-between; }
.brand-link { display: flex; align-items: center; gap: 10px; }
.brand-text {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 24px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.brand-logo {
  display: block;
  height: 50px; width: auto; object-fit: contain;
}
@media (max-width: 768px) {
  .brand-logo { height: 40px; }
}

.menu-toggle {
  display: none; flex-direction: column; gap: 4px;
  cursor: pointer; padding: 6px;
  background: none; border: 0;
}
.menu-toggle span {
  width: 25px; height: 3px; background: var(--blue);
  border-radius: 2px; transition: 0.2s;
}

.links { display: flex; gap: 14px; align-items: center; }
.links a.nav-link {
  padding: 8px 12px; border-radius: 8px;
  color: var(--blue); font-weight: 600;
}
.links a.nav-link:hover { background: var(--ghost); }

.btn {
  display: inline-block; padding: 10px 14px; border-radius: 8px;
  border: 2px solid var(--blue); color: var(--blue);
  font-weight: 800; white-space: nowrap; background: #fff;
  transition: background 0.2s, color 0.2s;
  cursor: pointer; font: inherit;
}
.btn:hover { background: var(--blue); color: #fff; }
.btn.dark { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.dark:hover { background: var(--blue-2); color: #fff; }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .links {
    position: absolute; top: 70px; right: 0;
    background: #fff; flex-direction: column; align-items: stretch;
    gap: 0; width: 100%; border-top: 1px solid var(--line-2);
    display: none;
  }
  .links a, .links .btn {
    width: 100%; padding: 15px 20px; border: 0; border-radius: 0;
    text-align: left; color: var(--blue); background: #fff;
  }
  .links.show { display: flex; }
  .links .btn.dark { background: var(--blue); color: #fff; }
}

.top-divider {
  position: fixed; top: 70px; left: 0; right: 0; z-index: 999;
  height: 6px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-2) 50%, var(--blue) 100%);
  border-bottom: 1px solid rgba(10, 28, 75, 0.13);
}

/* Padding (not margin) below the fixed header + above the fixed footer.
   Padding cannot collapse, so the first child (workspace) is guaranteed
   to sit below the header. */
main {
  margin: 0;
  padding-top: 76px;
  padding-bottom: 56px;
  box-sizing: border-box;
}

/* ========== Hero ========== */
.hero {
  position: relative; isolation: isolate;
  background: var(--blue-3); color: #fff;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,43,111,0.25), rgba(12,43,111,0.55));
  z-index: -1;
}
.hero-inner { padding: 120px 0; }
.hero h1 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05; margin: 0 0 14px;
  text-transform: uppercase; letter-spacing: 0.01em;
}
.hero p {
  max-width: 60ch; color: var(--soft-2);
  font-size: 17px; margin: 0 0 22px;
}
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== Support card ========== */
.support-section {
  background: var(--blue-deep);
  padding: 70px 0;
  color: #fff;
}
.support-card {
  background: var(--blue);
  max-width: 560px; margin: 0 auto;
  border-radius: 12px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.support-card h2 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 26px;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0 0 6px;
}
.support-card .lead { color: var(--soft-2); margin: 0 0 22px; }
.support-row {
  display: flex; flex-direction: column; gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 22px;
}
.support-row .label {
  display: block;
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}
.support-row a {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: clamp(20px, 3vw, 26px);
  color: var(--brand);
  word-break: break-word;
}
.support-row a:hover { color: #fff; }

/* ========== Footer (locked to bottom, height matches main margin-bottom) ========== */
footer.site {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  height: 56px;                            /* must match main margin-bottom above */
  background: var(--blue); color: #fff; text-align: center;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-bottom {
  font-size: 0.92rem; color: rgba(255, 255, 255, 0.85);
}
.footer-bottom a { color: #fff; text-decoration: underline; }

/* ========== Login page ========== */
.login-body {
  background: linear-gradient(135deg, var(--blue-3), var(--blue-deep));
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; color: #fff;
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.login-card {
  background: #fff; padding: 36px 32px;
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  width: 100%; max-width: 420px; color: var(--ink);
}
.login-card h1 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 26px; text-transform: uppercase;
  margin: 0 0 4px; color: var(--blue);
  letter-spacing: 0.04em;
}
.login-card .lead {
  color: var(--muted); margin: 0 0 20px;
}

.form { display: flex; flex-direction: column; gap: 14px; }
.form label {
  display: flex; flex-direction: column; gap: 4px;
  font-weight: 700; color: var(--blue); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form input[type="email"],
.form input[type="password"],
.form input[type="text"] {
  padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
.form input:focus {
  outline: 2px solid var(--blue-2); outline-offset: 1px;
}
.form input:disabled { background: var(--ghost); cursor: not-allowed; }

.btn-block { width: 100%; justify-content: center; text-align: center; }
.btn:disabled, .btn-google:disabled { opacity: 0.6; cursor: not-allowed; }

.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 14px; border-radius: 8px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); font-weight: 700;
  cursor: pointer; font: inherit;
  transition: background 0.2s, border-color 0.2s;
}
.btn-google:hover { background: var(--ghost); border-color: var(--blue-2); }
.btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.error {
  background: #fdeaea; border: 1px solid #f5b8b8;
  color: #7a0a0a; padding: 10px 14px; border-radius: 8px;
  margin-bottom: 14px; font-size: 14px;
}
.error[hidden] { display: none; }

.login-foot {
  margin-top: 20px; text-align: center; color: var(--muted);
  font-size: 13px;
}
.login-foot a { color: var(--blue); text-decoration: underline; }

/* ========== Dashboard quick actions ========== */
.quick-actions {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  margin-top: 14px;
}

/* ========== Compact hero (used on inner pages) ========== */
.hero-compact { padding: 0; }
.hero-compact .wrap { padding: 50px 20px 40px; }
.hero-compact h1 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  text-transform: uppercase; letter-spacing: 0.02em;
  margin: 0 0 6px;
}
.hero-compact p { color: var(--soft-2); margin: 0; }

/* ========== Companies page ========== */
.page-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin: 0 0 18px;
}

.form-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 22px 24px;
  margin: 0 0 22px;
  box-shadow: 0 4px 14px rgba(12, 43, 111, 0.06);
}
.form-card h2 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 18px; text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0 0 14px; color: var(--blue);
}

.form-actions {
  display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px;
}

.loading-state, .empty-state {
  text-align: center; color: var(--muted);
  padding: 36px 16px;
  background: var(--ghost); border: 1px dashed var(--line);
  border-radius: 10px;
}
.loading-state[hidden], .empty-state[hidden] { display: none; }

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.company-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(12, 43, 111, 0.06);
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.company-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(12, 43, 111, 0.12);
}
.company-card h3 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 16px; margin: 0;
  color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.02em;
  word-break: break-word;
}
.company-meta { color: var(--muted); font-size: 13px; margin: 0; }

.company-card-clickable { cursor: pointer; }
.company-card-clickable:focus {
  outline: 2px solid var(--blue-2); outline-offset: 2px;
}

/* Back link at top of detail */
.back-link {
  display: inline-block; margin-bottom: 14px;
  color: var(--blue); font-weight: 700; font-size: 13px;
  text-decoration: none;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.back-link:hover { text-decoration: underline; }

/* ========== Workspace (sidebar + main, fills viewport between header & footer) ========== */
.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 76px - 56px);     /* header bar + footer */
  background: #fff;
  padding: 0 20px;                       /* aligns with header/footer .wrap padding */
}
@media (max-width: 820px) {
  .workspace {
    grid-template-columns: 1fr;
    padding: 0;
    height: auto;                        /* on mobile, page scrolls normally */
    min-height: calc(100vh - 76px - 56px);
  }
}

/* On dashboard pages the .wrap inside header/footer drops its max-width so the
   logo aligns with the sidebar's left edge and the sign-out button aligns with
   the main panel's right edge. */
body.dashboard-page .wrap { max-width: none; }

.workspace-side {
  overflow: hidden;                      /* sidebar must never scroll */
  min-width: 0;
}
.workspace-main {
  overflow: auto;                        /* main panel scrolls if its content is tall */
  min-width: 0;                          /* allow nested grids to shrink */
}

/* On the dashboard the workspace fills the viewport exactly — no page scroll. */
body.dashboard-page { overflow: hidden; }
@media (max-width: 820px) {
  /* Mobile reverts to normal page-scroll because sidebar stacks above main. */
  body.dashboard-page { overflow: auto; }
}

.workspace-side {
  border-right: 1px solid var(--line);
  background: var(--ghost);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 18px;
}

.nav-section {
  display: flex; flex-direction: column; gap: 10px;
}
.nav-section + .nav-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

/* Top-level nav row (e.g. Inventory) */
.nav-link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--blue); font: inherit; font-weight: 800;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  text-align: left; cursor: pointer; width: 100%;
}
.nav-link-row:hover { background: #fff; border-color: var(--line); }
.nav-link-row.active { background: var(--blue); color: #fff; border-color: var(--blue); }
@media (max-width: 820px) {
  .workspace-side { border-right: 0; border-bottom: 1px solid var(--line); }
}

.side-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.side-head h2 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue); margin: 0;
}

.btn-sm { padding: 6px 10px; font-size: 0.85rem; }

.form-card-side {
  padding: 14px;
  margin: 0;
}
.form-card-side .form { gap: 10px; }

.side-list-state {
  color: var(--muted); font-size: 13px;
  text-align: center; padding: 18px 8px;
}

.company-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.company-item {
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; color: var(--ink);
  font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
  word-break: break-word;
}
.company-item:hover {
  background: #fff; border-color: var(--line);
}
.company-item.active {
  background: var(--blue); color: #fff;
  border-color: var(--blue);
}

.workspace-main {
  padding: 28px 32px;
  min-width: 0;
}
@media (max-width: 600px) {
  .workspace-main { padding: 22px 18px; }
}

.workspace-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 360px;
}
.empty-message {
  text-align: center; color: var(--muted);
  max-width: 360px;
}
.empty-message h3 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 18px; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0 0 6px;
}
.empty-message p { margin: 0; font-size: 14px; }

.detail-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px; margin-bottom: 22px;
}
.detail-head h2 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 26px; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.02em;
  margin: 0 0 6px; word-break: break-word;
}
.detail-address {
  color: var(--muted); margin: 0;
  white-space: pre-line;
}
.detail-address[hidden] { display: none; }

.detail-section { margin-bottom: 32px; }
.detail-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.detail-section-head h3 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--blue); margin: 0;
}

.form-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Item lists (locations + members) */
.item-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.item-row {
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.item-row:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(12, 43, 111, 0.08);
}
.item-row-clickable { cursor: pointer; }
.item-row-clickable:focus {
  outline: 2px solid var(--blue-2); outline-offset: 2px;
}
.item-main { flex: 1; min-width: 0; }
.item-main strong {
  display: block; color: var(--ink); font-size: 15px;
  word-break: break-word;
}
.item-sub {
  color: var(--muted); font-size: 13px; margin-top: 2px;
  word-break: break-word;
}

/* Textarea baseline (was missing) */
.form textarea {
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit;
  background: #fff; color: var(--ink);
  resize: vertical; min-height: 48px;
}
.form textarea:focus {
  outline: 2px solid var(--blue-2); outline-offset: 1px;
}

/* Checkbox row (inline) */
.form label.check {
  flex-direction: row; align-items: center; gap: 10px;
  font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--blue);
  cursor: pointer;
}
.form label.check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* Light helper text on field labels */
.form label .hint {
  font-weight: 400; text-transform: none; letter-spacing: 0;
  color: var(--muted); font-size: 12px; margin-left: 6px;
}

/* Portal-access badge on member rows */
.tag-portal {
  display: inline-block;
  background: var(--brand); color: #fff;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  align-self: center;
}

/* Inventory item tags */
.tag-company {
  display: inline-block;
  background: var(--blue); color: #fff;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
  align-self: center; max-width: 200px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tag-unassigned {
  display: inline-block;
  background: var(--ghost); color: var(--muted);
  border: 1px dashed var(--line);
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
  align-self: center;
}

/* Suspended status badge (companies) */
.tag-suspended {
  display: inline-block;
  background: #b00020; color: #fff;
  padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  align-self: center; vertical-align: middle;
}

/* Service Status fieldset on edit-company form */
fieldset.service-status {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px 12px; margin: 0;
}
fieldset.service-status legend {
  padding: 0 6px; color: var(--muted);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* Permissions fieldset on employee form (2-column compact grid) */
fieldset.permissions {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px 12px; margin: 0;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
@media (max-width: 480px) {
  fieldset.permissions { grid-template-columns: 1fr; }
}
fieldset.permissions legend {
  padding: 0 6px; color: var(--muted);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  grid-column: 1 / -1;
}
fieldset.permissions label.check {
  font-size: 13px; text-transform: none; letter-spacing: 0;
}

/* Company picker (super-admin scope filter) */
.company-picker {
  background: var(--ghost); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.company-picker label {
  display: flex; align-items: center; gap: 10px;
  margin: 0; font-weight: 700; color: var(--blue);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  flex: 1;
}
.company-picker select {
  padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; font: inherit;
  flex: 1; min-width: 0;
}

/* Schedule toolbar (week nav, status, publish) */
.schedule-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 8px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.toolbar-right { margin-left: auto; }
.schedule-week-label {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 14px; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-left: 8px;
}

/* Status badge for schedule week */
.status-badge {
  display: inline-block; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.status-badge[data-status="draft"] {
  background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db;
}
.status-badge[data-status="pending"] {
  background: #fff5e6; color: #8a5a00; border: 1px solid #f5d8a4;
}
.status-badge[data-status="published"] {
  background: #e6f7ee; color: #04632c; border: 1px solid #b3e3c8;
}

/* Schedule grid: sticky-first-column 8-col layout */
.schedule-grid-wrap {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; overflow: auto; max-width: 100%;
}
.schedule-grid {
  display: grid;
  grid-template-columns: 200px repeat(7, minmax(110px, 1fr));
  min-width: 980px;
}
.schedule-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px; min-height: 64px;
  background: #fff;
}
.schedule-head-row {
  display: contents;
}
.schedule-head-cell {
  background: var(--ghost);
  padding: 10px 10px; border-bottom: 2px solid var(--line);
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue); text-align: center;
  position: sticky; top: 0; z-index: 2;
}
.schedule-head-cell.today { background: var(--soft-2); color: var(--blue); }
.schedule-head-cell .head-day  { display: block; }
.schedule-head-cell .head-date { display: block; font-family: inherit; font-size: 14px; margin-top: 2px; color: var(--ink); }

.schedule-emp-cell {
  background: var(--ghost); padding: 10px 14px;
  font-weight: 700; color: var(--ink); font-size: 13px;
  border-right: 2px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: sticky; left: 0; z-index: 1;
  display: flex; align-items: center;
}
.schedule-cell.today { background: rgba(207, 216, 255, 0.15); }
.schedule-cell.clickable { cursor: pointer; transition: background 0.12s; }
.schedule-cell.clickable:hover { background: var(--ghost); }

.shift-chip {
  display: block; padding: 6px 8px;
  background: var(--blue); color: #fff;
  border-radius: 6px; font-size: 12px;
  line-height: 1.3; cursor: pointer;
}
.shift-chip .shift-time { font-weight: 800; display: block; }
.shift-chip .shift-meta { display: block; opacity: 0.9; font-size: 11px; }
.shift-chip:hover { background: var(--blue-2); }

/* Modal overlay */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(8, 19, 49, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--ghost);
}
.modal-head h2 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 18px; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0;
}
.modal-close {
  background: none; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--muted);
  padding: 0 4px;
}
.modal-close:hover { color: var(--ink); }
.modal-body {
  padding: 18px; overflow: auto;
}
.modal-context {
  margin: 0 0 14px; color: var(--muted); font-size: 14px;
}
.modal-context strong { color: var(--ink); }

/* Copy-to-days fieldset (compact 7-column) */
fieldset.copy-to-days {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px 12px; margin: 0;
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px 8px;
}
fieldset.copy-to-days legend {
  padding: 0 6px; color: var(--muted);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  grid-column: 1 / -1;
}
fieldset.copy-to-days label.check {
  font-size: 12px; text-transform: none; letter-spacing: 0;
  flex-direction: column; gap: 2px; align-items: center;
  text-align: center;
}

.btn.danger { background: #b00020; color: #fff; border-color: #b00020; }
.btn.danger:hover { background: #8a0019; border-color: #8a0019; }

/* Toolbar inline label (used in Timesheet) */
.toolbar-inline {
  display: flex; align-items: center; gap: 8px;
  margin: 0; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--blue);
}
.toolbar-inline select {
  padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; background: #fff;
  text-transform: none; letter-spacing: 0; font-weight: 500;
}

/* Timesheet table */
.timesheet-wrap {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; overflow: auto;
}
.timesheet-table {
  width: 100%; border-collapse: collapse;
  min-width: 720px; font-size: 14px;
}
.timesheet-table thead th {
  background: var(--ghost); padding: 10px 14px;
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue); text-align: left;
  border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.timesheet-table tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  vertical-align: top; white-space: pre-line;
}
.timesheet-table tbody tr.today td { background: rgba(207, 216, 255, 0.18); }
.timesheet-table tbody tr.empty td { color: var(--muted); }
.timesheet-table .ts-date strong { display: block; font-weight: 800; color: var(--blue); }
.timesheet-table .ts-date small { color: var(--muted); }
.timesheet-table .ts-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.timesheet-table tfoot td {
  padding: 12px 14px; background: var(--ghost);
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue); border-top: 2px solid var(--line);
}
.timesheet-table .ts-total-value {
  text-align: right; font-size: 16px; font-variant-numeric: tabular-nums;
}

/* Editable time cell button */
.ts-cell-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 92px; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink);
  font: inherit; font-size: 13px;
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
  font-variant-numeric: tabular-nums;
}
.ts-cell-btn:hover { background: var(--ghost); border-color: var(--blue-2); }
.ts-cell-btn.empty { color: var(--muted); font-style: italic; }
.ts-cell-btn.late {
  background: #fff5e6; border-color: #f5d8a4; color: #8a5a00; font-weight: 700;
}
.ts-cell-btn.missing {
  background: #fdeaea; border-color: #f5b8b8; color: #7a0a0a; font-weight: 700;
}

/* Inline editing input */
.ts-cell-input {
  min-width: 92px; padding: 6px 10px;
  border: 2px solid var(--blue); border-radius: 6px;
  font: inherit; font-size: 13px;
  background: #fff; color: var(--ink);
}
.ts-cell-input:focus { outline: none; }
.ts-cell-input.invalid { border-color: #b00020; background: #fff5f5; }

/* Clock-in/out pair stack — multi-pair days line up across the In and Out columns */
.ts-pair-stack { display: flex; flex-direction: column; gap: 6px; }
.ts-pair-row { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.ts-pair-row-spacer { /* invisible row in Out column to balance the + add pair button in the In column */ }
.ts-pair-del {
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 2px 6px; font-size: 16px; line-height: 1;
}
.ts-pair-del:hover { color: #b00020; }
.ts-pair-add {
  align-self: flex-start;
  background: transparent; border: 1px dashed var(--line); border-radius: 6px;
  color: var(--blue); font: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 4px 10px; cursor: pointer;
}
.ts-pair-add:hover { background: var(--ghost); border-color: var(--blue); }

/* Meal cell layout */
.ts-meal-stack { display: flex; flex-direction: column; gap: 6px; }
.ts-meal-row { display: flex; align-items: center; gap: 6px; }
.ts-meal-sep { color: var(--muted); font-weight: 700; }
.ts-meal-del {
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 2px 6px; font-size: 16px; line-height: 1;
}
.ts-meal-del:hover { color: #b00020; }
.ts-meal-add {
  align-self: flex-start;
  background: transparent; border: 1px dashed var(--line); border-radius: 6px;
  color: var(--blue); font: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 4px 10px; cursor: pointer;
}
.ts-meal-add:hover { background: var(--ghost); border-color: var(--blue); }

/* Unsaved-changes indicator */
.ts-unsaved-indicator {
  color: #8a5a00;
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
/* Saved confirmation (shown briefly after a successful save) */
.ts-saved-indicator {
  display: inline-block;
  background: #e6f7ee; color: #04632c;
  border: 1px solid #b3e3c8;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: opacity 0.3s;
}
.ts-saved-indicator.fading { opacity: 0; }

/* Audit log */
.ts-audit {
  margin-top: 22px; padding: 16px 18px;
  background: var(--ghost); border: 1px solid var(--line); border-radius: 10px;
}
.ts-audit h3 {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue); margin: 0 0 10px;
}
.ts-audit-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ts-audit-list li {
  font-size: 13px; color: var(--ink);
  padding: 6px 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px;
}
.ts-audit-list li .when { color: var(--muted); margin-left: 8px; font-size: 12px; }
.ts-audit-list li .who  { font-weight: 700; color: var(--blue); }
.ts-audit-list li .change { color: var(--ink); }
.ts-audit-empty { color: var(--muted); margin: 0; }

/* Availability — per-day windows */
.availability-wrap {
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
}
.availability-grid {
  display: flex; flex-direction: column;
}
.av-day-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px; align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.av-day-row:last-child { border-bottom: 0; }
.av-day-name {
  font-family: "Archivo Black", system-ui, sans-serif;
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--blue); padding-top: 6px;
}
.av-windows { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.av-window {
  display: flex; align-items: center; gap: 8px;
}
.av-window input[type="time"] {
  padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; font-size: 13px;
  background: #fff; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.av-window input[type="time"]:focus { outline: 2px solid var(--blue-2); outline-offset: 1px; }
.av-window .av-sep { color: var(--muted); font-weight: 700; }
.av-window-del {
  background: transparent; border: 0; color: var(--muted);
  cursor: pointer; padding: 2px 6px; font-size: 16px; line-height: 1;
}
.av-window-del:hover { color: #b00020; }
.av-window-add {
  align-self: flex-start;
  background: transparent; border: 1px dashed var(--line); border-radius: 6px;
  color: var(--blue); font: inherit; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 4px 10px; cursor: pointer;
}
.av-window-add:hover { background: var(--ghost); border-color: var(--blue); }
.av-day-empty { color: var(--muted); font-style: italic; font-size: 13px; padding-top: 6px; }

/* Time off in schedule grid */
.timeoff-chip {
  display: block; padding: 6px 8px;
  border: 1px solid; border-radius: 6px;
  font-size: 12px; line-height: 1.3; cursor: pointer;
}
.timeoff-chip .to-reason { font-weight: 800; display: block; text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }
.timeoff-chip .to-time   { display: block; opacity: 0.85; font-size: 11px; }

.timeoff-chip.status-pending  { background: #fff5e6; color: #8a5a00; border-color: #f5d8a4; }
.timeoff-chip.status-pending:hover  { background: #ffeacc; }
.timeoff-chip.status-approved { background: #e6f7ee; color: #04632c; border-color: #b3e3c8; }
.timeoff-chip.status-approved:hover { background: #d2f0df; }
.timeoff-chip.status-denied   { background: #fdeaea; color: #7a0a0a; border-color: #f5b8b8; }
.timeoff-chip.status-denied:hover   { background: #fbd6d6; }

/* Time-off modal: status row with Approve / Pending / Deny buttons */
.timeoff-status-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 6px 0 4px;
  background: #f7f7f9; border: 1px solid #e3e3ea; border-radius: 8px;
}
.timeoff-status-label {
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; font-size: 11px; color: #555;
}
.timeoff-status-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.timeoff-status-btn { border: 1px solid #ccc; background: #fff; }
.timeoff-status-btn.active[data-status="approved"] { background: #e6f7ee; color: #04632c; border-color: #04632c; }
.timeoff-status-btn.active[data-status="pending"]  { background: #fff5e6; color: #8a5a00; border-color: #8a5a00; }
.timeoff-status-btn.active[data-status="denied"]   { background: #fdeaea; color: #7a0a0a; border-color: #7a0a0a; }
.timeoff-status-btn:disabled { opacity: 0.6; cursor: default; }

/* Timesheet — Corrections Pending Approval */
.ts-corrections-pending-btn {
  background: #fff5e6; color: #8a5a00; border-color: #f5d8a4;
  font-weight: 700;
}
.ts-corrections-pending-btn:hover { background: #ffeacc; }
.ts-row-pending-badge {
  display: inline-block;
  margin-top: 4px; padding: 2px 8px;
  background: #fff5e6; color: #8a5a00; border: 1px solid #f5d8a4;
  border-radius: 999px;
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer;
}
.ts-row-pending-badge:hover { background: #ffeacc; }
.ts-correct-meta { margin-bottom: 14px; }
.ts-correct-meta .muted { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ts-correct-compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 12px 0;
}
.ts-correct-col {
  background: #f7f7f9; border: 1px solid #e3e3ea; border-radius: 8px;
  padding: 10px 12px;
}
.ts-correct-col.proposed { background: #fff5e6; border-color: #f5d8a4; }
.ts-correct-col h3 {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: #555; margin: 0 0 8px;
}
.ts-correct-col .row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 2px 0; font-size: 13px;
}
.ts-correct-col .row .lbl { color: var(--muted); font-weight: 600; }
.ts-correct-col .row .val { font-variant-numeric: tabular-nums; }
.ts-correct-note-box {
  background: #f7f7f9; border: 1px solid #e3e3ea; border-radius: 8px;
  padding: 10px 12px; margin: 12px 0;
}
.ts-correct-note-box h3 {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: #555; margin: 0 0 6px;
}
.ts-correct-note-box p { margin: 0; white-space: pre-wrap; font-size: 14px; }

/* Schedule cell can stack chips when both a shift and time-off exist */
.schedule-cell .shift-chip + .timeoff-chip,
.schedule-cell .timeoff-chip + .shift-chip {
  margin-top: 6px;
}

/* Soft warning notice (used for availability conflict in shift modal) */
.notice-warn {
  background: #fff5e6; color: #8a5a00;
  border: 1px solid #f5d8a4;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; margin-bottom: 12px;
}

/* Inventory: license code row (read-only input + regenerate button) */
.code-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 8px; align-items: stretch;
}
.code-row input[readonly] {
  background: var(--ghost); color: var(--ink);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

/* Company card title row (name + optional suspended tag) */
.company-card-title {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.company-card-title h3 { margin: 0; }

/* Select baseline (was missing) */
.form select {
  padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; background: #fff; color: var(--ink);
}
.form select:focus { outline: 2px solid var(--blue-2); outline-offset: 1px; }


