/* This file is served with a 4-hour browser cache (Cloudflare Pages default
   for static assets). Every page that links it does so via a "?v=YYYYMMDDx"
   query string precisely so a change here takes effect immediately instead
   of waiting out that cache -- bump the version on EVERY <link> to this file
   (grep for "app.css?v=") whenever you edit it, or visitors keep seeing the
   old styles for up to 4 hours after deploy. */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --gold: #B8975A;
  --gold-light: #D4AF72;
  --gold-pale: #F0E6D3;
  --cream: #FAF8F4;
  --cream-dark: #F2EDE4;
  --charcoal: #1C1C1C;
  --charcoal-light: #3A3A3A;
  --gray: #8A8A8A;
  --gray-light: #E8E4DC;
  --white: #FFFFFF;
  --taupe: #6F675E;
  --taupe-light: #8A8177;
  --ivory: #F7F3EC;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #E53935;
  --info: #1E88E5;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow: 0 4px 20px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.14);
  --radius: 10px;
  --radius-lg: 3px;
  --transition: all 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  line-height: 1.2;
  color: var(--charcoal);
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-light); }

/* ── Layout ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo img { height: 36px; }

.sidebar-logo .app-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 16px 24px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.65);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}

.nav-item.active {
  background: rgba(184,151,90,0.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  flex-shrink: 0;
}

.user-name { font-size: 0.8rem; font-weight: 600; color: var(--white); }
.user-role { font-size: 0.65rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }

.logout-btn {
  margin-left: auto;
  background: none; border: none;
  color: var(--gray); cursor: pointer;
  padding: 4px; border-radius: 4px;
  transition: var(--transition);
}
.logout-btn:hover { color: var(--danger); }

.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0; z-index: 50;
}

.topbar-title { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-body {
  /* .page-body is a flex item of .dash-main (column direction) -- an auto
     margin on a flex item's cross axis disables the default stretch instead
     of centering a stretched box, so without an explicit width this shrinks
     to its content's width first and centers THAT, not the intended
     "stretch, then cap at max-width, then center" (a real flexbox gotcha,
     not obvious from the rule alone). */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 48px 40px;
  box-sizing: border-box;
  flex: 1;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
}

.card-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 600; }
.card-body { padding: 20px 24px; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--gray-light);
}

.stat-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gray); margin-bottom: 6px; }
.stat-value { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 600; color: var(--charcoal); }
.stat-sub { font-size: 0.75rem; color: var(--gray); margin-top: 4px; }

/* High-emphasis stat-card variants -- e.g. Home's "Open Tickets" (dark) and
   "Year-End Reviews" (tan) cards, so the one or two numbers that matter most
   on a page stand out from the plain white stat-cards around them. */
.stat-card-dark { background: var(--charcoal); border-color: var(--charcoal); }
.stat-card-dark .stat-label { color: var(--gold-light); }
.stat-card-dark .stat-value { color: var(--white); }
.stat-card-dark .stat-sub { color: rgba(255,255,255,0.6); }
.stat-card-tan { background: var(--gold-pale); border-color: var(--gold-light); }
.stat-card-tan .stat-label { color: var(--gold); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
}
.btn-primary:hover { background: var(--charcoal); color: var(--white); }

.btn-secondary {
  background: var(--cream-dark);
  color: var(--charcoal);
  border: 1px solid var(--gray-light);
}
.btn-secondary:hover { background: var(--gray-light); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c62828; color: var(--white); }

.btn-ghost {
  background: none;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-ghost:hover { background: var(--gold); color: var(--white); }

.btn-sm { padding: 6px 14px; font-size: 0.74rem; }
.btn-lg { padding: 13px 28px; font-size: 0.88rem; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal-light);
  margin-bottom: 7px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-light);
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: var(--charcoal);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,151,90,0.12);
}

textarea { resize: vertical; min-height: 100px; }

/* ── Inline editing (js/inline-edit.js) ──
   [data-editable] elements had no visual affordance at all before this —
   nothing indicated they were clickable, and the swapped-in input/select
   used bare browser defaults. This makes editable fields discoverable and
   the edit/save states legible. */
[data-editable] {
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 4px;
  margin: -1px -4px;
  transition: var(--transition);
}
[data-editable]:hover:not(.gdc-editing) {
  background: rgba(184,151,90,0.1);
  box-shadow: inset 0 0 0 1px rgba(184,151,90,0.35);
}
[data-editable]:hover:not(.gdc-editing)::after {
  content: '✎';
  font-size: 0.7em;
  margin-left: 5px;
  color: var(--gold);
  opacity: 0.8;
}
.gdc-inline-input {
  width: 100%;
  min-width: 90px;
  padding: 4px 8px;
  border: 1.5px solid var(--gold);
  border-radius: 6px;
  font-family: inherit;
  font-size: inherit;
  color: var(--charcoal);
  background: var(--white);
  outline: none;
}
.gdc-saving { opacity: 0.6; pointer-events: none; }
.gdc-saved { box-shadow: inset 0 0 0 1px #2E7D32; background: #E8F5E9; }
.gdc-empty { color: var(--gray); font-style: italic; }
.gdc-inline-error {
  display: block;
  font-size: 0.68rem;
  color: var(--danger);
  margin-top: 2px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-gold { background: var(--gold-pale); color: var(--gold); }
.badge-green { background: #E8F5E9; color: #2E7D32; }
.badge-red { background: #FFEBEE; color: #C62828; }
.badge-blue { background: #E3F2FD; color: #1565C0; }
.badge-gray { background: var(--gray-light); color: var(--gray); }
/* Stronger, more saturated gold than .badge-gold (which is intentionally
   pale/subtle for branding accents elsewhere) — used for status indicators
   like "worked over scheduled hours" that need the same visual pop as the
   red/green status badges. */
.badge-hours-over { background: #FEF3C7; color: #92400E; }

/* ── Badge selects (inline-editable status badges) ── */
.badge-select {
  display: inline-flex;
  align-items: center;
  min-width: 118px;
  white-space: nowrap;
  padding: 3px 22px 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
}
.badge-select.badge-gold { color: var(--gold); }
.badge-select.badge-green { color: #2E7D32; }
.badge-select.badge-red { color: #C62828; }
.badge-select.badge-gray { color: var(--gray); }

/* ── Dot toggles (year-end checklist) ── */
.dot-toggle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gray-light);
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: var(--transition);
}
.dot-toggle.on {
  background: #2E7D32;
  border-color: #2E7D32;
}
.dot-toggle:hover { border-color: var(--gold); }

/* ── Inline text cell (year-end table) ── */
.cell-input {
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.83rem;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 4px;
  width: 100%;
}
.cell-input:hover { border-color: var(--gray-light); }
.cell-input:focus { border-color: var(--gold); outline: none; background: var(--white); }

/* ── Progress ── */
.progress-bar {
  background: var(--gray-light);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 20px;
  transition: width 0.6s ease;
}

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  border-bottom: 2px solid var(--gray-light);
  background: var(--cream);
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--gray-light);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--cream); }

.sop-evidence-link {
  color: var(--gold-dark, #8f6f34);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sop-evidence-link:hover { color: var(--dark); }

.sop-task-list { margin: 0; padding-left: 18px; }
.sop-task-list li { margin-bottom: 4px; }
.sop-task-list li:last-child { margin-bottom: 0; }
/* Scoped to this one column (not every .data-table's 2nd column app-wide)
   via cliRenderSopTable()'s explicit class, since the default auto table
   layout otherwise squeezes a bullet list of Task steps illegibly narrow. */
.sop-col-task { min-width: 320px; width: 30%; }

/* ── Candyland Journey ── */
.journey-map {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.month-block {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-light);
  overflow: hidden;
}

.month-header {
  background: var(--charcoal);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.month-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 600; }

.weeks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.week-card {
  padding: 16px;
  border-right: 1px solid var(--gray-light);
  border-top: 1px solid var(--gray-light);
  cursor: pointer;
  transition: var(--transition);
}

.week-card:last-child { border-right: none; }
.week-card:hover { background: var(--cream); }
.week-card.current { background: rgba(184,151,90,0.06); border-top-color: var(--gold); }
.week-card.completed { background: #F1F8E9; }

.week-number {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 4px;
}

.week-card.current .week-number { color: var(--gold); }
.week-card.completed .week-number { color: #558B2F; }

.week-progress { margin-top: 8px; }
.week-progress-text { font-size: 0.7rem; color: var(--gray); margin-top: 4px; }

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-light);
  margin-bottom: 24px;
  gap: 0;
}

.tab-btn {
  padding: 11px 20px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.04em;
}

.tab-btn:hover { color: var(--charcoal); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Checklist ── */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
}

.checklist-item:last-child { border-bottom: none; }

.check-box {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-light);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.check-box:hover { border-color: var(--gold); }
.check-box.checked { background: var(--gold); border-color: var(--gold); }
.check-box.checked::after { content: '✓'; color: white; font-size: 11px; font-weight: 700; }

.checklist-item.completed .check-label { text-decoration: line-through; color: var(--gray); }

.check-label { font-size: 0.85rem; font-weight: 500; }
.check-desc { font-size: 0.75rem; color: var(--gray); margin-top: 2px; }

/* ── Ticket Thread ── */
.ticket-message {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.ticket-message.from-gdc { flex-direction: row-reverse; }

.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.83rem;
  line-height: 1.5;
}

.ticket-message:not(.from-gdc) .message-bubble {
  background: var(--cream-dark);
  border-bottom-left-radius: 0;
}

.ticket-message.from-gdc .message-bubble {
  background: var(--gold);
  color: var(--white);
  border-bottom-right-radius: 0;
}

.message-meta { font-size: 0.68rem; color: var(--gray); margin-top: 4px; }

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--gray-light);
}

.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo img { height: 48px; }
.login-logo h2 { margin-top: 16px; font-size: 1.5rem; }
.login-logo p { font-size: 0.8rem; color: var(--gray); margin-top: 4px; }

.login-divider {
  text-align: center;
  font-size: 0.7rem;
  color: var(--gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 24px 0;
  position: relative;
}

.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%; width: calc(50% - 24px);
  height: 1px; background: var(--gray-light);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

/* ── Grid Helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-error { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.alert-info { background: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }
.alert-warning { background: #FFF8E1; color: #E65100; border: 1px solid #FFE082; }

/* ── Loading ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--gray-light);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(250,248,244,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .weeks-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .weeks-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 20px 16px; }
}

/* ── Admin Dashboard Shell (public/admin/dashboard.html only) ──
   Two-row horizontal header + per-section hero band + persistent
   ticker/footer, replacing that page's old vertical sidebar + topbar.
   Deliberately new class names (dash-*, hero-*, .actions-bar, .app-ticker,
   .app-footer) rather than redefining .app-shell/.sidebar/.topbar/
   .main-content -- those classes' existing rules above are still
   load-bearing for client/portal.html and employee/portal.html (both keep
   their own vertical-sidebar shell) and learning/index.html (its own
   .topbar), so none of that is touched here. Where a shared class IS reused
   (.nav-item, .user-avatar/.user-name/.user-role/.logout-btn/.user-pill,
   .topbar-actions), only new descendant-scoped overrides are added below;
   their base rules above are untouched. */
.dash-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dash-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  box-sizing: border-box;
}

.dash-header-top { height: 60px; }

.dash-wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dash-wordmark-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--charcoal);
}

/* Matches gracedouganconsulting.com's wordmark: "Grace Dougan" set roman,
   "Consulting" in the same serif but italic right beside it -- not a small
   tracked-caps subtitle. */
.dash-wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--charcoal-light);
}

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* .user-pill/.user-avatar/.user-role/.logout-btn keep their shared rules
   above (also used by client/portal.html's dark sidebar footer) -- only
   .user-name needs an override here, since its shared default is white
   text meant for a charcoal sidebar background. */
.dash-user .user-name { color: var(--charcoal); }

.dash-nav-row {
  display: flex;
  align-items: center;
  /* .dash-header-row (shared with the top wordmark/user row, where
     space-between is correct) sets justify-content: space-between --
     override it here or the nav items spread across the full row width
     with growing gaps instead of sitting together with a fixed gap. */
  justify-content: flex-start;
  gap: 32px;
  padding: 0 48px;
  height: 50px;
  border-top: 1px solid var(--gray-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Horizontal re-lay of the same .nav-item elements used elsewhere (e.g.
   client/portal.html's vertical sidebar) -- scoped to this row so the
   shared .nav-item rule above (vertical, left-border-accent) is untouched
   for that other page. */
.dash-nav-row .nav-item {
  flex-shrink: 0;
  height: 100%;
  padding: 0;
  border-left: none;
  border-bottom: 2px solid transparent;
  color: var(--charcoal-light);
  font-size: 0.78rem;
}
.dash-nav-row .nav-item:hover {
  background: none;
  color: var(--charcoal);
}
.dash-nav-row .nav-item.active {
  background: none;
  border-left-color: transparent;
  border-bottom-color: var(--gold);
  color: var(--charcoal);
}
/* Vertical-nav-only grouping dividers; the horizontal nav has none left in
   its markup except this one (kept for its id, toggled by CLI_NAV_IDS). */
.dash-nav-row .nav-section-label { display: none; }

/* ── Hero band (per-section eyebrow/title/subtitle/stats -- see HERO_META
   and setHeroBand() in dashboard.html's showSection()) ── */
.hero-band {
  /* Full-bleed tint background; .hero-band-inner (below) carries the actual
     flex layout + the shared max-width so this lines up with the header/nav/
     page-body. The horizontal padding lives on .hero-band-inner (not here),
     matching how .dash-header-row/.actions-bar/.page-body all apply their
     own max-width+margin:auto+padding on the same element -- putting the
     padding out here instead (while centering happens one level in) used to
     add an extra ~48px of left margin from the auto-centering on top of this
     padding whenever the viewport exceeded max-width+2*padding, visibly
     shifting the greeting/eyebrow left of the wordmark/nav/page content
     above and below it. */
  padding: 18px 0;
}
.hero-band.hidden { display: none; }
.hero-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px;
  box-sizing: border-box;
}

.hero-tint-neutral { background: var(--cream-dark); }
.hero-tint-sage { background: #EAF2EA; }
.hero-tint-lavender { background: #EFEDF5; }
.hero-tint-peach { background: #FBEEE3; }
.hero-tint-yellow { background: #FBF3DE; }

.hero-main { max-width: 640px; }

.hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
  min-height: 1em;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--charcoal);
}

.hero-subtitle {
  font-size: 0.84rem;
  color: var(--gray);
  margin-top: 4px;
  max-width: 56ch;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
/* Existing per-section stat-strip wrappers (.grid-3/.grid-4, holding plain
   .stat-card markup) get physically relocated in here at runtime by
   setHeroBand() -- flatten their fixed column grid into a wrapping row
   sized to the hero, and lighten the cards against the tint background,
   rather than inventing new stat-card markup for the hero. */
.hero-stats .grid-2, .hero-stats .grid-3, .hero-stats .grid-4 {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-stats .stat-card {
  background: rgba(255,255,255,0.7);
  min-width: 96px;
  padding: 10px 16px;
}
.hero-stats .stat-value { font-size: 1.5rem; }
.hero-stats .stat-label { margin-bottom: 3px; }

/* Section action buttons (e.g. "+ New Client") -- same #topbar-actions
   element as before (actionMap in showSection() is unchanged), now a thin
   bar between the hero band and the page body instead of inside a topbar. */
.actions-bar {
  /* Also a flex item of .dash-main -- see the width:100% note on .page-body
     above, same reason it's needed here. */
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 48px 0;
  box-sizing: border-box;
}
.actions-bar:empty { padding: 0; }

/* ── Footer (persistent across every section) ── */
.app-footer {
  background: var(--charcoal);
  color: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 48px;
}
/* Reversed-color echo of the header wordmark (.dash-wordmark/.dash-wordmark-sub):
   "Grace Dougan" upright serif + "Consulting" in the same serif, italic. */
.app-footer .footer-wordmark {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.app-footer .footer-wordmark-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ivory);
}
.app-footer .footer-wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ivory);
}
.app-footer .footer-meta {
  font-size: 0.72rem;
  color: rgba(247,243,236,0.62);
}

@media (max-width: 1200px) {
  .dash-header-row, .dash-nav-row, .hero-band-inner, .actions-bar, .app-footer, .cli-subnav-inner { padding-left: 32px; padding-right: 32px; }
  .page-body { padding-left: 32px; padding-right: 32px; }
}

@media (max-width: 900px) {
  .dash-nav-row { gap: 18px; }
  .hero-title { font-size: 1.6rem; }
  .hero-band-inner { align-items: flex-start; }
}

@media (max-width: 600px) {
  .dash-header-row, .dash-nav-row, .hero-band-inner, .actions-bar, .app-footer, .cli-subnav-inner { padding-left: 16px; padding-right: 16px; }
  .dash-header-top { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
  .hero-band-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Home's 3-column layout (Quick nav | Main content | Priority actions) ──
   Tablet: the priority-actions column (3rd child) drops beneath the nav +
   main content row instead of squeezing into a third narrow column. Mobile:
   all three stack full-width, in the same nav/main/actions priority order
   the desktop layout already reads left-to-right. !important is required
   because the base 3-column widths are set as an inline style. */
@media (max-width: 1024px) {
  .home-grid { grid-template-columns: 190px 1fr !important; }
  .home-grid > div:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .home-grid { grid-template-columns: 1fr !important; }
  .home-grid > div:nth-child(3) { grid-column: 1; }
}

/* ── Utility ── */
.text-gold { color: var(--gold); }
.text-gray { color: var(--gray); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Client-portal role chrome: default to the plain client view, reveal
   admin/team-member-only controls via the is-admin body class the portal
   sets synchronously before first paint (see public/client/portal.html)
   -- these must never depend on a DOMContentLoaded handler, which runs
   after the page has already painted and flashes the wrong role's view. */
#admin-back-wrap, #nav-onboarding, #edit-client-btn, #add-task-btn, #add-review-btn, #edit-info-btn {
  display: none;
}
body.is-admin #admin-back-wrap { display: block; }
body.is-admin #nav-onboarding { display: flex; } /* matches .nav-item */
body.is-admin #edit-client-btn,
body.is-admin #add-task-btn,
body.is-admin #add-review-btn {
  display: inline-flex; /* matches .btn */
}
body:not(.is-admin) #edit-info-btn {
  display: inline-block; /* plain <button>, no .btn class */
}

/* Onboarding repeater rows (SOP Generator field parity) */
.rep-group { margin-bottom: 6px; }
.rep-row {
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
  background: var(--white);
}
.rep-row .rep-remove {
  position: absolute;
  top: 10px;
  right: 10px;
}
.rep-add { margin-top: 2px; }
.rep-empty {
  font-size: 0.82rem;
  color: var(--gray);
  padding: 8px 0 14px;
}

/* Admin-only SOP output governance flag — hidden unless body.is-admin */
.sop-flag-row {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--gold-pale);
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 14px;
}
body.is-admin .sop-flag-row { display: flex; }

.picker-row { cursor: pointer; transition: var(--transition); }
.picker-row:hover { border-color: var(--gold); box-shadow: var(--shadow); }
.sop-flag-row label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal-light);
  margin: 0;
  white-space: nowrap;
}
.sop-flag-row select {
  width: auto;
  flex: 0 0 auto;
  font-size: 0.8rem;
  padding: 4px 8px;
}

/* ── My Page: Feedback tab 5-star rating (ported from employee/portal.html's
   .star-row -- ratings have no existing equivalent widget anywhere else in
   this file) ── */
.mypage-star-row { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin-bottom: 4px; }
.mypage-star-row input { display: none; }
.mypage-star-row label { font-size: 26px; color: var(--gray-light); cursor: pointer; transition: color 0.15s; line-height: 1; }
.mypage-star-row input:checked ~ label, .mypage-star-row label:hover, .mypage-star-row label:hover ~ label { color: var(--gold); }

/* ── My Page: Career Path competency-dimension icons (Scope/Delivery/etc,
   ported from employee/portal.html's .dim-icon) ── */
.mypage-dim-icon { width: 16px; height: 16px; display: inline-flex; flex-shrink: 0; color: var(--gold); }
.mypage-dim-icon svg { width: 100%; height: 100%; display: block; }

/* ── Home dashboard redesign: The Daily Ledger ──
   Scoped to show only while Home is the active section (body[data-section]
   is set by showSection()) so it never leaks into the shared hero band any
   other page reuses. Max-width ~600px per spec, no card/border -- text only,
   set against the hero band's own tint background. */
#hero-ledger-divider, #daily-ledger { display: none; }
body[data-section="home"] .hero-subtitle { color: var(--taupe-light); }
body[data-section="home"] #hero-ledger-divider,
body[data-section="cli-overview"] #hero-ledger-divider {
  display: block;
  height: 1px;
  background: var(--gray-light);
  margin: 14px 0;
  max-width: 600px;
}
body[data-section="home"] #daily-ledger,
body[data-section="cli-overview"] #daily-ledger {
  display: block;
  max-width: 600px;
  position: relative;
}
/* Extremely faint, stationary ledger-rule motif behind the quote -- purely
   decorative texture, never animated, opacity kept low enough it can never
   compete with text contrast. */
#daily-ledger::before {
  content: "";
  position: absolute;
  inset: -6px -14px;
  z-index: -1;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(184,151,90,0.045) 0px,
    rgba(184,151,90,0.045) 1px,
    transparent 1px,
    transparent 21px
  );
  pointer-events: none;
}
.dl-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.dl-accent-line {
  width: 32px;
  height: 2px;
  background: var(--gold);
  margin-bottom: 12px;
}
.dl-quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--taupe);
  margin: 0 0 8px;
}
.dl-attribution {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78rem;
  color: var(--taupe-light);
}
/* Quote change transition (local-midnight refresh only -- never an interval)
   -- crossfade with a small upward settle, capped well under the 400-600ms
   spec even including the brief opacity-out step. */
.dl-quote-out .dl-quote, .dl-quote-out .dl-attribution {
  opacity: 0;
  transition: opacity 200ms ease;
}
.dl-quote-in .dl-quote, .dl-quote-in .dl-attribution {
  animation: dlFadeUp 420ms ease both;
}
@keyframes dlFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Home dashboard redesign: one-time hero entrance sequence ──
   Applied via JS (maybeAnimateHomeEntrance()) at most once per page load --
   never replayed on tab refocus or on renavigating back to Home, since the
   triggering class is added only once and never removed. */
.hero-anim .hero-eyebrow, .hero-anim .hero-title { animation: dlFadeIn 400ms ease both; }
.hero-anim .hero-subtitle { animation: dlFadeIn 400ms ease 80ms both; }
.hero-anim .dl-accent-line { width: 0; animation: dlDrawLine 400ms ease 260ms forwards; }
.hero-anim .dl-label { animation: dlFadeUp 500ms ease 300ms both; }
.hero-anim .dl-quote { animation: dlFadeUp 500ms ease 380ms both; }
.hero-anim .dl-attribution { animation: dlFadeUp 500ms ease 440ms both; }
.hero-anim #hero-stats .stat-card:nth-child(1) { animation: dlFadeUp 400ms ease 480ms both; }
.hero-anim #hero-stats .stat-card:nth-child(2) { animation: dlFadeUp 400ms ease 540ms both; }
.hero-anim #hero-stats .stat-card:nth-child(3) { animation: dlFadeUp 400ms ease 600ms both; }
@keyframes dlFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlDrawLine { from { width: 0; } to { width: 32px; } }

/* One restrained highlight on the Next Up button, first load only -- JS
   adds/removes this class once (see playNextUpHighlightOnce()); it never
   repeats or loops. */
@keyframes dlButtonGlow {
  0% { box-shadow: 0 0 0 0 rgba(184,151,90,0.45); }
  100% { box-shadow: 0 0 0 8px rgba(184,151,90,0); }
}
.dl-btn-highlight-once { animation: dlButtonGlow 1100ms ease-out 1; }

/* ── Home dashboard redesign: interactive card hover/focus ──
   Opt-in via .hoverable so this never changes the countless static/
   non-clickable .card and .stat-card instances elsewhere in the app. */
.hoverable {
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.hoverable:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(28,28,28,0.08);
  border-color: var(--gold-light);
}
a:focus-visible, button:focus-visible, [tabindex]:focus-visible, .hoverable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Next Up card's own button -- darken gold slightly on hover, a subtle
   pressed state, no shimmer. Scoped to this card rather than every
   .btn-primary in the app, which keeps its existing charcoal hover elsewhere. */
#home-yearend-callout .btn-primary { background: var(--gold); }
#home-yearend-callout .btn-primary:hover { background: #A67D42; color: var(--white); }
#home-yearend-callout .btn-primary:active { transform: translateY(1px); }

@media (prefers-reduced-motion: reduce) {
  .hero-anim .hero-eyebrow, .hero-anim .hero-title, .hero-anim .hero-subtitle,
  .hero-anim .dl-label, .hero-anim .dl-quote, .hero-anim .dl-attribution,
  .hero-anim #hero-stats .stat-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-anim .dl-accent-line { animation: none !important; width: 32px !important; }
  .dl-quote-in .dl-quote, .dl-quote-in .dl-attribution { animation: none !important; opacity: 1 !important; transform: none !important; }
  .dl-btn-highlight-once { animation: none !important; }
  .hoverable:hover { transform: none !important; }
}

/* ══ Accessibility + mobile pass (client portal) ══════════════════════════ */

/* Skip link: off-screen until focused. */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 1000; background: var(--charcoal, #2b2b2b); color: #fff; padding: 10px 16px; border-radius: 6px; font-weight: 700; font-size: 0.85rem; text-decoration: none; }
.skip-link:focus { top: 8px; outline: 2px solid var(--gold-light, #D4B87A); outline-offset: 2px; }
#main-content:focus { outline: none; }

/* Visible keyboard focus. */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.tab-btn:focus-visible, .nav-item:focus-visible, .logout-btn:focus-visible, .a11y-kbd:focus-visible, [tabindex="0"]:focus-visible, #modal-box:focus-visible {
  outline: 2px solid var(--gold, #B8975A); outline-offset: 2px;
}
.cli-subnav .tab-btn:focus-visible, .dash-header .logout-btn:focus-visible, .dash-header .nav-item:focus-visible { outline-color: var(--gold-light, #D4B87A); }
.a11y-kbd { cursor: pointer; }

/* Client sub-nav: one scrollable row instead of squashing/overflowing. */
.cli-subnav .tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.35) transparent; }
.cli-subnav .tabs .tab-btn { flex: none; white-space: nowrap; }
.cli-subnav .tabs::-webkit-scrollbar { height: 4px; }
.cli-subnav .tabs::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 4px; }

/* Tour tooltip never wider than the viewport (positioning JS untouched). */
#tour-tooltip { max-width: calc(100vw - 24px); box-sizing: border-box; }

/* Stack the Overview/Home 3-col grid earlier (was 190px rail until 640px). */
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr !important; }
  .home-grid > div:nth-child(3) { grid-column: 1; }
}

/* Phones: no page-level sideways scroll; tables scroll inside their card. */
@media (max-width: 640px) {
  [id^="section-cli-"] .card { overflow-x: auto; max-width: 100%; }
  [id^="section-cli-"] .data-table { min-width: 560px; }
  [id^="section-cli-"] .flex-center, [id^="section-cli-"] .card-header { flex-wrap: wrap; gap: 8px; }
  [id^="section-cli-"] #esttax-actions, [id^="section-cli-"] .btn-row { flex-wrap: wrap; }
  [id^="section-cli-"] img, [id^="section-cli-"] iframe { max-width: 100%; }
  .dash-main { max-width: 100vw; overflow-x: hidden; }
  #toast-container { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  #toast-container > div { max-width: none !important; }
  #modal-overlay { padding: 12px !important; }
  #modal-box { padding: 20px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .tab-btn, .btn, .cli-subnav .tabs, #toast-container > div { transition: none !important; scroll-behavior: auto; }
  .cli-ticker-track { animation-duration: 120s; }
}

/* Month End Close tracker */
#section-month-end .me-wrap { display: flex; flex-direction: column; gap: 20px; }
#section-month-end [hidden] { display: none !important; }
#section-month-end .me-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#section-month-end .me-meta-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
#section-month-end .me-meta-left { font-size: 15px; color: #6B6560; white-space: nowrap; }
#section-month-end .me-meta-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#section-month-end .me-target { font-size: 15px; color: #1E1E1E; }
#section-month-end .me-hint { font-size: 13px; color: #7A746D; }
#section-month-end .me-state { background: #fff; border: 1px solid #E6E0D6; border-radius: 8px; padding: 32px 24px; font-size: 15px; color: #6B6560; }
#section-month-end .me-error { color: #B3261E; margin-right: 10px; }

#section-month-end .me-summary { background: #fff; border: 1px solid #E6E0D6; border-radius: 8px; padding: 30px 40px; display: flex; flex-wrap: wrap; gap: 32px 40px; align-items: center; }
#section-month-end .me-eyebrow { font-size: 12px; letter-spacing: 0.18em; color: #6B6560; }
#section-month-end .me-pct-line { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
#section-month-end .me-pct { font-size: 48px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
#section-month-end .me-pct-label { font-size: 16px; }
#section-month-end .me-sum-bar { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
#section-month-end .me-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #E8E1D6; }
#section-month-end .me-bar > div { height: 100%; }
#section-month-end .me-sw-closed { background: #5E8D4E; }
#section-month-end .me-sw-review { background: #2A2724; }
#section-month-end .me-sw-progress { background: #C9A15E; }
#section-month-end .me-sw-notstarted { background: #E8E1D6; }
#section-month-end .me-legend { display: flex; gap: 12px 28px; flex-wrap: wrap; font-size: 14px; }
#section-month-end .me-legend-item { display: flex; align-items: center; gap: 8px; }
#section-month-end .me-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
#section-month-end .me-sum-callout { flex: 1 1 260px; border-top: 1px solid #E6E0D6; padding-top: 20px; display: flex; flex-direction: column; gap: 14px; }
#section-month-end .me-callout-text { font-size: 15px; line-height: 1.5; }
#section-month-end .me-btns { display: flex; gap: 10px; flex-wrap: wrap; }
#section-month-end .me-btn-dark, #section-month-end .me-btn-light { padding: 11px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
#section-month-end .me-btn-dark { background: #1E1E1E; color: #fff; border: 1px solid #1E1E1E; }
#section-month-end .me-btn-dark:hover { background: #3A3A3A; }
#section-month-end .me-btn-light { background: #fff; color: #1E1E1E; border: 1px solid #E6E0D6; }
#section-month-end .me-btn-light:hover { background: #F7F3EE; }
#section-month-end .me-btn-dark:disabled, #section-month-end .me-btn-light:disabled { opacity: 0.55; cursor: default; }
#section-month-end button:focus-visible, #section-month-end select:focus-visible, #section-month-end input:focus-visible { outline: 2px solid #B8955C; outline-offset: 2px; }

#section-month-end .me-filters { background: #F0EBE4; border: 1px solid #E6E0D6; border-radius: 8px; }
#section-month-end .me-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; padding: 22px 28px; }
#section-month-end .me-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#section-month-end .me-field label { font-size: 12px; letter-spacing: 0.16em; color: #6B6560; font-weight: 600; text-transform: uppercase; }
#section-month-end .me-field input, #section-month-end .me-field select { padding: 12px 14px; border: 1px solid #E6E0D6; border-radius: 6px; font: inherit; font-size: 15px; background: #fff; width: 100%; min-width: 0; }
#section-month-end .me-period-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
#section-month-end .me-period-row select { flex: 1 1 130px; }
#section-month-end .me-seg { display: inline-flex; border: 1px solid #E6E0D6; border-radius: 6px; overflow: hidden; background: #fff; flex: none; }
#section-month-end .me-seg button { padding: 0 12px; font: inherit; font-size: 13px; font-weight: 600; color: #6B6560; background: #fff; border: none; cursor: pointer; }
#section-month-end .me-seg button[aria-pressed="true"] { background: #1E1E1E; color: #fff; }
#section-month-end .me-filter-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 28px; border-top: 1px solid #E6E0D6; flex-wrap: wrap; }
#section-month-end .me-footer-left, #section-month-end .me-footer-right { display: flex; gap: 16px 20px; align-items: center; font-size: 14px; flex-wrap: wrap; }
#section-month-end .me-footer-left { color: #6B6560; }
#section-month-end .me-footer-left > span { white-space: nowrap; }
#section-month-end .me-link { background: none; border: none; padding: 0; font: inherit; font-size: 14px; color: #1E1E1E; text-decoration: underline; cursor: pointer; }
#section-month-end .me-link:hover { color: #A57F45; }
#section-month-end .me-export { background: #fff; border: 1px solid #E6E0D6; padding: 8px 18px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#section-month-end .me-export:hover { background: #F7F3EE; }
#section-month-end .me-key { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 24px; padding: 18px 28px 22px; border-top: 1px solid #E6E0D6; background: #F7F3EE; border-radius: 0 0 8px 8px; }
#section-month-end .me-key-item { display: flex; gap: 12px; font-size: 13px; }
#section-month-end .me-key-item b { width: 36px; letter-spacing: 0.06em; flex: none; }
#section-month-end .me-key-item span { color: #4A4540; }
#section-month-end .me-key-note { grid-column: 1 / -1; font-size: 13px; color: #6B6560; }

#section-month-end .me-table-card { background: #fff; border: 1px solid #E6E0D6; border-radius: 8px; }
#section-month-end .me-table-scroll { overflow-x: auto; border-radius: 8px; }
#section-month-end .me-table { width: 100%; min-width: 1240px; border-collapse: collapse; table-layout: fixed; }
#section-month-end .me-col-client { width: 260px; }
#section-month-end .me-col-owner { width: 180px; }
#section-month-end .me-col-qs { width: 70px; }
#section-month-end .me-col-stage { width: 150px; }
#section-month-end .me-col-updated { width: 110px; }
#section-month-end .me-group-row th { padding: 16px 0; font-size: 12px; letter-spacing: 0.16em; font-weight: 600; color: #6B6560; text-transform: uppercase; border-bottom: 1px solid #EEE9E1; text-align: center; }
#section-month-end .me-group-row .me-group-th { border-left: 1px solid #EEE9E1; border-right: 1px solid #EEE9E1; }
#section-month-end .me-col-row th { padding: 18px 12px; font-size: 12px; letter-spacing: 0.12em; font-weight: 700; text-align: left; text-transform: uppercase; border-bottom: 2px solid #EEE9E1; color: #1E1E1E; background: #fff; }
#section-month-end .me-col-row .me-th-client { padding-left: 24px; }
#section-month-end .me-col-row .me-th-step, #section-month-end .me-col-row .me-th-qs { text-align: center; padding-left: 0; padding-right: 0; }
#section-month-end .me-gstart { border-left: 1px solid #EEE9E1; }
#section-month-end .me-gend { border-right: 1px solid #EEE9E1; }
#section-month-end .me-sort { background: none; border: none; padding: 0; font: inherit; letter-spacing: inherit; font-weight: inherit; text-transform: inherit; cursor: pointer; color: inherit; }
#section-month-end .me-table tbody tr { border-bottom: 1px solid #F1EDE6; }
#section-month-end .me-table tbody tr:hover { background: #FBF9F6; }
#section-month-end .me-table td, #section-month-end .me-table tbody th { vertical-align: middle; }
#section-month-end .me-client { padding: 20px 24px; font-size: 16px; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
#section-month-end .me-owner-td { padding: 0 12px; }
#section-month-end .me-owner-btn { display: flex; align-items: center; gap: 10px; background: none; border: none; font: inherit; font-size: 14px; cursor: pointer; padding: 4px; border-radius: 6px; text-align: left; max-width: 100%; }
#section-month-end .me-owner-btn:hover { background: #F7F3EE; }
#section-month-end .me-avatar { width: 28px; height: 28px; border-radius: 50%; background: #F0E6D6; color: #8A6430; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
#section-month-end .me-avatar-empty { background: transparent; border: 1px dashed #CFC6B8; color: #7A746D; }
#section-month-end .me-owner-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#section-month-end .me-unassigned { color: #7A746D; }
#section-month-end .me-owner-select { width: 100%; padding: 6px 8px; font: inherit; font-size: 13px; border: 1px solid #E6E0D6; border-radius: 6px; background: #fff; }
#section-month-end .me-step-cell { text-align: center; padding: 0; }
#section-month-end .me-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #CFC6B8; background: #fff; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; line-height: 1; font-family: inherit; }
#section-month-end .me-dot:hover { border-color: #B8955C; }
#section-month-end .me-dot.on { background: #5E8D4E; border-color: #5E8D4E; }
#section-month-end .me-dot.na { border-color: transparent; background: transparent; color: #7A746D; cursor: default; }
#section-month-end .me-qs { text-align: center; font-size: 14px; font-weight: 700; color: #7A746D; }
#section-month-end .me-qs-open { color: #B5651D; }
#section-month-end .me-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
#section-month-end .me-pill-closed { background: #E3EDDD; color: #3F6B31; }
#section-month-end .me-pill-review { background: #2A2724; color: #F1E3C8; }
#section-month-end .me-pill-progress { background: #F6E6CC; color: #7A5420; }
#section-month-end .me-pill-notstarted { background: #EDE7DE; color: #6B6560; }
#section-month-end .me-table td:nth-last-child(2) { padding: 0 16px; }
#section-month-end .me-updated { padding: 0 16px; font-size: 13px; color: #6B6560; }
#section-month-end .me-nomatch { padding: 32px 24px; font-size: 15px; color: #6B6560; }
@media (max-width: 640px) {
  #section-month-end .me-summary { padding: 22px 20px; }
  #section-month-end .me-filter-grid, #section-month-end .me-filter-footer { padding-left: 16px; padding-right: 16px; }
  #section-month-end .me-meta-right { align-items: flex-start; }
}


/* Client month-end / year-end */
.cle-wrap { display: flex; flex-direction: column; gap: 24px; max-width: 1280px; font-family: 'Montserrat', sans-serif; }
.cle-wrap > div { display: flex; flex-direction: column; gap: 24px; }
.cle-busy { opacity: .55; transition: opacity .15s; pointer-events: none; }
.cle-card { background: #fff; border: 1px solid #E6E0D6; border-radius: 6px; }
.cle-pad { padding: 28px 32px; }
.cle-pad2 { padding: 28px 32px; }
.cle-muted { font-size: 13px; color: #7A746D; }
.cle-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cle-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid #E6E0D6; background: #fff; color: #1E1E1E; font: 600 13px 'Montserrat', sans-serif; cursor: pointer; }
.cle-pill:hover { border-color: #B8955C; }
.cle-pill.on { background: #1E1E1E; border-color: #1E1E1E; color: #fff; }
.cle-pill:focus-visible, .cle-link:focus-visible, .cle-link-d:focus-visible { outline: 2px solid #B8955C; outline-offset: 2px; }
.cle-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; }
.cle-dot.sm { width: 8px; height: 8px; }
.cle-status { display: flex; flex-wrap: wrap; gap: 32px; padding: 36px 40px; }
.cle-status-l { flex: 1.6 1 380px; min-width: 0; }
.cle-status-r { flex: 1 1 240px; border-left: 1px solid #E6E0D6; padding-left: 32px; display: flex; flex-direction: column; gap: 22px; }
.cle-eyebrow-g { font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #6B6560; }
.cle-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #A57F45; }
.cle-eyebrow-d { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #D4B57F; }
.cle-big { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; font: 600 44px/1.05 'Cormorant Garamond', serif; color: #1E1E1E; }
.cle-copy { font-size: 15px; line-height: 1.6; color: #6B6560; max-width: 560px; margin: 0; }
.cle-lbl { font-size: 13px; color: #7A746D; }
.cle-val { font-size: 17px; font-weight: 600; color: #1E1E1E; margin-top: 2px; }
.cle-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cle-fig { padding: 22px 24px; }
.cle-fig-v { font: 600 34px/1.15 'Cormorant Garamond', serif; color: #1E1E1E; margin: 6px 0 4px; }
.cle-fig-d { font-size: 13px; color: #6B6560; }
.cle-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px; align-items: start; }
.cle-h { margin: 0; padding: 24px 28px; border-bottom: 1px solid #EEE9E1; font: 600 26px 'Cormorant Garamond', serif; color: #1E1E1E; }
.cle-h-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 24px 28px; border-bottom: 1px solid #EEE9E1; }
.cle-rep, .cle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 28px; border-bottom: 1px solid #F1EDE6; }
.cle-rep:last-child, .cle-row:last-child { border-bottom: 0; }
.cle-row-m { flex: 1; min-width: 0; }
.cle-rep-n, .cle-step-n { font-size: 15px; font-weight: 600; color: #1E1E1E; }
.cle-step-n { font-size: 14px; }
.cle-rep-s, .cle-step-s { font-size: 12px; color: #7A746D; margin-top: 2px; }
.cle-link { font-size: 13px; font-weight: 600; color: #A57F45; text-decoration: none; white-space: nowrap; }
.cle-link:hover { color: #1E1E1E; }
.cle-link-d { font-size: 14px; font-weight: 600; color: #D4B57F; text-decoration: none; }
.cle-link-d:hover { color: #fff; }
.cle-dark { background: #1E1E1E; border-radius: 6px; padding: 28px 30px; color: #fff; }
.cle-note { font: italic 500 21px/1.45 'Cormorant Garamond', serif; margin: 12px 0 14px; color: #fff; }
.cle-note-a { font-size: 13px; color: #CFC8BE; }
.cle-dark-big { font: 600 34px 'Cormorant Garamond', serif; margin: 8px 0; }
.cle-needs { border-color: #D9BE8F; padding: 24px 28px; }
.cle-steps { list-style: none; margin: 0; padding: 24px 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.cle-step { display: flex; align-items: flex-start; gap: 12px; }
.cle-chk { width: 26px; height: 26px; border-radius: 50%; flex: none; box-sizing: border-box; border: 2px solid #CFC6B8; background: #fff; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.cle-chk.on { background: #5E8D4E; border-color: #5E8D4E; }
.cle-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cle-months { margin-top: 26px; max-width: 560px; }
.cle-months-h { display: flex; justify-content: space-between; font-size: 13px; color: #6B6560; margin-bottom: 8px; }
.cle-months-h strong { color: #1E1E1E; }
.cle-bars, .cle-inits { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.cle-bar { height: 8px; border-radius: 2px; }
.cle-inits { margin-top: 6px; font-size: 11px; color: #7A746D; text-align: center; }
.cle-how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.cle-how-i { display: flex; flex-direction: column; gap: 4px; }
.cle-how-n { font: 600 30px 'Cormorant Garamond', serif; color: #B8955C; }
.cle-how-d { font-size: 13px; color: #6B6560; line-height: 1.5; }
.cle-how-t { font-size: 12px; font-weight: 600; color: #7A746D; margin-top: auto; padding-top: 8px; }
.cle-pillbadge { font-size: 11px; font-weight: 700; letter-spacing: .1em; border-radius: 999px; padding: 6px 10px; white-space: nowrap; }
.cle-p-ok { background: #E3EDDD; color: #3F6B31; }
.cle-p-need { background: #F6E6CC; color: #7A5420; }
.cle-p-wait { background: #EDE7DE; color: #6B6560; }
/* staff editor */
.cle-egrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.cle-eh { margin: 22px 0 8px; font-size: 14px; font-weight: 700; color: var(--charcoal); }
.cle-figs-e { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cle-fig-e { display: flex; flex-direction: column; gap: 6px; }
.cle-fig-e label { display: flex; flex-direction: column; font-size: 12px; color: #7A746D; gap: 2px; }
.cle-erow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; }
.cle-erow input, .cle-erow select { flex: 1 1 160px; min-width: 0; }
.cle-e-rep input[data-f="url"] { flex: 2 1 240px; }
@media (max-width: 640px) {
  .cle-status { padding: 24px 20px; }
  .cle-status-r { border-left: 0; padding-left: 0; border-top: 1px solid #E6E0D6; padding-top: 20px; }
  .cle-big { font-size: 36px; }
  .cle-two { grid-template-columns: 1fr; }
  .cle-rep, .cle-row, .cle-h, .cle-h-row, .cle-steps { padding-left: 20px; padding-right: 20px; }
}

/* Page Editor sub-pages */
#section-cli-pageeditor .pe-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--gray-light); margin-bottom: 20px; }
#section-cli-pageeditor .pe-tab { appearance: none; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: 10px 14px; font-family: inherit; font-size: 0.82rem; font-weight: 600; color: var(--charcoal-light); cursor: pointer; }
#section-cli-pageeditor .pe-tab:hover { color: var(--charcoal); }
#section-cli-pageeditor .pe-tab[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
#section-cli-pageeditor .pe-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
#section-cli-pageeditor .pe-panel[hidden] { display: none; }
.pe-toggle { display: flex; align-items: flex-start; gap: 12px; }
.pe-toggle input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; padding: 0; flex: 0 0 auto; accent-color: var(--gold); cursor: pointer; }
.pe-toggle label { display: block; flex: 1; min-width: 0; margin: 0; text-transform: none; letter-spacing: 0; font-size: 0.85rem; font-weight: 400; color: var(--charcoal); cursor: pointer; }
.pe-toggle .pe-t-title { display: block; font-weight: 600; color: var(--charcoal); }
.pe-toggle .pe-t-help { display: block; margin-top: 3px; font-size: 0.78rem; line-height: 1.45; color: var(--gray); }
.pe-toggle-sm { padding: 6px 0; }
.pe-toggle-sm label { font-size: 0.82rem; }
.pe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.pe-fieldset { border: 1px solid var(--gray-light); border-radius: var(--radius); padding: 12px 16px 14px; margin: 0 0 16px; min-width: 0; }
.pe-fieldset legend { padding: 0 6px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--charcoal-light); }
.pe-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2px 18px; }
.pe-adv { margin-top: 10px; }
.pe-adv summary { cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--charcoal-light); }
.pe-adv summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pe-pats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; }
.pe-pats label { margin-bottom: 4px; }
.pe-savebar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.pe-savebar [role="status"] { font-size: 0.82rem; font-weight: 600; }
.pe-yrow { display: grid; grid-template-columns: 22px minmax(0, 1.3fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.pe-yrow-filings { grid-template-columns: 22px minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 0.8fr) auto; }
.pe-yrow input[type="checkbox"] { width: 18px; height: 18px; padding: 0; accent-color: var(--gold); cursor: pointer; }
.pe-yrow-std { min-width: 70px; text-align: right; }
#cli-ce-period-body .pe-toggle { padding-bottom: 4px; }
@media (max-width: 720px) {
  .pe-yrow, .pe-yrow-filings { grid-template-columns: 22px minmax(0, 1fr); }
  .pe-yrow > :nth-child(n+3) { grid-column: 2; }
}
#section-month-end .me-stage-td { white-space: nowrap; }
#section-month-end .me-manual { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #6B6560; border: 1px solid #D8CFC2; border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
#section-month-end .me-close-btn { margin-left: 8px; background: none; border: 0; padding: 2px 4px; font-family: inherit; font-size: 12px; font-weight: 600; color: #7A5420; text-decoration: underline; cursor: pointer; border-radius: 4px; }
#section-month-end .me-close-btn:hover { color: #1E1E1E; }
#section-month-end .me-close-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ClickUp links */
#section-month-end .me-dot { position: relative; }
#section-month-end .me-cu-mark { position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #7B68EE; box-sizing: border-box; }
#section-month-end .me-linked-done .me-cu-mark { background: #7B68EE; border-color: #fff; box-shadow: 0 0 0 1.5px #7B68EE; }
#section-month-end .me-cu-btn { background: none; border: 1px solid transparent; border-radius: 4px; font: inherit; font-size: 16px; line-height: 1; padding: 0 6px; margin-left: 4px; cursor: pointer; color: #7A746D; vertical-align: middle; }
#section-month-end .me-cu-btn:hover { border-color: #CFC6B8; color: #1E1E1E; }
#section-month-end .me-cu-btn:focus-visible, #section-month-end .me-cu-linkbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#section-month-end .me-cu-live { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; font-size: 13px; }
#section-month-end .me-cu-refresh { padding: 7px 14px; font-size: 13px; }
#section-month-end .me-cu-on { color: #3F6B32; }
#section-month-end .me-cu-off { color: #7A746D; }
#section-month-end .me-cu-help, #section-month-end .me-cu-more { color: #7A746D; font-size: 12px; }
#section-month-end .me-cu-linkbtn { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: #7A5420; text-decoration: underline; cursor: pointer; border-radius: 4px; }
.cu-list { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow: auto; }
#modal-box .cu-list { max-height: 55vh; }
.cu-details > summary { cursor: pointer; font-size: 14px; font-weight: 700; margin: 22px 0 6px; }
.cu-details .cu-list { max-height: none; margin-top: 8px; }
.cu-row { display: flex; flex-direction: column; gap: 4px; }
.cu-need { flex: 1 1 100%; padding-left: 4px; border-left: 3px solid #E8E1D6; margin-bottom: 4px; }
.cu-lbl { font-size: 13px; }
.cu-inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cu-inline input { flex: 1 1 240px; min-width: 0; }
.cu-status { font-size: 12px; color: #7A746D; }
.cu-none { color: #7A746D; font-size: 12px; }
.cu-err { color: var(--danger); font-weight: 600; }
.cu-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #EFEAFD; color: #4B3FA8; font-size: 11px; font-weight: 600; }
.cu-pill-done { background: #E3F0DF; color: #3F6B32; }
.cu-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
