:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f6f7f9;
  --bg: #f6f7f9;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --brand: #111827;
  --brand-soft: #f3f4f6;
  --blue: #2563eb;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 20px;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.10), 0 2px 8px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30vw),
    linear-gradient(180deg, #fafafa 0%, var(--bg) 100%);
}

.shell {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 2px;
  scrollbar-width: thin;
}
body.collapsed .shell { display: none; }

header,
.card {
  background: var(--surface);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 16px;
}
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

h1 { margin: 0 0 5px; font-size: 18px; line-height: 1.15; letter-spacing: -0.03em; }
h2 { margin: 0 0 12px; font-size: 14px; letter-spacing: -0.01em; }
h3 { margin: 0 0 8px; font-size: 13px; }
p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.card { padding: 16px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.wide, .wide-all { grid-column: 1 / -1; }
.wide-actions { grid-column: 1 / -1; justify-content: flex-start; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-size: 12px;
  font-weight: 650;
}
.check { flex-direction: row; align-items: center; gap: 8px; padding: 2px 0 6px; color: var(--muted); }

select,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"] {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-solid);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
select:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}
input[type="checkbox"] { accent-color: var(--brand); width: 16px; height: 16px; }

.status {
  white-space: nowrap;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #047857;
  border: 1px solid #bbf7d0;
  font-weight: 750;
  font-size: 11px;
}
.status.error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.timer-card { text-align: center; padding: 18px 16px; }
.timer {
  margin: 2px 0 4px;
  font-size: clamp(48px, 11vw, 76px);
  font-weight: 780;
  line-height: .98;
  letter-spacing: -0.055em;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.muted { color: var(--muted); margin-bottom: 14px; min-height: 20px; font-size: 12px; line-height: 1.45; }
.actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

button {
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 38px;
  padding: 9px 14px;
  background: #f3f4f6;
  color: #111827;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, opacity .14s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10); }
button:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
button:disabled { opacity: .42; cursor: not-allowed; }
button.primary { background: #111827; color: #fff; }
button.danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
button.ghost { background: #fff; border-color: var(--line); padding: 8px 12px; font-size: 12px; }
.owner-primary-start {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 15px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.22);
}
.nav-link.ghost {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #111827;
  font-size: 12px;
  font-weight: 750;
}

.edit-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 14px;
}
.edit-panel[hidden] { display: none; }
.edit-panel h3,
.edit-panel p { grid-column: 1 / -1; }

.entries.empty { color: var(--muted); font-size: 13px; }
.entry {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  line-height: 1.45;
  font-size: 13px;
}
.entry:first-child { border-top: 0; padding-top: 0; }
.entry:last-child { padding-bottom: 0; }
.note { color: var(--muted); margin-top: 3px; }
.entry-actions { margin-top: 9px; }
.entry-actions button { min-height: 32px; padding: 7px 11px; border-radius: 999px; font-size: 12px; }

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 750;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid var(--line);
  vertical-align: middle;
}
.pill.running { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.pill.paused { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pill.stopped { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill.billable { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.pill.danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.floating-timer-btn {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  border-radius: 999px;
  padding: 13px 17px;
  background: #111827;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
body.collapsed .floating-timer-btn { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 560px) {
  .shell { right: 8px; bottom: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  header { flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .grid, .edit-panel { grid-template-columns: 1fr; }
  .wide, .wide-all, .wide-actions { grid-column: auto; }
  .status { white-space: normal; }
  .timer { font-size: clamp(44px, 16vw, 64px); }
}


/* VT_app admin dashboard UX — 2026-05-24 */
body.admin-dashboard {
  background: #f6f5f2;
}

.admin-dashboard .admin-shell {
  position: static;
  width: 100%;
  max-height: none;
  min-height: 100vh;
  overflow: visible;
  padding: 24px;
}

.admin-dashboard .admin-topbar {
  max-width: 1480px;
  margin: 0 auto 16px;
}

.admin-dashboard .admin-topbar h1 {
  font-size: 28px;
  letter-spacing: -0.05em;
}

.admin-eyebrow {
  margin: 0 0 6px;
  color: #7c756e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.admin-sidebar,
.admin-detail-drawer {
  position: sticky;
  top: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.admin-sidebar {
  padding: 18px;
}

.admin-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.admin-brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #111827;
  color: #fff;
  font-weight: 850;
}

.admin-brand strong,
.admin-brand span {
  display: block;
}

.admin-brand span {
  color: var(--muted);
  font-size: 12px;
}

.admin-side-nav {
  display: grid;
  gap: 6px;
}

.admin-side-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.admin-side-nav a:hover,
.admin-side-nav a.active {
  background: #111827;
  color: #fff;
  text-decoration: none;
}

.admin-side-nav span {
  color: inherit;
  opacity: 0.78;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.admin-guardrails {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-guardrails strong {
  color: var(--text);
}

.admin-content {
  min-width: 0;
}

.admin-session-card {
  margin-bottom: 16px;
}

.admin-screen {
  display: none;
}

.admin-screen.active {
  display: block;
}

.admin-hero,
.admin-module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
}

.admin-hero h2,
.admin-module-header h2 {
  margin: 0 0 8px;
  color: #111827;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.admin-module-header h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.admin-safety-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 320px;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-metric-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.admin-metric-card strong {
  display: block;
  color: #111827;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}

.admin-metric-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
}

.admin-action-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 9px;
  background: #fff;
}

.decision-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0;
}
.decision-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
}
.decision-meta strong { color: #1f2937; }

.admin-action-rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-module-card {
  display: block;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.admin-module-card:hover {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
  text-decoration: none;
}

.admin-module-card header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
}

.admin-module-card h3 {
  margin: 0;
  font-size: 14px;
}

.admin-module-card p {
  font-size: 12px;
}

.admin-module-count {
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 11px;
  font-weight: 850;
}

.admin-module-count.secondary {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

.admin-module-count.good {
  background: #ecfdf5;
  color: #047857;
  border-color: #bbf7d0;
}

.admin-detail-drawer {
  display: none;
  position: fixed;
  right: 24px;
  top: 96px;
  z-index: 500;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 20px;
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22), 0 0 0 9999px rgba(17, 24, 39, 0.08);
}

.admin-detail-drawer.active {
  display: block;
}

.admin-detail-close {
  float: right;
}

.admin-detail-drawer h2 {
  margin: 8px 0 12px;
  font-size: 20px;
}

.admin-detail-body {
  clear: both;
}

.decision-answers {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 18px;
  background: #eff6ff;
}

.decision-answers h3 {
  margin: 0;
  color: #1e3a8a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.decision-answers p,
.decision-answers li {
  color: #111827;
  font-size: 13px;
}

.clickable-row {
  cursor: pointer;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid transparent;
}

.clickable-row:hover,
.clickable-row:focus-within {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.row-cta {
  margin-top: 8px;
}

.owner-only-header {
  border-color: #fed7aa;
  background: #fffaf2;
}

@media (max-width: 1180px) {
  .admin-app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .admin-overview-grid,
  .admin-overview-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-dashboard .admin-shell {
    padding: 12px;
  }
  .admin-app-shell,
  .admin-overview-grid,
  .admin-overview-columns,
  .admin-module-grid {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    position: static;
  }
  .admin-detail-drawer {
    top: 12px;
    right: 12px;
    max-height: calc(100vh - 24px);
  }
  .admin-hero,
  .admin-module-header {
    display: grid;
  }
  .admin-safety-badges {
    justify-content: flex-start;
  }
  .admin-action-entry {
    grid-template-columns: auto 1fr;
  }
  .admin-action-entry button {
    grid-column: 2;
    justify-self: start;
  }
}
