/* ===========================
   C2IT Dashboard — Global Styles
   =========================== */

/* Inter, served from /fonts (SIL Open Font License, see fonts/Inter-LICENSE.txt). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Fraunces, the serif for page titles and big numbers (SIL Open Font License,
   see fonts/Fraunces-LICENSE.txt). */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/fraunces-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/fraunces-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Brand colors (rate card + pine). When the branding package arrives,
     these are the values to swap. */
  --navy: #324e66;
  --navy-dark: #263d51;
  --pine: #285e4d;
  --pine-dark: #1f4a3c;
  --coral: #f56b49;
  --yellow: #f5c149;
  --white: #ffffff;

  /* Roles: what buttons, links, and highlights use */
  --primary: var(--pine);
  --primary-dark: var(--pine-dark);
  --primary-rgb: 40, 94, 77;
  --primary-tint: #e7f0ec;
  --sidebar-bg: var(--navy);
  --sidebar-width: 232px;

  /* Neutrals */
  --page-bg: #e9eef3;
  --gray-50: #f4f7fa;
  --gray-100: #eceff3;
  --gray-200: #dce3ea;
  --gray-400: #616d7a;
  --gray-600: #4f5b68;
  --gray-800: #1f2a33;
  --text: #14181c;
  --line: #e3e9ef;
  --table-head: #eef3f8;
  --soft-fill: rgba(50, 78, 102, 0.08);

  /* Same colors as channels, for see-through tints: rgba(var(--yellow-rgb), 0.15) */
  --yellow-rgb: 245, 193, 73;
  --coral-rgb: 245, 107, 73;

  /* Status colors: background tint, ink (text on the tint), and solid */
  --info-bg: #e3ecf5;
  --info-tint: #f1f5f9;
  --info-ink: var(--navy);
  --success: #3a8f68;
  --success-bg: #e2efe9;
  --success-ink: var(--pine);
  --success-tint: #f2f8f5;
  --warning-bg: #fdf1d8;
  --warning-ink: #7a5a12;
  --warning-tint: #fef9ec;
  --danger: #b8432a;
  --danger-bg: #fdeae4;
  --danger-ink: #b33f22;
  --danger-hover: #fbd5c9;

  /* Shape. Cards float on the canvas with a soft shadow (and a faint edge
     built into it, so no border rules needed). */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 0 0 1px rgba(16, 24, 40, 0.04), 0 1px 2px rgba(16, 24, 40, 0.05), 0 6px 18px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 0 0 1px rgba(16, 24, 40, 0.04), 0 2px 4px rgba(16, 24, 40, 0.06), 0 14px 32px rgba(16, 24, 40, 0.12);

  /* Brand stripe from the rate card: navy, coral, gold */
  --brand-stripe: linear-gradient(to right, var(--navy) 0 62%, var(--coral) 62% 84%, var(--yellow) 84% 100%);

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, strong, b, th { font-weight: 600; }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   Side menu (a bar across the top on phones)
   =========================== */
.app-body { padding-left: var(--sidebar-width); }

.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 22px 14px 18px;
  background: var(--sidebar-bg);
  color: var(--white);
  overflow-y: auto;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: var(--white);
  text-decoration: none;
}
.app-brand:hover { text-decoration: none; }

.app-brand-text { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.2px; white-space: nowrap; }
.app-brand-text span { font-weight: 400; opacity: 0.7; }

.logo-dot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--coral);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.app-nav-links { display: flex; flex-direction: column; gap: 2px; }

.app-nav-links a,
.navbar-calendar,
.navbar-logout {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.app-nav-links a:hover,
.navbar-calendar:hover,
.navbar-logout:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-decoration: none;
}

.app-nav-links a.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-weight: 600;
}

.ico { flex-shrink: 0; }
.app-nav .ico { opacity: 0.9; }

.app-nav-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.app-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  min-width: 0;
  border-radius: 9px;
  text-decoration: none;
}
.app-nav-user:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }

.nav-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.navbar-user {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Phones and small tablets: the menu becomes a bar across the top. */
@media (max-width: 900px) {
  .app-body { padding-left: 0; }
  .app-nav {
    position: sticky;
    width: auto;
    bottom: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 16px;
    overflow: visible;
  }
  .app-brand { padding: 0; }
  .app-nav-links,
  .app-nav-foot {
    flex-direction: row;
    align-items: center;
    gap: 4px;
  }
  .app-nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    margin: 0 -6px;
    scrollbar-width: none;
  }
  .app-nav-links::-webkit-scrollbar { display: none; }
  .app-nav-foot { margin: 0 0 0 auto; padding: 0; border: none; }
  .app-nav-links a,
  .navbar-calendar,
  .navbar-logout { width: auto; padding: 6px 10px; font-size: 0.85rem; gap: 7px; }
  .app-nav-user { padding: 4px; border-radius: 50%; }
  .navbar-user,
  .navbar-calendar span,
  .navbar-logout span { display: none; }
  .app-body .flash { top: 104px; }
  html { scroll-padding-top: 104px; }
}

/* ===========================
   Layout
   =========================== */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.25rem 2rem 4rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===========================
   Sidebar (Admin)
   =========================== */
.sidebar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  height: fit-content;
  position: sticky;
  top: 76px;
}

.sidebar h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-400);
  margin-bottom: 0.75rem;
}

.client-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.client-list li a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  transition: background 0.15s;
}

.client-list li a:hover {
  background: var(--gray-100);
  text-decoration: none;
}

.client-list li a.active {
  background: var(--info-bg);
  color: var(--primary);
}

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-blue { background: var(--info-bg); color: var(--info-ink); }
.icon-yellow { background: var(--warning-bg); color: var(--warning-ink); }
.icon-coral { background: var(--danger-bg); color: var(--danger-ink); }
.icon-green { background: var(--success-bg); color: var(--success-ink); }

/* ===========================
   Section Header
   =========================== */
.section-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.section-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
}

.section-header p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 2px;
}

/* ===========================
   Goal Cards
   =========================== */
.goal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--primary);
}

.goal-card.goal-complete {
  border-left-color: var(--success);
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.goal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.goal-description {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.875rem;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.progress-bar-wrap {
  flex: 1;
  background: var(--gray-200);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.progress-bar-fill.complete {
  background: var(--success);
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* ===========================
   Task Checklist
   =========================== */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.6rem 0.75rem;
  border-radius: 7px;
  background: var(--gray-50);
  transition: background 0.1s;
}

.task-item:hover {
  background: var(--gray-100);
}

/* Finished tasks read as done through the checkmark, strikethrough, and
   Done badge, so the text stays readable. */
.task-item.complete .task-meta span { color: var(--gray-400); }

.task-checkbox-form {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  margin-top: 1px;
}

.task-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
  line-height: 1.4;
}

.task-item.complete .task-title {
  text-decoration: line-through;
  color: var(--gray-400);
}

.task-meta {
  display: flex;
  gap: 12px;
  margin-top: 2px;
  flex-wrap: wrap;
}

.task-meta span {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.task-meta .due-date {
  color: var(--gray-600);
  font-weight: 500;
}

.task-meta .due-date.overdue {
  color: var(--danger-ink);
  font-weight: 600;
}

.badge-complete {
  display: inline-block;
  background: var(--success-bg);
  color: var(--success-ink);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  margin-left: 6px;
}

/* ===========================
   Notes
   =========================== */
.note-item {
  padding: 1rem;
  border-radius: 8px;
  background: var(--gray-50);
  border-left: 3px solid var(--yellow);
  margin-bottom: 0.75rem;
}

.note-item:last-child {
  margin-bottom: 0;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.note-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.note-date {
  font-size: 0.78rem;
  color: var(--gray-400);
}

.note-content {
  font-size: 0.875rem;
  color: var(--gray-800);
  line-height: 1.6;
}

/* ===========================
   Resources
   =========================== */
.resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.875rem;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  transition: border-color 0.15s, background 0.15s;
}

.resource-item:hover {
  background: var(--info-tint);
  border-color: var(--primary);
}

/* Long links wrap so the remove button stays on screen on phones. */
.resource-item { overflow-wrap: anywhere; }
.resource-item div { min-width: 0; }
.resource-item form { flex-shrink: 0; }

.resource-icon {
  width: 30px;
  height: 30px;
  background: var(--info-bg);
  color: var(--info-ink);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.resource-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
}

/* ===========================
   Scheduling (Cal.com) frame
   =========================== */
.scheduling-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

/* ===========================
   Forms (Admin)
   =========================== */
.form-section {
  margin-top: 1.25rem;
}

.form-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.form-group {
  margin-bottom: 0.75rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.28);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.32); }

.btn-yellow {
  background: var(--yellow);
  color: var(--gray-800);
}
.btn-yellow:hover { background: #e6b03a; }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-sm {
  padding: 0.32rem 0.8rem;
  font-size: 0.78rem;
}

.btn-ghost {
  background: var(--white);
  color: var(--gray-800);
  border: 1px solid var(--gray-200);
}
.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-400); }

/* ===========================
   Admin Task / Goal Row Actions
   =========================== */
.admin-goal-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  overflow: hidden;
}

.admin-goal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  gap: 1rem;
}

.admin-goal-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
}

.admin-goal-desc {
  font-size: 0.82rem;
  color: var(--gray-600);
  margin-top: 2px;
}

.admin-goal-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.admin-task-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  gap: 10px;
}

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

.admin-task-row:hover {
  background: var(--gray-50);
}

.admin-task-info {
  flex: 1;
  min-width: 0;
}

.admin-task-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-800);
}

.admin-task-meta {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 1px;
}

.status-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.complete {
  background: var(--success-bg);
  color: var(--success-ink);
}

.status-badge.incomplete {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ===========================
   Stats Row
   =========================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 2px;
  font-weight: 500;
}
.stat-note { font-size: 0.72rem; color: var(--gray-600); margin-top: 4px; }
.form-group-end { display: flex; align-items: flex-end; }
.stat-note a { color: inherit; text-decoration: underline; }

/* ===========================
   Tabs (Admin)
   =========================== */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
  gap: 2px;
  margin-bottom: 1.25rem;
  background: var(--gray-100);
  border-radius: 20px;
  padding: 4px;
}

.tab-btn {
  flex: 0 0 auto;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text);
  text-decoration: none;
}

.tab-btn.active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 24, 28, 0.1);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ===========================
   Modal (inline collapsible form)
   =========================== */
.collapsible-form {
  display: none;
  background: var(--gray-50);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.75rem;
}

.collapsible-form.open {
  display: block;
}

/* ===========================
   Empty States
   =========================== */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--gray-400);
  font-size: 0.875rem;
}


/* ===========================
   Utility
   =========================== */
.text-blue { color: var(--primary); }
.text-coral { color: var(--danger-ink); }
.text-yellow { color: var(--yellow); }
.text-muted { color: var(--gray-400); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 0.5rem; }

.divider {
  height: 1px;
  background: var(--gray-100);
  margin: 1rem 0;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===========================
   Admin — Full-width page wrapper
   =========================== */
.admin-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.25rem 2.5rem 4rem;
}

/* ===========================
   Status Summary Row
   =========================== */
.status-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.status-box {
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.status-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.status-box.status-active {
  border-color: currentColor;
  box-shadow: var(--shadow-md);
}

.status-green  { color: var(--success-ink); background: var(--success-tint); }
.status-yellow { color: var(--warning-ink); background: var(--warning-tint); }
.status-coral  { color: var(--danger); background: #fff6f3; }

.status-count {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.status-label {
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-sub {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 2px;
}

.status-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ===========================
   Client Cards Grid
   =========================== */
.client-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.client-card {
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display: block;
  color: var(--text);
  text-decoration: none;
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.client-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15), var(--shadow-md);
}

.client-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.client-avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1.1rem;
}

.client-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.client-card-email {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.client-card-progress {
  margin-bottom: 0.75rem;
}

.client-card-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
  margin-bottom: 5px;
}

.client-card-pct {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

.client-card-session {
  font-size: 0.78rem;
  color: var(--gray-600);
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

/* ===========================
   Detail Panel
   =========================== */
.detail-panel {
  background: var(--gray-50);
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 1.75rem;
  scroll-margin-top: 24px;
}

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

.detail-name {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.detail-meta {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-top: 3px;
}

/* ===========================
   Add Forms Grid (2-col)
   =========================== */
.add-forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
}

/* ===========================
   Add Client Tile
   =========================== */
.add-client-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--gray-200);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  min-height: 240px;
  padding: 1.5rem;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.add-client-tile:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
  transform: translateY(-3px);
  box-shadow: none;
}

.add-client-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--primary);

  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  transition: background 0.2s, color 0.2s;
}

.add-client-tile:hover .add-client-icon {
  background: var(--primary);
  color: var(--white);
}

.add-client-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.add-client-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
  padding: 0 1rem;
  line-height: 1.5;
}

/* ===========================
   Modal
   =========================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 50, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 1.75rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--gray-100);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

.modal-body {
  display: flex;
  flex-direction: column;
}

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

/* ===========================
   Responsive — Admin
   =========================== */
@media (max-width: 600px) {
  .page-wrapper {
    padding: 1.25rem 1rem 3rem;
  }
  .crm-title,
  .detail-name {
    font-size: 1.35rem;
  }
  .status-summary {
    grid-template-columns: 1fr;
  }
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-page-wrapper {
    padding: 1rem 1rem 3rem;
  }
}

/* ===========================
   + Add Client Tile
   =========================== */
.add-client-tile {
  background: transparent;
  border: 2px dashed var(--gray-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 220px;
  color: var(--gray-600);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.add-client-tile:hover {
  border-color: var(--primary);
  background: var(--info-tint);
  color: var(--primary);
  transform: translateY(-3px);
}

.add-client-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);

  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.875rem;
  transition: background 0.15s, color 0.15s;
}

.add-client-tile:hover .add-client-icon {
  background: var(--primary);
  color: var(--white);
}

.add-client-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.add-client-sub {
  font-size: 0.78rem;
  color: var(--gray-400);
}

/* ===========================
   Modal
   =========================== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 32, 44, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modal-slide-up 0.18s ease-out;
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

/* ===========================
   Login Page
   =========================== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 2rem 1rem;
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(10, 20, 30, 0.28);
  padding: 2.25rem 2rem 2rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.75rem;
}

.login-brand-text {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--gray-800);
  letter-spacing: -0.2px;
}

.login-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.login-sub {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 3px solid var(--coral);
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-submit {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  justify-content: center;
}

.login-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

/* ===========================
   Wins & Milestones
   =========================== */
.wins-section {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.25rem;
  margin-bottom: 1.5rem;
}

.wins-timeline {
  position: relative;
  padding-left: 0;
  margin-bottom: 1rem;
}

.wins-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 22px;
  bottom: 22px;
  width: 2px;
  background: rgba(var(--yellow-rgb), 0.4);
  border-radius: 2px;
  z-index: 0;
}

.win-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 14px;
  align-items: start;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.win-item:last-child {
  margin-bottom: 0.5rem;
}

.win-marker {
  width: 12px;
  height: 12px;
  margin: 18px 2px 0;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px var(--white);
}

.win-content {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 0.85rem 1.05rem;
}

.win-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 4px;
  line-height: 1.35;
}

.win-desc {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.55;
  margin-bottom: 8px;
}

.win-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
}

.win-meta .win-date {
  color: var(--warning-ink);
  font-weight: 600;
  letter-spacing: 0.15px;
}

/* Add Win form */
.win-add-wrap {
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(var(--yellow-rgb), 0.4);
  margin-top: 0.75rem;
}

.win-add-form {
  background: var(--white);
  border-radius: 10px;
  padding: 1.1rem;
  border: 1px solid var(--gray-200);
  margin-top: 0.5rem;
}

/* ===========================
   Book Overview (footer status)
   =========================== */
.book-overview {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

.book-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.book-overview-header h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-400);
}

.book-overview-toggle {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.book-overview-toggle:hover {
  background: var(--gray-50);
  border-color: var(--primary);
  color: var(--primary);
}

.book-overview-body {
  margin-top: 0.5rem;
}

/* ===========================
   Package badges + credit
   =========================== */
.client-card-package {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: -0.4rem 0 0.9rem;
}

.package-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: var(--gray-100);
  color: var(--gray-800);
}

.package-badge.founder {
  background: rgba(var(--yellow-rgb), 0.22);
  color: var(--warning-ink);
}

.package-badge.edtech {
  background: rgba(var(--coral-rgb), 0.15);
  color: var(--danger-ink);
}

.package-timeline {
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
}

.credit-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--info-bg);
  color: var(--info-ink);
}

.credit-warning {
  background: #fff5f2;
  border: 1px solid rgba(var(--coral-rgb), 0.3);
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

/* Tall modals (e.g. Add Client) scroll instead of overflowing the screen */
.modal {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

/* ===========================
   Task views: Checklist / Calendar / Gantt
   =========================== */
.task-views-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.view-switcher {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--gray-100);
  border-radius: 999px;
}

.view-switcher button {
  border: none;
  background: transparent;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
}

.view-switcher button.active {
  background: var(--white);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 24, 28, 0.1);
}

.task-view-note {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.6rem;
}

.task-view-empty {
  padding: 2rem;
  text-align: center;
  color: var(--gray-400);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.goal-dates {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-600);
  margin: -0.4rem 0 0.75rem;
}

/* Calendar */
.cal-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.cal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.cal-title {
  margin-right: auto;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--gray-100);
  border-left: 1px solid var(--gray-100);
}

.cal-dow,
.cal-cell {
  border-right: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.cal-dow {
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
}

.cal-cell {
  min-height: 92px;
  min-width: 0;
  padding: 4px 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-cell.outside { background: var(--gray-50); }
.cal-cell.outside .cal-date { color: var(--gray-400); }

.cal-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
}

.cal-cell.today .cal-date {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
}

.cal-chip {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--info-bg);
  color: var(--info-ink);
}

.cal-chip.overdue { background: var(--danger-bg); color: var(--danger-ink); }
.cal-chip.done { background: var(--success-bg); color: var(--success-ink); text-decoration: line-through; }
.cal-chip.cal-goal { background: rgba(var(--yellow-rgb), 0.25); color: var(--warning-ink); font-weight: 600; }
.cal-chip.extra { display: none; }
.cal-cell.expanded .cal-chip.extra { display: block; }

.cal-more {
  padding: 0 2px;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.7rem;
  color: var(--primary);
  text-align: left;
  cursor: pointer;
}

/* Gantt */
.gantt {
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.gantt-labels {
  flex: 0 0 240px;
  min-width: 0;
  border-right: 1px solid var(--gray-200);
}

.gantt-axis-spacer,
.gantt-axis {
  height: 36px;
  border-bottom: 1px solid var(--gray-100);
}

.gantt-label,
.gantt-row {
  height: 30px;
  border-bottom: 1px solid var(--gray-50);
}

.gantt-label {
  padding: 0 12px;
  line-height: 30px;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gantt-label.goal,
.gantt-row.goal { background: var(--gray-50); }
.gantt-label.goal { font-weight: 600; color: var(--gray-800); }
.gantt-label.task { padding-left: 24px; color: var(--gray-600); }
.gantt-label.task.done { text-decoration: line-through; color: var(--gray-400); }
.gantt-label-note { font-size: 0.72rem; font-weight: 500; color: var(--gray-400); }

.gantt-scroll { flex: 1; min-width: 0; overflow-x: auto; }
.gantt-chart { position: relative; }
.gantt-axis { position: relative; }
.gantt-row { position: relative; }

.gantt-month {
  position: absolute;
  top: 10px;
  padding-left: 4px;
  border-left: 1px solid var(--gray-200);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}

.gantt-tick {
  position: absolute;
  top: 36px;
  bottom: 0;
  width: 1px;
  background: var(--gray-100);
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--coral);
  opacity: 0.75;
  z-index: 2;
}

.gantt-bar {
  position: absolute;
  top: 8px;
  height: 14px;
  border-radius: 7px;
  background: rgba(var(--primary-rgb), 0.25);
  overflow: hidden;
}

.gantt-bar.derived {
  background: repeating-linear-gradient(45deg,
    rgba(var(--primary-rgb), 0.14) 0 6px,
    rgba(var(--primary-rgb), 0.26) 6px 12px);
}

.gantt-bar-fill { height: 100%; background: var(--primary); }

.gantt-marker {
  position: absolute;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--primary);
}

.gantt-marker.overdue { background: var(--coral); }
.gantt-marker.done { background: var(--success); }

.gantt-undated {
  position: absolute;
  top: 7px;
  left: 8px;
  font-size: 0.72rem;
  color: var(--gray-400);
}

.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 0.6rem;
  font-size: 0.75rem;
  color: var(--gray-600);
}

.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { display: inline-block; }
.legend-bar { width: 22px; height: 10px; border-radius: 5px; background: var(--primary); }
.legend-bar.derived {
  background: repeating-linear-gradient(45deg,
    rgba(var(--primary-rgb), 0.2) 0 4px,
    rgba(var(--primary-rgb), 0.45) 4px 8px);
}
.legend-diamond { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: var(--primary); }
.legend-diamond.overdue { background: var(--coral); }
.legend-diamond.done { background: var(--success); }
.legend-today { width: 2px; height: 14px; background: var(--coral); }

@media (max-width: 600px) {
  .gantt-labels { flex-basis: 140px; }
  .cal-cell { min-height: 64px; }
  .cal-chip { font-size: 0.62rem; }
}

/* ===========================
   Calendar feed
   =========================== */
.calendar-intro { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 1rem; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.25rem; }
.calendar-actions a { text-decoration: none; }
.calendar-copy { display: flex; gap: 8px; }
.calendar-copy .form-control { font-size: 0.78rem; color: var(--gray-600); }
.calendar-fine { font-size: 0.75rem; color: var(--gray-400); margin: 0.25rem 0 1rem; }
.calendar-reset-note {
  background: var(--success-bg);
  color: var(--success-ink);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ===========================
   Teams
   =========================== */
.team-intro { font-size: 0.85rem; color: var(--gray-600); margin: -0.5rem 0 0.75rem; }

.team-member { padding: 0.9rem 0; border-top: 1px solid var(--gray-100); }
.team-member-row { display: flex; gap: 12px; align-items: flex-start; }
.team-member-info { flex: 1; min-width: 0; }

.team-member-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--gray-800);
}

.team-level,
.team-you {
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}
.team-level { background: var(--info-bg); color: var(--info-ink); }
.team-you { background: var(--gray-100); color: var(--gray-600); }

.team-member-meta { font-size: 0.8rem; color: var(--gray-400); margin-top: 2px; }
.team-status-invited { color: var(--primary); font-weight: 500; }
.team-status-expired { color: var(--danger-ink); font-weight: 500; }

.team-perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.perm-chip {
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--gray-100);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--gray-600);
}

.team-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.team-member-actions form { display: inline; }
.team-member .collapsible-form { margin-top: 0.75rem; }

.perm-toggles { display: grid; gap: 10px; margin: 0.25rem 0 1rem; }
.perm-toggle { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; cursor: pointer; }
.perm-toggle input { margin-top: 3px; accent-color: var(--primary); }
.perm-toggle small { display: block; font-size: 0.75rem; color: var(--gray-400); }

.team-invite-hint { margin-left: 10px; font-size: 0.75rem; color: var(--gray-400); }

.invite-note {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--info-tint);
  font-size: 0.8rem;
  color: var(--gray-600);
}

.view-only-note {
  margin-bottom: 1.25rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  background: var(--gray-100);
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* One-time notices, pinned so they're visible wherever the page scrolls */
.flash {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  width: min(560px, calc(100% - 2rem));
  padding: 0.9rem 2.5rem 0.9rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  background: var(--white);
  border-left: 4px solid var(--primary);
  font-size: 0.875rem;
}
.app-body .flash { left: calc(50% + var(--sidebar-width) / 2); }
@media (max-width: 900px) { .app-body .flash { left: 50%; } }
.flash-success { border-left-color: var(--success); }
.flash-error { border-left-color: var(--coral); }
.flash-message { margin-bottom: 0; }
.flash .calendar-copy { margin-top: 0.6rem; }
.flash-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 0.9rem;
  color: var(--gray-400);
  cursor: pointer;
}

@media (max-width: 600px) {
  .team-member-row { flex-wrap: wrap; }
  .team-member-actions { justify-content: flex-start; width: 100%; }
}

/* ===========================
   Packages
   =========================== */
.tab-btn { white-space: nowrap; }

.pkg-row { padding: 1rem 0; border-top: 1px solid var(--gray-100); }
.pkg-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.pkg-money { font-size: 0.85rem; color: var(--gray-600); }
.pkg-money strong { color: var(--gray-800); }

.pkg-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--gray-400);
}
.pkg-dates strong { color: var(--gray-800); font-weight: 500; }

.pkg-credit {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}
.pkg-credit.available { background: var(--info-bg); color: var(--info-ink); }
.pkg-credit.pending { background: var(--gray-100); color: var(--gray-600); }
.pkg-credit.used { background: var(--success-bg); color: var(--success-ink); }
.pkg-credit.expired { background: var(--danger-bg); color: var(--danger-ink); }

.pkg-actions { display: flex; gap: 6px; margin-top: 0.6rem; }
.pkg-row .collapsible-form { margin-top: 0.75rem; }

.inline-form { display: inline; }
.link-btn {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--primary);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.form-hint { font-size: 0.75rem; color: var(--gray-400); margin: -4px 0 12px; }
.form-hint:empty { display: none; }

.package-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
}
.package-banner-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
}

/* Locked fields (e.g. a start date set by applied credit) */
.form-control[readonly] { background: var(--gray-50); color: var(--gray-600); cursor: not-allowed; }

/* ===========================
   Evidence Hub
   =========================== */
.evidence-switcher { flex-wrap: wrap; margin-bottom: 1rem; border-radius: 18px; }
.subtab-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--gray-200);
  color: var(--gray-600);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.subtab-count.alert { background: var(--danger-ink); color: var(--white); }

.hub-intro { font-size: 0.85rem; color: var(--gray-600); margin: -0.25rem 0 0.9rem; }
.hub-form-card { margin-top: 1rem; }
.hub-form-card .card-title { font-size: 0.9rem; }

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}
.evidence-grid-video { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.evidence-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.1rem;
  min-width: 0;
}
/* An open embed takes the full row: the "dashboard of dashboards" view. */
.evidence-card.expanded { grid-column: 1 / -1; }

.evidence-card-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.evidence-card-text { min-width: 0; flex: 1; }
.evidence-title { font-weight: 600; color: var(--gray-800); }
.evidence-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 2px; }
.evidence-desc { font-size: 0.83rem; color: var(--gray-600); margin-top: 6px; }
.evidence-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.evidence-actions a { text-decoration: none; }

.evidence-embed { margin-top: 0.9rem; }
.evidence-embed iframe {
  display: block;
  width: 100%;
  height: 640px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
}
.evidence-embed-video iframe { height: auto; aspect-ratio: 16 / 9; }
.evidence-embed-note { font-size: 0.72rem; color: var(--gray-400); margin-top: 6px; }

.req-row, .var-row { padding: 0.9rem 0; border-top: 1px solid var(--gray-100); }
.req-row:first-child, .var-row:first-child { border-top: none; padding-top: 0.2rem; }
.req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.req-title { font-weight: 600; color: var(--gray-800); }
.req-desc { font-size: 0.83rem; color: var(--gray-600); margin-top: 4px; }
.req-due { font-size: 0.75rem; color: var(--gray-400); }
.req-due.overdue { color: var(--danger-ink); font-weight: 600; }
.req-reply {
  margin-top: 8px;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  background: var(--info-tint);
  font-size: 0.82rem;
  color: var(--gray-800);
}
.req-reply a { margin-left: 6px; font-weight: 500; }

.req-status, .var-status {
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}
.req-requested { background: var(--gray-100); color: var(--gray-600); }
.req-sent { background: var(--info-bg); color: var(--info-ink); }
.req-verified { background: var(--success-bg); color: var(--success-ink); }
.req-needs_changes { background: var(--danger-bg); color: var(--danger-ink); }
.var-proposed { background: var(--gray-100); color: var(--gray-600); }
.var-validated { background: var(--success-bg); color: var(--success-ink); }
.var-in_use { background: var(--info-bg); color: var(--info-ink); }
.var-retired { background: var(--gray-100); color: var(--gray-400); text-decoration: line-through; }

.var-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800);
}
.var-formula code {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gray-100);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gray-800);
}
.var-source { font-size: 0.75rem; color: var(--gray-400); margin-top: 6px; }

@media (max-width: 900px) {
  .evidence-embed iframe { height: 480px; }
}

/* ===========================
   Contracts & payments
   =========================== */
.setup-note {
  margin-bottom: 1rem;
  padding: 10px 14px;
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  background: var(--warning-tint);
  font-size: 0.82rem;
  color: var(--gray-800);
}
.setup-note code { font-size: 0.78rem; }

.pkg-billing {
  margin-top: 0.75rem;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--gray-50);
}
.pkg-billing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 4px 0;
  font-size: 0.8rem;
}
.pkg-billing-label {
  width: 64px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
}
.pkg-billing-meta { color: var(--gray-600); flex: 1 1 200px; }
.pkg-billing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.status-chip {
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.st-pending { background: var(--gray-100); color: var(--gray-600); }
.st-sent { background: var(--info-bg); color: var(--info-ink); }
.st-signed, .st-paid { background: var(--success-bg); color: var(--success-ink); }
.st-declined, .st-past_due { background: var(--danger-bg); color: var(--danger-ink); }
.st-void, .st-refunded { background: var(--gray-100); color: var(--gray-400); }

.pay-link-row { margin-top: 8px; font-size: 0.75rem; color: var(--gray-600); }
.pay-link-row label { display: block; font-weight: 500; margin-bottom: 4px; }
.pay-link-field { display: flex; gap: 6px; }
.pay-link-field .form-control { font-size: 0.75rem; padding: 6px 10px; }

.billing-card { border-left: 4px solid var(--coral); }
.billing-item { padding: 0.9rem 0; border-top: 1px solid var(--gray-100); }
.billing-item:first-of-type { border-top: none; padding-top: 0.25rem; }
.billing-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.billing-amount { font-weight: 600; color: var(--gray-800); }
.billing-terms { margin-top: 4px; font-size: 0.82rem; color: var(--gray-600); }
.billing-step { margin: 0.75rem 0 0.5rem; font-size: 0.85rem; font-weight: 500; color: var(--gray-800); }
.billing-wait { margin-top: 0.6rem; font-size: 0.85rem; color: var(--gray-600); }
.billing-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 0.75rem; }
.billing-note { font-size: 0.78rem; color: var(--gray-400); }
.billing-card docuseal-form { display: block; margin-bottom: 0.5rem; }

.package-banner-link { font-size: 0.8rem; font-weight: 500; }

/* ===========================
   Foundations: account, team, activity
   =========================== */
.narrow-page { max-width: 880px; margin: 0 auto; }

.account-card { max-width: 480px; }
.account-section { padding: 1.1rem 0; border-top: 1px solid var(--gray-100); }
.account-section:first-of-type { border-top: none; }
.account-section h2 { font-size: 0.95rem; font-weight: 600; color: var(--gray-800); margin-bottom: 0.6rem; }
.account-note { font-size: 0.8rem; color: var(--gray-600); margin: -4px 0 12px; }

.error-reference { margin-top: 0.75rem; font-size: 0.85rem; color: var(--gray-600); }

.activity-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 1rem; }
.activity-filters .form-control { width: auto; min-width: 180px; flex: 1 1 180px; }
.activity-day {
  margin: 1rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
}
.activity-row {
  display: grid;
  grid-template-columns: 72px 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid var(--gray-100);
  font-size: 0.85rem;
}
.activity-time { color: var(--gray-400); font-size: 0.78rem; white-space: nowrap; }
.activity-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--gray-400); justify-self: center; align-self: start; }
.activity-dot.kind-auth, .activity-dot.kind-security { background: var(--navy); }
.activity-dot.kind-team, .activity-dot.kind-client, .activity-dot.kind-crm { background: var(--primary); }
.activity-dot.kind-package, .activity-dot.kind-contract, .activity-dot.kind-payment { background: var(--yellow); }
.activity-dot.kind-work, .activity-dot.kind-evidence { background: var(--coral); }
.activity-summary { color: var(--gray-800); overflow-wrap: anywhere; }
.activity-client {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.72rem;
  font-weight: 500;
}
.activity-actor { color: var(--gray-600); font-size: 0.78rem; text-align: right; }
.activity-pager { display: flex; justify-content: space-between; margin-top: 1rem; }

@media (max-width: 600px) {
  .activity-row { grid-template-columns: 60px 20px minmax(0, 1fr); }
  .activity-actor { grid-column: 3; text-align: left; }
}

.account-tz-detect { display: block; margin: -4px 0 10px; font-size: 0.8rem; }

/* An element with the hidden attribute stays hidden even when a class gives
   it a display value (form rows, grids, flex groups). */
[hidden] { display: none !important; }

/* ===========================
   CRM: companies, people, settings
   =========================== */
.optional { color: var(--gray-400); font-weight: 400; }
.crm-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 1rem; }
.crm-title { font-size: 1.65rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); margin-bottom: 0.75rem; }
.page-intro { font-size: 0.875rem; color: var(--gray-600); margin: -0.4rem 0 1.25rem; }
.crm-count { font-size: 1rem; font-weight: 500; letter-spacing: 0; color: var(--gray-400); margin-left: 4px; }
.crm-header .crm-title { margin: 0; }
.crm-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crm-breadcrumb { font-size: 0.8rem; color: var(--gray-400); margin-bottom: 0.75rem; }
.seats-chip { font-size: 0.78rem; padding: 5px 13px; border-radius: 999px; background: var(--white); border: 1px solid var(--gray-200); color: var(--gray-600); }

.stage-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.75rem; }
.stage-filter {
  padding: 5px 13px; border-radius: 999px; font-size: 0.8rem; font-weight: 500;
  background: var(--gray-100); color: var(--gray-600); text-decoration: none; transition: background 0.15s, color 0.15s;
}
.stage-filter:hover { background: var(--gray-200); color: var(--text); text-decoration: none; }
.stage-filter span { color: var(--gray-400); font-weight: 500; margin-left: 2px; }
.stage-filter.active { background: var(--text); color: var(--white); }
.stage-filter.active span { color: rgba(255, 255, 255, 0.65); }

.stage-chip { display: inline-block; padding: 1px 9px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.stage-chip.st-lead { background: var(--warning-bg); color: var(--warning-ink); }
.stage-chip.st-prospect { background: var(--info-bg); color: var(--info-ink); }
.stage-chip.st-client { background: var(--success-bg); color: var(--success-ink); }
.stage-chip.st-past { background: var(--gray-100); color: var(--gray-600); }
.tag-chip {
  display: inline-block; margin: 2px 4px 2px 0; padding: 0 8px; border-radius: 20px;
  background: var(--gray-100); color: var(--gray-600); font-size: 0.72rem; font-weight: 500; text-decoration: none;
}
.tag-chip.tag-main { background: var(--info-bg); color: var(--info-ink); }

.crm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 1rem; }
.crm-filters .form-control { width: auto; flex: 1 1 130px; min-width: 120px; }
.crm-filters input[type="search"] { flex: 2 1 220px; }

.crm-list-card { padding: 0; overflow: hidden; }
.crm-table-wrap { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.crm-table th {
  text-align: left; padding: 10px 14px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--gray-400); border-bottom: 1px solid var(--gray-100); white-space: nowrap;
}
.crm-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: top; color: var(--gray-800); }
.crm-table tr:last-child td { border-bottom: none; }
.crm-name { font-weight: 600; color: var(--gray-800); margin-right: 6px; }
.crm-sub { font-size: 0.75rem; color: var(--gray-400); }
.crm-tags { margin-top: 3px; }
.crm-due { color: var(--danger-ink); font-weight: 600; }
.crm-auto { font-size: 0.65rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.4px; margin-left: 4px; }

.crm-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 20px; margin: 0.25rem 0 0.75rem; }
.crm-details dt { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: var(--gray-400); }
.crm-details dd { margin: 2px 0 0; font-size: 0.88rem; color: var(--gray-800); overflow-wrap: anywhere; }
.crm-fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin: 0.5rem 0 1rem; }
.crm-fieldset legend { font-size: 0.8rem; font-weight: 600; color: var(--gray-600); padding: 0 6px; }
.crm-record-head { display: flex; align-items: center; gap: 14px; margin-bottom: 1rem; }
.crm-record-title h1 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }

.cf-choices { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 2px; }
.cf-choice { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 500; color: var(--gray-800); }
.cf-choice input { accent-color: var(--primary); }

.person-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--gray-100); }
.person-row:first-of-type { border-top: none; }
.person-info { min-width: 0; }

.convo-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 0.75rem; }
.convo-kind {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px;
  border: 1px solid var(--gray-200); font-size: 0.8rem; font-weight: 500; color: var(--gray-600); cursor: pointer;
}
.convo-kind input { accent-color: var(--primary); }
.convo-kind:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }

.history-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--gray-100); font-size: 0.85rem;
}
.history-row:first-of-type { border-top: none; }
.history-row.is-conversation .history-what strong { color: var(--info-ink); }
.history-when { color: var(--gray-400); font-size: 0.78rem; white-space: nowrap; }
.history-what { color: var(--gray-800); overflow-wrap: anywhere; }
.history-remove { font-size: 0.75rem; color: var(--gray-400); }
.tab-count { font-size: 0.7rem; color: var(--gray-400); font-weight: 500; margin-left: 2px; }

.settings-nav { margin-bottom: 1rem; }
.settings-nav .tab-btn { text-decoration: none; }
.setting-row { padding: 12px 0; border-top: 1px solid var(--gray-100); }
.setting-row:first-of-type { border-top: none; }
.setting-main { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.service-row { padding: 14px 0; border-top: 1px solid var(--gray-100); }
.service-row:first-of-type { border-top: none; }
.service-row.archived { opacity: 0.6; }
.service-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.service-price { font-weight: 600; color: var(--gray-800); white-space: nowrap; }
.service-desc { font-size: 0.85rem; color: var(--gray-600); margin: 6px 0 0; }
.inline-settings-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flash-link { display: inline-block; margin-top: 4px; font-weight: 500; }

@media (max-width: 600px) {
  .history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .history-when { grid-column: 1 / -1; }
}
.crm-details dd.crm-due { color: var(--danger-ink); font-weight: 600; }

/* ===========================
   Pipeline: deals, board, C2IT to-dos
   =========================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Relationship and deal chips */
.stage-chip.st-none,
.stage-chip.st-partner { background: var(--warning-tint); color: var(--warning-ink); box-shadow: inset 0 0 0 1px rgba(var(--yellow-rgb), 0.45); }
.stage-chip.st-deal-open { background: var(--info-bg); color: var(--info-ink); }
.stage-chip.st-deal-won { background: var(--success-bg); color: var(--success-ink); }
.stage-chip.st-deal-lost { background: var(--danger-bg); color: var(--danger-ink); }
.stage-chip.st-deal-nurture { background: var(--gray-100); color: var(--gray-600); }
.detail-meta .stage-chip, .crm-table .stage-chip { margin-right: 4px; }
.label-chip {
  display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px;
  background: var(--gray-100); color: var(--gray-600); font-size: 0.72rem; font-weight: 500; white-space: nowrap;
}
.label-chip.warmth-warm { background: rgba(var(--coral-rgb), 0.16); color: var(--danger-ink); }
.label-chip.warmth-cold { background: var(--info-bg); color: var(--info-ink); }
.label-chip.label-flag { background: var(--success-bg); color: var(--success-ink); }
.internal-chip {
  margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-family: var(--font-sans);
  background: var(--gray-100); color: var(--gray-600); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em;
}
.deal-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin-top: 4px; }
.deal-labels .package-badge { margin-right: 4px; }
.deal-notes { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gray-50); font-size: 0.875rem; color: var(--gray-800); white-space: pre-wrap; }

/* Menu badge: C2IT to-dos due */
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--coral); color: var(--white); font-size: 0.7rem; font-weight: 600; line-height: 20px; text-align: center;
}

/* Board */
.board-wrap { overflow-x: auto; margin: 0 -4px 1.5rem; padding: 0 4px 8px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 10px; min-width: min-content; }
.board-col { background: rgba(50, 78, 102, 0.06); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.board-col-head { padding: 2px 4px 4px; }
.board-col-name { font-weight: 600; font-size: 0.85rem; color: var(--text); }
.board-col-name span { margin-left: 4px; color: var(--gray-600); font-weight: 500; }
.board-col-sub { font-size: 0.75rem; color: var(--gray-600); font-variant-numeric: tabular-nums; }
.board-empty { font-size: 0.8rem; color: var(--gray-600); padding: 8px 4px; }
.deal-card {
  background: var(--white); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 12px 12px 10px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.deal-card-name { font-weight: 600; color: var(--text); line-height: 1.35; overflow-wrap: anywhere; }
.deal-card-company { font-size: 0.8rem; color: var(--gray-600); }
.deal-card-labels { margin: 2px 0; }
.deal-card-labels .package-badge { margin-right: 4px; }
.deal-card-value { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.deal-card-value span { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500; color: var(--gray-600); }
.deal-card-meta { font-size: 0.75rem; color: var(--gray-600); }
.deal-card-flag { font-size: 0.75rem; color: var(--success-ink); font-weight: 500; }
.deal-card-todo { font-size: 0.75rem; color: var(--gray-800); background: var(--gray-50); border-radius: 8px; padding: 4px 8px; }
.deal-card-todo.is-late { background: var(--danger-bg); color: var(--danger-ink); }
/* Drag and drop on the board */
.deal-card[draggable="true"] { cursor: grab; }
.deal-card.is-dragging { opacity: 0.45; }
.deal-card.is-moving { opacity: 0.6; pointer-events: none; }
.board-col.is-over { background: rgba(40, 94, 77, 0.12); box-shadow: inset 0 0 0 2px var(--pine); }
.board-hint { font-size: 0.78rem; color: var(--gray-600); margin: 0 0 8px; }
/* Won / Lost / Nurture targets float at the bottom of the screen while dragging. */
.board-dropbar { display: none; gap: 10px; position: fixed; left: calc(50% + var(--sidebar-width) / 2); bottom: 20px; transform: translateX(-50%); width: min(640px, 80vw); z-index: 50; }
.board-wrap.is-dragging .board-dropbar { display: flex; }
@media (max-width: 900px) { .board-dropbar { left: 50%; } }
.board-drop { flex: 1; text-align: center; padding: 16px 10px; border-radius: var(--radius); border: 2px dashed var(--gray-400); background: var(--white); box-shadow: var(--shadow-md); font-size: 0.85rem; font-weight: 600; color: var(--gray-600); }
.board-drop-won { border-color: var(--pine); color: var(--pine); }
.board-drop-lost { border-color: var(--coral); color: #a8452d; }
.board-drop.is-over { background: rgba(40, 94, 77, 0.1); border-style: solid; }
.board-drop-lost.is-over { background: rgba(var(--coral-rgb), 0.12); }
@media (hover: none) { .board-hint { display: none; } }
.deal-card-move { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.deal-card-move .btn { padding: 0.3rem 0.75rem; }
.deal-card-move .btn[hidden] { display: none; }
.deal-card-move .form-control { padding: 0.35rem 0.6rem; font-size: 0.78rem; border-radius: 999px; }
.pipeline-view { margin-left: auto; }
.pipeline-view a { display: inline-block; padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.8rem; font-weight: 500; color: var(--gray-600); text-decoration: none; }
.pipeline-view a.active { background: var(--white); color: var(--text); box-shadow: 0 1px 3px rgba(20, 24, 28, 0.1); }

/* Deal rows on a company record */
.deal-row { padding: 10px 0; border-top: 1px solid var(--gray-100); }
.deal-row:first-of-type { border-top: none; }
.deal-row .stage-chip { margin-left: 4px; }

/* Stage track on a deal */
.stage-track { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1.25rem; padding: 0; }
.stage-step span {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 500;
  background: var(--white); color: var(--gray-600); box-shadow: 0 0 0 1px var(--line);
}
.stage-step.is-done span { background: var(--success-bg); color: var(--success-ink); box-shadow: none; }
.stage-step.is-now span { background: var(--navy); color: var(--white); box-shadow: none; }
.stage-step.is-won span { background: var(--primary); color: var(--white); box-shadow: none; }
.stage-step.is-closed span { background: var(--gray-100); color: var(--gray-800); box-shadow: none; }
.stage-step.is-off span { opacity: 0.75; }

/* C2IT to-dos */
.todo-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--gray-100); }
.todo-row:first-child { border-top: none; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 0.9rem; color: var(--text); overflow-wrap: anywhere; }
.todo-row.is-done .todo-title { text-decoration: line-through; color: var(--gray-600); }
.todo-check {
  width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--gray-400);
  background: var(--white); cursor: pointer; flex-shrink: 0; padding: 0;
}
.todo-check:hover { border-color: var(--primary); background: var(--primary-tint); }
.todo-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.todo-check.is-checked { background: var(--primary); border-color: var(--primary); }
.todo-done { margin-top: 6px; font-size: 0.85rem; color: var(--gray-600); }
.todo-done summary { cursor: pointer; padding: 4px 0; }
.todo-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.todo-add input[name="title"] { flex: 3 1 220px; }
.todo-add input[type="date"], .todo-add select { flex: 1 1 140px; width: auto; }

.move-form .form-row { align-items: start; }
.scheduling-fallback { font-size: 0.8rem; color: var(--gray-600); margin: 8px 14px 12px; }

@media (max-width: 900px) {
  .board-wrap { overflow-x: visible; margin: 0 0 1.5rem; padding: 0; }
  .board { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); min-width: 0; }
}

/* ===========================
   Finish: serif titles, brand color, and surfaces on the deeper canvas
   =========================== */
/* Page titles, record names, section titles, and big numbers use the serif. */
.crm-title, .detail-name, .crm-record-title h1, .login-title,
.section-header h2, .modal-header h2, .stat-number, .status-count {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.crm-title { font-size: 1.9rem; line-height: 1.15; }
.crm-title .crm-count { font-family: var(--font-sans); letter-spacing: 0; }
.detail-name, .crm-record-title h1 { font-size: 1.6rem; }
.login-title { font-size: 1.65rem; }
.section-header h2 { font-size: 1.3rem; color: var(--text); }
.modal-header h2 { font-size: 1.25rem; color: var(--text); }
.stat-number { font-size: 1.75rem; color: var(--text); }
.status-count { font-size: 2.1rem; }

/* The rate card stripe under each page title and on the sign-in card */
.crm-title::after,
.login-title::after {
  content: '';
  display: block;
  width: 84px;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: var(--brand-stripe);
}
.crm-header .crm-title::after { margin-top: 8px; }
.login-title { margin-bottom: 10px; }

/* Summary tiles carry a colored top edge */
.stat-card { border-top: 3px solid var(--tile-accent, var(--line)); }
.stats-row .stat-card:nth-child(1) { --tile-accent: var(--navy); }
.stats-row .stat-card:nth-child(2) { --tile-accent: var(--primary); }
.stats-row .stat-card:nth-child(3) { --tile-accent: var(--yellow); }

/* Table headers get a light navy band */
.crm-table th { background: var(--table-head); color: var(--navy); border-bottom-color: var(--line); }

/* Current menu item: a gold marker on the left (underneath on phones) */
.app-nav-links a.active { box-shadow: inset 3px 0 0 var(--yellow); }
@media (max-width: 900px) {
  .app-nav-links a.active { box-shadow: inset 0 -2px 0 var(--yellow); }
}

/* Things that sit straight on the canvas need their own surface now */
.tab-nav, .view-switcher { background: var(--soft-fill); }
.stage-filter { background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.stage-filter:not(.active):hover { background: var(--gray-50); }
.stage-filter.active { box-shadow: none; }
.book-overview-toggle, .view-only-note { background: var(--white); }
.book-overview { border-top-color: rgba(50, 78, 102, 0.14); }
.section-header { border-bottom-color: rgba(50, 78, 102, 0.14); }
.package-badge.edtech { background: var(--danger-bg); }
.package-banner .credit-pill { background: var(--white); }
.tab-btn .tab-count { color: inherit; }
.add-client-tile { border-color: rgba(50, 78, 102, 0.28); background: rgba(255, 255, 255, 0.45); }
.add-client-tile:hover { background: var(--white); }

@media (max-width: 600px) {
  .crm-title { font-size: 1.55rem; }
  .detail-name, .crm-record-title h1 { font-size: 1.4rem; }
}
