/* Work Tracker – shared styles. Light, calm, spreadsheet-first. */
:root {
  --bg: #e6f1fa;              /* light blue page background (was light grey) */
  --paper: #ffffff;
  --fg: #1d2430;
  --muted: #5d6777;
  --faint: #8a93a2;
  --line: #c9dcec;
  --line-soft: #dfe7ef;
  --brand: #0071bd;            /* Pentadesk blue, rgb(0, 113, 189) */
  --brand-dark: #005a97;
  --accent: #0071bd;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0fa;
  --select: rgba(0, 113, 189, 0.13);
  --select-line: #0071bd;
  --head: #e6f1fa;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn-soft: #fff4d6;
  --row-h: 28px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font); }
a { color: var(--accent); }
a.btn { text-decoration: none; color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--paper); white-space: nowrap; }
.btn:hover { border-color: #b9c1cd; }
.btn:focus-visible, .input:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.small { height: 26px; padding: 0 8px; font-size: 13px; }
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; border: 1px solid transparent;
  background: transparent; border-radius: 5px; color: var(--fg); }
.icon-btn:hover { background: var(--head); }
.icon-btn.on { background: var(--accent-soft); border-color: #b8d9ce; color: var(--accent); }
.input { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); width: 100%; }
textarea.input { height: auto; padding: 8px 10px; min-height: 80px; resize: vertical; }
label.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label.field > span { font-weight: 600; color: var(--fg); }
.hint { font-size: 12px; color: var(--muted); }
.error-text { color: var(--danger); font-size: 13px; }

/* top bar */
.topbar { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--brand);
  color: #fff; }
.topbar .btn, .topbar .icon-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); color: #fff; }
.topbar .btn:hover, .topbar .icon-btn:hover { background: rgba(255,255,255,.22); }
.topbar .hint { color: #e3f0fa; }
.topbar a.btn { color: #fff; }
.logo { height: 26px; width: auto; display: block; }
.brand-name { color: #fff; font-weight: 650; }
.brand { font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand .mark { width: 22px; height: 22px; border-radius: 5px; background: var(--accent); display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700; }
.topbar .spacer { flex: 1; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px;
  font-weight: 700; color: #fff; background: #6b7c93; flex: none; }

/* cards / pages */
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--brand-dark); border-color: var(--brand); }
table.list { width: 100%; border-collapse: collapse; background: var(--paper); }
table.list th, table.list td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
table.list tr:hover td { background: #fafbfc; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--head); color: var(--muted); }
.pill.green { background: var(--accent-soft); color: var(--accent); }
.pill.amber { background: var(--warn-soft); color: #8a5a00; }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* toast & modal */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; }
.toast { background: #1d2430; color: #fff; padding: 9px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  max-width: min(560px, 90vw); font-size: 13px; }
.toast.error { background: var(--danger); }
.modal-back { position: fixed; inset: 0; background: rgba(20, 26, 36, .35); display: grid; place-items: center; z-index: 900; padding: 16px; }
.modal { background: var(--paper); border-radius: 12px; width: min(560px, 100%); max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(980px, 100%); }
.modal header { padding: 16px 20px 0; font-weight: 700; font-size: 16px; }
.modal .body { padding: 14px 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.modal .body > * { min-width: 0; }
.modal footer { padding: 12px 20px 16px; display: flex; gap: 8px; justify-content: flex-end; }

/* menus & popovers */
.menu { position: fixed; z-index: 950; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 4px; min-width: 200px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 10px;
  border-radius: 5px; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--head); outline: none; }
.menu button .kbd { margin-left: auto; color: var(--faint); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px 0; }
.popover { position: fixed; z-index: 950; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 12px; width: 280px; display: grid; gap: 10px; }
.checklist { max-height: 240px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 6px; padding: 4px; }
.checklist label { display: flex; gap: 8px; padding: 3px 6px; align-items: center; font-size: 13px; }

/* login */
.login-wrap { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px 16px; background: var(--brand); }
.login-wrap .logo { height: 40px; }
.login { width: min(400px, 100%); display: grid; gap: 14px; }

/* error form */
.ef-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.ef-job { position: relative; }
.ef-jobs { position: absolute; top: 58px; left: 0; right: 0; z-index: 5; background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); max-height: 240px; overflow: auto; }
.ef-jobit { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; cursor: pointer; color: var(--fg); }
.ef-jobit:hover { background: var(--head); }
.ef-drop { border: 2px dashed var(--line); border-radius: 8px; padding: 10px; min-height: 90px; background: #fafbfc; outline: none; }
.ef-drop:focus, .ef-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.ef-drop-text { color: var(--muted); font-size: 13px; }
.ef-browse { color: var(--accent); text-decoration: underline; cursor: pointer; }
.ef-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ef-file { position: relative; width: 120px; display: grid; gap: 2px; }
.ef-file img { width: 120px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; background: #fff; }
.ef-doc { display: grid; place-items: center; height: 84px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px;
  padding: 4px; text-align: center; overflow: hidden; background: #fff; color: var(--fg); text-decoration: none; }
.ef-fn { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ef-x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6);
  color: #fff; line-height: 1; }
details summary { cursor: pointer; }

.update-bar { background: #b42318; color: #fff; padding: 10px 16px; font-weight: 600; }

/* notification bell */
.bell { position: relative; font-size: 16px; }
.bell-n { position: absolute; top: -2px; right: -4px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px;
  font-weight: 700; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
.bell-list { display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.bell-it { display: flex; gap: 8px; padding: 7px 8px; border-radius: 6px; text-decoration: none; color: var(--fg); font-size: 13px; }
.bell-it:hover { background: var(--head); }
.bell-it.unread { background: var(--accent-soft); }
.bell-k { width: 20px; flex: none; text-align: center; color: var(--accent); font-weight: 700; }
