/* =========================================================================
   Mauveworx Proof Portal — stylesheet
   Same design language as viewer-theme-2026.css: Inter, violet–teal accent,
   soft canvas, elevated cards, rounded 2026 controls.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --font: 'Inter', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --accent: #6D5DF7;
  --accent-2: #16C7B8;
  --accent-soft: rgba(109, 93, 247, 0.12);
  --accent-glow: rgba(109, 93, 247, 0.35);
  --canvas: #E9EAF3;
  --ink: #17182A;
  --ink-soft: rgba(23, 24, 42, 0.62);
  --card: #FFFFFF;
  --line: rgba(23, 24, 42, 0.09);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(21,20,40,0.06), 0 18px 40px -14px rgba(21,20,40,0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ok: #17A567;
  --warn: #D97706;
  --bad: #DC2626;
}

/* Dark theme — same palette the PDF viewer already uses, toggled the same
 * way (html.theme-dark), so the whole product feels consistent whichever
 * screen you're on. Every rule elsewhere already reads these as CSS
 * variables, so this one block is the entire theme swap. */
html.theme-dark {
  --accent: #8C7CFF;
  --accent-2: #2FE6D6;
  --accent-soft: rgba(140, 124, 255, 0.16);
  --accent-glow: rgba(140, 124, 255, 0.5);
  --canvas: #0A0B12;
  --ink: #F1F1FA;
  --ink-soft: rgba(241, 241, 250, 0.62);
  --card: #16171F;
  --line: rgba(255, 255, 255, 0.09);
  --ok: #22C77E;
  --warn: #F0A020;
  --bad: #F0453D;
}
html.theme-dark body {
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(140,124,255,0.14), transparent 60%),
    radial-gradient(900px 460px at 105% 0%, rgba(47,230,214,0.08), transparent 55%),
    var(--canvas);
}
html.theme-dark dialog.mw::backdrop { background: rgba(0,0,0,0.6); }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(109,93,247,0.14), transparent 60%),
    radial-gradient(900px 460px at 105% 0%, rgba(22,199,184,0.10), transparent 55%),
    var(--canvas);
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 60px;
  padding: 0 26px;
  background: rgba(255,255,255,0.72);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
          backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 14px -6px var(--accent-glow);
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand-logo { height: 26px; max-width: 220px; object-fit: contain; display: block; }
/* Show the light-theme logo by default; swap to the dark-theme one the
 * same way every other themed color already switches (html.theme-dark),
 * no JS involved in the swap itself. If only one theme has a logo
 * uploaded, brand_logo_relative_url() already points both variants at
 * it, so this still shows correctly either way. */
.brand-logo-dark { display: none; }
html.theme-dark .brand-logo-light { display: none; }
html.theme-dark .brand-logo-dark { display: block; }
.brand-login-logo img { height: 40px; max-width: 260px; object-fit: contain; }
.logo-preview {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 10px;
  padding: 12px 14px; background: var(--canvas); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.logo-preview img { height: 36px; max-width: 200px; object-fit: contain; }
.f-check-inline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.f-check-inline input { width: auto; }

/* Searchable multi-select picker (groups / people) */
.mw-picker {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 6px 8px;
}
.mw-picker-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 4px;
}
.mw-picker-chips:empty { margin-bottom: 0; }
.mw-picker-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; font-weight: 700;
  padding: 4px 6px 4px 10px; border-radius: 999px;
}
.mw-picker-chip button {
  border: none; background: rgba(109,93,247,0.16); color: var(--accent);
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  font-size: 11px; line-height: 1; padding: 0;
}
.mw-picker-chip button:hover { background: var(--bad); color: #fff; }
.mw-picker-search {
  border: none; outline: none; width: 100%; padding: 4px 2px;
  font-family: var(--font); font-size: 14px; background: transparent;
}
.mw-picker-dropdown {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 16px 32px -12px rgba(23,24,42,0.18);
  max-height: 220px; overflow-y: auto; z-index: 50;
}
.mw-picker-dropdown.hidden { display: none; }
.mw-picker-option {
  padding: 8px 12px; font-size: 14px; cursor: pointer;
}
.mw-picker-option:hover, .mw-picker-option.active { background: var(--canvas); }
.mw-picker-empty { padding: 8px 12px; font-size: 13px; color: var(--ink-soft); }
.topnav { display: flex; gap: 4px; flex: 1; }
.navlink {
  text-decoration: none; color: var(--ink-soft);
  font-weight: 600; font-size: 14px;
  padding: 8px 14px; border-radius: 999px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.navlink:hover { background: var(--accent-soft); color: var(--ink); }
.navlink.active { background: var(--accent-soft); color: var(--accent); }
.nav-count {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(23,24,42,0.08); color: var(--ink-soft);
}
.navlink.active .nav-count { background: rgba(109,93,247,0.18); color: var(--accent); }
html.theme-dark .nav-count { background: rgba(255,255,255,0.10); }
html.theme-dark .navlink.active .nav-count { background: rgba(140,124,255,0.22); }
.nav-menu-toggle {
  display: none;   /* shown only on mobile, see the max-width:900px block below */
  align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); cursor: pointer; flex-shrink: 0;
}
.nav-menu-toggle svg { width: 20px; height: 20px; }
.nav-menu-toggle:hover { background: var(--canvas); color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.theme-dark .theme-toggle .icon-sun { display: block; }
html.theme-dark .theme-toggle .icon-moon { display: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.username { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ------------------------------------------------------------- layout */
.page { max-width: var(--page-max-width, 1160px); margin: 0 auto; padding: 30px 26px 60px; }
.page-full { max-width: none; padding: 0; }

.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; flex: 1; }
.page-sub { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card h2 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

.grid { display: grid; gap: 18px; }
.grid-jobs { grid-template-columns: var(--jobs-grid-cols, repeat(auto-fill, minmax(320px, 1fr))); }

.job-card {
  position: relative;
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.job-card:hover { transform: translateY(-3px); box-shadow: 0 2px 3px rgba(21,20,40,0.06), 0 26px 50px -16px rgba(21,20,40,0.30); }
.jc-stretched-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.jc-thumb {
  display: flex; align-items: center; justify-content: center;
  width: 112px; height: 112px; margin: 16px auto 0; flex-shrink: 0;
  background:
    repeating-conic-gradient(var(--canvas) 0% 25%, transparent 0% 50%) 50% / 12px 12px,
    var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.jc-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center center; }
.jc-body { padding: 12px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.jc-select {
  position: relative; z-index: 2;
  width: 17px; height: 17px; margin: 2px 0 0; flex-shrink: 0; cursor: pointer;
}
.job-card .jc-top { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; position: relative; z-index: 2; pointer-events: none; }
.job-card .jc-select { pointer-events: auto; }
.job-card h3 { font-size: 15px; font-weight: 700; flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.job-card .jc-meta { color: var(--ink-soft); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 14px; position: relative; z-index: 0; pointer-events: none; }
.job-card .jc-foot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; position: relative; z-index: 0; pointer-events: none; }

.bulkBar {
  position: sticky;
  bottom: 20px;
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px -16px rgba(0,0,0,0.4);
  font-size: 14px;
  font-weight: 600;
}
.bulkBar.hidden { display: none; }
.bulkBar .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.25); }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-awaiting { background: rgba(109,93,247,0.12); color: var(--accent); }
.badge-changes  { background: rgba(217,119,6,0.12);  color: var(--warn); }
.badge-approved { background: rgba(23,165,103,0.12); color: var(--ok); }
.badge-master   { background: rgba(22,199,184,0.14); color: #0E8A80; }
.badge-role     { background: rgba(23,24,42,0.07); color: var(--ink-soft); }

.master-progress { display: flex; flex-direction: column; gap: 5px; }
.master-progress-bar {
  width: 100%; height: 8px; border-radius: 999px;
  background: rgba(23,24,42,0.08); overflow: hidden;
}
html.theme-dark .master-progress-bar { background: rgba(255,255,255,0.10); }
.master-progress-fill {
  height: 100%; border-radius: 999px; background: #0E8A80;
  transition: width 200ms var(--ease);
}

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease),
              background-color 150ms var(--ease);
  color: var(--ink);
  background: rgba(23,24,42,0.06);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8A7DF9);
  color: #fff;
  box-shadow: 0 10px 22px -10px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 14px 26px -10px var(--accent-glow); }
.btn-approve { background: linear-gradient(135deg, #17A567, #2FCB8B); color: #fff; box-shadow: 0 10px 22px -10px rgba(23,165,103,0.5); }
.btn-changes { background: linear-gradient(135deg, #D97706, #F59E0B); color: #fff; box-shadow: 0 10px 22px -10px rgba(217,119,6,0.5); }
.btn-danger  { background: rgba(220,38,38,0.10); color: var(--bad); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

/* ------------------------------------------------------------- forms */
label.f-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=number],
select, textarea {
  width: 100%;
  font-family: var(--font); font-size: 14px; color: var(--ink);
  padding: 10px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 74px; }
.f-row { display: flex; gap: 14px; }
.f-row > * { flex: 1; }
.f-check { display: flex; align-items: center; gap: 9px; font-size: 14px; margin-top: 14px; }
.f-check input { width: auto; }

.flash {
  padding: 12px 16px; border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; margin-bottom: 18px;
}
.flash-ok  { background: rgba(23,165,103,0.12); color: var(--ok); }
.flash-err { background: rgba(220,38,38,0.10); color: var(--bad); }

/* ------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.tbl th.sortable {
  cursor: pointer; user-select: none; position: relative; padding-right: 20px;
}
.tbl th.sortable:hover { color: var(--ink); }
.tbl th.sortable::after {
  content: ''; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 4px solid transparent; border-top-color: var(--ink-soft); opacity: 0.35;
}
.tbl th.sortable.sort-asc::after { border-top-color: transparent; border-bottom-color: var(--accent); opacity: 1; margin-top: -4px; }
.tbl th.sortable.sort-desc::after { border-top-color: var(--accent); opacity: 1; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(109,93,247,0.04); }

/* ------------------------------------------------------------- login */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  width: 400px; max-width: 100%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow);
  padding: 38px 34px;
}
.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card h1 { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.login-card .page-sub { text-align: center; margin-bottom: 10px; }

/* ------------------------------------------------------------- review page */
.review {
  display: grid;
  grid-template-columns: 1fr 440px;
  height: calc(100vh - 60px);
}
.review-viewer { position: relative; background: var(--canvas); min-width: 0; }
.review-viewer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.viewerError {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: rgba(233, 234, 243, 0.92);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.viewerError.hidden { display: none; }
.viewerError-card {
  max-width: 420px; text-align: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 28px 30px;
}
.viewerError-card h2 { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.viewerError-card p { font-size: 13.5px; line-height: 1.55; margin-bottom: 16px; }

.review-side {
  border-left: 1px solid var(--line);
  background: var(--card);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
}
.review-side-head { padding: 18px 20px 0; }
.review-side-head h1 { font-size: 17px; font-weight: 800; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-side-head .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-soft); font-size: 12.5px; margin: 7px 0 0; }

.tabs {
  display: flex; gap: 2px; padding: 14px 20px 0; border-bottom: 1px solid var(--line);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: var(--ink-soft); background: none; border: none; cursor: pointer;
  padding: 9px 14px; border-radius: 10px 10px 0 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap; flex-shrink: 0;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.tabpanes { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tabpane { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: none; }
.tabpane.active { display: block; }

/* Page-level tabs (e.g. Settings) — same tab button look, but normal
 * document flow instead of job.php's fixed-height split-pane layout. */
.tabs.tabs-page { padding: 0; margin-bottom: 18px; }
.tabpanes.tabpanes-page { display: block; flex: none; }
.tabpanes.tabpanes-page .tabpane { flex: none; min-height: auto; overflow: visible; padding: 0; }

.review-actions {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}
.review-actions .btn { flex: 1; }
.review-actions.approvedLock {
  align-items: center;
  background: rgba(23, 165, 103, 0.06);
}
.review-actions.approvedLock .small { flex: 1; }

/* comments */
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment .c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment .c-author { font-weight: 700; font-size: 13.5px; }
.comment .c-time { font-size: 12px; color: var(--ink-soft); }
.comment .c-page {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 999px;
  cursor: pointer; border: none; font-family: var(--font);
}
.comment .c-box {
  font-size: 11px; font-weight: 700; color: #C0392B;
  background: rgba(192, 57, 43, 0.12); padding: 2px 8px; border-radius: 999px;
  cursor: pointer; border: none; font-family: var(--font);
}
.comment .c-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.comment.resolved .c-body { opacity: 0.55; text-decoration: line-through; }
.comment .c-tools { margin-top: 6px; display: flex; gap: 10px; }
.comment .c-tools button {
  background: none; border: none; cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: 0;
}
.comment .c-tools button:hover { color: var(--accent); }
.comment .replies { margin: 8px 0 0 16px; padding-left: 12px; border-left: 2px solid var(--accent-soft); }

.comment-form { border-top: 1px solid var(--line); padding: 12px 20px 14px; }
.comment-form textarea { min-height: 56px; margin-bottom: 8px; }
.comment-form .cf-row { display: flex; gap: 8px; align-items: center; }
.comment-form .cf-row .btn { margin-left: auto; }
.pin-page {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.pin-page input { width: 56px; padding: 6px 8px; text-align: center; }

/* activity feed */
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.activity-item .a-time { color: var(--ink-soft); font-size: 12px; }

/* versions list */
.version-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.version-item:last-child { border-bottom: none; }
.version-num {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.version-item .v-meta { flex: 1; min-width: 0; }
.version-item .v-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.version-item .v-sub { color: var(--ink-soft); font-size: 12px; }
.version-item.current .version-num { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

/* decisions list */
.decision-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.decision-item:last-child { border-bottom: none; }

/* dialogs */
dialog.mw {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.45);
  background: var(--card);
  color: var(--ink);
  padding: 26px;
  width: 440px; max-width: 92vw;
  font-family: var(--font);
}
dialog.mw.wide { width: 720px; }
dialog.mw::backdrop { background: rgba(10,11,18,0.45); backdrop-filter: blur(6px); }
dialog.mw h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
dialog.mw .d-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* misc */
.muted { color: var(--ink-soft); }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; }
.spacer { flex: 1; }
.empty {
  text-align: center; color: var(--ink-soft); padding: 44px 20px;
  font-size: 14px;
}
.search-no-results.hidden { display: none; }
.search-no-results { margin-top: 8px; }
.job-search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; max-width: 980px;
}
.job-search-bar svg { width: 17px; height: 17px; color: var(--ink-soft); flex-shrink: 0; }
.search-submit-btn {
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; padding: 0; margin: 0;
  cursor: pointer; color: var(--ink-soft); flex-shrink: 0;
}
.job-search-bar input#jobSearch {
  border: none; outline: none; background: transparent;
  flex: 1 1 160px; min-width: 120px;
  font-family: var(--font); font-size: 14px; color: var(--ink);
}
.job-search-bar input#titleFilter {
  border: none; border-left: 1px solid var(--line); outline: none;
  background: transparent; flex: 0 1 150px; min-width: 110px;
  font-family: var(--font); font-size: 13.5px; color: var(--ink-soft);
  padding: 4px 4px 4px 14px;
}
.job-search-bar select#clientFilter,
.job-search-bar select#groupFilter {
  border: none; border-left: 1px solid var(--line); outline: none;
  background: transparent; font-family: var(--font); font-size: 13.5px;
  color: var(--ink-soft); flex: 0 0 auto; padding: 4px 4px 4px 14px;
  min-width: 108px; max-width: 180px; cursor: pointer;
}
.job-card.search-hidden { display: none; }
.tbl tr.search-hidden { display: none; }
.grid-jobs.hidden { display: none; }
.tbl-wrap.hidden { display: none; }
.view-toggle {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
  border-left: 1px solid var(--line); padding-left: 10px; margin-left: 2px;
}
.view-toggle-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: none; border-radius: 8px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
}
.view-toggle-btn svg { width: 16px; height: 16px; color: inherit; }
.view-toggle-btn:hover { background: rgba(23,24,42,0.05); }
.view-toggle-btn.active { background: rgba(109,93,247,0.12); color: var(--accent); }
html.theme-dark .view-toggle-btn:hover { background: rgba(255,255,255,0.08); }
html.theme-dark .view-toggle-btn.active { background: rgba(109,93,247,0.22); }
.copy-link {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: rgba(23,24,42,0.05); border-radius: 8px; padding: 8px 10px;
  word-break: break-all; overflow-wrap: break-word; max-width: 100%;
  cursor: pointer;
}
.access-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(23,24,42,0.06); border-radius: 999px;
  padding: 5px 8px 5px 12px; font-size: 12.5px; font-weight: 600; margin: 0 6px 6px 0;
}
.access-chip form { display: inline; }
.access-chip select {
  border: none; background: rgba(23,24,42,0.08); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 600; padding: 3px 6px; border-radius: 999px;
  cursor: pointer; font-family: var(--font);
}
.access-chip button {
  border: none; background: rgba(23,24,42,0.10); color: var(--ink-soft);
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  font-size: 11px; line-height: 1;
}
.access-chip button:hover { background: var(--bad); color: #fff; }

/* Analytics tab (Admin -> Settings) */
.analytics-stats {
  display: flex; flex-wrap: wrap; gap: 24px;
}
.analytics-stat {
  display: flex; flex-direction: column; gap: 4px; min-width: 110px;
}
.analytics-stat-value { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1; }
.analytics-stat-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.analytics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px; margin-top: 18px;
}
.analytics-legend {
  display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--ink-soft);
}
.analytics-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 6px; vertical-align: middle;
}

/* Groups list (Admin -> Users & Groups) — each group is a native
 * <details> element so a long list stays manageable: collapsed by
 * default, showing just the name and member count, expanding on click
 * to reveal members and the add-member form. Buttons/forms nested
 * inside <summary> call stopPropagation() on click so using them
 * doesn't also toggle the group open/closed. */
.group-details {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 0; margin-top: 10px !important;
}
.group-details[open] { padding-bottom: 14px; }
.group-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; cursor: pointer; list-style: none;
  border-radius: var(--radius-md);
}
.group-summary::-webkit-details-marker { display: none; }
.group-summary::before {
  content: '›'; display: inline-block; font-size: 18px; font-weight: 700;
  color: var(--ink-soft); transition: transform 150ms var(--ease);
  width: 14px; text-align: center;
}
.group-details[open] > .group-summary::before { transform: rotate(90deg); }
.group-summary:hover { background: rgba(23,24,42,0.03); }
html.theme-dark .group-summary:hover { background: rgba(255,255,255,0.04); }
.group-details > .mt:not(.group-summary),
.group-details > form { margin-left: 14px; margin-right: 14px; }
.group-details.search-hidden { display: none; }

.dangerZone {
  margin-top: 26px;
  padding: 14px 16px;
  border: 1px solid rgba(220,38,38,0.25);
  background: rgba(220,38,38,0.05);
  border-radius: var(--radius-md);
}
.dangerZone p { margin: 4px 0 10px; }

/* =========================================================================
   Responsive — tablet and mobile. Two breakpoints: 900px roughly covers
   tablets and narrow laptop windows, 640px covers phones. Built mobile-
   first from the top of the page down: topbar, then page-level layout,
   then the specific components (search bar, tabs, tables, dialogs,
   forms) that don't just reflow naturally on their own.
   ========================================================================= */
@media (max-width: 900px) {
  .page { padding: 20px 16px 44px; }
  .card { padding: 16px; }
  .grid-jobs { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

  .topbar { gap: 14px; padding: 0 14px; }
  .brand-name { display: none; }   /* the mark alone is enough once space is tight — logo/name still show if uploaded */
  .nav-menu-toggle { display: flex; }
  .topnav {
    display: none;
    position: absolute; top: calc(100% + 8px); left: 14px;
    flex-direction: column; gap: 2px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
    box-shadow: var(--shadow); padding: 6px; min-width: 180px; z-index: 70;
  }
  .topnav.open { display: flex; }
  .navlink { padding: 10px 14px; font-size: 14.5px; white-space: nowrap; border-radius: 8px; }
  .username { display: none; }   /* avatar initial alone identifies who's logged in when space is tight */

  .job-search-bar { flex-wrap: wrap; max-width: none; }
  .job-search-bar input#jobSearch,
  .job-search-bar input#titleFilter { min-width: 160px; flex: 1 1 160px; }
  .job-search-bar select#groupFilter,
  .job-search-bar select#clientFilter {
    border-left: none; padding-left: 4px; flex: 1 1 140px;
  }

  .tabs.tabs-page { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tabs.tabs-page::-webkit-scrollbar { display: none; }
  .tabs.tabs-page .tab, .tabs.tabs-page button { white-space: nowrap; }

  .f-row { flex-direction: column; gap: 0; }

  dialog.mw, dialog.mw.wide { width: 94vw; padding: 20px; }

  .review { grid-template-columns: 1fr; grid-template-rows: 50vh 1fr; height: auto; }
  .review-side { border-left: none; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .page-head { flex-wrap: wrap; }
  .page-head h1 { font-size: 20px; }

  .grid-jobs { grid-template-columns: 1fr; }

  .btn { padding: 9px 14px; font-size: 13.5px; }
  .d-actions { flex-wrap: wrap; }
  .d-actions .btn { flex: 1 1 auto; }

  .review-actions { flex-wrap: wrap; }
  .review-actions .btn { flex: 1 1 100%; }

  .bulkBar { flex-wrap: wrap; bottom: 10px; left: 10px; right: 10px; }

  /* Table actions column: buttons stack instead of forcing extra
   * horizontal scroll on top of the table's own — this is the one
   * column worth reflowing rather than just letting it scroll, since
   * it's pure controls, not data someone's scanning across a row. */
  .tbl td[style*="text-align:right"] {
    text-align: left !important;
    display: flex; flex-wrap: wrap; gap: 6px;
  }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 22px; }
  .avatar { width: 28px; height: 28px; font-size: 12px; }
  .theme-toggle { width: 30px; height: 30px; }
}

/* The review page (job.php, guest.php) is deliberately sized to exactly
 * fill the viewport with no page-level scroll — its own panels scroll
 * internally instead. A normal-flow footer would add height and break
 * that. guest.php's external reviewers have no other navigation, so
 * their footer becomes a small floating pill instead — still reachable,
 * out of the layout flow. job.php's internal, logged-in view already
 * has Proofs/Approved/Archive/Settings one click away in its topbar, so
 * there it's simplest to just hide the footer rather than float
 * something over the PDF underneath it. Distinguishing the two isn't
 * as simple as "has a topbar" — guest.php has its own similarly-styled
 * header for branding, just without real nav links in it — so this
 * keys off .navlink specifically, which only job.php's topbar has. */
body:has(.review) footer {
  position: fixed; bottom: 10px; left: 14px; z-index: 40;
  padding: 5px 12px; margin: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow);
}
body:has(.review):has(.navlink) footer { display: none; }

/* The login page is also a fixed 100vh layout with no scroll — the
 * global footer would land below the fold there. It already has its
 * own privacy link inside the visible card, so just hide the global
 * one to avoid showing it twice (once reachable, once not). */
body:has(.login-stage) footer { display: none; }
