/* hour pixel v2 facelift (Space Indigo / Grape Soda / Sea Green).
   design tokens match landing-page-mockup-v2.html */

/* ---------- Self-hosted web fonts ---------- */
@font-face {
  font-family: 'MuseoModerno';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('vendor/Fonts/museomoderno-v29-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Bebas Neue';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/Fonts/bebas-neue-v16-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Croissant One';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/Fonts/croissant-one-v28-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Quicksand';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/Fonts/quicksand-v37-latin-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Quicksand';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('vendor/Fonts/quicksand-v37-latin-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Quicksand';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('vendor/Fonts/quicksand-v37-latin-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Quicksand';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('vendor/Fonts/quicksand-v37-latin-700.woff2') format('woff2');
}

/* ---------- CSS Variables ---------- */
:root {
  /* v2 palette, canonical names */
  --space-indigo:  #25283D;
  --grape-soda:    #8F3985;
  --frosted-blue:  #98DFEA;
  --sea-green:     #07BEB8;
  --powder-petal:  #EFD9CE;

  --ink:           #25283D;
  --ink-muted:     #5a5d72;
  --ink-dim:       #8a8ca0;
  --cream:         #fbf6f2;
  --cream-deep:    #efe6dc;
  --surface:       #ffffff;
  --border-soft:   rgba(37, 40, 61, 0.08);
  --border-strong: rgba(37, 40, 61, 0.16);

  /* Typography roles */
  --font-display:  'Croissant One', Georgia, serif;
  --font-heading:  'MuseoModerno', 'Quicksand', sans-serif;
  --font-eyebrow:  'Bebas Neue', 'Impact', sans-serif;
  --font-body:     'Quicksand', -apple-system, 'Segoe UI', sans-serif;

  /* Legacy semantic aliases, the rest of the stylesheet was written against
     these names. Remapping cascades the facelift through ~5000 lines of CSS
     without rewriting every selector. */
  --bg-base:       var(--cream);
  --bg-surface:    var(--surface);
  --bg-elevated:   var(--cream-deep);
  --glass-bg:      rgba(255,255,255,0.85);
  --glass-border:  var(--border-soft);
  --glass-hover:   rgba(143, 57, 133, 0.08);

  --accent:        var(--grape-soda);
  --accent-light:  #a44d9c;
  --accent-glow:   rgba(143, 57, 133, 0.20);
  --accent-dim:    rgba(143, 57, 133, 0.12);
  --accent-2:      var(--sea-green);
  --green:         #2fb37b;
  --red:           #d65b5b;
  --orange:        #d4a56a;

  --text-primary:  var(--ink);
  --text-secondary:var(--ink-muted);
  --text-muted:    var(--ink-dim);

  --text:          var(--text-primary);
  --text-main:     var(--text-primary);
  --border:        var(--glass-border);
  --bg:            var(--bg-surface);
  --bg-card:       var(--bg-surface);
  --surface-tint:  rgba(37, 40, 61, 0.04);

  --sidebar-w:     220px;
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;

  --shadow-glow:   0 8px 24px rgba(37, 40, 61, 0.08);
  --transition:    all 0.22s ease;
  --input-bg:      #FFFFFF;

  --toast-bg:      var(--space-indigo);
  --toast-fg:      #ffffff;

  /* Invoice preview: neutral grays that sit on the white invoice paper */
  --paper-border:  #e5e7eb;
  --paper-text:    #374151;
  --paper-muted:   #6b7280;
  --paper-hover:   #f3f4f6;
}

/* Dark Mode: v2 palette derived, deep Space Indigo with cream text */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --cream:         #0f1120;
    --cream-deep:    #1a1d2e;
    --surface:       #1a1d2e;
    --ink:           #f0ebe4;
    --ink-muted:     #a8abc2;
    --ink-dim:       #7a7fa0;

    --glass-bg:      rgba(26, 29, 46, 0.92);
    --glass-border:  rgba(251, 246, 242, 0.08);
    --glass-hover:   rgba(143, 57, 133, 0.14);
    --border-soft:   rgba(251, 246, 242, 0.08);
    --border-strong: rgba(251, 246, 242, 0.16);

    --input-bg:      rgba(239, 217, 206, 0.08);
    --surface-tint:  rgba(251, 246, 242, 0.05);
    --shadow-glow:   0 8px 24px rgba(0, 0, 0, 0.4);
    --accent-glow:   rgba(143, 57, 133, 0.25);
    --accent-dim:    rgba(143, 57, 133, 0.18);
    color-scheme: dark;
  }
}

/* Dark Mode: manual toggle override */
html[data-theme="dark"] {
  --cream:         #0f1120;
  --cream-deep:    #1a1d2e;
  --surface:       #1a1d2e;
  --ink:           #f0ebe4;
  --ink-muted:     #a8abc2;
  --ink-dim:       #7a7fa0;

  --glass-bg:      rgba(26, 29, 46, 0.92);
  --glass-border:  rgba(251, 246, 242, 0.08);
  --glass-hover:   rgba(143, 57, 133, 0.14);
  --border-soft:   rgba(251, 246, 242, 0.08);
  --border-strong: rgba(251, 246, 242, 0.16);

  --input-bg:      rgba(239, 217, 206, 0.08);
  --surface-tint:  rgba(251, 246, 242, 0.05);
  --shadow-glow:   0 8px 24px rgba(0, 0, 0, 0.4);
  --accent-glow:   rgba(143, 57, 133, 0.25);
  --accent-dim:    rgba(143, 57, 133, 0.18);
  color-scheme: dark;
}
html[data-theme="light"] {
  color-scheme: light;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

/* ---------- Typography (v2) ----------
   The app has many explicit heading rules that already set font-size/color.
   This block only sets the font-family so every heading inherits MuseoModerno
   without us rewriting every existing heading rule. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}
.font-display { font-family: var(--font-display); }
.font-eyebrow {
  font-family: var(--font-eyebrow);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Suppress browser autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-surface) inset;
  -webkit-text-fill-color: var(--text-primary);
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--text-primary);
}
/* Hide search input decorations so type="search" looks like type="text" */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none; appearance: none;
}
input[type="search"] {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: width 0.2s ease, padding 0.2s ease;
}
.sidebar.collapsed {
  width: 64px;
  padding: 1.5rem 0.5rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
  position: relative;
}

/* Collapse toggle, vertically centred on the sidebar's right edge */
.sidebar-collapse-btn {
  position: absolute;
  top: 50%;
  right: -22px;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, background 0.15s, transform 0.2s, border-color 0.15s;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.sidebar-collapse-btn svg { width: 22px; height: 22px; }
.sidebar-collapse-btn:hover {
  color: var(--accent);
  background: var(--bg-elevated);
  border-color: var(--accent);
}
.sidebar.collapsed .sidebar-collapse-btn {
  transform: translateY(-50%) rotate(180deg);
}

/* Collapsed sidebar: stack logo icon + BETA badge vertically */
.sidebar.collapsed .sidebar-logo {
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.sidebar.collapsed .logo-img-mark { height: 30px; }
.sidebar.collapsed .beta-badge {
  font-size: 0.58rem;
  padding: 0.12rem 0.32rem;
  letter-spacing: 0.12em;
}

.logo-icon { font-size: 1.4rem; }
.logo-text  {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
/* Brand SVG in sidebar, swaps white variant in dark mode. */
.logo-img {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.logo-img-dark { display: none; }
html[data-theme="dark"] .logo-img-light { display: none; }
html[data-theme="dark"] .logo-img-dark  { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .logo-img-light { display: none; }
  html:not([data-theme="light"]) .logo-img-dark  { display: block; }
}
/* Logo swap: full wordmark (expanded) vs icon-only mark (collapsed).
   The mark uses a single saturated icon that reads on both themes. */
.logo-img-mark { display: none; }
.sidebar.collapsed .logo-img-full { display: none; }
.sidebar.collapsed .logo-img-mark { display: block; }
/* Matches .beta-chip in landing-page-mockup-v2.html */
.beta-badge {
  font-family: var(--font-eyebrow);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--grape-soda);
  background: var(--powder-petal);
  border: none;
  padding: 0.14rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 0.3rem; }

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  width: 100%;
}

.nav-btn:hover { background: var(--glass-hover); color: var(--grape-soda); }
.nav-btn.active { background: var(--grape-soda); color: #fff; font-weight: 600; }
.nav-icon { font-size: 1rem; }

.nav-icon-svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  display: block;
}
.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed sidebar, icons only */
.sidebar.collapsed .nav-btn {
  justify-content: center;
  padding: 0.65rem 0;
  gap: 0;
}
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .sidebar-user-email { display: none; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .sidebar-footer-actions {
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}
.sidebar.collapsed .theme-toggle { display: none; }
.sidebar-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.sidebar-signout-icon { display: none; flex-shrink: 0; }
.sidebar.collapsed .sidebar-signout-btn {
  padding: 0.5rem 0;
  font-size: 0.75rem;
  min-width: 0;
  width: 100%;
  gap: 0;
}
.sidebar.collapsed .sidebar-signout-label { display: none; }
.sidebar.collapsed .sidebar-signout-icon { display: block; }

/* Dark Mode Toggle */
/* Theme Toggle (pill switch) */
.theme-toggle { display:inline-flex; align-items:center; cursor:pointer; user-select:none; }
.theme-toggle-cb { position:absolute; opacity:0; width:0; height:0; }
.toggle-track {
  position: relative;
  width: 52px; min-width: 52px; height: 28px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.3s;
  z-index: 1;
}
.theme-toggle-cb:checked + .toggle-track .toggle-knob { transform: translateX(24px); }
.theme-toggle-cb:checked + .toggle-track { background: var(--accent-dim, rgba(143, 57, 133,0.18)); border-color: rgba(143, 57, 133,0.3); }
.toggle-icon { width:14px; height:14px; flex-shrink:0; }
.toggle-icon-sun { color: #f5a623; }
.toggle-icon-moon { color: var(--text-muted); }

/* Sidebar footer actions row */
.sidebar-footer-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.2rem 0.4rem; margin-bottom: 0.3rem;
}
.sidebar-gear-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: transparent;
  color: var(--text-muted); cursor: pointer;
  transition: var(--transition);
}
.sidebar-gear-btn:hover { background: var(--glass-bg); color: var(--accent-light); }

/* ---------- Main Content ---------- */
.main-content {
  flex: 1;
  overflow-y: auto;
  max-height: 100vh;
  padding: 2rem;
}

/* ---------- Pages ---------- */
.page { display: none; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--space-indigo);
}
html[data-theme="dark"] .page-title { color: var(--ink); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .page-title { color: var(--ink); }
}

.page-header-actions { display: flex; gap: 0.6rem; }

.date-display {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body); /* <button> elements don't inherit font-family from body by default */
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-light); border-color: var(--accent-light); }

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover { border-color: var(--glass-border); color: var(--text-primary); }

.btn-danger {
  background: rgba(247,106,106,0.12);
  color: var(--red);
  border-color: rgba(247,106,106,0.25);
}
.btn-danger:hover { background: rgba(247,106,106,0.22); }

.btn-start {
  background: rgba(61,214,140,0.12);
  color: var(--green);
  border-color: rgba(61,214,140,0.25);
}
.btn-start:hover { background: rgba(61,214,140,0.22); }

.btn-lg  { padding: 0.7rem 1.4rem; font-size: 0.95rem; font-weight: 600; }
.btn-sm  { padding: 0.35rem 0.7rem; font-size: 0.78rem; font-weight: 500; }
.hidden  { display: none !important; }

/* ---------- Inputs ---------- */
.styled-input, .styled-select {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.styled-input::placeholder { color: var(--text-muted); }
.styled-select option { background: var(--bg-elevated); }

.styled-input:focus, .styled-select:focus {
  border-color: var(--grape-soda);
  box-shadow: 0 0 0 3px rgba(152, 223, 234, 0.45); /* frosted-blue glow complements grape-soda border */
}

/* ---------- Timer Card ---------- */
.timer-card {
  margin-bottom: 2rem;
  box-shadow: var(--shadow-glow);
}

.timer-project-row {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.timer-project-row .styled-select { flex: 0 0 200px; }
.timer-project-row .styled-input  { flex: 1; min-width: 200px; }

.timer-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}


.timer-clock {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-muted);
  transition: color 0.3s;
}

.timer-clock.running { color: var(--accent-light); }
.timer-clock.paused  { color: var(--orange, #f7a76a); }

.btn-warning {
  background: rgba(247,167,106,0.12);
  color: var(--orange, #f7a76a);
  border-color: rgba(247,167,106,0.3);
}
.btn-warning:hover { background: rgba(247,167,106,0.22); }

.timer-clock-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.timer-adjust-group {
  display: flex;
  gap: 0.4rem;
}

.timer-btn-group { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.timer-status {
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.input-highlight {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(143, 57, 133,0.2) !important;
}

/* ---------- Entries ---------- */
.entries-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-dim);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
}

.range-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.range-tab {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.range-tab:hover { color: var(--text-primary); background: var(--glass-bg); }
.range-tab.active { background: var(--accent-dim); color: var(--accent-light); border-color: rgba(143, 57, 133,0.3); }

.entry-card {
  display: grid;
  grid-template-columns: 10px auto 1fr auto auto auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--glass-border);
}

.entry-card:last-child { border-bottom: none; }

.entry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.entry-project    { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-task-group { display: flex; align-items: center; gap: 0.25rem; min-width: 0; overflow: hidden; }
.entry-task       { color: var(--text-secondary); font-size: 0.85rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-time       { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.entry-time--multi { white-space: normal; }
.entry-dur     { font-size: 0.8rem; font-weight: 600; color: var(--accent-light); white-space: nowrap; }

.entry-time-clickable { cursor: pointer; transition: var(--transition); }
.entry-time-clickable:hover { color: var(--accent-light); text-decoration: underline; }

.entry-sessions { display: flex; flex-direction: column; gap: 2px; }
.entry-session  { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.entry-session + .entry-session { border-top: 1px dashed var(--glass-border); padding-top: 2px; }
.entry-session:hover { color: var(--accent-light); }
.entry-sessions.entry-time-clickable:hover .entry-session { color: var(--accent-light); }

/* collapsed multi-session card: extras hidden until the toggle expands */
.entry-card:not(.entry-card-expanded) .entry-session-extra { display: none; }

.entry-sessions-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 3px 0 0;
  margin-top: 2px;
  text-align: left;
  white-space: nowrap;
  border-top: 1px dashed var(--glass-border);
}
.entry-sessions-toggle:hover { color: var(--accent-light); }

.log-sessions { display: flex; flex-direction: column; gap: 2px; }
.log-session  { font-size: 0.8rem; white-space: nowrap; }
.log-session + .log-session { border-top: 1px dashed var(--glass-border); padding-top: 2px; }

/* collapsed multi-session row: extras hidden until the toggle expands the row */
tr:not(.log-row-expanded) > td .log-session-extra { display: none; }

.log-sessions-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 0 0;
  margin-top: 2px;
  text-align: left;
  white-space: nowrap;
  border-top: 1px dashed var(--glass-border);
}
.log-sessions-toggle:hover { color: var(--accent-light); }

.log-time-clickable { cursor: pointer; }
.log-time-clickable:hover { color: var(--accent-light); }

/* imported entries (e.g. Hubstaff) have no start/end -- muted dash */
.entry-time-imported { color: var(--text-muted); opacity: 0.55; cursor: help; }

.entry-edit-btn, .entry-continue-btn, .entry-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.7;
  transition: var(--transition);
  padding: 0.6rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}
.entry-edit-btn:hover     { opacity: 1; color: var(--accent-light); }
.entry-continue-btn:hover { opacity: 1; color: var(--green); }
.entry-del-btn:hover      { opacity: 1; color: var(--red); }

.entry-task-edit {
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  width: 100%;
}

/* Inline description edit inside the log table, no floating box */
.log-task-edit {
  font-size: inherit;
  width: 100%;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--accent) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
  color: var(--text) !important;
}
.log-task-edit:focus {
  box-shadow: none !important;
  outline: none !important;
}

.entry-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.2rem 0.3rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 0.3rem;
}

.entry-date-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.entry-date-total { font-size: 0.75rem; font-weight: 600; color: var(--accent-light); }

/* ---------- Clients (v2 redesign) ---------- */
/* Stats strip, replaces 4-card grid */
.client-overview-strip {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  margin: 0.25rem 0 1rem;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.client-overview-strip strong {
  color: var(--text-main);
  font-weight: 600;
}
.client-overview-strip .strip-dot { color: var(--text-muted); opacity: 0.7; }
.client-overview-strip .strip-accent strong { color: var(--accent); }

/* All clients live in a single rounded container with internal separators. */
#clients-list {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
#clients-list:empty { border: none; background: transparent; }

.client-section {
  background: transparent;
  border-bottom: 1px solid var(--glass-border);
  margin: 0;
  overflow: hidden;
}
.client-section:last-child { border-bottom: none; }
.client-section.dragging { opacity: 0.35; }

.client-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  transition: background 0.12s ease;
  flex-wrap: nowrap;
}
.client-header > .drag-handle { margin-right: -0.25rem; }
.client-header > .client-header-info { flex: 1; min-width: 0; }
.client-header:hover { background: var(--bg-elevated); }

.client-color-bar {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  flex-shrink: 0;
}

.client-header-info { min-width: 0; }
.client-name-row    { display: flex; align-items: baseline; gap: 0.55rem; flex-wrap: wrap; line-height: 1.3; }
.client-name        { font-weight: 600; font-size: 0.95rem; color: var(--text-main); }

/* Billing + grade become inline muted metadata, not pills. */
.client-billing-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.client-billing-badge + .client-billing-badge::before {
  content: '·';
  margin: 0 0.35rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.client-contact-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.client-contact-link { color: var(--text-muted); text-decoration: none; }
.client-contact-link:hover { color: var(--accent); text-decoration: underline; }

.client-hours-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.client-hours-label strong { color: var(--text-main); font-weight: 600; }
.client-actions     { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.client-chevron     { font-size: 0.75rem; color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s ease; }

/* Default: client header shows just the essentials + chevron. Actions hidden until hover. */
.client-header .client-actions {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
@media (hover: hover) {
  .client-section:hover > .client-header .client-actions {
    opacity: 1;
    pointer-events: auto;
  }
}
@media (hover: none) {
  .client-header .client-actions { opacity: 1; pointer-events: auto; }
}

.client-expandable {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.client-section.expanded .client-expandable {
  max-height: 1400px;
}

/* Project rows, stacked vertically, not a card grid. */
.client-projects-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.25rem 1.1rem 1rem 2.1rem;
}
.client-projects-grid > .project-card + .project-card {
  border-top: 1px solid var(--glass-border);
}

.client-no-projects { font-size: 0.82rem; color: var(--text-muted); padding: 0.5rem 0; }

/* A project is now a row: [dot] [name + status] [hours] [hover actions] */
.project-card {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  cursor: default;
  transition: background 0.1s ease;
  position: relative;
  border: none;
  overflow: visible;
}
.project-card::before { content: none; }
.project-card:hover {
  background: var(--bg-elevated);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

/* Status dot, replaces the old colored pill. */
.project-card .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--project-color, var(--accent));
}

.project-card-name {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  display: inline-block;
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
  margin: 0;
}
.project-card-name:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.project-card-hours {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.project-row-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.project-card-actions {
  display: flex;
  gap: 0.2rem;
  flex-wrap: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.project-card-actions .btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  min-width: 0;
  border-radius: 6px;
}
@media (hover: hover) {
  .project-card:hover .project-card-actions {
    opacity: 1;
    pointer-events: auto;
  }
}
@media (hover: none) {
  .project-card-actions { opacity: 1; pointer-events: auto; }
}

.project-card-archived { opacity: 0.65; }
.project-card-completed { opacity: 0.75; }

/* Dragged row gets reduced opacity so the user can still see it during drag.
   Siblings shift into place via JS, no drag-over indicator needed. */
.project-card.dragging { opacity: 0.4; background: var(--bg-elevated); }
.client-section.dragging { background: var(--bg-elevated); }

/* Completed projects collapsible section */
.completed-projects-section summary { padding: 0.4rem 0; }
.completed-projects-section summary::-webkit-details-marker { display: none; }
.completed-projects-section[open] .completed-toggle-icon { transform: rotate(90deg); display: inline-block; }
.completed-toggle-icon { display: inline-block; transition: transform 0.2s; }

/* Archived projects collapsible section */
.archived-projects-section summary { padding: 0.4rem 0; }
.archived-projects-section summary::-webkit-details-marker { display: none; }
.archived-projects-section[open] .archived-toggle-icon { transform: rotate(90deg); display: inline-block; }
.archived-toggle-icon { display: inline-block; transition: transform 0.2s; }

/* ---------- Drag & Drop ---------- */
.drag-handle {
  cursor: grab;
  opacity: 0.3;
  font-size: 1rem;
  user-select: none;
  transition: opacity 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.drag-handle:hover { opacity: 0.7; }
.drag-handle:active { cursor: grabbing; }

.project-drag-handle {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-size: 0.85rem;
  z-index: 1;
}

/* ---------- Log ---------- */
.log-filter-bar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
}

.log-table-wrap { padding: 0; overflow-x: auto; }

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.log-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.log-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  white-space: nowrap;
  /* With table-layout:fixed + nowrap content, long strings can visually spill
     past the cell's allotted column width unless clipped. Clip + ellipsis keeps
     rows contained inside the .log-table-wrap scroll container. */
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-table tr:last-child td { border-bottom: none; }
.log-table tr:hover td { background: rgba(143, 57, 133,0.04); }

.log-task-cell {
  cursor: pointer;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-task-cell:hover { color: var(--accent-light); }

.log-del-btn, .log-continue-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: var(--transition);
  padding: 0.2rem 0.4rem;
}
.log-del-btn:hover      { color: var(--red); }
.log-continue-btn:hover { color: var(--green); }

.empty-row { text-align: center; color: var(--text-muted); padding: 2rem !important; }

/* ---------- Reports ---------- */
.report-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1rem;
  position: relative;   /* establish stacking context so z-index takes effect */
  z-index: 10;          /* paint above the stats-grid cards below it */
}

.tab-group { display: flex; gap: 0.4rem; }

.tab-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.tab-btn:hover  { color: var(--text-primary); background: var(--glass-bg); }
.tab-btn.active { background: var(--accent-dim); color: var(--accent-light); border-color: rgba(143, 57, 133,0.3); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card { text-align: center; padding: 1.2rem; }
.stat-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent-light); }
.stat-value-sm { font-size: 1.3rem; }
.stat-sub   { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; }
.rev-line   { display: block; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 120px;
  gap: 0.5rem;
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  height: 100%;
  gap: 0.3rem;
}

.bar-val   { font-size: 0.7rem; color: var(--text-muted); min-height: 1em; }
.bar-fill  { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.4s ease; }
.bar-label { font-size: 0.7rem; color: var(--text-muted); }

.reports-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.reports-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.breakdown-item {
  display: grid;
  grid-template-columns: 10px 1fr 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.breakdown-item:last-child { border-bottom: none; }
.breakdown-dot    { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.breakdown-name   { font-size: 0.85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown-bar-wrap { height: 6px; background: rgba(0,0,0,0.08); border-radius: 3px; overflow: hidden; }
.breakdown-bar    { height: 100%; border-radius: 3px; }
.breakdown-hours  { font-size: 0.78rem; color: var(--accent-light); font-weight: 600; white-space: nowrap; }
.breakdown-pct    { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ---------- Calendar ---------- */
.cal-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.cal-range-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--glass-border);
  gap: 1px;
  margin-bottom: 0.6rem;
}

/* Week summary row spans all 7 columns */
.cal-week-row-summary {
  grid-column: 1 / 8;
}

.cal-header-cell {
  background: var(--bg-elevated);
  text-align: center;
  padding: 0.4rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.cal-day {
  background: var(--bg-elevated);
  padding: 0.4rem 0.5rem;
  min-height: 60px;
  font-size: 0.75rem;
  transition: var(--transition);
}

.cal-day:hover { background: rgba(143, 57, 133,0.06); }
.cal-other     { opacity: 0.35; }
.cal-is-today  { background: rgba(143, 57, 133,0.08); }
.cal-has-data  { border-left: 2px solid var(--accent); }

.cal-day-num {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.cal-today {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.cal-hours { font-size: 0.7rem; color: var(--accent-light); font-weight: 600; }
.cal-rev   { font-size: 0.65rem; color: var(--green); }

.cal-week-grid { grid-template-rows: auto auto; }

.cal-week-total {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.5rem 0.2rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.cal-total-label { color: var(--text-muted); }
.cal-total-hours { font-weight: 700; color: var(--accent-light); }
.cal-total-rev   { font-weight: 600; color: var(--green); font-size: 0.78rem; }

/* ---------- Calendar Invoice Dates ---------- */
.cal-invoice-row {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cal-invoice-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ---------- Invoice History ---------- */
/* Invoice Overview Summary */
.inv-overview {
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.inv-overview-main {
  margin-bottom: 0.75rem;
}
.inv-overview-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.inv-overview-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.inv-overview-sub {
  display: flex;
  gap: 0.5rem;
}
.inv-overview-sub-item {
  flex: 1;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.inv-overview-sub-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.inv-overview-sub-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.inv-overview-overdue { color: var(--red); }
.inv-overview-paid    { color: var(--accent); }

#invoice-history-list { overflow-x: auto; }

.inv-history-filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.inv-history-filters .styled-input,
.inv-history-filters .styled-select {
  font-size: 0.82rem;
  height: 2rem;
  padding: 0 0.6rem;
}
.inv-history-filters .styled-input { width: 14rem; }
.inv-history-filters .styled-select { width: auto; min-width: 8.5rem; }
@media (max-width: 680px) {
  .inv-history-filters { width: 100%; }
  .inv-history-filters .styled-input { flex: 1 1 100%; width: auto; }
  .inv-history-filters .styled-select { flex: 1 1 calc(50% - 0.25rem); }
}

.inv-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.inv-history-table th {
  text-align: left;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.inv-history-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.inv-history-table tr:last-child td {
  border-bottom: none;
}

.inv-history-table tr:hover td {
  background: var(--bg-elevated);
}

/* Plain-icon action buttons on invoice rows (send / delete). No button chrome, just the icon. */
.inv-row-action {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.inv-row-action:hover { color: var(--accent); background: var(--glass-hover, rgba(143, 57, 133,0.08)); }
.inv-row-delete:hover { color: var(--red); background: rgba(220,38,38,0.08); }
.inv-row-icon { display: block; }

/* Custom Date Range Picker (Reports) */
.tf-date-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem !important;
  min-width: 140px;
  cursor: pointer;
  text-align: left;
  background: var(--bg-elevated);
  font-size: 0.82rem;
}
.tf-date-btn:hover { border-color: var(--accent); }

.tf-date-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.4rem;
  z-index: 50;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  padding: 0.6rem;
  min-width: 260px;
  font-size: 0.82rem;
}
.tf-date-popover.hidden { display: none; }

.tf-dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.tf-dp-title { font-weight: 600; color: var(--text-primary); }
.tf-dp-nav {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
}
.tf-dp-nav:hover { background: var(--glass-hover, rgba(143, 57, 133,0.08)); color: var(--accent); }

.tf-dp-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
}

.tf-dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.tf-dp-cell {
  background: none;
  border: 1px solid transparent;
  color: var(--text-primary);
  font: inherit;
  padding: 0.3rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
}
.tf-dp-cell.tf-dp-empty { visibility: hidden; }
.tf-dp-cell:hover { background: var(--glass-hover, rgba(143, 57, 133,0.1)); }
.tf-dp-cell.is-today { border-color: var(--accent); }
.tf-dp-cell.is-selected { background: var(--accent); color: #fff; }

.tf-dp-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--glass-border);
}
.tf-dp-footer-btn {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}
.tf-dp-footer-btn:hover { background: var(--glass-hover, rgba(143, 57, 133,0.1)); }

.inv-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.inv-status-badge.Draft   { background: var(--bg-elevated); color: var(--text-muted); }
.inv-status-badge.Sent    { background: rgba(62,207,207,0.15); color: var(--accent-2); }
.inv-status-badge.Paid    { background: rgba(143, 57, 133,0.15); color: var(--accent); }
.inv-status-badge.Overdue { background: rgba(176,123,224,0.15); color: var(--red); }
.inv-status-badge.Opened    { background: rgba(143, 57, 133,0.12); color: var(--accent); }
.inv-status-badge.Delivered { background: rgba(62,207,207,0.15); color: var(--accent-2); }
.inv-status-badge.Bounced   { background: rgba(255,99,99,0.15);  color: var(--red); }

/* Invoice Card Layout (mobile) */
.inv-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.inv-card {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.inv-card:active { transform: scale(0.98); }
.inv-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}
.inv-card-body {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 0.5rem 0.85rem 1rem;
}
.inv-card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.inv-card-num {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--accent);
}
.inv-card-client {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.inv-card-row-bottom {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.inv-card-amount {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.inv-card-currency {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}
.inv-card-chevron {
  flex-shrink: 0;
  padding: 0 0.75rem;
  color: var(--text-muted);
  opacity: 0.4;
}

.inv-status-select {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}

.inv-num-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inv-num-link:hover {
  opacity: 0.75;
}

/* Invoice Preview Modal */
.inv-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1rem;
}
.inv-preview-overlay.hidden { display: none; }
.inv-preview-modal {
  background: #fff;
  color: #000;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
}
.inv-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--paper-border);
  flex-shrink: 0;
}
.inv-preview-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--paper-text);
}
.inv-preview-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--paper-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}
.inv-preview-close:hover { background: var(--paper-hover); }
.inv-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.inv-preview-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--paper-border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.inv-preview-recipient-row {
  padding: 0.7rem 1.25rem 0.85rem;
  border-top: 1px solid var(--paper-border);
  background: var(--paper-hover);
  flex-shrink: 0;
}
/* AI Polish row inside the invoice preview — sits between the iframe and the
   pending-footer action bar. Hidden by default; shown when the user opts in
   via Settings → Invoicing → AI Polish. */
.inv-preview-polish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  border-top: 1px solid var(--paper-border);
  background: linear-gradient(90deg, rgba(143, 57, 133, 0.06), rgba(7, 190, 184, 0.06));
  flex-shrink: 0;
  flex-wrap: wrap;
}
.inv-preview-polish-row.hidden { display: none; }
.inv-polish-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex: 1 1 auto;
  min-width: 16rem;
}
.inv-polish-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.inv-polish-btn {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.inv-polish-btn.is-loading { cursor: progress; opacity: 0.85; }
.inv-polish-btn.is-polished {
  border-color: var(--accent, #8F3985);
  color: var(--accent, #8F3985);
}
.inv-polish-revert-btn { font-size: 0.82rem; }
.inv-polish-revert-btn.hidden { display: none; }
.inv-polish-sparkle {
  font-size: 0.95em;
  filter: drop-shadow(0 0 2px rgba(143, 57, 133, 0.35));
}
.inv-polish-spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: inv-polish-spin 0.7s linear infinite;
  vertical-align: -0.15em;
}
@keyframes inv-polish-spin { to { transform: rotate(360deg); } }

/* Settings → Invoicing → AI Polish toggle */
.settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
}
.settings-toggle-checkbox {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
  accent-color: var(--accent, #8F3985);
}
.settings-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}
.inv-preview-recipient-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--paper-muted);
  margin-bottom: 0.45rem;
}
.inv-preview-recipient-choice {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--paper-text);
  transition: background 0.12s;
}
.inv-preview-recipient-choice:hover { background: #fff; }
.inv-preview-recipient-choice input[type="radio"],
.inv-preview-recipient-choice input[type="checkbox"] {
  accent-color: var(--accent);
  flex-shrink: 0;
  margin: 0;
}
.inv-preview-recipient-choice-role {
  font-weight: 600;
  min-width: 110px;
}
.inv-preview-recipient-choice-name {
  color: var(--paper-muted);
}
.inv-preview-recipient-choice-email {
  color: var(--paper-text);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.inv-preview-recipient-empty {
  font-size: 0.82rem;
  color: var(--paper-muted);
  font-style: italic;
}
@media (max-width: 540px) {
  .inv-preview-recipient-choice { flex-wrap: wrap; gap: 0.3rem; }
  .inv-preview-recipient-choice-email { margin-left: 0; width: 100%; }
  .inv-preview-recipient-choice-role { min-width: 0; }
}
.inv-preview-btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  text-align: center;
  font-size: 0.82rem !important;
  padding: 0.55rem 0.75rem !important;
}

@media (max-width: 680px) {
  .inv-preview-overlay { padding: 0; align-items: stretch; }
  .inv-preview-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    height: 100%;
  }
  .inv-preview-footer {
    padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  }
  .inv-preview-btn {
    font-size: 0.75rem !important;
    padding: 0.5rem 0.5rem !important;
  }
}

.inv-history-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Stack invoice history table on small screens, now handled by card layout in JS */

/* ---------- Calendar Monthly Weekly Summary Row ---------- */
.cal-week-row-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.7rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--glass-border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cal-week-row-label {
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cal-week-row-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-week-row-hours {
  font-weight: 700;
  color: var(--accent-light);
  font-size: 0.78rem;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 380px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-lg {
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
}

.modal p { color: var(--text-secondary); margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}

.form-label:first-of-type { margin-top: 0; }

.modal .styled-input { width: 100%; }

.form-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 1.2rem;
  margin-bottom: 0.2rem;
}

/* Required field indicator */
.form-required { color: var(--red); margin-left: 0.15rem; }

/* Inline validation error */
.styled-input.input-error,
.styled-select.input-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(222,79,79,0.15);
}

/* Old swatch-only picker wrapper (kept for fallback) */
.color-picker {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.color-swatch:hover, .color-swatch.selected {
  border-color: #fff;
  transform: scale(1.2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* ---------- Colour Picker (Rectangular SB + Hue slider) ---------- */
.cpw-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.4rem;
}

/* Saturation / Brightness canvas + Preview side by side */
.cpw-sb-wrap {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  width: 100%;
  user-select: none;
  flex-shrink: 0;
}

/* Colour preview panel (left half) */
.cpw-preview {
  width: 50%;
  min-height: 160px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: background 0.12s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* Canvas container (right half) */
.cpw-canvas-area {
  position: relative;
  flex: 1;
  border-radius: 10px;
  overflow: hidden;
  cursor: crosshair;
}

.cpw-sb-canvas {
  width: 100%;
  height: 160px;
  display: block;
}

/* Cursor dot on the SB canvas */
.cpw-cursor {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.35), 0 2px 6px rgba(0,0,0,0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

/* Slider row */
.cpw-slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 2px;
}

/* Hue slider */
.cpw-hue-wrap {
  position: relative;
  width: 100%;
  height: 14px;
  user-select: none;
}

.cpw-hue-canvas {
  width: 100%;
  height: 14px;
  border-radius: 7px;
  display: block;
  cursor: pointer;
}

/* Slider thumb (hue) */
.cpw-slider-thumb {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

/* Hex input row */
.cpw-hex-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cpw-hex-label {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  user-select: none;
  cursor: default;
  flex-shrink: 0;
}

.cpw-hex-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  min-width: 0;
}

.cpw-hash {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: monospace;
  flex-shrink: 0;
}

.cpw-hex-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.9rem;
  font-family: monospace;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 0;
}

/* Saved colours header */
.cpw-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.1rem;
}

.cpw-saved-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cpw-add-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light, #8F3985);
  padding: 0;
  line-height: 1;
}

.cpw-add-btn:hover {
  text-decoration: underline;
}

/* Swatches grid */
.cpw-presets {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 5px;
  max-width: 420px;
}

.cpw-custom-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.5rem 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.cpw-custom-toggle:hover { color: var(--text); border-color: var(--accent); }
.cpw-custom-chevron { display: inline-block; transition: transform 0.18s; }
.cpw-custom-toggle.is-open .cpw-custom-chevron { transform: rotate(90deg); }

.cpw-advanced { margin-top: 0.8rem; }
.cpw-advanced[hidden] { display: none; }

/* Info Tooltip (reusable) */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  margin-left: 0.4rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  position: relative;
  vertical-align: middle;
  transition: var(--transition);
}
.info-tip:hover, .info-tip:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  outline: none;
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  font-family: var(--font-body); /* override .info-tip's Georgia, tooltip body should be Quicksand */
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 400;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
  text-align: left;
}
.info-tip:hover::after,
.info-tip:focus-visible::after {
  opacity: 1;
}

/* Disabled input look (used by Hourly Rate when Fixed Fee) */
.styled-input:disabled,
.styled-input.input-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg-elevated);
}
.form-label.label-disabled { opacity: 0.45; }

/* Invoice Email Template Editor */
.email-tpl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.email-tpl-toolbar-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 0.2rem;
}
.email-tpl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  background: rgba(143, 57, 133,0.08);
  border: 1px solid rgba(143, 57, 133,0.25);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.email-tpl-chip::before { content: "+"; font-weight: 600; opacity: 0.7; }
.email-tpl-chip:hover {
  background: rgba(143, 57, 133,0.16);
  border-color: rgba(143, 57, 133,0.5);
  transform: translateY(-1px);
}
.email-tpl-chip:active { transform: translateY(0); }

.email-tpl-textarea { font-size: 0.92rem; line-height: 1.5; }

.email-tpl-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  align-items: center;
}
.email-tpl-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.email-tpl-link:hover { color: var(--accent-2); }

.email-tpl-preview {
  margin-top: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.email-tpl-preview[hidden] { display: none; }
.email-tpl-preview-label {
  padding: 0.4rem 0.8rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.email-tpl-preview-body {
  padding: 1.2rem 1.4rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}
.email-tpl-preview-body p { margin: 0 0 0.9em; }
.email-tpl-preview-body p:last-child { margin-bottom: 0; }

.cpw-preset {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 0.14s, border-color 0.14s;
  min-width: 0;
}

.cpw-preset:hover,
.cpw-preset.selected {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
  transform: scale(1.2);
}

/* ---------- Date Field Wrapper ---------- */
.date-field-wrap {
  position: relative;
  cursor: pointer;
}

.date-field-input {
  cursor: pointer !important;
  padding-right: 2.4rem !important;
}

.date-field-icon {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: all;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* ---------- Time Field Wrapper ---------- */
.time-field-wrap {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  position: relative;
}

.time-field-input {
  flex: 1;
  min-width: 0;
}

.time-now-btn {
  flex-shrink: 0;
  padding: 0 0.7rem;
  background: rgba(143, 57, 133,0.1);
  border: 1px solid rgba(143, 57, 133,0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.time-now-btn:hover {
  background: rgba(143, 57, 133,0.2);
  border-color: var(--accent);
}

/* ---------- Manual Duration Preview ---------- */
.manual-duration-preview {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.3rem;
  min-height: 1.2em;
  text-align: right;
}

/* ---------- Manual Quick Enter (natural-language) ---------- */
.manual-nl-feedback {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  min-height: 1em;
  font-weight: 500;
}
.manual-nl-feedback-ok  { color: var(--green, #22a06b); }
.manual-nl-feedback-err { color: var(--text-muted); }

/* ---------- Manual New Project Row ---------- */
.manual-new-proj-row {
  background: rgba(143, 57, 133,0.05);
  border: 1px solid rgba(143, 57, 133,0.2);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  margin-top: 0.3rem;
}

/* ---------- Project Detail (v2) ---------- */
.pd-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pd-color-accent { display: none; }   /* removed from layout; kept in case JS still sets it */

.pd-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.pd-title-block { min-width: 0; flex: 1; }
.pd-title-block h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  letter-spacing: -0.005em;
}

/* Client · Contact as a muted subtitle under the title (no pill). */
.pd-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}

/* Close button top-right of the modal. */
.pd-close-btn {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.pd-close-btn:hover { background: var(--bg-elevated); color: var(--text-main); }

/* Summary row: hero total hours + status dot + status text. */
.pd-summary-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.pd-total {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pd-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.pd-status-inline .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}

/* Primary actions row (under the billing strip). */
.pd-actions-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.pd-actions-row .btn { font-size: 0.82rem; padding: 0.45rem 0.8rem; white-space: nowrap; }

.pd-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 1rem 0 0.65rem;
}
.pd-section-label:first-of-type { margin-top: 0.25rem; }

/* Task breakdown, thin accent bars, not red. */
.pd-task-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 0.6rem;
  margin-bottom: 0.75rem;
}
.pd-task-name {
  grid-column: 1;
  font-size: 0.85rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-task-meta {
  grid-column: 2;
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.pd-task-pct { color: var(--text-muted); }
.pd-task-bar-wrap {
  grid-column: 1 / 3;
  height: 4px;
  background: var(--glass-border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: -2px;
}
.pd-task-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--accent) !important;   /* force accent, project colour pollutes the feel */
}

.pd-entries-list {
  max-height: 300px;
  overflow-y: auto;
}
.pd-entry-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.82rem;
}
.pd-entry-row:last-child { border-bottom: none; }
.pd-entry-date { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.pd-entry-task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-main); }
.pd-entry-time { display: none; }  /* times consolidated into the log, save the space for readability here */
.pd-entry-dur {
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pd-empty { font-size: 0.82rem; color: var(--text-muted); padding: 0.5rem 0; }

.pd-invoices-list {
  display: flex;
  flex-direction: column;
}
.pd-invoice-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.82rem;
}
.pd-invoice-row:last-child { border-bottom: none; }
.pd-invoice-num { font-weight: 600; }
.pd-invoice-date { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.pd-invoice-total {
  text-align: right;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-main);
}
.pd-invoice-status { white-space: nowrap; }
.pd-inv-manual-badge {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* ---------- Project detail: billing progress (fixed-fee) ---------- */
.pd-billing-progress {
  margin: 0.85rem 0 0.5rem;
}
.pd-billing-progress.hidden { display: none; }
.pd-billing-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.pd-billing-progress-pct {
  font-weight: 600;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.pd-billing-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}
.pd-billing-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.pd-billing-progress-summary {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.pd-billing-progress-over {
  color: var(--text-main);
  font-weight: 500;
}

/* ---------- Manual invoice modal ---------- */
.manual-inv-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.manual-inv-line {
  display: grid;
  grid-template-columns: 1fr 70px 110px 110px 32px;
  gap: 0.5rem;
  align-items: center;
}
.manual-inv-line .styled-input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.4rem 0.5rem;
}
.manual-inv-line-amount {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: right;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  padding-right: 0.4rem;
}
.manual-inv-line-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.2rem;
  border-radius: 4px;
}
.manual-inv-line-remove:hover { color: var(--red); background: var(--bg-elevated); }
.manual-inv-line-headers {
  display: grid;
  grid-template-columns: 1fr 70px 110px 110px 32px;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 0.3rem;
  padding: 0 0.5rem;
}
.manual-inv-line-headers > div:nth-child(2),
.manual-inv-line-headers > div:nth-child(3),
.manual-inv-line-headers > div:nth-child(4) {
  text-align: right;
}
.manual-inv-totals {
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
}
.manual-inv-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 0.18rem 0;
  font-variant-numeric: tabular-nums;
}
.manual-inv-totals-row.total {
  margin-top: 0.3rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--glass-border);
  font-weight: 700;
  color: var(--text-main);
}
.manual-inv-totals-label { color: var(--text-muted); }
@media (max-width: 600px) {
  .manual-inv-line, .manual-inv-line-headers {
    grid-template-columns: 1fr 60px 90px 90px 28px;
  }
}

.pd-status-history { margin-top: 1.2rem; padding-top: 0.9rem; border-top: 1px solid var(--glass-border); }
.pd-status-history > summary { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

/* Ghost button variant used for low-emphasis actions (Archive in detail modal) */
.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--toast-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
  color: var(--toast-fg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 200;
  animation: fadeIn 0.2s ease;
  white-space: nowrap;
}

/* ---------- Empty State ---------- */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  color: var(--accent-light);
  display: flex;
  justify-content: center;
  opacity: 0.75;
}
.empty-icon svg { flex-shrink: 0; }
.empty-sub  { font-size: 0.82rem; margin-top: 0.4rem; }

/* ---------- Skeleton Loader ---------- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skel {
  display: inline-block;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--glass-border) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
  vertical-align: middle;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Mobile Header ---------- */
.mobile-header { display: none; }

/* ---------- Mobile Bottom Nav ---------- */
.mobile-nav { display: none; }

/* ---------- Project detail, billing strip ---------- */
.pd-billing-strip {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  margin: 0.6rem 0 1rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  font-size: 0.82rem;
}
.pd-billing-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.pd-billing-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.pd-billing-value {
  color: var(--text-main);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-billing-accent .pd-billing-value { color: var(--accent); }
.pd-billing-divider {
  width: 1px;
  height: 28px;
  background: var(--glass-border);
}
@media (max-width: 520px) {
  .pd-billing-strip { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .pd-billing-divider { display: none; }
  .pd-billing-cell { flex-direction: row; justify-content: space-between; align-items: baseline; }
}

/* ---------- Fee type toggle (project editor) ---------- */
.fee-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 3px;
}
.fee-type-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s ease;
}
.fee-type-btn:hover { color: var(--text-main); }
.fee-type-btn.on {
  background: var(--glass-bg);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(17,19,40,0.08);
}

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

.input-prefix-char {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.styled-input.input-with-prefix { padding-left: 26px; }

/* ---------- Day Summary (Reports calendar day click) ---------- */
.cal-day.cal-has-data { cursor: pointer; }
.cal-day.cal-has-data:hover { background: var(--accent-dim); }

.day-sum-total {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  margin: 0 0 1rem;
  background: var(--surface-tint);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.day-sum-total-label { color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.72rem; }
.day-sum-total-hours { color: var(--accent); font-weight: 700; font-size: 1.05rem; }
.day-sum-total-rev   { margin-left: auto; color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; }

.day-sum-client {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--glass-border);
}
.day-sum-client:last-child { border-bottom: none; }

.day-sum-client-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}
.day-sum-client-name  { font-weight: 600; color: var(--text-primary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-sum-client-hours { color: var(--accent-light); font-weight: 700; font-variant-numeric: tabular-nums; }

.day-sum-revenue {
  margin: 0.15rem 0 0.35rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.day-sum-projects {
  margin-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.day-sum-proj-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.day-sum-proj-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-sum-proj-hours { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.day-sum-dot    { width: 8px;  height: 8px;  border-radius: 50%; flex-shrink: 0; display: inline-block; }
.day-sum-dot-lg { width: 10px; height: 10px; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.18); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .main-content        { padding: 1.5rem; }
  .stats-grid         { grid-template-columns: repeat(2, 1fr); }
  .reports-charts-grid { grid-template-columns: 1fr; }
  .reports-bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { flex-direction: column; overflow: auto; }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 1rem;
    padding-top: 4.5rem;
    padding-bottom: 7rem;
    max-height: none;
    overflow-y: visible;
  }

  /* Disable backdrop-filter on mobile, iOS Safari has a known bug where
     multiple backdrop-filter elements break position:fixed stacking.
     The Reports page has 8 glass-cards, which triggers this reliably. */
  .glass-card { backdrop-filter: none; }

  /* Mobile Header */
  .mobile-header {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3.5rem;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 110;
  }
  .mobile-header-left { display: flex; align-items: center; gap: 0.5rem; }
  .mobile-header-date {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
  }
  .mobile-header-right { display: flex; align-items: center; gap: 0.25rem; }
  .mobile-header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background 0.2s;
  }
  .mobile-header-btn:hover { background: var(--accent-dim); }

  /* Floating Bottom Nav */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    height: 4rem;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    z-index: 100;
    padding: 0 0.25rem;
    gap: 0;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.25), 0 0 0 1px var(--glass-border);
    transform: translateZ(0);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0;
    border-radius: 0.75rem;
    transition: color 0.2s;
    flex: 1;
    position: relative;
  }

  .mobile-nav-btn.active {
    color: var(--accent);
  }
  .mobile-nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
  }

  .mobile-nav-icon {
    display: block;
    width: 22px;
    height: 22px;
  }
  .mobile-nav-btn.active .mobile-nav-icon { stroke-width: 2.5; }

  .mobile-nav-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  /* Time Log: card layout on mobile */
  .log-table-wrap { overflow-x: visible !important; padding: 0 !important; }
  .log-table,
  .log-table tbody { display: block !important; width: 100% !important; }
  .log-table { table-layout: auto !important; }
  .log-table thead { display: none !important; }
  .log-table tr {
    display: grid !important;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.25rem 0.6rem;
    align-items: center;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--glass-border);
    width: auto !important;
  }
  .log-table tr:last-child { border-bottom: none; }
  .log-table td {
    display: block !important;
    padding: 0 !important;
    border: none !important;
    white-space: normal !important;
    width: auto !important;
    min-width: 0;
    font-size: 0.86rem;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  /* Row 1: date (left) ... duration (right) */
  .log-table td:nth-child(1) {
    grid-column: 1; grid-row: 1;
    font-size: 0.72rem; color: var(--text-muted);
    font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
  }
  .log-table td:nth-child(7) {
    grid-column: 2 / -1; grid-row: 1;
    text-align: right; font-weight: 700; font-size: 1rem;
    color: var(--accent-light);
  }
  /* Row 2: client */
  .log-table td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  /* Row 3: project */
  .log-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; font-size: 0.8rem; color: var(--text-muted); }
  /* Row 4: task description (full width, clickable) */
  .log-table td:nth-child(4) {
    grid-column: 1 / -1; grid-row: 4;
    max-width: none !important;
    font-weight: 500; color: var(--text-primary);
    white-space: normal !important;
    overflow: hidden !important;
  }
  /* Row 5: start → end (left) + actions (right) */
  .log-table td:nth-child(5),
  .log-table td:nth-child(6) {
    grid-row: 5;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
  }
  .log-table td:nth-child(5) { grid-column: 1; }
  .log-table td:nth-child(5)::after { content: ' → '; opacity: 0.6; margin: 0 0.2rem; }
  .log-table td:nth-child(6) { grid-column: 2; margin-right: auto; }
  .log-table td:nth-child(8) { grid-column: 3; grid-row: 5; justify-self: end; }
  .log-table td:nth-child(9) { grid-column: 4; grid-row: 5; justify-self: end; }
  /* Pagination footer row, reset grid for a single full-width centered cell */
  .log-table tr.log-pagination-row {
    display: block !important;
    padding: 0 !important;
    border-top: 1px solid var(--border);
  }
  .log-table tr.log-pagination-row td {
    grid-column: unset !important; grid-row: unset !important;
    display: block !important;
    text-align: center !important;
    padding: 0.75rem 1rem !important;
  }
  /* Empty-state row */
  .log-table tr td.empty-row { grid-column: 1 / -1 !important; text-align: center; }

  .modal     { width: 95vw; padding: 1.2rem; }
  .modal-lg  { width: 95vw; padding: 1.2rem; }

  /* Keep modals clear of the fixed mobile header (3.5rem) and bottom nav (~5rem).
     Scroll from the top of the modal rather than centering, on small screens the
     modal is almost always taller than the safe area anyway. */
  .modal-overlay {
    align-items: flex-start;
    padding: 4rem 0 5.5rem;
    overflow-y: auto;
  }
  .modal-overlay > .modal,
  .modal-overlay > .modal-lg {
    max-height: none;
    margin: auto;
  }

  /* Convert ALL 2-column modal grids to single column on mobile */
  .modal div[style*="grid-template-columns:1fr 1fr"],
  .modal div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .stats-grid .stat-card { min-height: 5.5rem; }
  .stats-grid .stat-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Client list: tighter padding on mobile */
  .client-header { padding: 0.85rem 0.9rem; gap: 0.6rem; }
  .client-projects-grid { padding: 0.25rem 0.6rem 0.9rem 1.6rem; }
  .client-overview-strip { font-size: 0.8rem; gap: 0.4rem; padding: 0.75rem 0; }
  .client-overview-strip .strip-dot { display: none; }
  .client-overview-strip > span { flex: 1 0 auto; }

  /* Project row: hours and actions go below name on small screens */
  .project-card {
    grid-template-columns: 10px 1fr auto;
    grid-template-areas:
      "dot name hours"
      "dot meta meta"
      ".   actions actions";
    row-gap: 0.2rem;
  }
  .project-card .status-dot { grid-area: dot; align-self: start; margin-top: 6px; }
  .project-card-name { grid-area: name; }
  .project-card-hours { grid-area: hours; align-self: start; }
  .project-row-meta { grid-area: meta; }
  .project-card-actions {
    grid-area: actions;
    justify-content: flex-start;
    margin-top: 0.25rem;
    /* Narrow viewport = always show actions, regardless of hover capability. */
    opacity: 1;
    pointer-events: auto;
  }
  /* Same for client action buttons on narrow viewports. */
  .client-header .client-actions { opacity: 1; pointer-events: auto; }

  /* Entry Cards: 3-row layout 
     Row 1: [●] [Project › Name]           [↺] [✕]
     Row 2: [  ] [task description ✎ (wraps)]
     Row 3: [  ] [10:00 – 11:30 AM]       [1h 30m]
 */
  .entry-card {
    grid-template-columns: 12px 1fr auto auto;
    row-gap: 0.3rem;
    column-gap: 0.35rem;
    padding: 0.7rem 0.3rem;
    align-items: center;
  }

  .entry-dot          { grid-column: 1; grid-row: 1; align-self: center; }
  .entry-project      { grid-column: 2; grid-row: 1; white-space: normal; overflow: visible; text-overflow: unset; font-size: 0.82rem; }
  .entry-continue-btn { grid-column: 3; grid-row: 1; }
  .entry-del-btn      { grid-column: 4; grid-row: 1; }
  .entry-task-group   { grid-column: 2 / 5; grid-row: 2; overflow: visible; }
  .entry-task         { white-space: normal; overflow: visible; text-overflow: unset; font-size: 0.8rem; color: var(--text-muted); }
  .entry-time         { grid-column: 2; grid-row: 3; font-size: 0.73rem; }
  .entry-dur          { grid-column: 3 / 5; grid-row: 3; text-align: right; font-size: 0.78rem; }

  /* Client Cards: grid layout 
     Row 1: [bar] [Client Name + badges]   [▸]
     Row 2: [bar] [contact · hours]
     Row 3: [bar] [+ Project] [✎ Edit] [🗑]
 */
  .client-header {
    display: grid;
    grid-template-columns: auto 4px 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 0.3rem 0.75rem;
    padding: 0.85rem 1rem;
    align-items: start;
  }

  .client-header > .drag-handle {
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: center;
  }

  .client-color-bar {
    grid-column: 2;
    grid-row: 1 / 4;
    width: 4px;
    height: auto;
    align-self: stretch;
    min-height: 60px;
    border-radius: 2px;
  }

  .client-header-info {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
  }

  .client-chevron {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
  }

  .client-hours-label {
    grid-column: 3 / 5;
    grid-row: 2;
    white-space: normal;
    font-size: 0.75rem;
  }

  .client-actions {
    grid-column: 3 / 5;
    grid-row: 3;
    flex-wrap: nowrap;
    gap: 0.35rem;
    justify-content: flex-start;
  }

  .client-actions .btn-sm {
    padding: 0.28rem 0.55rem;
    font-size: 0.75rem;
  }

  .timer-clock     { font-size: 2.2rem; }
  .page-title      { font-size: 1.3rem; }

  /* Let timer inputs wrap properly on small screens */
  .timer-project-row .styled-select { flex: 1 1 100%; min-width: 0; }
  .timer-project-row .styled-input  { flex: 1 1 100%; min-width: 0; }

  /* Date filter inputs shouldn't force overflow */
  .log-filter-bar .styled-input,
  .log-filter-bar .styled-select { min-width: 0 !important; flex: 1 1 auto; }

  /* Invoice page: prevent content bleeding outside container */
  #invoice-preview-area {
    padding: 1rem !important;   /* override the inline padding:2rem */
    overflow-x: hidden;
  }

  /* Make the invoice table scroll horizontally instead of bleeding */
  #invoice-html-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ensure the table has enough room to be readable while scrollable */
  #invoice-html-content table {
    min-width: 340px;
  }

  /* Increase touch targets for mobile */
  .btn-sm { padding: 0.5rem 0.85rem; font-size: 0.8rem; min-height: 44px; }
  .time-now-btn { padding: 0.4rem 0.85rem; min-height: 44px; }

  /* Generate Invoice button: full-width on mobile for easy tap */
  #invoice-generate-inline-btn {
    width: 100%;
    margin-top: 0.25rem;
  }

  /* Keyboard shortcuts hint is irrelevant on touch devices */
  .timer-shortcuts-hint {
    display: none;
  }

  /* Toast: sit above floating mobile nav with breathing room */
  .toast {
    bottom: 6.5rem;
    max-width: calc(100vw - 2rem);
    white-space: normal;
    text-align: center;
    z-index: 150;
  }

  /* Tax Estimate: horizontal scroll like time log table */
  #tax-estimate-panel {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #tax-estimate-panel > * {
    min-width: 320px;
  }
}

/* ---------- CSS Chevrons ---------- */
.chevron {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.chevron.down { transform: rotate(45deg); }

/* ---------- Focus Visible ---------- */
.btn:focus-visible,
.mobile-nav-btn:focus-visible,
.nav-btn:focus-visible,
.dark-mode-toggle:focus-visible,
.styled-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Print Styles for Invoices ---------- */
@media print {
  /* Reset all overflow/height clipping so the full invoice prints */
  html, body {
    background:  #fff !important;
    color:       #000 !important;
    overflow:    visible !important;  /* body has overflow:hidden on desktop, must clear it */
    height:      auto   !important;
    max-height:  none   !important;
  }

  .sidebar, .mobile-nav, .mobile-header, .page-header, .invoice-controls, .no-print {
    display: none !important;
  }

  /* main-content: remove the 100vh max-height and overflow:auto that clip the invoice */
  .main-content {
    margin:     0       !important;
    padding:    0       !important;
    width:      100%    !important;
    height:     auto    !important;   /* NOT 100%, that would clip to one page */
    max-height: none    !important;
    overflow:   visible !important;
    flex:       none    !important;
  }

  .print-section {
    box-shadow: none        !important;
    border:     none        !important;
    background: transparent !important;
    margin:     0           !important;
    padding:    0           !important;
    width:      100%        !important;
    height:     auto        !important;
    overflow:   visible     !important;
  }

  /* Hide all pages except the invoice page */
  .page               { display: none  !important; }
  #page-invoices      { display: block !important; overflow: visible !important; }
  #invoice-preview-area { overflow: visible !important; height: auto !important; }

  /* Table header repeats on every printed page */
  #invoice-html-content table thead { display: table-header-group; }

  /* Avoid splitting a week group row mid-page */
  #invoice-html-content tbody tr { page-break-inside: avoid; break-inside: avoid; }

  /* Keep the totals block together on one page */
  #invoice-html-content tbody tr:last-child,
  #invoice-html-content div[style*="justify-content:flex-end"] {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}


/* Invoice Calendar Modal */
.inv-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  user-select: none;
}
.inv-cal-header {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 4px 2px;
  font-weight: 600;
}
.inv-cal-day {
  text-align: center;
  padding: 9px 4px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1;
  transition: background 0.12s;
}
.inv-cal-day:hover:not(.inv-cal-other) {
  background: var(--bg-elevated);
}
.inv-cal-day.inv-cal-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.inv-cal-day.inv-cal-in-range {
  background: var(--accent-dim);
  border-radius: 0;
}
.inv-cal-day.inv-cal-range-start {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 6px 0 0 6px;
}
.inv-cal-day.inv-cal-range-end {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 0 6px 6px 0;
}
.inv-cal-day.inv-cal-other {
  color: var(--text-muted);
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.inv-cal-day.inv-cal-today:not(.inv-cal-selected):not(.inv-cal-range-start):not(.inv-cal-range-end) {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Invoice Inline Calendar, Day Selection */
.inv-day-selectable {
  cursor: pointer;
}
.inv-day-selectable:hover {
  background: var(--bg-elevated);
}
.inv-day-start,
.inv-day-end {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}
.inv-day-start .cal-day-num,
.inv-day-end .cal-day-num,
.inv-day-start .cal-hours,
.inv-day-end .cal-hours,
.inv-day-start .cal-rev,
.inv-day-end .cal-rev {
  color: #fff !important;
}
.inv-day-in-range {
  background: var(--accent-dim) !important;
}

/*  Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base, #0f0f1a);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
  text-align: left;
}

.login-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.5rem 0;
}

.login-field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.login-required {
  color: var(--red);
}

.login-input {
  width: 100%;
  margin-bottom: 1rem;
}

.login-btn {
  width: 100%;
  margin-bottom: 0.75rem;
}

.login-toggle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}
.login-toggle a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.login-toggle a:hover { text-decoration: underline; }

.login-error {
  background: rgba(247, 106, 106, 0.15);
  border: 1px solid rgba(247, 106, 106, 0.4);
  color: var(--red);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.83rem;
  margin-bottom: 1rem;
  text-align: left;
}

.login-success {
  background: rgba(47, 179, 123, 0.12);
  border: 1px solid rgba(47, 179, 123, 0.35);
  color: var(--green, #2fb37b);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 0.83rem;
  margin-bottom: 1rem;
  text-align: left;
  line-height: 1.5;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0.25rem 0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google,
.btn-microsoft {
  background: var(--surface-tint);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-google:hover,
.btn-microsoft:hover {
  background: var(--bg-elevated);
}

/* Password requirements checklist */
.pw-checklist {
  margin-bottom: 1rem;
  padding: 0;
}
.pw-check-item {
  font-size: 0.8rem;
  padding: 0.2rem 0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}
.pw-check-item .pw-icon {
  font-size: 0.75rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.pw-check-item.met {
  color: var(--green);
}
.pw-check-item.met .pw-icon {
  color: var(--green);
}
.pw-check-item:not(.met) .pw-icon {
  color: var(--red);
}

.login-forgot {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}
.login-forgot a {
  color: var(--accent);
  text-decoration: none;
}
.login-forgot a:hover { text-decoration: underline; }

/*  Sidebar Footer (user info + sign-out) */
.sidebar-footer {
  padding: 0.75rem 0.5rem 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  background: var(--surface-tint);
}

.sidebar-user-avatar { font-size: 1.1rem; flex-shrink: 0; }

.sidebar-user-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.sidebar-signout-btn {
  width: 100%;
  font-size: 0.78rem;
  margin-top: 0.5rem;
}

/*  Tax Estimate Panel */

.tax-locked {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.25rem 0;
}

.tax-locked-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.tax-locked-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.tax-locked-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tax-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tax-title {
  font-size: 1rem;
  font-weight: 700;
}

.tax-province-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.tax-ytd-badge {
  display: inline-block;
  background: rgba(61, 214, 140, 0.15);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
}

.tax-default-badge {
  display: inline-block;
  background: rgba(247, 167, 106, 0.15);
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.12rem 0.5rem;
  border-radius: 20px;
}

.tax-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tax-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1rem;
  align-items: start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.875rem;
}

.tax-row:last-child {
  border-bottom: none;
}

.tax-row-label {
  font-weight: 500;
}

.tax-row-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  grid-column: 1;
}

.tax-usd-warning {
  color: var(--orange);
}

.tax-row-amount {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  min-width: 90px;
  font-variant-numeric: tabular-nums;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}

.tax-total-row {
  margin-top: 0.3rem;
  padding-top: 0.85rem !important;
  border-top: 2px solid var(--glass-border) !important;
  border-bottom: none !important;
}

/* Revenue breakdown section */
.tax-revenue-section {
  padding: 0.6rem 0 0.7rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--glass-border);
}
.tax-revenue-section .tax-row-label {
  margin-bottom: 0.4rem;
}
.tax-revenue-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.tax-revenue-total {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.88rem;
  color: var(--text-primary);
}

.tax-total-amount {
  font-size: 1.05rem;
  color: var(--red);
}

.tax-disclaimer {
  margin-top: 1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.65;
  padding-top: 0.85rem;
  border-top: 1px solid var(--glass-border);
}

/*  Custom Time Picker */
.tp-trigger {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}
.tp-caret {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-left: 0.4rem;
  flex-shrink: 0;
}
.tp-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 999;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  display: flex;
  align-items: stretch;
  min-width: 164px;
}
.tp-col {
  height: 176px;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 0.25rem 0;
  flex: 1;
  outline: none;
  scroll-behavior: auto;
}
.tp-col::-webkit-scrollbar { width: 4px; }
.tp-col::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 4px; }
.tp-sep {
  display: flex;
  align-items: center;
  padding: 0 0.15rem;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1rem;
  user-select: none;
}
.tp-item {
  padding: 0.3rem 0.55rem;
  text-align: center;
  cursor: pointer;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  border-radius: var(--radius-sm);
  margin: 0 0.15rem;
  transition: background 0.1s;
  white-space: nowrap;
}
.tp-item:hover { background: var(--accent-dim); }
.tp-item.tp-selected {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.tp-ampm-col {
  height: auto;
  overflow: visible;
  min-width: 48px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--glass-border);
  padding: 0.25rem 0;
}

/*  Multi-select Dropdown */
.ms-wrap {
  position: relative;
  display: inline-flex;
}
.ms-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  min-width: 140px;
  gap: 0.4rem;
}
.ms-caret {
  color: var(--text-muted);
  font-size: 0.72rem;
  flex-shrink: 0;
}
.ms-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 500;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.35rem 0;
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.8rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.1s;
}
.ms-item:hover { background: var(--accent-dim); }
.ms-item input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.ms-divider {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 0.3rem 0;
}

/* Expense rows */
.expenses-section {
  margin: 0.75rem 0.25rem 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.65rem;
}
.expenses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.expenses-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.expenses-total {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.expense-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.32rem 0.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  transition: background 0.12s;
}
.expense-row:hover { background: var(--accent-dim); }
.expense-date   { color: var(--text-muted); min-width: 82px; font-size: 0.76rem; }
.expense-desc   { flex: 1; color: var(--text-primary); }
.expense-amount { font-weight: 600; color: var(--text-primary); white-space: nowrap; }

/* Quick filter buttons active state */
.log-quick-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Keyboard shortcut hint */
.timer-shortcuts-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.4rem;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* PiP pop-out button */
.pip-popout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  opacity: 0.8;
  font-family: inherit;
}
.pip-popout-btn:hover {
  color: var(--accent-light);
  border-color: var(--accent);
  opacity: 1;
}

/* ============================================================
   Settings Page
   ============================================================ */

/* Tabs */
.settings-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  width: fit-content;
  flex-wrap: wrap;
}

.settings-tab {
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: none;
  transition: var(--transition);
  font-family: inherit;
}
.settings-tab:hover { color: var(--text-primary); background: var(--glass-bg); }
.settings-tab.active { background: var(--accent); color: #fff; font-weight: 600; }

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

/* Grid / Section */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.settings-grid.single { grid-template-columns: 1fr; max-width: 680px; }

.settings-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}
.settings-section.span2 { grid-column: 1 / -1; }

.settings-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Field Rows */
.settings-field-row { margin-bottom: 0.9rem; }
.settings-field-row:last-child { margin-bottom: 0; }

.settings-field-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.settings-field-row-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.settings-field-row-inline:last-child { margin-bottom: 0; }

.field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* Logo Upload Area */
.logo-upload-area {
  background: var(--bg-elevated);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.logo-upload-area:hover { border-color: var(--accent); }

/* Bug Report File Upload */
.bug-upload-dropzone {
  background: var(--bg-elevated);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.bug-upload-dropzone:hover {
  border-color: var(--accent);
  background: var(--glass-bg);
}
.bug-file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.bug-file-list:empty { margin-top: 0; }
.bug-file-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.bug-file-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.bug-file-info {
  flex: 1;
  min-width: 0;
}
.bug-file-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bug-file-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.bug-file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}
.bug-file-remove:hover {
  color: var(--red);
  background: rgba(247, 106, 106, 0.1);
}

/* Invoice Template Picker */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.template-card {
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.template-card:hover { border-color: var(--accent); }
.template-card.selected { border-color: var(--accent); }
.template-card.selected::after {
  content: '';
  position: absolute;
  top: 8px; right: 10px;
  background: var(--accent);
  width: 10px; height: 10px;
  border-radius: 50%;
}
.template-preview {
  background: #fff;
  height: 90px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tpl-header { height: 18px; border-radius: 2px; margin-bottom: 4px; }
.tpl-line { height: 4px; background: #e8e8e8; border-radius: 2px; }
.tpl-line.w60 { width: 60%; }
.tpl-line.w40 { width: 40%; }
.tpl-line.w80 { width: 80%; }
.tpl-table { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.tpl-row { display: flex; gap: 2px; }
.tpl-cell { height: 4px; flex: 1; background: #e8e8e8; border-radius: 1px; }
.template-name {
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  text-align: center;
}
.template-card.selected .template-name { color: var(--accent); }

/* Toggle Group */
.toggle-group {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.toggle-option {
  flex: 1;
  padding: 0.45rem 0.5rem;
  text-align: center;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  border: none;
  background: none;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.toggle-option.active { background: var(--accent); color: #fff; font-weight: 600; }

/* Payment Methods (Client Card) */
.payment-method-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.6rem; }
.payment-method-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.84rem;
}
.payment-icon { font-size: 1.1rem; flex-shrink: 0; }
.payment-detail { flex: 1; min-width: 0; }
.payment-type  { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.payment-value { font-size: 0.84rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-remove-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; padding: 0.1rem 0.3rem; border-radius: 4px; flex-shrink: 0; }
.pm-remove-btn:hover { color: var(--red); }
.pm-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: none;
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.pm-add:hover { border-color: var(--accent); color: var(--accent); }
.pm-inline-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}

/* Plan Badge */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(143, 57, 133,0.15);
  color: var(--accent);
  border: 1px solid rgba(143, 57, 133,0.3);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Danger Zone */
.danger-zone {
  border: 1px solid rgba(222,79,79,0.25);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
}
.danger-label { font-size: 0.84rem; color: var(--text-primary); font-weight: 500; }
.danger-sub   { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.btn-danger-sm {
  padding: 0.4rem 0.9rem;
  background: rgba(222,79,79,0.12);
  color: var(--red);
  border: 1px solid rgba(222,79,79,0.3);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-danger-sm:hover { background: rgba(222,79,79,0.2); }

/* Settings Save Bar */
.settings-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

/* Annotation Badges */
.new-badge {
  display: inline-block;
  background: rgba(34,160,107,0.15);
  color: var(--green);
  border: 1px solid rgba(34,160,107,0.3);
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 0.2rem;
}
.moved-badge {
  display: inline-block;
  background: rgba(232,146,74,0.12);
  color: var(--orange);
  border: 1px solid rgba(232,146,74,0.25);
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 0.2rem;
}

/* Settings Callout */
.settings-callout {
  background: rgba(143, 57, 133,0.08);
  border: 1px solid rgba(143, 57, 133,0.2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.5;
}
.settings-callout strong { color: var(--accent); }

/* GST Threshold Banner */
.gst-threshold-banner {
  background: rgba(232,146,74,0.10);
  border: 1px solid rgba(232,146,74,0.3);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--orange);
  margin-bottom: 1rem;
  line-height: 1.4;
  display: none;
}
.gst-threshold-banner.visible { display: block; }

/* Settings page responsive */
@media (max-width: 700px) {
  .settings-grid { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-tab  { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
  .settings-save-bar { margin-top: 1.2rem; }
  .settings-field-row-inline { grid-template-columns: 1fr; }
  .pm-inline-form { grid-template-columns: 1fr; }
}

/* ============================================================
   Project Status System
   ============================================================ */

/* Status badge, compact inline text next to the status dot, not a pill. */
.project-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0;
  border-radius: 0;
  border: none !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  white-space: nowrap;
}
.project-status-days {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Status popover */
.status-popover {
  z-index: 1000;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg, 12px);
  padding: 0.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  min-width: 210px;
}
.status-popover-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s;
}
.status-popover-item:hover {
  background: var(--accent-dim, rgba(143, 57, 133,0.1));
}
.status-popover-item.current {
  background: var(--accent-dim, rgba(143, 57, 133,0.15));
  font-weight: 600;
}
.status-popover-note {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--glass-border);
}

/* Status filter bar, ghost chips, no container pill */
.status-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  overflow-x: auto;
}
.status-filter-bar > span:first-child { margin-right: 0.3rem; }
.status-filter-btn {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.status-filter-btn:hover { color: var(--text-main); background: transparent; }
.status-filter-btn.active {
  background: var(--accent-dim, rgba(143, 57, 133,0.12));
  color: var(--accent);
  border-color: transparent;
}

/* Status history timeline */
.status-timeline-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.78rem;
  border-left: 2px solid var(--glass-border);
  padding-left: 0.8rem;
  margin-left: 0.4rem;
  align-items: baseline;
}
.status-timeline-date {
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 80px;
  font-size: 0.72rem;
}
.status-timeline-note {
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   Advanced Reporting
   ============================================================ */

/* Stat card delta indicators */
.stat-delta {
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.25rem;
}
.stat-delta.up   { color: var(--green, #2fb37b); }
.stat-delta.down { color: var(--red, #d65b5b); }
.stat-delta.flat { color: var(--text-muted); }

/* Revenue trend chart */
#revenue-trend-chart .bar-label {
  font-size: 0.65rem;
}

/* Retainer profitability panel */
.retainer-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
}
.retainer-row:last-child { border-bottom: none; }
.retainer-rate-warn { color: var(--red, #d65b5b); font-weight: 700; }

/* Effective rate in breakdown */
.breakdown-eff-rate {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Utilization / Revenue goal circular progress */
.stat-progress-ring {
  font-size: 1.2rem;
  font-weight: 700;
}
.stat-progress-bar {
  width: 100%;
  height: 10px;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.stat-progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}
.stat-progress-pct {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.35rem;
  text-align: right;
}
.stat-sub-target {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.stat-forecast {
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 0.3rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.stat-forecast.on-track {
  background: rgba(61,214,140,0.12);
  color: var(--green, #2fb37b);
}
.stat-forecast.behind {
  background: rgba(222,79,79,0.12);
  color: var(--red, #d65b5b);
}
.stat-forecast.ahead {
  background: rgba(61,214,140,0.12);
  color: var(--green, #2fb37b);
}

/* ============================================================
   Schedule Page
   ============================================================ */

.sched-day {
  cursor: pointer;
  min-height: 70px;
  transition: background 0.15s;
}
.sched-day:hover {
  background: var(--accent-dim, rgba(143, 57, 133,0.08)) !important;
}

.sched-block {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 5px;
  margin: 2px 0;
  border-left: 3px solid;
  border-radius: 0 3px 3px 0;
  background: rgba(143, 57, 133,0.06);
  font-size: 0.65rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.15s;
  line-height: 1.4;
}
.sched-block:hover {
  background: rgba(143, 57, 133,0.14);
}

.sched-actual {
  font-size: 0.65rem;
  color: var(--green, #2fb37b);
  margin-top: 2px;
  padding: 0 2px;
}

.sched-gap {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0 2px;
}

.sched-overflow {
  font-size: 0.6rem;
  color: var(--text-muted);
  padding: 0 2px;
  font-style: italic;
}

/* Day Detail View */
.day-detail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.day-detail-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.day-detail-grid {
  position: relative;
  overflow-y: auto;
  max-height: 70vh;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md, 12px);
  background: var(--bg-elevated);
}

.dg-row {
  display: flex;
  height: 56px;
  border-bottom: 1px solid var(--glass-border);
}
.dg-row:last-of-type { border-bottom: none; }

.dg-label {
  width: 54px;
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  padding: 2px 8px 0 0;
  user-select: none;
}

.dg-slots {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.dg-slot {
  flex: 1;
  cursor: crosshair;
  border-top: 1px solid var(--glass-border);
  transition: background 0.1s;
}
.dg-slot:first-child { border-top: none; }
.dg-slot-half {
  border-top: 1px dashed rgba(128,128,128,0.15);
}
.dg-slot:hover {
  background: var(--accent-dim, rgba(143, 57, 133,0.06));
}

/* Planned block overlay */
.dg-block {
  position: absolute;
  left: 58px;
  right: 8px;
  border: 1px solid;
  border-left: 4px solid;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: grab;
  overflow: hidden;
  z-index: 2;
  transition: filter 0.15s, box-shadow 0.15s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dg-block:hover { filter: brightness(0.9); }
.dg-block.dg-block-dragging {
  cursor: grabbing;
  z-index: 4;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  filter: brightness(0.95);
}
.dg-block-title { font-weight: 700; font-size: 0.78rem; pointer-events: none; }
.dg-block-sub { font-size: 0.68rem; opacity: 0.75; margin-top: 1px; pointer-events: none; }
.dg-block-time-preview { font-variant-numeric: tabular-nums; }

/* Resize handles (top / bottom edges of the block) */
.dg-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  cursor: ns-resize;
  z-index: 3;
  touch-action: none;
}
.dg-resize-top    { top: 0; }
.dg-resize-bottom { bottom: 0; }
.dg-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 2px;
  margin: -1px 0 0 -11px;
  background: currentColor;
  opacity: 0;
  border-radius: 1px;
  transition: opacity 0.15s;
}
.dg-block:hover .dg-resize-handle::after { opacity: 0.45; }
.dg-block.dg-block-dragging .dg-resize-handle::after { opacity: 0.7; }

/* Actual entry overlay */
.dg-entry {
  position: absolute;
  left: 58px;
  right: 8px;
  border-left: 3px dashed;
  border-radius: 0 6px 6px 0;
  background: rgba(34,160,107,0.06);
  padding: 3px 8px;
  font-size: 0.68rem;
  color: var(--green, #2fb37b);
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* Read-only imported events from Google Calendar, shown as muted
   background behind planned blocks on the day detail view. */
.dg-gcal {
  position: absolute;
  left: 58px;
  right: 8px;
  background: repeating-linear-gradient(45deg,
    rgba(120,120,150,0.08), rgba(120,120,150,0.08) 6px,
    rgba(120,120,150,0.14) 6px, rgba(120,120,150,0.14) 12px);
  border-left: 3px solid rgba(120,120,150,0.5);
  border-radius: 0 5px 5px 0;
  padding: 3px 8px;
  font-size: 0.7rem;
  color: var(--text-muted, #7a7a90);
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.dg-gcal-title { font-weight: 600; font-size: 0.72rem; }
.dg-gcal-sub   { font-size: 0.66rem; opacity: 0.75; margin-top: 1px; }

/* Outlook Calendar variant, same structure, Microsoft blue tint so the
   user can tell which calendar an imported event came from at a glance. */
.dg-outlook {
  position: absolute;
  left: 58px;
  right: 8px;
  background: repeating-linear-gradient(45deg,
    rgba(0,120,212,0.08), rgba(0,120,212,0.08) 6px,
    rgba(0,120,212,0.14) 6px, rgba(0,120,212,0.14) 12px);
  border-left: 3px solid rgba(0,120,212,0.6);
  border-radius: 0 5px 5px 0;
  padding: 3px 8px;
  font-size: 0.7rem;
  color: var(--text-muted, #7a7a90);
  opacity: 0.85;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Current time line */
.dg-now-line {
  position: absolute;
  left: 50px;
  right: 0;
  height: 2px;
  background: var(--red, #d65b5b);
  z-index: 5;
  pointer-events: none;
}
.dg-now-line::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red, #d65b5b);
}

/* Drag selection highlight */
.dg-drag-selection {
  position: absolute;
  left: 58px;
  right: 8px;
  background: var(--accent-dim, rgba(143, 57, 133,0.15));
  border: 1px dashed var(--accent);
  border-radius: 6px;
  z-index: 3;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 600px) {
  .dg-label { width: 38px; font-size: 0.6rem; padding-right: 4px; }
  .dg-block { left: 42px; right: 4px; }
  .dg-entry { left: 42px; right: 4px; }
  .dg-drag-selection { left: 42px; right: 4px; }
  .dg-now-line { left: 38px; }
  .day-detail-title { font-size: 0.88rem; }
}

/*  Resizable table columns (time log, invoice history) */
.resizable-table th {
  position: relative;
}
/* Subtle vertical separators between header columns hint that columns are
   distinct and resizable. Last column omitted, no divider past table edge. */
.resizable-table thead th:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  right: 0;
  width: 1px;
  background: var(--glass-border, rgba(0,0,0,0.08));
  pointer-events: none;
}
.col-resizer {
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 2;
}
.col-resizer::after {
  content: "";
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: transparent;
  border-radius: 1px;
  transition: background 0.15s;
}
.col-resizer:hover::after,
.col-resizer.active::after {
  background: var(--accent, #8F3985);
}
body.col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}
body.col-resizing * {
  cursor: col-resize !important;
}

/* schedule: mockup-based redesign */

/*  Page Header with inline compact stats */
.sched-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.sched-page-header .page-title { margin: 0; }
.sched-header-stats {
  display: flex;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.5rem 1rem;
  gap: 1.5rem;
}
.sched-header-stat {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  padding-right: 1.5rem;
}
.sched-header-stat:last-child {
  border-right: none;
  padding-right: 0;
}
.sched-header-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sched-header-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-top: 0.2rem;
}
.sched-header-stat-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 2px;
}

/*  Full-width schedule layout */
.sched-layout {
  display: block;
}
.sched-main-card {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/*  Mini Calendar */
.sched-mini-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.sched-mini-title {
  font-weight: 600; font-size: 0.95rem;
  color: var(--text-primary);
}
.sched-mini-nav {
  display: flex; gap: 4px;
}
.sched-mini-nav button {
  padding: 2px 8px;
  min-width: 26px;
  font-size: 0.9rem;
  line-height: 1;
}
.sched-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 4px;
  font-size: 0.8rem;
}
.sched-mini-wkd {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.sched-mini-date {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  margin: 0 auto;
  color: var(--text-primary);
  transition: background 0.12s, color 0.12s;
  position: relative;
}
.sched-mini-date:hover { background: var(--bg-elevated); }
.sched-mini-date.is-active { background: var(--accent); color: #fff; }
.sched-mini-date.muted { color: var(--text-muted); opacity: 0.5; }
.sched-mini-date.has-data::after {
  content: '';
  position: absolute;
  bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent);
}
.sched-mini-date.is-active.has-data::after { background: #fff; }

/*  Filter Sections */
.sched-filter-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--glass-border);
}
.sched-filter-heading {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.sched-filter-list {
  display: flex; flex-direction: column; gap: 0.55rem;
}
.sched-filter-item {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.sched-filter-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  cursor: pointer;
  margin: 0;
}
.sched-filter-item:hover { color: var(--text-primary); }
.sched-filter-item-client { padding-left: 1.45rem; }

.sched-cal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/*  Calendar Controls Bar */
.sched-cal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}
.sched-cal-controls-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.sched-nav-group {
  display: flex; gap: 4px;
}
.sched-nav-group button { min-width: 28px; padding: 0.3rem 0.55rem; }
.sched-range-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 0.3rem;
}

/*  Legacy view tabs (reused by Reports calendar) */
.sched-view-tabs {
  display: flex;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.sched-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-right: 1px solid var(--glass-border);
}
.sched-tab-btn:last-child { border-right: none; }
.sched-tab-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.sched-tab-btn.active {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
}

/*  Schedule dropdowns (Calendars / Clients / View) */
.sched-cal-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sched-weekends-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  padding: 0 0.2rem;
}
.sched-weekends-cb {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sched-weekends-track {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.sched-weekends-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.2s;
}
.sched-weekends-cb:checked + .sched-weekends-track {
  background: var(--accent-dim, rgba(143, 57, 133, 0.18));
  border-color: rgba(143, 57, 133, 0.35);
}
.sched-weekends-cb:checked + .sched-weekends-track .sched-weekends-knob {
  transform: translateX(16px);
}
.sched-weekends-cb:focus-visible + .sched-weekends-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sched-weekends-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.sched-weekends-cb:checked ~ .sched-weekends-label { color: var(--text); }
.sched-dd {
  position: relative;
}
.sched-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.sched-dd-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
}
.sched-dd-btn.sched-dd-btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.sched-dd-btn.sched-dd-btn-primary:hover {
  filter: brightness(1.05);
}
.sched-dd-caret {
  opacity: 0.7;
  transition: transform 0.15s;
}
.sched-dd.open .sched-dd-caret {
  transform: rotate(180deg);
}
.sched-dd-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: 280px;
  max-height: 380px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 0.5rem;
  z-index: 50;
  display: none;
}
.sched-dd.open .sched-dd-panel { display: block; }
.sched-dd-panel-view { min-width: 180px; }

.sched-dd-section {
  padding: 0.3rem 0.2rem 0.15rem;
}
.sched-dd-section + .sched-dd-section { margin-top: 0.4rem; }
.sched-dd-heading {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem 0.35rem;
}
.sched-dd-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.1s;
}
.sched-dd-item:hover { background: var(--bg-elevated); }
.sched-dd-item.active {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
}
.sched-dd-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.4rem 0;
}
.sched-dd-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
}
.sched-dd-toggle:hover { background: var(--bg-elevated); }
.sched-dd-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  cursor: pointer;
  margin: 0;
}
.sched-dd-check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-primary);
  user-select: none;
}
.sched-dd-check-row:hover { background: var(--bg-elevated); }
.sched-dd-check-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
.sched-dd-check-row .sched-cal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sched-dd-check-row .sched-dd-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*  Week/Day Grid */
.sched-grid {
  display: grid;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}
.sched-grid.view-week { grid-template-columns: 50px repeat(var(--sched-days, 7), 1fr); }
.sched-grid.view-day  { grid-template-columns: 50px 1fr; }

.sched-grid-h-cell {
  padding: 0.7rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.sched-grid-h-cell:last-child { border-right: none; }
.sched-grid-h-cell.time-col { background: var(--bg-surface); }

.sched-gh-day {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sched-gh-date {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.12s;
}
.sched-gh-date:hover { background: var(--bg-elevated); }
.sched-gh-date.is-today {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(143, 57, 133,0.3);
}

.sched-grid-body {
  position: relative;
}
.view-week .sched-grid-body { grid-column: 2 / -1; grid-row: 2; }
.view-day  .sched-grid-body { grid-column: 2; grid-row: 2; }

.sched-grid-body-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--glass-border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--glass-border) 1px, transparent 1px);
  pointer-events: none;
}
.view-week .sched-grid-body-bg {
  background-size: calc(100% / var(--sched-days, 7)) 60px;
  background-position: -1px -1px;
}
.view-day .sched-grid-body-bg {
  background-size: 100% 60px;
  background-position: -1px -1px;
}

.sched-time-sidebar {
  grid-column: 1; grid-row: 2;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--glass-border);
  background: var(--bg-surface);
}
.sched-time-label {
  height: 60px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding-top: 0.4rem;
}

/* Day-column containers, one per day, absolute events live inside */
.sched-day-col {
  position: relative;
  border-right: 1px solid transparent;
  cursor: crosshair;
}
.view-week .sched-day-col { border-right-color: var(--glass-border); }
.view-week .sched-day-col:last-child { border-right: none; }
.sched-day-col-today {
  background: linear-gradient(180deg, rgba(143, 57, 133,0.05) 0%, rgba(143, 57, 133,0) 100%);
}

/* Events, positioned absolutely; `left`/`width` set inline by the overlap layout engine */
.sched-event {
  position: absolute;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.1s, box-shadow 0.1s;
  border-left: 3px solid transparent;
  z-index: 2;
}
.sched-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 10;
}
.sched-event-planned { cursor: grab; }
.sched-event-planned:active { cursor: grabbing; }
.sched-event-dragging {
  opacity: 0.85;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 20 !important;
  transform: none;
  cursor: grabbing !important;
}

/* Top/bottom resize handles on calendar-view planned blocks */
.sched-event-planned .sched-resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  cursor: ns-resize;
  z-index: 3;
  touch-action: none;
}
.sched-event-planned .sched-resize-top    { top: 0; }
.sched-event-planned .sched-resize-bottom { bottom: 0; }
.sched-event-planned .sched-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 2px;
  margin: -1px 0 0 -10px;
  background: currentColor;
  opacity: 0;
  border-radius: 1px;
  transition: opacity 0.15s;
  pointer-events: none;
}
.sched-event-planned:hover .sched-resize-handle::after { opacity: 0.4; }
.sched-event-planned.sched-event-dragging .sched-resize-handle::after { opacity: 0.65; }
/* On very short blocks, fall back to plain move/click — there's not enough
   vertical room for the resize handles to live beside the label without
   eating the whole click target. */
.sched-event-planned.sched-event-compact .sched-resize-handle { pointer-events: none; }
.sched-event-planned.sched-event-compact .sched-resize-handle::after { display: none; }
.sched-event-title {
  font-weight: 600;
  overflow: hidden;
  /* Let long titles wrap to a second line when the event is tall enough;
     fall back to ellipsis via line-clamp. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  line-height: 1.2;
}
.sched-event-time {
  font-size: 0.68rem;
  opacity: 0.8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Compact (single-line) layout for short blocks (~30 min and under) so the
   title and time fit on one row instead of getting clipped. */
.sched-event.sched-event-compact {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  padding: 2px 6px 2px 8px;
}
.sched-event-compact .sched-event-title {
  display: block;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.sched-event-compact .sched-event-time {
  margin-top: 0;
  flex: 0 0 auto;
}
.sched-event-planned {
  background: rgba(143, 57, 133,0.15);
  border-left-color: var(--accent);
  color: var(--accent-light, var(--accent));
}
.sched-event-logged {
  background: rgba(61,214,140,0.15);
  border-left-color: var(--green, #3dd68c);
  color: var(--green, #3dd68c);
}
.sched-event-gcal {
  background: repeating-linear-gradient(45deg,
    rgba(120,120,150,0.08), rgba(120,120,150,0.08) 6px,
    rgba(120,120,150,0.14) 6px, rgba(120,120,150,0.14) 12px);
  border-left-color: rgba(120,120,150,0.7);
  color: var(--text-secondary);
}
.sched-event-outlook {
  /* Microsoft blue tint so users can tell Outlook events apart from Google ones */
  background: repeating-linear-gradient(45deg,
    rgba(0,120,212,0.08), rgba(0,120,212,0.08) 6px,
    rgba(0,120,212,0.14) 6px, rgba(0,120,212,0.14) 12px);
  border-left-color: rgba(0,120,212,0.7);
  color: var(--text-secondary);
}

/* External calendar event details modal (gcal / outlook) */
.ext-ev-header { margin-bottom: 0.8rem; }
.ext-ev-source {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}
.ext-ev-source-gcal    { color: #1a73e8; border-color: rgba(26,115,232,0.35); background: rgba(26,115,232,0.08); }
.ext-ev-source-outlook { color: #0078d4; border-color: rgba(0,120,212,0.35);  background: rgba(0,120,212,0.08); }
.ext-ev-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border-soft);
  font-size: 0.9rem;
  align-items: start;
}
.ext-ev-row:first-child { border-top: none; }
.ext-ev-row-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding-top: 0.1rem;
}
.ext-ev-row-val { word-break: break-word; }
.ext-ev-att-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ext-ev-att-list li {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ext-ev-att-status {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.ext-ev-att-accepted    { color: var(--green, #3dd68c); border-color: rgba(61,214,140,0.35); background: rgba(61,214,140,0.08); }
.ext-ev-att-declined    { color: var(--red, #de4f4f);  border-color: rgba(222,79,79,0.35);  background: rgba(222,79,79,0.08); }
.ext-ev-att-tentative,
.ext-ev-att-tentativelyAccepted { color: var(--accent-2, #07beb8); border-color: rgba(7,190,184,0.35); background: rgba(7,190,184,0.08); }
.ext-ev-att-more { color: var(--text-muted); font-style: italic; }
.ext-ev-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: normal;
  color: var(--text-primary);
  max-height: 320px;
  overflow-y: auto;
}

/* Current time indicator */
.sched-now-line {
  position: absolute;
  left: 0; right: 0;
  pointer-events: none;
  z-index: 4;
  display: flex;
  align-items: center;
}
.sched-now-line::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: -4px;
  flex-shrink: 0;
}
.sched-now-line::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--accent);
  opacity: 0.55;
}

/* Drag-to-create preview */
.sched-drag-preview {
  position: absolute;
  left: 3px; right: 3px;
  background: rgba(143, 57, 133,0.15);
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  pointer-events: none;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}

/*  Month Grid */
.sched-month {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}
.sched-month-head {
  display: grid;
  grid-template-columns: repeat(var(--sched-month-cols, 7), 1fr);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--glass-border);
}
.sched-month-wkd {
  padding: 0.7rem 0.5rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  border-right: 1px solid var(--glass-border);
  letter-spacing: 0.05em;
}
.sched-month-wkd:last-child { border-right: none; }

.sched-month-grid {
  display: grid;
  grid-template-columns: repeat(var(--sched-month-cols, 7), 1fr);
}
.sched-month-cell {
  min-height: 110px;
  padding: 6px 6px 8px;
  border-bottom: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.12s;
  overflow: hidden;
}
.sched-month-grid:not(.no-weekends) .sched-month-cell:nth-child(7n) { border-right: none; }
.sched-month-grid.no-weekends .sched-month-cell:nth-child(5n) { border-right: none; }
.sched-month-cell:hover { background: rgba(143, 57, 133,0.04); }
.sched-month-cell.muted {
  background: var(--bg-base);
  opacity: 0.5;
}
.sched-month-datenum {
  align-self: flex-end;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.sched-month-datenum.is-today {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(143, 57, 133,0.35);
}
.sched-month-event {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  background: rgba(143, 57, 133,0.12);
  color: var(--accent);
  border-left: 2px solid var(--accent);
}
.sched-month-event.ev-logged {
  background: rgba(61,214,140,0.12);
  color: var(--green, #3dd68c);
  border-left-color: var(--green, #3dd68c);
}
.sched-month-event:hover { filter: brightness(1.1); }
.sched-month-more {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding-left: 4px;
  font-weight: 600;
}

/* Invoice range-selection overlays on schedule-style month cells */
.sched-month-cell.inv-month-in-range {
  background: rgba(143, 57, 133, 0.10);
}
.sched-month-cell.inv-month-start,
.sched-month-cell.inv-month-end {
  background: rgba(143, 57, 133, 0.18);
}
.sched-month-cell.inv-month-start .sched-month-datenum,
.sched-month-cell.inv-month-end   .sched-month-datenum {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(143, 57, 133, 0.35);
}

/* Reports calendar, reuse schedule month-cell styling, add accent stripe for days with hours */
.sched-month-cell.cal-has-data {
  cursor: pointer;
  border-left: 2px solid var(--accent);
}
.sched-month-cell.cal-has-data:hover {
  background: var(--accent-dim);
}
/* Weekly summary row fits inside the 7-column sched-month-grid */
.sched-month-grid .cal-week-row-summary {
  grid-column: 1 / 8;
  justify-content: space-between;
}

/*  Agenda */
.sched-agenda {
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.sched-agenda-group {
  border-bottom: 1px solid var(--glass-border);
}
.sched-agenda-group:last-child { border-bottom: none; }
.sched-agenda-day-head {
  background: var(--bg-elevated);
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}
.sched-agenda-row {
  display: flex;
  gap: 1.25rem;
  padding: 0.85rem 1rem;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.15s;
}
.sched-agenda-row:last-child { border-bottom: none; }
.sched-agenda-row:hover { background: var(--bg-elevated); }
.sched-agenda-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 160px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.sched-agenda-title {
  font-weight: 600;
  font-size: 0.92rem;
  flex: 1;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sched-agenda-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.sched-agenda-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.88rem;
}
