/* ====================================================================
   Design System: MindBalance Standard Theme
   Typography: Outfit & Inter
   Directionality: Designed purely using CSS Logical Properties
   ==================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800&family=Manrope:wght@300;400;500;600;700&family=Assistant:wght@300;400;500;600;700;800&family=Rubik:wght@300;400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  /* Typography — Manrope for LTR (replaces Outfit/Inter). Assistant kept for RTL. */
  --font-family: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:  'Instrument Serif', Georgia, serif;

  /* Surface — cream / paper / sand */
  --bg-primary:    hsl(40 36% 95%);          /* cream  #F8F4EC */
  --bg-secondary:  hsl(43 40% 97%);          /* paper  #FBF9F3 */
  --bg-tertiary:   hsl(40 31% 89%);          /* sand   #EFE8DA */

  /* Text — charcoal / muted */
  --text-primary:    hsl(40 6% 14%);         /* charcoal #262522 */
  --text-secondary:  hsl(40 7% 35%);         /* ink     #5F5B53 */
  --text-soft:       hsl(40 6% 55%);         /* labels / muted */
  --border-color:    hsla(40, 6%, 14%, 0.10);
  --hairline:        hsla(40, 6%, 14%, 0.07);

  /* Accent — sage deep (replaces vivid purple) */
  --accent-color:  hsl(108 11% 40%);         /* sageDeep #5C6E5A */
  --accent-light:  hsl(108 16% 88%);         /* sage wash for active backgrounds */
  --accent-hover:  hsl(108 11% 33%);
  --accent-glow:   hsla(108, 11%, 40%, 0.15);

  /* Semantic — calm versions, NO red alarms for a therapy audience */
  --success-color:  hsl(108 20% 38%);
  --success-light:  hsl(108 22% 92%);
  --success-border: hsl(108 22% 82%);

  --warning-color:  hsl(28 35% 50%);         /* warm cocoa #A27B5C */
  --warning-light:  hsl(28 50% 94%);
  --warning-border: hsl(28 40% 82%);

  /* Danger uses the same warm cocoa — never red. */
  --danger-color:   hsl(28 35% 50%);
  --danger-light:   hsl(28 50% 94%);
  --danger-border:  hsl(28 40% 82%);

  --cyan-color:     hsl(180 13% 47%);        /* soft teal */
  --cyan-light:     hsl(180 20% 93%);
  --cyan-border:    hsl(180 20% 82%);

  /* Shadows — warmer, less harsh than rgb(0,0,0) */
  --shadow-sm:    0 1px 2px 0 rgba(38, 37, 34, 0.04);
  --shadow-md:    0 4px 14px -2px rgba(38, 37, 34, 0.06),
                  0 2px 6px -1px rgba(38, 37, 34, 0.04);
  --shadow-lg:    0 20px 30px -8px rgba(38, 37, 34, 0.08),
                  0 10px 12px -6px rgba(38, 37, 34, 0.04);
  --shadow-inset: inset 0 1px 3px 0 rgba(38, 37, 34, 0.04);

  /* Geometry — slightly larger radii for a softer, calmer feel */
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  /* Motion — same speed; ease curve aligned with marketing site */
  --transition-base: 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Calendar — client color palette (soft pastels on sand) */
  --c-peach:  #F9D6B7;  --c-peach-stripe:  #E89A78;
  --c-butter: #F8E1A6;  --c-butter-stripe: #D6B654;
  --c-sky:    #D2DEEA;  --c-sky-stripe:    #8AA9C2;
  --c-lilac:  #D9CBE3;  --c-lilac-stripe:  #A48ABA;
  --c-sage:   #C6D2BF;  --c-sage-stripe:   #6F8B6B;
  --c-teal:   #BCD2CF;  --c-teal-stripe:   #5F8C86;
  --c-clay:   #E4C2A5;  --c-clay-stripe:   #A87649;
  --c-rose:   #EFCFCF;  --c-rose-stripe:   #BC8585;

  /* Calendar — avatar / brand-mark fills (slightly more saturated) */
  --c-peach-solid:  #F2B48B;
  --c-butter-solid: #F4D58A;
  --c-sky-solid:    #BFD3E4;
  --c-lilac-solid:  #C8B6D6;
  --c-sage-solid:   #8DA386;
  --c-teal-solid:   #7FA9A4;
  --c-clay-solid:   #C8956E;
  --c-rose-solid:   #E5B4B4;

  /* Shared brand palette aliases — used by client directory avatars,
     daily-quote decorative mark, and any future avatar-style accents. */
  --peach:  #F2B48B;
  --butter: #F4D58A;
  --sky:    #BFD3E4;
  --lilac:  #C8B6D6;
  --sage:   #8DA386;
  --teal:   #7FA9A4;
  --clay:   #C8956E;
  --rose:   #E5B4B4;

  /* Calendar — non-client kinds */
  --c-break:       #ECE6D6;
  --c-personal:    #E8DEEC;
  --c-supervision: #DCDDB9;

  /* Calendar — color-by-kind palette (overrides per-client when active) */
  --k-regular:     #DBE5D4;
  --k-long:        #C9DDD9;
  --k-intake:      #F0DBC4;
  --k-couple:      #E7D4D4;
  --k-online:      #D6E2EA;
  --k-supervision: #DCDDB9;
  --k-break:       #ECE6D6;
  --k-personal:    #E8DEEC;

  /* Calendar — geometry */
  --slot-h:        30px;   /* one 30-min slot. 22 compact / 38 airy */
  --time-col:      64px;
  --event-radius:  10px;
  --day-count:     7;

  --in-oklab: ;
}

[data-theme="dark"] {
  --bg-primary:    hsl(40 6% 10%);
  --bg-secondary:  hsl(40 5% 13%);
  --bg-tertiary:   hsl(40 5% 16%);
  --text-primary:    hsl(40 25% 96%);
  --text-secondary:  hsl(40 6% 70%);
  --text-soft:       hsl(40 6% 55%);
  --border-color:    hsla(40, 6%, 96%, 0.08);
  --hairline:        hsla(40, 6%, 96%, 0.05);

  --accent-color:  hsl(108 16% 60%);
  --accent-light:  hsl(108 14% 20%);
  --accent-hover:  hsl(108 18% 70%);
  --accent-glow:   hsla(108, 16%, 60%, 0.20);

  --success-color:  hsl(108 28% 60%);
  --success-light:  hsl(108 14% 18%);
  --success-border: hsl(108 14% 26%);

  --warning-color:  hsl(28 45% 65%);
  --warning-light:  hsl(28 14% 18%);
  --warning-border: hsl(28 18% 28%);

  --danger-color:   hsl(28 45% 65%);
  --danger-light:   hsl(28 14% 18%);
  --danger-border:  hsl(28 18% 28%);

  --cyan-color:     hsl(180 28% 62%);
  --cyan-light:     hsl(180 14% 16%);
  --cyan-border:    hsl(180 14% 24%);
}

@supports (linear-gradient(in oklab, white, black)) {
  :root { --in-oklab: in oklab; }
}

[dir="rtl"] {
  --font-family: 'Assistant', 'Rubik', system-ui, -apple-system, sans-serif;
}

/* ====================================================================
   Generic Defaults & Boilerplate Resets
   ==================================================================== */

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color var(--transition-base), color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App Skeleton Container */
.app-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-block-size: 100vh;
  transition: var(--transition-base);
}

/* Sidebar Navigation */
.app-sidebar {
  background-color: var(--bg-secondary);
  border-inline-end: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  block-size: 100vh;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-block-end: 2rem;
}

.brand-logo {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg var(--in-oklab), var(--accent-color), hsl(290 80% 50%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--accent-color);
  background-color: var(--accent-light);
  font-weight: 600;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-block-start: 1px solid var(--border-color);
  padding-block-start: 1.5rem;
}

.utility-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
  inline-size: 100%;
}

.utility-button:hover {
  background-color: var(--border-color);
}

/* ====================================================================
   Main Dashboard Layout
   ==================================================================== */

.app-main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow-y: auto;
  max-inline-size: 1600px;
  margin-inline: auto;
  inline-size: 100%;
}

/* Dashboard Header Row */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-title h1 {
  font-family: 'Outfit', var(--font-family);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.header-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

/* Operational Widget Triage Grid */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.widget-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.widget-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.widget-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.widget-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Widget Specific Displays */

/* 1. Overdue Aging AR Display */
.widget-ar-value {
  font-family: 'Outfit', var(--font-family);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--danger-color);
  line-height: 1;
}

.widget-ar-alert {
  background-color: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger-color);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-block-start: 0.5rem;
  align-self: flex-start;
}

/* 2. Billing Sync Queue */
.sync-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-block-size: 140px;
  overflow-y: auto;
}

.sync-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background-color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
}

.sync-item-meta {
  display: flex;
  flex-direction: column;
}

.sync-item-name {
  font-weight: 600;
}

.sync-item-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* 3. Dispatch Hub */
.dispatch-count {
  font-family: 'Outfit', var(--font-family);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
}

.document-type-select {
  min-inline-size: 12rem;
  max-inline-size: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
}

/* 4. Revenue Pulse Chart */
.revenue-pulse-chart {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-block-start: 0.5rem;
}

.chart-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
}

.chart-bar-label {
  inline-size: 80px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: end;
}

.chart-bar-track {
  flex-grow: 1;
  background-color: var(--bg-tertiary);
  block-size: 10px;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-inset);
}

.chart-bar-fill {
  block-size: 100%;
  border-radius: 5px;
  transition: width var(--transition-slow) ease-in-out;
}

.chart-bar-fill.collected {
  background: linear-gradient(to right var(--in-oklab), var(--success-color), hsl(142 80% 45%));
}

.chart-bar-fill.outstanding {
  background: linear-gradient(to right var(--in-oklab), var(--warning-color), hsl(38 92% 65%));
}

.chart-bar-value {
  inline-size: 60px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: start;
}

/* ====================================================================
   Zero-Dependency Custom CSS Grid / Table Component
   ==================================================================== */

.ledger-section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.table-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-block-end: 1px solid var(--border-color);
  padding-block-end: 1rem;
}

/* Custom CSS Responsive Grid Table Layout */
.custom-table {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
}

/* Define columns globally for Desktop: Checkbox, Client, Date, Status, Fee, State, Actions */
.custom-table-row {
  display: grid;
  grid-template-columns: 40px 1.5fr 1.2fr 1fr 0.8fr 1fr 1.2fr;
  align-items: center;
  padding: 0.9rem 1rem;
  border-block-end: 1px solid var(--border-color);
  transition: background-color var(--transition-base);
  font-size: 0.9rem;
}

.custom-table-row:last-child {
  border-block-end: none;
}

.custom-table-header {
  background-color: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  border-block-end: none;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.custom-table-row:not(.custom-table-header):hover {
  background-color: var(--bg-primary);
}

/* Cell alignment styling using logical systems */
.table-cell {
  display: flex;
  align-items: center;
  text-align: start;
}

.table-cell.actions {
  justify-content: flex-end;
  gap: 0.5rem;
}

.table-cell.numeric {
  justify-content: flex-start;
  font-weight: 600;
}

/* ====================================================================
   Minimalist Progressive Disclosure Forms (Critical Feature)
   ==================================================================== */

.minimalist-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Underline Form Fields */
.minimalist-input {
  font-family: var(--font-family);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-block-end: 1px solid var(--border-color);
  padding: 0.5rem 0.25rem;
  outline: none;
  transition: border-color var(--transition-base);
}

.minimalist-input:focus {
  border-block-end: 2px solid var(--accent-color);
}

.form-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Progressive Disclosure Dropdowns and Autocompletes */
.progressive-disclosure {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline: 0;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-block-size: 200px;
  overflow-y: auto;
  
  /* Initial State: Hidden and shifted */
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  display: none;
  transition: opacity var(--transition-base) ease, transform var(--transition-base) ease;
}

/* Active class triggered on onFocus via client-side logic */
.progressive-disclosure.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.disclosure-option {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-base);
  text-align: start;
}

.disclosure-option:hover {
  background-color: var(--bg-tertiary);
  color: var(--accent-color);
}

/* Expandable internal notes text area styling */
.tech-notes-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tech-notes-toggle {
  font-size: 0.8rem;
  color: var(--accent-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  user-select: none;
}

.tech-notes-textarea {
  display: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  min-block-size: 80px;
}

.tech-notes-textarea.visible {
  display: block;
  animation: slideDown var(--transition-base) forwards;
}

/* ====================================================================
   Buttons, Badges, Modals, & Micro-animations
   ==================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-base), transform 0.1s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

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

.btn-secondary:hover {
  background-color: var(--border-color);
}

.btn-pdf {
  color: var(--text-secondary);
  transition: all var(--transition-base) !important;
}

.btn-pdf:hover {
  color: var(--accent-color) !important;
  background-color: var(--accent-light) !important;
  border-color: rgba(99, 102, 241, 0.2) !important;
}

.btn-success {
  background-color: var(--success-color);
  color: white;
}

.btn-success:hover {
  background-color: hsl(142 72% 23%);
}

.btn-icon {
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-draft {
  background-color: var(--warning-light);
  color: var(--warning-color);
  border: 1px solid var(--warning-border);
}

.badge-issued {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid var(--border-color);
}

.badge-paid {
  background-color: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.badge-demand {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: 1px solid var(--accent-glow);
}

.badge-paid-internal {
  background-color: var(--cyan-light);
  color: var(--cyan-color);
  border: 1px solid var(--cyan-border);
}

.badge-event {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.badge-event.completed {
  background-color: var(--success-light);
  color: var(--success-color);
  border: 1px solid var(--success-border);
}

.badge-event.billable {
  background-color: var(--danger-light);
  color: var(--danger-color);
  border: 1px solid var(--danger-border);
}

/* Compliance Lock Indicator */
.compliance-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--success-color);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base) ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  inline-size: 90%;
  max-inline-size: 480px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform var(--transition-base) ease;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-block-start: 1px solid var(--border-color);
  padding-block-start: 1rem;
}

/* ====================================================================
   Micro-Animations & Keyframes
   ==================================================================== */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 hsla(262, 80%, 50%, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px hsla(262, 80%, 50%, 0);
  }
  100% {
    box-shadow: 0 0 0 0 hsla(262, 80%, 50%, 0);
  }
}

.pulse-target {
  animation: pulseGlow 2s infinite;
  border-radius: var(--radius-md);
}

/* Toggle Switch Styling */
.switch-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.switch {
  position: relative;
  display: inline-block;
  inline-size: 40px;
  block-size: 22px;
}

.switch input {
  opacity: 0;
  inline-size: 0;
  block-size: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  block-size: 14px;
  inline-size: 14px;
  inset-inline-start: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: white;
}

/* RTL adjustment for slider */
[dir="rtl"] input:checked + .slider:before {
  transform: translateX(-18px);
}

/* Success Pulse highlight for newly created item */
.new-client-highlight {
  animation: pulse-success-glow 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes pulse-success-glow {
  0% {
    border-color: #10b981;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.4);
    background-color: rgba(16, 185, 129, 0.05);
    transform: scale(1.02);
  }
  30% {
    border-color: #10b981;
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0.1);
    background-color: rgba(16, 185, 129, 0.02);
    transform: scale(1.01);
  }
  100% {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
    background-color: var(--bg-secondary);
    transform: scale(1);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Premium Form Success Alert Banner */
.form-success-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-block-end: 1.25rem;
  border-radius: var(--radius-md);
  background-color: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success-color);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transform: translateY(-10px);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-success-alert.show {
  transform: translateY(0);
  opacity: 1;
}

/* ====================================================================
   RESPONSIVE DESIGN & MOBILE-FIRST STACKING (Critical Constraint)
   ==================================================================== */

@media (max-width: 992px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  
  .app-sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    inline-size: 100vw;
    block-size: 60px;
    padding: 0.5rem 1rem;
    border-inline-end: none;
    border-block-start: 1px solid var(--border-color);
    flex-direction: row;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
  }
  
  .brand-section, .sidebar-footer {
    display: none;
  }
  
  .nav-menu {
    flex-direction: row;
    justify-content: space-around;
    inline-size: 100%;
    margin: 0;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    flex-direction: column;
    gap: 0.1rem;
  }
  
  .app-main {
    padding: 1.5rem 1.5rem 80px 1.5rem; /* Extra bottom padding to avoid sidebar overlap */
  }
}

/* CUSTOM LIGHTWEIGHT TABLE RESPONSIVE CARD STACKING */
@media (max-width: 768px) {
  
  /* 1. Hide the table column headers entirely on mobile */
  .custom-table-header {
    display: none;
  }
  
  /* 2. Transform the rows into vertical cards */
  .custom-table-row {
    grid-template-columns: 1fr; /* Stack vertically */
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-block-end: 1rem;
    box-shadow: var(--shadow-sm);
  }
  
  /* 3. Render each cell as a horizontal key-value pair */
  .table-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: end;
    inline-size: 100%;
    padding-block-end: 0.4rem;
    border-block-end: 1px dashed var(--border-color);
  }
  
  .table-cell:last-child, .table-cell.actions {
    border-block-end: none;
    padding-block-end: 0;
  }
  
  /* Force Actions to stretch or align beautifully */
  .table-cell.actions {
    justify-content: flex-end;
    margin-block-start: 0.5rem;
    gap: 0.5rem;
  }
  
  /* 4. Display data-label attribute as mobile header key */
  .table-cell::before {
    content: attr(data-label);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-inline-end: 1rem;
    text-align: start;
  }
  
  /* Overrides for specific mobile styles */
  .table-cell.numeric {
    justify-content: space-between;
  }
  
  /* Expand checkbox label width on mobile */
  .table-cell:first-child {
    justify-content: flex-start;
  }
  .table-cell:first-child::before {
    content: "Select";
  }
}

/* ====================================================================
   Premium Empty-State and Editing Highlight Rules
   ==================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 2rem;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background-color: rgba(255, 255, 255, 0.01);
  margin-block-start: 1rem;
  transition: var(--transition-base);
  inline-size: 100%;
}

.empty-state:hover {
  border-color: var(--accent-color);
  background-color: var(--accent-glow);
}

.empty-state-icon {
  margin-block-end: 1rem;
  color: var(--text-secondary);
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  transition: var(--transition-base);
}

.empty-state:hover .empty-state-icon {
  color: var(--accent-color);
  background: var(--accent-light);
  transform: scale(1.08);
}

.empty-state-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-block-end: 0.5rem;
}

.empty-state-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-inline-size: 340px;
  line-height: 1.45;
}

/* Editing Highlight Border for Client Directory Cards */
.editing-client-highlight {
  border: 2px solid var(--accent-color) !important;
  box-shadow: 0 0 14px var(--accent-glow) !important;
  background-color: var(--accent-light) !important;
  transform: translateY(-2px) scale(1.01);
  transition: var(--transition-base);
}

[data-theme="dark"] .editing-client-highlight {
  background-color: rgba(139, 92, 246, 0.08) !important;
}

/* ====================================================================
   Multi-Tenant Practitioner Authentication & Scoped Access Style Block
   ==================================================================== */

/* Premium Standalone Auth Page */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity var(--transition-slow) ease, visibility var(--transition-slow) ease;
}

[data-theme="dark"] .auth-overlay {
  background: radial-gradient(circle at 50% 50%, #1e1b4b 0%, #030712 100%);
}

.auth-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* Hide the main application container when the auth page is active to prevent clutter and blurring */
body:has(#authOverlay.active) .app-container {
  display: none !important;
}

.auth-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 24px;
  padding: 2.5rem;
  inline-size: 90%;
  max-inline-size: 450px;
  box-shadow: 
    0 4px 30px rgba(0, 0, 0, 0.03),
    0 1px 3px rgba(0, 0, 0, 0.02),
    0 20px 40px -10px var(--accent-glow);
  transform: translateY(20px) scale(0.98);
  transition: transform var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

[data-theme="dark"] .auth-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 4px 30px rgba(0, 0, 0, 0.2),
    0 1px 3px rgba(0, 0, 0, 0.1),
    0 20px 40px -10px var(--accent-glow);
}

.auth-overlay.active .auth-card {
  transform: translateY(0) scale(1);
}

.auth-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.auth-logo {
  font-family: 'Outfit', var(--font-family);
  font-weight: 800;
  font-size: 2.25rem;
  background: linear-gradient(135deg, var(--accent-color), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-input {
  font-family: var(--font-family);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-base);
}

.auth-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-toggle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--accent-color);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
  transition: opacity var(--transition-base);
}

.auth-toggle:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.auth-error {
  display: none;
  font-size: 0.85rem;
  color: var(--danger-color);
  background-color: var(--danger-light);
  border: 1px solid var(--danger-border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  align-items: center;
  gap: 0.5rem;
  line-height: 1.4;
  animation: slideDown var(--transition-base) forwards;
}

.auth-error.visible {
  display: flex;
}

/* Segmented Tabs Control for Auth */
.auth-tabs {
  display: flex;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  width: 100%;
  box-sizing: border-box;
}

.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.55rem 1rem;
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: calc(var(--radius-md) - 2px);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
  white-space: nowrap;
}

.auth-tab-btn.active {
  background-color: var(--bg-primary);
  color: var(--accent-color);
  box-shadow: var(--shadow-sm);
}

.auth-tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* SSO Provider Login Buttons Styling */
.auth-sso-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  transition: all var(--transition-base);
}

.btn-sso svg {
  flex-shrink: 0;
}

.btn-sso:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--accent-color);
  box-shadow: 0 4px 10px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-google {
  background-color: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
}
.btn-google:hover {
  background-color: #f8f9fa;
  border-color: #c3c6ca;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
[data-theme="dark"] .btn-google {
  background-color: #202124;
  color: #e8eaed;
  border: 1px solid #5f6368;
}
[data-theme="dark"] .btn-google:hover {
  background-color: #303134;
}

.btn-apple {
  background-color: #000000;
  color: #ffffff;
  border: none;
}
.btn-apple:hover {
  background-color: #1a1a1a;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
[data-theme="dark"] .btn-apple {
  background-color: #ffffff;
  color: #000000;
}
[data-theme="dark"] .btn-apple:hover {
  background-color: #f2f2f2;
}

.btn-microsoft {
  background-color: #ffffff;
  color: #2f2f2f;
  border: 1px solid #8c8c8c;
}
.btn-microsoft:hover {
  background-color: #f6f6f6;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
[data-theme="dark"] .btn-microsoft {
  background-color: #2f2f2f;
  color: #ffffff;
  border: 1px solid #4a4a4a;
}
[data-theme="dark"] .btn-microsoft:hover {
  background-color: #3a3a3a;
}

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0.5rem 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-color);
}

.auth-divider::before {
  margin-inline-end: 1rem;
}

.auth-divider::after {
  margin-inline-start: 1rem;
}

/* Onboarding Screen layout overrides */
#authOnboardingCard {
  animation: slideDown var(--transition-slow) cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Sidebar profile card styles */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-block-start: auto;
  margin-block-end: 0.5rem;
  transition: all var(--transition-base);
}

.sidebar-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-color), #ec4899);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', var(--font-family);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.sidebar-profile-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  overflow: hidden;
}

.sidebar-profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-clinic {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-signout {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-signout:hover {
  background: var(--danger-light);
  color: var(--danger-color);
  border-color: var(--danger-border);
}

/* ====================================================================
   SaaS Tenant Settings Panel Styling
   ==================================================================== */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  inline-size: 100%;
  animation: fadeIn var(--transition-base) ease-in-out;
}

.settings-header {
  margin-block-end: 0.5rem;
}

.settings-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  inline-size: 100%;
}

.settings-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.settings-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.settings-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-block-end: 1px solid var(--border-color);
  padding-block-end: 0.75rem;
}

.settings-card-title {
  font-family: 'Outfit', var(--font-family);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.settings-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.settings-input,
.settings-select,
.settings-textarea {
  font-family: var(--font-family);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-base);
  inline-size: 100%;
}

.settings-textarea {
  min-block-size: 80px;
  resize: vertical;
  line-height: 1.5;
}

.settings-input:focus,
.settings-select:focus,
.settings-textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: var(--bg-primary);
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--border-color);
  margin-block-start: 1rem;
}

.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-color), #ec4899);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
  transition: all var(--transition-base);
}

.btn-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-save:active:not(:disabled) {
  transform: translateY(0);
}

.btn-save:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-save .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  display: none;
}

.btn-save.loading .spinner {
  display: block;
}

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

/* RTL Specific Logical Styles for Settings Form */
[dir="rtl"] .btn-save {
  flex-direction: row-reverse;
}

/* ====================================================================
   SaaS Client Card & Unified activity timeline styling
   ==================================================================== */

/* Sub-Tabs styling */
.client-tab-btn {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-base);
  white-space: nowrap;
}

.client-tab-btn.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.client-tab-btn:hover {
  color: var(--text-primary);
}

/* Bi-directional Logical Timeline stream */
.timeline-stream {
  position: relative;
  padding-inline-start: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.timeline-stream::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  inset-inline-start: 6px;
  width: 2px;
  background-color: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-dot {
  position: absolute;
  inset-inline-start: -26px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 3px solid var(--border-color);
  z-index: 1;
  transition: var(--transition-base);
}

.timeline-item.session .timeline-dot {
  border-color: var(--accent-color);
}

.timeline-item.invoice .timeline-dot {
  border-color: var(--warning-color);
}

.timeline-item.payment .timeline-dot {
  border-color: var(--success-color);
  background-color: var(--success-color);
}

.timeline-content-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Client Ledger clickable Link */
.client-ledger-link {
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-glow);
  cursor: pointer;
  transition: all var(--transition-base);
}

.client-ledger-link:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* Style overrides for active highlighting on client list */
.new-client-highlight {
  border: 2px solid var(--success-color) !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15) !important;
}

.unbilled-session-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-base);
}

.unbilled-session-checkbox-label:hover {
  background-color: var(--bg-primary);
}

/* Logical CSS rules for responsive components */
[dir="rtl"] .back-arrow-icon {
  transform: scaleX(-1);
}

/* ====================================================================
   SaaS Payment Tracking Card & Status indicator styles
   ==================================================================== */
.payment-track-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border-inline-start: 6px solid var(--border-color);
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

[dir="rtl"] .payment-track-card {
  border-right: 6px solid var(--border-color);
  border-left: 1px solid var(--border-color);
}

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

/* Vivid, Reassuring Theme Colors for Simple/Anxious Users */
.payment-track-card.state-unpaid {
  border-inline-start-color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.04);
}
[dir="rtl"] .payment-track-card.state-unpaid {
  border-right-color: var(--danger-color);
}
[data-theme="dark"] .payment-track-card.state-unpaid {
  background-color: rgba(239, 68, 68, 0.08);
}

.payment-track-card.state-partial {
  border-inline-start-color: var(--warning-color);
  background-color: rgba(245, 158, 11, 0.04);
}
[dir="rtl"] .payment-track-card.state-partial {
  border-right-color: var(--warning-color);
}
[data-theme="dark"] .payment-track-card.state-partial {
  background-color: rgba(245, 158, 11, 0.08);
}

.payment-track-card.state-paid {
  border-inline-start-color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.04);
}
[dir="rtl"] .payment-track-card.state-paid {
  border-right-color: var(--success-color);
}
[data-theme="dark"] .payment-track-card.state-paid {
  background-color: rgba(16, 185, 129, 0.08);
}

.payment-track-card.state-overpaid {
  border-inline-start-color: #0ea5e9;
  background-color: rgba(14, 165, 233, 0.04);
}
[dir="rtl"] .payment-track-card.state-overpaid {
  border-right-color: #0ea5e9;
}
[data-theme="dark"] .payment-track-card.state-overpaid {
  background-color: rgba(14, 165, 233, 0.08);
}

/* Overdue Badge & Explanation styling */
.payment-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.badge-unpaid {
  background-color: rgba(239, 68, 68, 0.12);
  color: var(--danger-color);
}

.badge-partial {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--warning-color);
}

.badge-paid {
  background-color: rgba(16, 185, 129, 0.12);
  color: var(--success-color);
}

.badge-overpaid {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

.payment-track-badge.badge-demand {
  background-color: var(--accent-light);
  color: var(--accent-color);
  border: none;
}

.payment-track-badge.badge-paid-internal {
  background-color: var(--cyan-light);
  color: var(--cyan-color);
  border: none;
}

.payment-track-desc {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.5;
}

.state-unpaid .payment-track-desc { color: var(--danger-color); }
.state-partial .payment-track-desc { color: #d97706; }
.state-paid .payment-track-desc { color: var(--success-color); }
.state-overpaid .payment-track-desc { color: #0369a1; }

.overdue-pulse-indicator {
  display: inline-flex;
  align-items: center;
  background-color: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  animation: overduePulse 2s infinite ease-in-out;
}

@keyframes overduePulse {
  0% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.98); }
  100% { opacity: 0.95; transform: scale(1); }
}

/* Calm, Neutral Pending State (Unpaid/Partial but not overdue yet) */
.payment-track-card.state-pending {
  border-inline-start-color: var(--text-secondary);
  background-color: rgba(100, 116, 139, 0.04);
}
[dir="rtl"] .payment-track-card.state-pending {
  border-right-color: var(--text-secondary);
}
[data-theme="dark"] .payment-track-card.state-pending {
  background-color: rgba(100, 116, 139, 0.08);
}

.badge-pending {
  background-color: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
}

.state-pending .payment-track-desc {
  color: var(--text-secondary);
}

/* ====================================================================
   Super Friendly Therapist Billing Summary Panel & Reminder Styles
   ==================================================================== */
.friendly-summary-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base) !important;
}
.friendly-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(124, 58, 237, 0.25) !important;
}

#externalUploadContainer {
  transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-base) !important;
}
#externalUploadContainer:hover {
  border-color: var(--accent-color) !important;
  background-color: rgba(124, 58, 237, 0.03) !important;
}
#externalUploadContainer svg {
  transition: color var(--transition-base), transform var(--transition-base) !important;
}
#externalUploadContainer:hover svg {
  color: var(--accent-color) !important;
  transform: translateY(-2px);
}

.timeline-item.reminder .timeline-dot {
  border-color: var(--accent-color) !important;
  background-color: var(--accent-color) !important;
}

/* ====================================================================
   Client Import Wizard & CSV File Uploader Stepper Styles
   ==================================================================== */
.import-stepper {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.stepper-step {
  padding: 0.25rem 0.5rem;
  transition: color var(--transition-base), opacity var(--transition-base);
  opacity: 0.5;
}

.stepper-step.active {
  color: var(--accent-color);
  opacity: 1;
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.15rem;
}

#csvDropzone {
  transition: border-color var(--transition-base), background-color var(--transition-base), transform var(--transition-base) !important;
}

#csvDropzone:hover {
  border-color: var(--accent-color) !important;
  background-color: rgba(124, 58, 237, 0.03) !important;
}

#importMappingTableBody tr:hover {
  background-color: var(--bg-tertiary);
}

#importPreviewTableBody tr:hover {
  background-color: var(--bg-tertiary);
}

/* ====================================================================
   Clinical Calendar & Appointment Scheduler Styles
   ==================================================================== */
[dir="rtl"] .calendar-controls button svg {
  transform: scaleX(-1);
}

.calendar-event-card {
  position: absolute;
  inset-inline-start: 4px;
  inset-inline-end: 4px;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  cursor: pointer;
  transition: transform var(--transition-base), box-shadow var(--transition-base), filter var(--transition-base);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  font-family: inherit;
  font-weight: 600;
  text-align: start;
  line-height: 1.25;
  box-sizing: border-box;
}

.calendar-event-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  z-index: 20;
  filter: brightness(0.95);
}

/* Event status colors conforming to Google Calendar API & Outlook */
/* Scheduled (מתוזמן) - Blueberry Blue */
.event-status-scheduled {
  background-color: rgba(63, 81, 181, 0.1);
  border-inline-start: 4px solid #3f51b5;
  color: #3f51b5;
}
[data-theme="dark"] .event-status-scheduled {
  background-color: rgba(63, 81, 181, 0.2);
  color: #7986cb;
}

/* Completed (הושלם) - Basil Green */
.event-status-completed {
  background-color: rgba(11, 128, 67, 0.1);
  border-inline-start: 4px solid #0b8043;
  color: #0b8043;
}
[data-theme="dark"] .event-status-completed {
  background-color: rgba(11, 128, 67, 0.2);
  color: #34a853;
}

/* Late Cancelled / No-Show Billable (היעדרות לחיוב) - Tomato Red */
.event-status-noshow-billable {
  background-color: rgba(213, 0, 0, 0.1);
  border-inline-start: 4px solid #d50000;
  color: #d50000;
}
[data-theme="dark"] .event-status-noshow-billable {
  background-color: rgba(213, 0, 0, 0.2);
  color: #ff5252;
}

/* Excused / No-Show Excused (היעדרות מאושרת) - Graphite Gray */
.event-status-noshow-excused {
  background-color: rgba(97, 97, 97, 0.12);
  border-inline-start: 4px solid #616161;
  color: #616161;
}
[data-theme="dark"] .event-status-noshow-excused {
  background-color: rgba(97, 97, 97, 0.22);
  color: #9e9e9e;
}

/* Form Styles inside Modals */
.reschedule-option-card:hover {
  background-color: var(--bg-primary);
  border-color: var(--accent-color) !important;
}

.reschedule-option-card input[type="radio"]:checked + div span {
  font-weight: 800 !important;
}

/* Calendar View Toggle Segmented Controls */
.btn-view-mode {
  transition: all var(--transition-base);
}
.btn-view-mode:not(.active):hover {
  background: rgba(0,0,0,0.03) !important;
  color: var(--text-primary) !important;
}

/* Month Grid Layout */
.calendar-month-cell {
  background-color: var(--bg-secondary);
  border-block-end: 1px solid var(--border-color);
  border-inline-end: 1px solid var(--border-color);
  padding: 0.4rem;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  position: relative;
  box-sizing: border-box;
  transition: background-color var(--transition-base);
}

.calendar-month-cell:hover {
  background-color: var(--bg-primary);
}

/* Outside month cells */
.calendar-month-cell.month-cell-outside {
  background-color: var(--bg-primary);
  opacity: 0.45;
}

.month-day-number {
  align-self: flex-end;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-secondary);
  margin-block-end: 0.1rem;
}

/* Month Event Badges */
.month-event-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  transition: transform var(--transition-base), filter var(--transition-base);
  border-inline-start-width: 3px;
  border-inline-start-style: solid;
}

.month-event-badge:hover {
  transform: translateY(-0.5px);
  filter: brightness(0.95);
}

.month-badge-scheduled {
  background-color: rgba(63, 81, 181, 0.1);
  border-inline-start-color: #3f51b5;
  color: #3f51b5;
}
[data-theme="dark"] .month-badge-scheduled {
  background-color: rgba(63, 81, 181, 0.2);
  color: #7986cb;
}

.month-badge-completed {
  background-color: rgba(11, 128, 67, 0.1);
  border-inline-start-color: #0b8043;
  color: #0b8043;
}
[data-theme="dark"] .month-badge-completed {
  background-color: rgba(11, 128, 67, 0.2);
  color: #34a853;
}

.month-badge-noshow-billable {
  background-color: rgba(213, 0, 0, 0.1);
  border-inline-start-color: #d50000;
  color: #d50000;
}
[data-theme="dark"] .month-badge-noshow-billable {
  background-color: rgba(213, 0, 0, 0.2);
  color: #ff5252;
}

.month-badge-noshow-excused {
  background-color: rgba(97, 97, 97, 0.12);
  border-inline-start-color: #616161;
  color: #616161;
}
[data-theme="dark"] .month-badge-noshow-excused {
  background-color: rgba(97, 97, 97, 0.22);
  color: #9e9e9e;
}

/* Drag and Drop premium animations & states */
.calendar-event-card {
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
  cursor: grab;
}
.calendar-event-card:active {
  cursor: grabbing;
}
.calendar-event-card.dragging {
  opacity: 0.55 !important;
  transform: scale(0.97);
  box-shadow: var(--shadow-lg) !important;
  border: 2px dashed var(--accent-color) !important;
}

.calendar-day-column {
  transition: background-color var(--transition-base);
}

.calendar-month-cell {
  transition: background-color var(--transition-base);
}

.month-event-badge {
  transition: opacity var(--transition-base), transform var(--transition-base);
  cursor: grab;
}
.month-event-badge:active {
  cursor: grabbing;
}

/* ====================================================================
   Calendar (MindBalance Calendar — high-fidelity design)
   All selectors scoped under .cal-page so they don't bleed into other
   tabs. Drawer (.side-drawer) is global because it's reusable.
   ==================================================================== */

.cal-page {
  display: grid;
  grid-template-rows: auto 1fr;
  block-size: 100vh;
  min-block-size: 0;
  overflow: hidden;
  background: var(--bg-primary);
  font-family: var(--font-family);
}
[dir="rtl"] .cal-page { font-family: 'Assistant', 'Rubik', system-ui, sans-serif; }

/* === Header === */
.cal-page .cal-header {
  padding: 22px clamp(20px, 3vw, 36px) 14px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
  border-block-end: 1px solid var(--hairline);
  background: var(--bg-primary);
}
.cal-page .cal-title-block {
  display: flex; flex-direction: column; gap: 4px;
  min-inline-size: 200px;
}
.cal-page .cal-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 500;
}
.cal-page .cal-month-title {
  margin: 0;
  font-size: 26px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1;
  display: flex; align-items: baseline; gap: 10px;
  color: var(--text-primary);
}
.cal-page .cal-month-title .cal-year {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  color: var(--text-soft);
  font-size: 22px;
}

.cal-page .cal-nav-cluster,
.cal-page .cal-views {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
}
.cal-page .cal-nav-cluster button,
.cal-page .cal-views button {
  border: none; background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .cal-nav-cluster button:hover,
.cal-page .cal-views button:hover { color: var(--text-primary); }
.cal-page .cal-nav-cluster button.is-today {
  background: var(--bg-primary);
  box-shadow: var(--shadow-sm);
}
.cal-page .cal-nav-cluster svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cal-page .cal-views button.is-active { background: var(--text-primary); color: var(--bg-primary); }
.cal-page .cal-header-spacer { flex: 1; }

.cal-page .cal-search {
  position: relative;
  inline-size: 220px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.cal-page .cal-search:focus-within { border-color: var(--border-color); }
.cal-page .cal-search svg {
  position: absolute; inset-inline-end: 14px; inset-block-start: 50%;
  transform: translateY(-50%); width: 14px; height: 14px;
  stroke: var(--text-soft); fill: none; stroke-width: 1.7; pointer-events: none;
}
.cal-page .cal-search input {
  inline-size: 100%; border: none; background: transparent;
  padding-block: 10px; padding-inline-start: 14px; padding-inline-end: 36px;
  font: 400 13px/1 var(--font-family);
  color: var(--text-primary); outline: none;
}
.cal-page .cal-search input::placeholder { color: var(--text-soft); }

.cal-page .cal-new-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--text-primary); color: var(--bg-primary);
  border: none; border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cal-page .cal-new-btn:hover { background: var(--text-secondary); transform: translateY(-1px); }
.cal-page .cal-new-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* === Body grid === */
.cal-page .cal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-block-size: 0;
}

/* === Side rail === */
.cal-page .cal-rail {
  border-inline-end: 1px solid var(--hairline);
  padding: 22px 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
  background: var(--bg-primary);
}
.cal-page .cal-rail h3 {
  margin: 0 0 10px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
}

/* mini calendar */
.cal-page .mini-cal { font-size: 12px; }
.cal-page .mini-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 10px;
}
.cal-page .mini-month { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.cal-page .mini-nav { display: flex; gap: 2px; }
.cal-page .mini-nav button {
  inline-size: 22px; block-size: 22px;
  border: none; background: transparent;
  color: var(--text-soft); cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .mini-nav button:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.cal-page .mini-nav svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.cal-page .mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; user-select: none; touch-action: none; }
.cal-page .mini-dow {
  text-align: center; font-size: 10.5px; color: var(--text-soft);
  padding: 4px 0; font-weight: 600; letter-spacing: 0.04em;
}
.cal-page .mini-day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 11.5px; color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .mini-day:hover { background: var(--bg-tertiary); }
.cal-page .mini-day.is-out { color: var(--text-soft); opacity: 0.4; }
.cal-page .mini-day.is-today { background: var(--accent-light); color: var(--accent-hover); font-weight: 600; }
.cal-page .mini-day.in-week { background: var(--bg-tertiary); color: var(--text-primary); }
.cal-page .mini-day.in-week.is-today { background: var(--accent-color); color: var(--bg-primary); }
.cal-page .mini-day.has-events::after {
  content: ''; position: absolute; inset-block-end: 2px;
  inline-size: 3px; block-size: 3px; border-radius: 50%;
  background: var(--text-soft);
}
.cal-page .mini-day.in-week.has-events::after { background: var(--text-primary); }
.cal-page .mini-day.in-week.is-today.has-events::after { background: var(--bg-primary); }
/* Multi-day range selection (committed + while dragging) */
.cal-page .mini-day.is-selected,
.cal-page .mini-day.is-selecting {
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 0;
  font-weight: 600;
}
.cal-page .mini-day.is-selected.is-today,
.cal-page .mini-day.is-selecting.is-today {
  background: var(--accent-color); color: var(--bg-primary);
}

/* legend */
.cal-page .legend-list { display: flex; flex-direction: column; gap: 8px; }
.cal-page .legend-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 4px;
  border-radius: 6px;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .legend-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.cal-page .legend-swatch {
  inline-size: 10px; block-size: 10px; border-radius: 3px; flex-shrink: 0;
}

/* tweaks */
.cal-page .tweaks-group { display: flex; flex-direction: column; gap: 12px; }
.cal-page .tweak { display: flex; flex-direction: column; gap: 6px; }
.cal-page .tweak-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.cal-page .seg {
  display: flex; gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 2px;
}
.cal-page .seg button {
  flex: 1;
  border: none; background: transparent;
  padding: 6px 8px;
  border-radius: 6px;
  font: 500 11.5px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .seg button:hover { color: var(--text-primary); }
.cal-page .seg button.is-active { background: var(--bg-primary); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* === Calendar main wrap === */
.cal-page .cal-wrap {
  overflow: hidden;
  display: flex; flex-direction: column;
  min-inline-size: 0;
}

/* Time-view (day / workweek / week) */
.cal-page .cal-wrap[data-view="month"] .time-view,
.cal-page .cal-wrap[data-view="agenda"] .time-view { display: none; }
.cal-page .cal-wrap[data-view="day"] .time-view,
.cal-page .cal-wrap[data-view="workweek"] .time-view,
.cal-page .cal-wrap[data-view="week"] .time-view,
.cal-page .cal-wrap[data-view="custom"] .time-view { display: flex; flex-direction: column; flex: 1; min-block-size: 0; }

.cal-page .cal-wrap[data-view="month"] .month-view  { display: flex; }
.cal-page .cal-wrap[data-view="agenda"] .agenda-view { display: block; }

/* Day header row */
.cal-page .cal-headrow {
  display: grid;
  grid-template-columns: var(--time-col) repeat(var(--day-count, 7), 1fr);
  border-block-end: 1px solid var(--hairline);
  background: var(--bg-primary);
  position: sticky; inset-block-start: 0; z-index: 5;
}
.cal-page .cal-headrow .corner { border-inline-end: 1px solid var(--hairline); }
.cal-page .day-head {
  padding: 12px 14px;
  border-inline-end: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer;
  transition: background var(--transition-base);
}
.cal-page .day-head:hover { background: var(--bg-secondary); }
.cal-page .day-head:last-child { border-inline-end: none; }
.cal-page .day-head .dow {
  font-size: 11.5px; color: var(--text-soft); font-weight: 500;
  letter-spacing: 0.04em;
}
.cal-page .day-head .dnum {
  font-size: 20px; font-weight: 500; color: var(--text-primary);
  letter-spacing: -0.02em; line-height: 1.1;
}
.cal-page .day-head.is-today .dnum { color: var(--accent-hover); }
.cal-page .day-head.is-today .dnum::before {
  content: ''; display: inline-block;
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--accent-color);
  margin-inline-end: 6px;
  vertical-align: middle;
  transform: translateY(-2px);
}
.cal-page .day-head.is-weekend { background: linear-gradient(180deg, hsla(28, 50%, 94%, 0.5), transparent); }
.cal-page .day-head.is-weekend .dow { color: var(--c-clay-stripe); }

/* Time grid */
.cal-page .cal-scroll {
  overflow-y: auto;
  flex: 1;
  background: var(--bg-secondary);
  min-block-size: 0;
}
.cal-page .cal-grid {
  display: grid;
  grid-template-columns: var(--time-col) repeat(var(--day-count, 7), 1fr);
  position: relative;
}

.cal-page .time-col {
  border-inline-end: 1px solid var(--hairline);
  background: var(--bg-primary);
  position: sticky; inset-inline-start: 0; z-index: 2;
}
.cal-page .time-label {
  block-size: calc(var(--slot-h) * 2);
  padding: 4px 8px;
  font-size: 10.5px;
  color: var(--text-soft);
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.cal-page .day-col {
  border-inline-end: 1px solid var(--hairline);
  position: relative;
  background: var(--bg-primary);
}
.cal-page .day-col:last-child { border-inline-end: none; }
.cal-page .day-col.is-weekend { background: hsl(28 35% 96%); }

.cal-page .day-col .slot {
  block-size: var(--slot-h);
  border-block-end: 1px solid var(--hairline);
  cursor: pointer;
  transition: background var(--transition-base);
  position: relative;
}
.cal-page .day-col .slot.is-half {
  border-block-end-style: dashed;
  border-block-end-color: var(--hairline);
  opacity: 0.7;
}
.cal-page .day-col .slot:hover { background: hsla(108, 16%, 88%, 0.4); }
.cal-page .day-col .slot:hover::after {
  content: '+ פגישה';
  position: absolute; pointer-events: none;
  font-size: 10.5px; color: var(--accent-hover);
  padding: 2px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--accent-light);
  border-radius: 4px;
  margin: 4px;
  z-index: 1;
}
[lang="en"] .cal-page .day-col .slot:hover::after { content: '+ Session'; }

/* Now-line */
.cal-page .now-line {
  position: absolute;
  inset-inline: 0;
  block-size: 1.5px;
  background: var(--c-clay-stripe);
  z-index: 4;
  pointer-events: none;
}
.cal-page .now-line::before {
  content: '';
  position: absolute;
  inset-inline-start: -5px;
  inset-block-start: -4px;
  inline-size: 9px; block-size: 9px;
  border-radius: 50%;
  background: var(--c-clay-stripe);
}

/* Events (time-grid) */
.cal-page .event {
  position: absolute;
  inset-inline: 4px;
  border-radius: var(--event-radius);
  padding: 7px 10px 6px;
  color: hsl(40 8% 16%);
  cursor: pointer;
  z-index: 3;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex; flex-direction: column; gap: 2px;
  background: var(--c-sage);
}
.cal-page .event:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); z-index: 6; }
.cal-page .event .e-time {
  font-size: 10.5px; color: rgba(38,37,34,0.55);
  font-variant-numeric: tabular-nums;
}
.cal-page .event .e-title {
  font-size: 13px; font-weight: 600; color: hsl(40 8% 14%);
  letter-spacing: -0.005em; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Resize handles on the top/bottom edge of a time-grid event */
.cal-page .event .e-resize {
  position: absolute;
  inset-inline: 0;
  block-size: 7px;
  cursor: ns-resize;
  z-index: 4;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.cal-page .event .e-resize-top { inset-block-start: -1px; }
.cal-page .event .e-resize-bottom { inset-block-end: -1px; }
.cal-page .event:hover .e-resize { opacity: 1; }
/* subtle grip line so the handle is discoverable on hover */
.cal-page .event:hover .e-resize::after {
  content: '';
  position: absolute;
  inset-inline: 50% auto;
  inline-size: 22px; block-size: 3px;
  transform: translateX(50%);
  border-radius: 999px;
  background: rgba(38,37,34,0.28);
}
.cal-page .event .e-resize-top::after { inset-block-start: 1px; }
.cal-page .event .e-resize-bottom::after { inset-block-end: 1px; }
body.cal-resizing { cursor: ns-resize !important; user-select: none; }
body.cal-resizing .cal-page .event { transition: none; } /* snappy live resize */
.cal-page .event .e-resize { touch-action: none; }      /* don't scroll while resizing on touch */

/* Pointer-based move-drag (mouse + touch) */
.cal-page .event { touch-action: none; }                 /* allow drag-move on touch */
.cal-page .event.is-dragging { opacity: 0.5; box-shadow: var(--shadow-md); }
body.cal-dragging { user-select: none; cursor: grabbing; }

/* Compact events (≤45min) — tighter so text never clips mid-line */
.cal-page .event.is-compact {
  padding: 3px 8px;
  gap: 0;
  justify-content: center;
}
.cal-page .event.is-compact .e-time { font-size: 9.5px; line-height: 1.15; }
.cal-page .event.is-compact .e-title { font-size: 11.5px; line-height: 1.15; }
.cal-page .event .e-meta {
  font-size: 11px; color: rgba(38,37,34,0.6);
  line-height: 1.2;
  display: flex; align-items: center; gap: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-page .event .e-meta svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 1.7; flex-shrink: 0; }
.cal-page .event .e-dot {
  position: absolute;
  inset-block-start: 8px; inset-inline-end: 8px;
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--success-color);
  opacity: 0.85;
}
.cal-page .event .e-dot.is-due  { background: var(--warning-color); }
.cal-page .event .e-dot.is-late { background: var(--c-clay-stripe); }

/* Event color variants — by client */
.cal-page .event[data-color="peach"]  { background: var(--c-peach); }
.cal-page .event[data-color="butter"] { background: var(--c-butter); }
.cal-page .event[data-color="sky"]    { background: var(--c-sky); }
.cal-page .event[data-color="lilac"]  { background: var(--c-lilac); }
.cal-page .event[data-color="sage"]   { background: var(--c-sage); }
.cal-page .event[data-color="teal"]   { background: var(--c-teal); }
.cal-page .event[data-color="clay"]   { background: var(--c-clay); color: hsl(28 30% 20%); }
.cal-page .event[data-color="rose"]   { background: var(--c-rose); }
/* Non-client kinds */
.cal-page .event[data-kind="break"] {
  background: var(--c-break);
  border: 1px dashed rgba(140,120,90,0.4);
  box-shadow: none;
}
.cal-page .event[data-kind="break"] .e-title {
  font-style: italic; color: hsl(40 8% 30%); font-weight: 500;
}
.cal-page .event[data-kind="personal"] {
  background: var(--c-personal);
  border: 1px dashed rgba(120,100,140,0.35);
  box-shadow: none;
}
.cal-page .event[data-kind="personal"] .e-title {
  font-style: italic; color: hsl(270 10% 30%); font-weight: 500;
}
.cal-page .event[data-kind="supervision"] { background: var(--c-supervision); }

/* Style tweak: stripe variant */
.cal-page .cal-wrap[data-style="stripe"] .event {
  background: transparent !important;
  box-shadow: none;
  border: none;
  border-inline-start: 3px solid var(--event-stripe, var(--c-sage-stripe));
  padding-inline-start: 10px;
  backdrop-filter: blur(2px);
}
.cal-page .cal-wrap[data-style="stripe"] .event::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--event-radius);
  opacity: 0.55; z-index: -1;
  background: inherit;
}
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="peach"]  { --event-stripe: var(--c-peach-stripe);  background: #FBEADD; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="butter"] { --event-stripe: var(--c-butter-stripe); background: #FBF1D4; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="sky"]    { --event-stripe: var(--c-sky-stripe);    background: #E3ECF3; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="lilac"]  { --event-stripe: var(--c-lilac-stripe);  background: #EBE2F0; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="sage"]   { --event-stripe: var(--c-sage-stripe);   background: #DEE6D7; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="teal"]   { --event-stripe: var(--c-teal-stripe);   background: #D7E3E1; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="clay"]   { --event-stripe: var(--c-clay-stripe);   background: #EFD9C2; }
.cal-page .cal-wrap[data-style="stripe"] .event[data-color="rose"]   { --event-stripe: var(--c-rose-stripe);   background: #F4DEDE; }

/* Color-by-kind override */
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="regular"]     { background: var(--k-regular); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="long"]        { background: var(--k-long); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="intake"]      { background: var(--k-intake); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="couple"]      { background: var(--k-couple); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="online"]      { background: var(--k-online); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="supervision"] { background: var(--k-supervision); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="break"]       { background: var(--k-break); }
.cal-page .cal-wrap[data-color="kind"] .event[data-kind="personal"]    { background: var(--k-personal); }

/* Empty-day suggestion */
.cal-page .day-col.is-empty-suggest::before {
  content: '';
  position: absolute;
  inset: 30% 14% 30%;
  border-radius: 18px;
  background: radial-gradient(ellipse at center, hsla(108, 16%, 78%, 0.4), transparent 70%);
  z-index: 1;
  pointer-events: none;
}
.cal-page .empty-pill {
  position: absolute;
  inset-block-start: 42%;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  font: 500 11.5px/1 var(--font-family);
  color: var(--text-secondary);
  z-index: 2;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
}
[dir="rtl"] .cal-page .empty-pill { transform: translateX(50%); }
.cal-page .empty-pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.cal-page .empty-pill:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--border-color); }

/* Density tweak */
.cal-page .cal-wrap[data-density="airy"]    { --slot-h: 38px; }
.cal-page .cal-wrap[data-density="compact"] { --slot-h: 22px; }
.cal-page .cal-wrap[data-density="compact"] .day-col .slot:hover::after { display: none; }

/* === Month view === */
.cal-page .month-view {
  display: none;
  flex: 1;
  overflow: auto;
  background: var(--bg-secondary);
  flex-direction: column;
  min-block-size: 0;
}
.cal-page .month-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-block-end: 1px solid var(--hairline);
  background: var(--bg-primary);
  position: sticky; inset-block-start: 0; z-index: 4;
}
.cal-page .month-dow {
  padding: 10px 14px;
  font-size: 11.5px; color: var(--text-soft);
  font-weight: 600; letter-spacing: 0.06em;
  border-inline-end: 1px solid var(--hairline);
}
.cal-page .month-dow:last-child { border-inline-end: none; }
.cal-page .month-dow.is-weekend { color: var(--c-clay-stripe); background: hsl(28 35% 96%); }

.cal-page .month-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(120px, 1fr);
  background: var(--hairline);
  gap: 1px;
}
.cal-page .mcell {
  background: var(--bg-primary);
  padding: 8px 10px;
  display: flex; flex-direction: column;
  gap: 6px;
  min-inline-size: 0;
  min-block-size: 0;
  cursor: pointer;
  transition: background var(--transition-base);
  position: relative;
}
.cal-page .mcell:hover { background: var(--bg-secondary); }
.cal-page .mcell.is-weekend { background: hsl(28 35% 97%); }
.cal-page .mcell.is-weekend:hover { background: hsl(28 35% 95%); }
.cal-page .mcell.is-out { background: var(--bg-secondary); }
.cal-page .mcell.is-out .mcell-num { color: var(--text-soft); opacity: 0.5; }
.cal-page .mcell.is-out .mevent { opacity: 0.45; }

.cal-page .mcell-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 2px;
}
.cal-page .mcell-num {
  font-size: 13px; font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  inline-size: 24px; block-size: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-page .mcell.is-today .mcell-num {
  background: var(--accent-color); color: var(--bg-primary);
}
.cal-page .mcell-count {
  font-size: 10.5px; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.cal-page .mevents {
  display: flex; flex-direction: column; gap: 2px;
  min-block-size: 0; overflow: hidden;
}
.cal-page .mevent {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 11.5px;
  color: hsl(40 8% 18%);
  cursor: pointer;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: transform var(--transition-base);
  background: var(--c-sage);
}
.cal-page .mevent:hover { transform: translateX(2px); }
[dir="rtl"] .cal-page .mevent:hover { transform: translateX(-2px); }
.cal-page .mevent .me-time {
  font-size: 10.5px; color: rgba(38,37,34,0.55);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.cal-page .mevent .me-title {
  overflow: hidden; text-overflow: ellipsis;
  font-weight: 500;
}
.cal-page .mevent[data-color="peach"]  { background: var(--c-peach); }
.cal-page .mevent[data-color="butter"] { background: var(--c-butter); }
.cal-page .mevent[data-color="sky"]    { background: var(--c-sky); }
.cal-page .mevent[data-color="lilac"]  { background: var(--c-lilac); }
.cal-page .mevent[data-color="sage"]   { background: var(--c-sage); }
.cal-page .mevent[data-color="teal"]   { background: var(--c-teal); }
.cal-page .mevent[data-color="clay"]   { background: var(--c-clay); }
.cal-page .mevent[data-color="rose"]   { background: var(--c-rose); }
.cal-page .mevent[data-kind="break"]    { background: var(--c-break); font-style: italic; }
.cal-page .mevent[data-kind="personal"] { background: var(--c-personal); font-style: italic; }
.cal-page .mevent[data-kind="supervision"] { background: var(--c-supervision); }
.cal-page .mevent.is-more {
  background: transparent;
  color: var(--text-soft);
  font-weight: 500;
  padding-inline-start: 7px;
}

/* === Agenda view === */
.cal-page .agenda-view {
  display: none;
  flex: 1;
  overflow: auto;
  padding-block: 16px 60px;
  padding-inline: clamp(20px, 4vw, 48px);
}
.cal-page .agenda-list { max-inline-size: 760px; margin: 0 auto; }

.cal-page .agenda-day {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-block-end: 1px solid var(--hairline);
  align-items: flex-start;
}
.cal-page .agenda-day:last-child { border-block-end: 0; }
.cal-page .agenda-day.is-today .agenda-date { color: var(--accent-hover); }
.cal-page .agenda-day.is-weekend .agenda-date small { color: var(--c-clay-stripe); }
.cal-page .agenda-day.is-empty .agenda-items {
  color: var(--text-soft); font-size: 13px; font-style: italic; padding: 6px 0;
}
.cal-page .agenda-date {
  position: sticky; inset-block-start: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-page .agenda-date .ag-dnum {
  font-family: var(--font-serif); font-style: italic; font-weight: 400;
  font-size: 42px; line-height: 1; letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cal-page .agenda-day.is-today .agenda-date .ag-dnum { color: var(--accent-hover); }
.cal-page .agenda-date small {
  font-size: 12px; color: var(--text-soft); letter-spacing: 0.04em;
  text-transform: uppercase; font-weight: 600;
}
.cal-page .agenda-date .ag-month {
  font-size: 12px; color: var(--text-soft);
  margin-block-start: 2px;
}

.cal-page .agenda-items { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.cal-page .ag-event {
  display: grid;
  grid-template-columns: 86px minmax(0,1fr) auto auto;
  gap: 18px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-inline-start: 3px solid var(--ag-stripe, var(--c-sage-stripe));
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cal-page .ag-event:hover { background: var(--bg-primary); transform: translateY(-1px); }
.cal-page .ag-event[data-color="peach"]  { --ag-stripe: var(--c-peach-stripe); }
.cal-page .ag-event[data-color="butter"] { --ag-stripe: var(--c-butter-stripe); }
.cal-page .ag-event[data-color="sky"]    { --ag-stripe: var(--c-sky-stripe); }
.cal-page .ag-event[data-color="lilac"]  { --ag-stripe: var(--c-lilac-stripe); }
.cal-page .ag-event[data-color="sage"]   { --ag-stripe: var(--c-sage-stripe); }
.cal-page .ag-event[data-color="teal"]   { --ag-stripe: var(--c-teal-stripe); }
.cal-page .ag-event[data-color="clay"]   { --ag-stripe: var(--c-clay-stripe); }
.cal-page .ag-event[data-color="rose"]   { --ag-stripe: var(--c-rose-stripe); }
.cal-page .ag-event[data-kind="break"],
.cal-page .ag-event[data-kind="personal"] {
  --ag-stripe: hsl(40 8% 70%);
  background: transparent;
  border-style: dashed;
}
.cal-page .ag-event[data-kind="break"] .ag-title,
.cal-page .ag-event[data-kind="personal"] .ag-title {
  font-style: italic; color: var(--text-secondary); font-weight: 500;
}
.cal-page .ag-time {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.cal-page .ag-time small {
  display: block; font-size: 11px; color: var(--text-soft);
  font-weight: 400;
}
.cal-page .ag-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; color: var(--text-primary); }
.cal-page .ag-meta  { font-size: 12px; color: var(--text-soft); margin-block-start: 3px; }
.cal-page .ag-pay {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: var(--success-light); color: var(--success-color);
  font-weight: 500; white-space: nowrap;
}
.cal-page .ag-pay.is-due  { background: var(--warning-light); color: var(--warning-color); }
.cal-page .ag-pay.is-late { background: hsl(20 40% 90%); color: hsl(20 38% 38%); }
.cal-page .ag-pay.is-none { background: transparent; color: transparent; }
.cal-page .ag-chev { color: var(--text-soft); display: grid; place-items: center; }
.cal-page .ag-chev svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.7; }
[dir="rtl"] .cal-page .ag-chev svg { transform: scaleX(-1); }

/* Responsive */
@media (max-width: 1100px) {
  .cal-page .cal-body { grid-template-columns: 1fr; }
  .cal-page .cal-rail { display: none; }
}
@media (max-width: 700px) {
  .cal-page .month-grid { grid-auto-rows: minmax(82px, 1fr); }
  .cal-page .mcell { padding: 5px 6px; gap: 2px; }
  .cal-page .mcell-num { inline-size: 20px; block-size: 20px; font-size: 11.5px; }
  .cal-page .mevent .me-time { display: none; }
  .cal-page .agenda-day { grid-template-columns: 1fr; gap: 12px; }
  .cal-page .agenda-date { position: static; flex-direction: row; align-items: baseline; gap: 10px; }
  .cal-page .agenda-date .ag-dnum { font-size: 30px; }
  .cal-page .ag-event { grid-template-columns: 70px 1fr auto; }
  .cal-page .ag-event .ag-chev { display: none; }
}

/* ====================================================================
   Reusable side-drawer (global — used by calendar, can be reused elsewhere)
   ==================================================================== */
.side-drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(38, 37, 34, 0.18);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.side-drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.side-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: min(420px, 100vw);
  background: var(--bg-primary);
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
[dir="rtl"] .side-drawer { transform: translateX(-100%); }
.side-drawer.is-open { transform: translateX(0) !important; }

.side-drawer .drawer-head {
  padding: 24px 26px 18px;
  border-block-end: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 14px;
}
.side-drawer .drawer-head .drawer-close {
  inline-size: 36px; block-size: 36px;
  margin-inline-start: auto;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid; place-items: center;
  transition: background var(--transition-base), color var(--transition-base);
}
.side-drawer .drawer-head .drawer-close:hover {
  background: var(--bg-secondary); color: var(--text-primary);
}
.side-drawer .drawer-head .drawer-close svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2;
}
.side-drawer .drawer-avatar {
  inline-size: 48px; block-size: 48px;
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
  background: var(--c-lilac-solid);
  display: grid; place-items: center;
  font: 600 16px/1 var(--font-family);
  color: hsl(40 10% 18%);
  flex-shrink: 0;
}
.side-drawer .drawer-name {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text-primary);
}
.side-drawer .drawer-sub {
  font-size: 13px; color: var(--text-soft); margin-block-start: 2px;
}
.side-drawer .drawer-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
  display: flex; flex-direction: column; gap: 22px;
}
.side-drawer .drawer-field { display: flex; flex-direction: column; gap: 5px; }
.side-drawer .drawer-field-label {
  font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
}
.side-drawer .drawer-field-value {
  font-size: 14.5px; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.side-drawer .drawer-field-value svg {
  width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6;
  color: var(--text-soft);
}
.side-drawer .drawer-field-2col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.side-drawer .drawer-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12px; color: var(--text-secondary); font-weight: 500;
}
.side-drawer .drawer-chip .chip-dot {
  inline-size: 6px; block-size: 6px; border-radius: 50%;
  background: var(--success-color);
}
.side-drawer .drawer-chip.is-due  .chip-dot { background: var(--warning-color); }
.side-drawer .drawer-chip.is-late .chip-dot { background: var(--c-clay-stripe); }
.side-drawer .drawer-note {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.55;
}
.side-drawer .drawer-history-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 0;
  border-block-end: 1px dashed var(--hairline);
  font-size: 12.5px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.side-drawer .drawer-history-row:last-child { border-block-end: none; }
.side-drawer .drawer-history-row .dh-meta { color: var(--text-soft); font-size: 11.5px; text-align: end; }
.side-drawer .drawer-actions {
  padding: 18px 26px;
  border-block-start: 1px solid var(--hairline);
  display: flex; gap: 10px;
}
.side-drawer .drawer-actions .drawer-btn-soft {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 11px 14px;
  font: 500 13px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.side-drawer .drawer-actions .drawer-btn-soft:hover {
  background: var(--bg-primary); color: var(--text-primary);
}
.side-drawer .drawer-actions .drawer-btn-primary {
  flex: 1.4;
  background: var(--text-primary); color: var(--bg-primary);
  border: none; border-radius: 999px;
  padding: 11px 14px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base);
}
.side-drawer .drawer-actions .drawer-btn-primary:hover { background: var(--text-secondary); }

/* ====================================================================
   Appointment form + late-reschedule alert (calendar design language)
   These restyle the existing #appointmentFormModal and
   #rescheduleAlertModal dialogs by adding a .cal-modal modifier to them.
   ==================================================================== */

.cal-modal.modal-overlay {
  background: rgba(38, 37, 34, 0.18);
  backdrop-filter: blur(2px);
}
.cal-modal .cal-modal-card {
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  inline-size: min(560px, 95vw);
  max-block-size: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-family);
}
.cal-modal.is-wide .cal-modal-card { inline-size: min(620px, 95vw); }

.cal-modal-head {
  padding: 22px 26px 16px;
  border-block-end: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-primary);
}
.cal-modal-head .cal-modal-eyebrow {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
  margin-block-end: 4px;
}
.cal-modal-head .cal-modal-title {
  margin: 0;
  font-size: 18px; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.01em;
}
.cal-modal-head .cal-modal-title-block { flex: 1; min-inline-size: 0; }
.cal-modal-head .cal-modal-close {
  inline-size: 36px; block-size: 36px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid; place-items: center;
  transition: background var(--transition-base), color var(--transition-base);
  margin-inline-start: auto;
  flex-shrink: 0;
}
.cal-modal-head .cal-modal-close:hover {
  background: var(--bg-secondary); color: var(--text-primary);
}
.cal-modal-head .cal-modal-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.cal-modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  flex: 1;
  display: flex; flex-direction: column; gap: 18px;
  background: var(--bg-primary);
}

.cal-form-section {
  display: flex; flex-direction: column; gap: 10px;
}
.cal-form-section-title {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
  margin: 0 0 2px;
}
.cal-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cal-form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.cal-form-row.two-one { grid-template-columns: 2fr 1fr; }
.cal-form-field { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; position: relative; }
.cal-form-label {
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.cal-form-input,
.cal-form-select,
.cal-form-textarea {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition-base), background var(--transition-base);
  inline-size: 100%;
}
.cal-form-input::placeholder,
.cal-form-textarea::placeholder { color: var(--text-soft); }
.cal-form-input:focus,
.cal-form-select:focus,
.cal-form-textarea:focus {
  border-color: var(--accent-color);
  background: var(--bg-primary);
}
.cal-form-textarea { resize: vertical; min-block-size: 64px; font-family: var(--font-family); }
.cal-form-help {
  font-size: 11.5px; color: var(--text-soft); margin-block-start: 2px;
}

/* Kind pill picker */
.cal-kind-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cal-kind-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 12px;
  font: 500 12px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.cal-kind-pill:hover { color: var(--text-primary); }
.cal-kind-pill.is-active {
  background: var(--accent-light);
  border-color: var(--accent-color);
  color: var(--accent-hover);
}
.cal-kind-pill .pill-swatch {
  inline-size: 10px; block-size: 10px; border-radius: 3px;
}

/* Color swatch picker */
.cal-color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cal-color-swatch {
  inline-size: 28px; block-size: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--bg-tertiary);
  cursor: pointer;
  padding: 0;
  outline-offset: 2px;
  transition: transform var(--transition-base), border-color var(--transition-base);
}
.cal-color-swatch:hover { transform: scale(1.08); }
.cal-color-swatch.is-active {
  border-color: var(--text-primary);
}
.cal-color-swatch[data-val="auto"] {
  background: linear-gradient(135deg, var(--c-peach) 0%, var(--c-sage) 50%, var(--c-lilac) 100%);
}
.cal-color-swatch[data-val="peach"]  { background: var(--c-peach); }
.cal-color-swatch[data-val="butter"] { background: var(--c-butter); }
.cal-color-swatch[data-val="sky"]    { background: var(--c-sky); }
.cal-color-swatch[data-val="lilac"]  { background: var(--c-lilac); }
.cal-color-swatch[data-val="sage"]   { background: var(--c-sage); }
.cal-color-swatch[data-val="teal"]   { background: var(--c-teal); }
.cal-color-swatch[data-val="clay"]   { background: var(--c-clay); }
.cal-color-swatch[data-val="rose"]   { background: var(--c-rose); }

/* Inline notice (calm replacement for the old red banner) */
.cal-inline-notice {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-light);
  border: 1px solid var(--accent-color);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--accent-hover);
  font-weight: 500;
}
.cal-inline-notice svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  flex-shrink: 0;
}

/* Recurrence panel */
.cal-form-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.cal-form-toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer; user-select: none;
}
.cal-form-toggle input[type="checkbox"] {
  inline-size: 16px; block-size: 16px; accent-color: var(--accent-color);
  cursor: pointer;
}

/* Reschedule history list */
.cal-history {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.cal-history-title {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.cal-history-list {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-secondary);
  max-block-size: 120px; overflow-y: auto;
}

/* Modal footer */
.cal-modal-foot {
  padding: 16px 26px;
  border-block-start: 1px solid var(--hairline);
  display: flex; gap: 10px; align-items: center;
  background: var(--bg-primary);
}
.cal-modal-foot .cal-modal-foot-spacer { flex: 1; }

.cal-btn {
  border: none; cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font: 500 13px/1 var(--font-family);
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
  display: inline-flex; align-items: center; gap: 6px;
}
.cal-btn-primary  { background: var(--text-primary); color: var(--bg-primary); }
.cal-btn-primary:hover { background: var(--text-secondary); transform: translateY(-1px); }
.cal-btn-soft {
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--hairline);
}
.cal-btn-soft:hover { background: var(--bg-primary); color: var(--text-primary); }
.cal-btn-ghost-danger {
  background: transparent; color: var(--warning-color);
  border: 1px solid transparent;
}
.cal-btn-ghost-danger:hover {
  background: var(--warning-light); border-color: var(--warning-border);
}

/* Late-reschedule policy cards */
.cal-policy-list {
  display: flex; flex-direction: column; gap: 10px;
}
.cal-policy {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.cal-policy:hover { background: var(--bg-primary); }
.cal-policy.is-selected {
  background: var(--accent-light);
  border-color: var(--accent-color);
}
.cal-policy input[type="radio"] {
  margin-block-start: 2px;
  accent-color: var(--accent-color);
  flex-shrink: 0;
  cursor: pointer;
}
.cal-policy-body { display: flex; flex-direction: column; gap: 4px; }
.cal-policy-title {
  font-size: 13.5px; font-weight: 600; color: var(--text-primary);
  letter-spacing: -0.005em;
}
.cal-policy-title .pill {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  margin-inline-start: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-color);
  color: var(--bg-primary);
  font-weight: 600;
}
.cal-policy-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.45;
}

.cal-warning-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--warning-color);
}
.cal-warning-banner svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  flex-shrink: 0;
  margin-block-start: 2px;
}
.cal-warning-banner-body { display: flex; flex-direction: column; gap: 4px; min-inline-size: 0; }
.cal-warning-banner-title {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-primary);
}
.cal-warning-banner-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5;
}
.cal-warning-banner-times {
  display: flex; flex-direction: column; gap: 2px;
  margin-block-start: 6px;
  font-size: 12.5px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.cal-warning-banner-times strong { color: var(--text-primary); font-weight: 600; }

/* Suggestions panel for the client search */
.cal-suggestions {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 0;
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 10;
  max-block-size: 220px;
  overflow-y: auto;
  margin-block-start: 4px;
}
.cal-suggestion {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px; color: var(--text-secondary);
  transition: background var(--transition-base), color var(--transition-base);
}
.cal-suggestion:hover { background: var(--bg-secondary); color: var(--text-primary); }
.cal-suggestion .cs-dot {
  inline-size: 10px; block-size: 10px; border-radius: 50%;
  background: var(--c-sage-solid);
  flex-shrink: 0;
}

/* Search input with leading icon */
.cal-form-search {
  position: relative;
}
.cal-form-search .cal-form-input { padding-inline-end: 36px; }
.cal-form-search-icon {
  position: absolute; inset-inline-end: 12px; inset-block-start: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  stroke: var(--text-soft); fill: none; stroke-width: 1.7;
  pointer-events: none;
}

/* ====================================================================
   Overview / סקירה (dashboard landing) — Claude Design handoff
   Calm KPI overview + today's sessions + contextual aside panel.
   Scoped under .ov-page. Reuses the global tokens.
   ==================================================================== */

.ov-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  block-size: 100vh;
  min-block-size: 0;
  overflow: hidden;
  background: var(--bg-primary);
  font-family: var(--font-family);
}
[dir="rtl"] .ov-page { font-family: 'Assistant', 'Rubik', system-ui, sans-serif; }

/* === Content column === */
.ov-content { padding: 36px 40px 56px; overflow-y: auto; }
.ov-header { margin-block-end: 32px; display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.ov-header-text { flex: 1; min-inline-size: 240px; }
.ov-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 500; margin-block-end: 14px;
}
.ov-title { font-size: 36px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; margin: 0; color: var(--text-primary); }
.ov-sub { font-size: 15px; color: var(--text-secondary); margin-block-start: 10px; max-inline-size: 56ch; line-height: 1.55; }

/* Kept action buttons (calendar sync + create client), calm style */
.ov-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.ov-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px;
  padding: 10px 16px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
}
.ov-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.ov-btn-soft {
  background: var(--bg-secondary); color: var(--text-secondary);
  border: 1px solid var(--hairline);
}
.ov-btn-soft:hover { background: var(--bg-primary); color: var(--text-primary); }
.ov-btn-primary {
  background: var(--text-primary); color: var(--bg-primary); border: 1px solid var(--text-primary);
}
.ov-btn-primary:hover { background: var(--text-secondary); border-color: var(--text-secondary); transform: translateY(-1px); }

/* === KPI widget grid === */
.ov-widgets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-block-end: 28px; }
.ov-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  transition: border-color var(--transition-base), transform var(--transition-base);
  cursor: pointer;
  text-align: start;
}
.ov-widget:hover { border-color: var(--border-color); }
.ov-widget-label { font-size: 12px; color: var(--text-soft); letter-spacing: 0.04em; font-weight: 500; margin-block-end: 8px; }
.ov-widget-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-widget-value.is-accent { color: var(--warning-color); }
.ov-widget-foot { font-size: 12px; color: var(--text-soft); margin-block-start: 6px; }

/* === Today section === */
.ov-section { margin-block-start: 36px; }
.ov-section-title {
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft); font-weight: 600; margin: 0 0 16px;
}
.ov-today-list { display: flex; flex-direction: column; gap: 2px; }
.ov-today-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base);
  cursor: pointer;
}
.ov-today-row:hover { background: var(--bg-secondary); }
.ov-today-time { font-size: 14px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ov-today-time small { display: block; font-size: 11px; color: var(--text-soft); font-weight: 400; }
.ov-today-name { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.ov-today-meta { font-size: 12px; color: var(--text-secondary); margin-block-start: 2px; }
.ov-today-empty { font-size: 13px; color: var(--text-soft); font-style: italic; padding: 8px 14px; }
.ov-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  font-weight: 500; letter-spacing: 0.02em; white-space: nowrap;
}
.ov-pill.is-success { background: var(--success-light); color: var(--success-color); }
.ov-pill.is-warn    { background: var(--warning-light); color: var(--warning-color); }
.ov-pill.is-idle    { background: var(--bg-tertiary); color: var(--text-secondary); }

/* === Aside — contextual illustration panel === */
.ov-aside {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border-inline-start: 1px solid var(--hairline);
  padding: 36px 32px;
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.ov-aside > * { position: relative; z-index: 1; }
.ov-aside .illo-stage svg { position: static; }
.ov-aside-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-soft); font-weight: 500; margin-block-end: 14px; }
.ov-aside-title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; color: var(--text-primary); }
.ov-aside-sub { font-size: 14px; color: var(--text-secondary); line-height: 1.55; max-inline-size: 32ch; margin: 0 0 24px; }
.ov-aside-cta {
  align-self: flex-start;
  background: var(--text-primary); color: var(--bg-primary);
  font: 500 13px/1 var(--font-family);
  padding: 12px 20px;
  border: none; border-radius: 999px;
  cursor: pointer; letter-spacing: 0.02em;
  transition: background var(--transition-base), transform var(--transition-base);
  display: inline-flex; align-items: center; gap: 8px;
}
.ov-aside-cta:hover { background: var(--text-secondary); transform: translateY(-1px); }
.ov-aside-cta svg { stroke: currentColor; }
[dir="rtl"] .ov-aside-cta svg { transform: scaleX(-1); }

.ov-aside .illo-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  margin-block-start: 20px; min-block-size: 280px;
}
.ov-aside .illo-stage svg { width: 100%; max-width: 320px; height: auto; }

/* Ambient blobs */
.ov-aside-decor { position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0.55; }
.ov-aside-decor svg { position: absolute; }
.ov-aside-decor .a { inset-block-start: -20px; inset-inline-end: -30px; width: 180px; height: 180px; }
.ov-aside-decor .b { inset-block-end: 80px; inset-inline-start: -40px; width: 140px; height: 140px; }

/* Hidden (non-active) aside variants */
.ov-aside-variant { display: none; flex-direction: column; flex: 1; }
.ov-aside-variant.is-active { display: flex; }

/* === Illustration animations === */
@keyframes ov-float-pebble   { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes ov-float-pebble-2 { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes ov-float-pebble-3 { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes ov-spin-slow { to { transform: rotate(360deg); } }
@keyframes ov-breathe { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes ov-bob-l { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ov-bob-r { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ov-wave-dash { to { stroke-dashoffset: -40; } }
.ov-peb-1 { animation: ov-float-pebble 6s ease-in-out infinite; transform-origin: center; }
.ov-peb-2 { animation: ov-float-pebble-2 7s ease-in-out infinite -1.5s; transform-origin: center; }
.ov-peb-3 { animation: ov-float-pebble-3 5.5s ease-in-out infinite -0.8s; transform-origin: center; }
.ov-petals { animation: ov-spin-slow 70s linear infinite; transform-origin: 160px 155px; }
.ov-sun    { animation: ov-breathe 7s ease-in-out infinite; transform-origin: 160px 155px; }
.ov-minute { animation: ov-spin-slow 90s linear infinite; transform-origin: 160px 155px; }
.ov-anim-bob-l { animation: ov-bob-l 4.2s ease-in-out infinite; }
.ov-anim-bob-r { animation: ov-bob-r 4.6s ease-in-out infinite -1.4s; }
.ov-anim-wave  { stroke-dasharray: 5 6; animation: ov-wave-dash 2.6s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  .ov-page *, .ov-page *::before, .ov-page *::after { animation: none !important; transition: none !important; }
}

/* === Responsive === */
@media (max-width: 1100px) {
  .ov-page { grid-template-columns: 1fr; block-size: auto; overflow: visible; }
  .ov-content { overflow: visible; }
  .ov-aside { border-inline-start: none; border-block-start: 1px solid var(--hairline); }
}
@media (max-width: 700px) {
  .ov-widgets { grid-template-columns: 1fr; }
  .ov-content { padding: 28px 20px 48px; }
  .ov-header { flex-direction: column; }
  .ov-title { font-size: 30px; }
}

/* ====================================================================
   Client Card — full-screen detail with animated hero
   Namespace: .cc-*
   ==================================================================== */

:root {
  --cc-peach:  #F2B48B;
  --cc-butter: #F4D58A;
  --cc-sky:    #BFD3E4;
  --cc-lilac:  #C8B6D6;
  --cc-sage:   #8DA386;
  --cc-teal:   #7FA9A4;
  --cc-clay:   #C8956E;
  --cc-deep:   #5C6E5A;
}

.cc-page {
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 4px 4px 40px;
  display: flex;
  flex-direction: column;
}

.cc-breadcrumb {
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-end: 22px;
}
.cc-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}
.cc-breadcrumb a:hover { color: var(--text-primary); }
.cc-breadcrumb svg {
  inline-size: 12px;
  block-size: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
[dir="rtl"] .cc-breadcrumb svg { transform: scaleX(-1); }

/* === Identity row === */
.cc-ident {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-block-end: 22px;
}
.cc-ident-avatar {
  inline-size: 64px;
  block-size: 64px;
  background: var(--cc-lilac);
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
  display: grid;
  place-items: center;
  color: hsl(40 10% 18%);
  font: 600 20px/1 var(--font-family);
  flex-shrink: 0;
}
.cc-ident-avatar[data-color="peach"] { background: var(--cc-peach); }
.cc-ident-avatar[data-color="sky"]   { background: var(--cc-sky); }
.cc-ident-avatar[data-color="sage"]  { background: var(--cc-sage); color: #FBF7EE; }
.cc-ident-avatar[data-color="butter"] { background: var(--cc-butter); }
.cc-ident-meta { flex: 1; min-inline-size: 0; }
.cc-ident-name {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  color: var(--text-primary);
}
.cc-ident-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-block-start: 6px;
}
.cc-ident-sub .cc-dot {
  display: inline-block;
  inline-size: 3px;
  block-size: 3px;
  border-radius: 50%;
  background: var(--text-soft);
  opacity: 0.5;
  margin-inline: 8px;
  vertical-align: middle;
}
.cc-ident-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cc-icon-btn {
  inline-size: 38px;
  block-size: 38px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}
.cc-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: var(--bg-primary);
}
.cc-icon-btn svg {
  inline-size: 16px;
  block-size: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.cc-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: 0;
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cc-primary-btn:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
}
.cc-primary-btn svg { inline-size: 14px; block-size: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

/* === Hero — animated sea scene === */
.cc-hero {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 24 / 9;
  min-block-size: 240px;
  background: linear-gradient(180deg, #F8D6B5 0%, #FBE7C7 45%, #D5E2EC 70%, #B4CFDB 100%);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: background 1.2s ease;
}
.cc-hero .cc-scene { position: absolute; inset: 0; }
.cc-hero .cc-scene svg { inline-size: 100%; block-size: 100%; display: block; }

@keyframes cc-breathe {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50%      { transform: scale(1.04); filter: brightness(1.05); }
}
.cc-sun { transform-origin: 980px 160px; animation: cc-breathe 6.5s ease-in-out infinite; }

@keyframes cc-bird-fly {
  0%   { transform: translate(-80px, 0); opacity: 0; }
  8%   { opacity: 1; }
  50%  { transform: translate(420px, -22px); opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translate(880px, -8px); opacity: 0; }
}
.cc-bird { animation: cc-bird-fly 18s linear infinite; transform-origin: center; }

.cc-wave-band {
  position: absolute;
  inset-inline: 0;
  block-size: 60px;
  pointer-events: none;
}
.cc-wave-band svg { inline-size: 200%; block-size: 100%; }
.cc-wave-back  { inset-block-end: 60px; opacity: 0.55; animation: cc-wave-shift 14s linear infinite; }
.cc-wave-mid   { inset-block-end: 30px; opacity: 0.75; animation: cc-wave-shift 9s linear infinite; }
.cc-wave-front { inset-block-end: 0;    opacity: 1;    animation: cc-wave-shift 6s linear infinite; }
@keyframes cc-wave-shift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@keyframes cc-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-6px) rotate(1.5deg); }
}
.cc-boat { transform-origin: center bottom; animation: cc-bob 4.4s ease-in-out infinite; }

@keyframes cc-float-peb {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(3deg); }
}
.cc-pebbles { opacity: 0; transition: opacity 1s ease; }
.cc-pebble  { animation: cc-float-peb 5.5s ease-in-out infinite; transform-origin: center; }
.cc-pebble:nth-child(2) { animation-duration: 6.2s; animation-delay: -1s; }
.cc-pebble:nth-child(3) { animation-duration: 5s;   animation-delay: -2.4s; }
.cc-pebble:nth-child(4) { animation-duration: 6.8s; animation-delay: -3.1s; }

@keyframes cc-raindrop {
  0%   { transform: translateY(-10px); opacity: 0; }
  20%  { opacity: 0.6; }
  100% { transform: translateY(180px); opacity: 0; }
}
.cc-rain { opacity: 0; transition: opacity 1s ease; }
.cc-rain line { animation: cc-raindrop 1.6s linear infinite; transform-origin: top; }

@keyframes cc-cloud-drift {
  0%   { transform: translateX(-40px); }
  100% { transform: translateX(120px); }
}
.cc-cloud {
  opacity: 0;
  transition: opacity 1s ease;
  animation: cc-cloud-drift 40s linear infinite;
}

.cc-hero .cc-scene,
.cc-hero .cc-wave-band { transition: opacity 0.9s ease; }

@keyframes cc-scroll-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
@keyframes cc-scroll-glow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.7; }
}
.cc-scroll-note {
  opacity: 0;
  transition: opacity 0.9s ease;
  transform-origin: center;
  animation: cc-scroll-bob 4.5s ease-in-out infinite;
}
.cc-scroll-note .cc-glow { animation: cc-scroll-glow 3s ease-in-out infinite; }

.cc-biome-desert {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
.cc-biome-desert svg { inline-size: 100%; block-size: 100%; display: block; }

@keyframes cc-star-twinkle {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.cc-star { animation: cc-star-twinkle 3.2s ease-in-out infinite; transform-origin: center; }

@keyframes cc-moon-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(244, 229, 200, 0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(244, 229, 200, 0.7)); }
}
.cc-moon { animation: cc-moon-glow 6s ease-in-out infinite; }

@keyframes cc-z-float {
  0%   { opacity: 0; transform: translateY(0); }
  25%  { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-36px); }
}
.cc-z { transform-origin: center; }
.cc-z.cc-z1 { animation: cc-z-float 4.5s ease-out infinite; }
.cc-z.cc-z2 { animation: cc-z-float 4.5s ease-out infinite; animation-delay: 1.5s; }
.cc-z.cc-z3 { animation: cc-z-float 4.5s ease-out infinite; animation-delay: 3.0s; }

/* Per-state overrides */
.cc-hero[data-state="sailing"]  { background: linear-gradient(180deg, #F8D6B5 0%, #FBE7C7 45%, #D5E2EC 70%, #B4CFDB 100%); }
.cc-hero[data-state="sailing"] .cc-bird { opacity: 1; }

.cc-hero[data-state="idle"]     { background: linear-gradient(180deg, #E8CDB0 0%, #ECD9BC 45%, #C9D5DE 70%, #A8C0CC 100%); }
.cc-hero[data-state="idle"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="idle"] .cc-wave-front { animation-duration: 14s; }
.cc-hero[data-state="idle"] .cc-wave-mid   { animation-duration: 20s; }
.cc-hero[data-state="idle"] .cc-wave-back  { animation-duration: 26s; }
.cc-hero[data-state="idle"] .cc-boat       { animation-duration: 9s; }
.cc-hero[data-state="idle"] .cc-sun        { opacity: 0.85; }

.cc-hero[data-state="tobill"]   { background: linear-gradient(180deg, #F8D6B5 0%, #FBE7C7 45%, #D5E2EC 70%, #B4CFDB 100%); }
.cc-hero[data-state="tobill"] .cc-bird        { opacity: 0; }
.cc-hero[data-state="tobill"] .cc-scroll-note { opacity: 1; }
.cc-hero[data-state="tobill"] .cc-boat        { animation-duration: 5s; }

.cc-hero[data-state="pending"]  { background: linear-gradient(180deg, #F2C99F 0%, #F7DBB2 45%, #CEDBE5 70%, #ADC6D3 100%); }
.cc-hero[data-state="pending"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="pending"] .cc-pebbles    { opacity: 1; }
.cc-hero[data-state="pending"] .cc-cloud      { opacity: 0.5; }
.cc-hero[data-state="pending"] .cc-wave-front { animation-duration: 7s; }
.cc-hero[data-state="pending"] .cc-boat       { animation-duration: 4.4s; }

.cc-hero[data-state="drizzle"]  { background: linear-gradient(180deg, #DFC4A8 0%, #DACEB6 45%, #BFCED7 70%, #9AB4C2 100%); }
.cc-hero[data-state="drizzle"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="drizzle"] .cc-pebbles    { opacity: 1; }
.cc-hero[data-state="drizzle"] .cc-rain       { opacity: 0.55; }
.cc-hero[data-state="drizzle"] .cc-cloud      { opacity: 0.8; }
.cc-hero[data-state="drizzle"] .cc-sun        { opacity: 0.7; }
.cc-hero[data-state="drizzle"] .cc-wave-front { animation-duration: 5s; }
.cc-hero[data-state="drizzle"] .cc-boat       { animation-duration: 3.8s; }

.cc-hero[data-state="storm"]    { background: linear-gradient(180deg, #B5A292 0%, #B0B6B0 45%, #8FA4B0 70%, #738F9C 100%); }
.cc-hero[data-state="storm"] .cc-bird       { opacity: 0; }
.cc-hero[data-state="storm"] .cc-pebbles    { opacity: 1; }
.cc-hero[data-state="storm"] .cc-rain       { opacity: 1; }
.cc-hero[data-state="storm"] .cc-cloud      { opacity: 1; }
.cc-hero[data-state="storm"] .cc-sun        { opacity: 0.3; }
.cc-hero[data-state="storm"] .cc-wave-front { animation-duration: 3.5s; }
.cc-hero[data-state="storm"] .cc-wave-mid   { animation-duration: 5s; }
.cc-hero[data-state="storm"] .cc-boat       { animation-duration: 2.6s; }

.cc-hero[data-state="sleeping"] { background: linear-gradient(180deg, #2D3550 0%, #4A4264 45%, #7A6A85 75%, #B89B95 100%); }
.cc-hero[data-state="sleeping"] .cc-scene,
.cc-hero[data-state="sleeping"] .cc-wave-band   { opacity: 0; }
.cc-hero[data-state="sleeping"] .cc-biome-desert { opacity: 1; }

.cc-hero-caption {
  position: absolute;
  inset-block-end: 20px;
  inset-inline-start: 24px;
  z-index: 2;
  background: rgba(251, 247, 238, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 10px 16px;
  border-radius: 999px;
  font: 500 12.5px/1.2 var(--font-family);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-hero-caption .cc-swatch {
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--success-color);
}
.cc-hero[data-state="sailing"]  .cc-hero-caption .cc-swatch { background: var(--success-color); }
.cc-hero[data-state="idle"]     .cc-hero-caption .cc-swatch { background: var(--cc-sky); }
.cc-hero[data-state="tobill"]   .cc-hero-caption .cc-swatch { background: var(--cc-butter); }
.cc-hero[data-state="pending"]  .cc-hero-caption .cc-swatch { background: var(--warning-color); }
.cc-hero[data-state="drizzle"]  .cc-hero-caption .cc-swatch { background: var(--cc-clay); }
.cc-hero[data-state="storm"]    .cc-hero-caption .cc-swatch { background: hsl(28 25% 38%); }
.cc-hero[data-state="sleeping"] .cc-hero-caption .cc-swatch { background: var(--cc-lilac); }
.cc-hero[data-state="sleeping"] .cc-hero-caption {
  background: rgba(45, 53, 80, 0.55);
  color: #F4E5C8;
  border-color: rgba(244, 229, 200, 0.25);
}

/* === Quick stats + cards === */
.cc-card {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.cc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-block-end: 16px;
  gap: 12px;
}
.cc-card-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  margin: 0;
}
.cc-card-link {
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
}
.cc-card-link:hover { color: var(--text-primary); }

.cc-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cc-stat { padding: 10px 0; }
.cc-stat-label {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  margin-block-end: 6px;
}
.cc-stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cc-stat-value.cc-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 30px;
}
.cc-stat-foot {
  font-size: 12px;
  color: var(--text-soft);
  margin-block-start: 4px;
}

/* === Payment-tracking card === */
.cc-billing-card .cc-card-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 14px;
  margin-block-end: 18px;
}
.cc-billing-head-row {
  display: flex;
  align-items: center;
  gap: 16px;
  inline-size: 100%;
  flex-wrap: wrap;
}
.cc-billing-head-row > .cc-card-title { margin-inline-end: auto; }
.cc-billing-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-soft);
}
.cc-mode-toggle {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}
.cc-mode-toggle button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  font: 500 12px/1 var(--font-family);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.cc-mode-toggle button.active {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.cc-billing-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 16px 18px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  margin-block-end: 6px;
}
.cc-bs-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-inline-size: 0;
  padding-inline-end: 8px;
  border-inline-end: 1px solid var(--hairline);
}
.cc-bs-cell:last-child { border-inline-end: 0; }
.cc-bs-label {
  font-size: 10.5px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cc-bs-value {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.cc-bs-value.cc-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  line-height: 1;
}
.cc-bs-value.cc-alert { color: var(--warning-color); }
.cc-bs-value.cc-late  { color: hsl(20 38% 40%); }
.cc-bs-value.cc-muted { color: var(--text-soft); }

.cc-billing-footnote {
  margin-block-start: 14px;
  padding: 11px 14px;
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.cc-billing-footnote svg {
  inline-size: 14px;
  block-size: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  flex-shrink: 0;
  margin-block-start: 2px;
  opacity: 0.7;
}
.cc-billing-footnote strong { color: var(--text-primary); font-weight: 600; }

/* === Per-session billing cards === */
.cc-bsession-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-block-start: 16px;
}

.cc-group-invoice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin: 16px 0 4px;
  background: hsl(43 55% 96%);
  border: 1px solid hsl(43 45% 80%);
  border-radius: var(--radius-md);
  position: relative;
}
.cc-gi-icon {
  inline-size: 46px;
  block-size: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: hsl(43 45% 85%);
  color: hsl(43 38% 28%);
  flex-shrink: 0;
}
.cc-gi-icon svg { inline-size: 22px; block-size: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.cc-gi-body { flex: 1; min-inline-size: 0; }
.cc-gi-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.cc-gi-title .cc-num { color: hsl(43 38% 28%); font-variant-numeric: tabular-nums; }
.cc-gi-title .cc-total {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: hsl(43 38% 24%);
  letter-spacing: -0.01em;
}
.cc-gi-sub { font-size: 12.5px; color: var(--text-secondary); margin-block-start: 5px; }
.cc-gi-sub strong { color: var(--text-primary); font-weight: 500; }
.cc-gi-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cc-gi-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid hsl(43 45% 75%);
  background: var(--bg-secondary);
  color: hsl(43 38% 28%);
  font: 500 12.5px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.cc-gi-btn:hover { background: hsl(43 50% 90%); }
.cc-gi-btn.cc-primary {
  background: hsl(43 38% 28%);
  color: hsl(43 55% 96%);
  border-color: hsl(43 38% 28%);
}
.cc-gi-btn.cc-primary:hover { background: hsl(43 38% 22%); }
.cc-gi-btn svg { inline-size: 13px; block-size: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.cc-bsession {
  background: var(--bg-primary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  border-inline-start: 4px solid var(--hairline);
  position: relative;
}
.cc-bsession.cc-paid     { border-inline-start-color: var(--success-color); }
.cc-bsession.cc-partial  { border-inline-start-color: hsl(28 45% 55%); background: hsl(28 50% 97%); }
.cc-bsession.cc-late     { border-inline-start-color: var(--cc-clay); background: hsl(20 45% 97%); }
.cc-bsession.cc-pending  { border-inline-start-color: var(--warning-color); }
.cc-bsession.cc-awaiting { border-inline-start-color: var(--cc-butter); background: hsl(43 50% 98%); }

.cc-bsession-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-block-end: 14px;
}
.cc-bsession-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.cc-bsession-date {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  margin-block-start: 5px;
}
.cc-bsession-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.cc-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cc-pill::before {
  content: '';
  inline-size: 5px;
  block-size: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.cc-pill.cc-paid     { background: var(--success-light); color: var(--success-color); }
.cc-pill.cc-partial  { background: hsl(28 50% 92%); color: hsl(28 38% 38%); }
.cc-pill.cc-late     { background: hsl(20 40% 90%); color: hsl(20 38% 38%); }
.cc-pill.cc-pending  { background: var(--warning-light); color: var(--warning-color); }
.cc-pill.cc-awaiting { background: hsl(43 35% 88%); color: hsl(43 38% 30%); }

.cc-bsession-alert {
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-block-end: 14px;
  background: hsl(20 50% 93%);
  color: hsl(20 50% 32%);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.5;
}
.cc-bsession-alert.cc-warn { background: var(--warning-light); color: var(--warning-color); }
.cc-bsession-alert.cc-info { background: var(--success-light); color: var(--success-color); }
.cc-bsession-alert svg {
  inline-size: 14px;
  block-size: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
  margin-block-start: 2px;
}
.cc-bsession-alert strong { font-weight: 600; }

.cc-bsession-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-block-end: 8px;
}
.cc-bstat {
  background: var(--bg-secondary);
  padding: 12px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cc-bstat-label {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.02em;
}
.cc-bstat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.cc-bstat-value.cc-alert { color: var(--cc-clay); }
.cc-bstat-value.cc-warn  { color: var(--warning-color); }
.cc-bstat-value.cc-good  { color: var(--success-color); }
.cc-bstat-value.cc-muted { color: var(--text-soft); font-weight: 500; }

.cc-bsession-terms {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-block: 14px;
  display: flex;
  gap: 6px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--hairline);
}
.cc-bsession-terms strong { color: var(--text-secondary); font-weight: 500; }

.cc-bsession-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  inline-size: 100%;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px;
  font: 500 13.5px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base);
}
.cc-bsession-action:hover { background: var(--accent-hover); }
.cc-bsession-action svg { inline-size: 14px; block-size: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cc-bsession-action.cc-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
}
.cc-bsession-action.cc-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.cc-bsession-action.cc-warn { background: var(--warning-color); }
.cc-bsession-action.cc-warn:hover { background: hsl(28 35% 42%); }

.cc-bsession-actions-row { display: flex; gap: 8px; }
.cc-bsession-actions-row .cc-bsession-action { flex: 1; }

.cc-bsession-receipts {
  margin-block-start: 14px;
  padding-block-start: 12px;
  border-block-start: 1px dashed var(--border-color);
}
.cc-bsession-receipts-title {
  font-size: 11px;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  margin-block-end: 8px;
  text-transform: uppercase;
}
.cc-bsession-receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-block: 5px;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.cc-bsession-receipt-row .cc-method { color: var(--text-primary); }
.cc-bsession-receipt-row .cc-amt    { color: var(--success-color); font-weight: 500; }
.cc-bsession-receipt-row.cc-refund .cc-amt { color: var(--cc-clay); }

/* === Body grid === */
.cc-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 22px;
  margin-block-start: 22px;
}
.cc-body-main { display: flex; flex-direction: column; gap: 22px; }
.cc-body-aside { display: flex; flex-direction: column; gap: 22px; }

.cc-timeline { position: relative; padding-inline-start: 18px; }
.cc-timeline::before {
  content: '';
  position: absolute;
  inset-block: 6px;
  inset-inline-start: 5px;
  inline-size: 1.5px;
  background: var(--hairline);
}
.cc-tl-item {
  position: relative;
  padding-block: 10px;
  padding-inline-start: 14px;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: baseline;
}
.cc-tl-item::before {
  content: '';
  position: absolute;
  inset-block-start: 18px;
  inset-inline-start: -4px;
  inline-size: 9px;
  block-size: 9px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1.5px solid var(--accent-color);
}
.cc-tl-item.cc-upcoming::before {
  border-style: dashed;
  background: var(--bg-primary);
}
.cc-tl-date {
  font-size: 12px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.cc-tl-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}
.cc-tl-text .cc-note {
  color: var(--text-soft);
  font-size: 13px;
  display: block;
  margin-block-start: 2px;
}
.cc-tl-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
}
.cc-tl-tag.cc-paid { background: var(--success-light); color: var(--success-color); }
.cc-tl-tag.cc-due  { background: var(--warning-light); color: var(--warning-color); }

.cc-note-pad {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px 24px;
}
.cc-note-pad p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.cc-note-pad p + p { margin-block-start: 10px; }
.cc-note-meta {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-block-start: 14px;
}

.cc-aside-status {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}
.cc-aside-status .cc-stat-amount {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 36px;
  line-height: 1;
  color: var(--text-primary);
}
.cc-aside-status .cc-stat-foot {
  margin-block-start: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.cc-aside-status .cc-stat-cta {
  margin-block-start: 14px;
  display: block;
  inline-size: 100%;
  border: 1px solid var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: 999px;
  padding: 10px 14px;
  font: 500 13px/1 var(--font-family);
  cursor: pointer;
  transition: opacity var(--transition-base);
}
.cc-aside-status .cc-stat-cta:hover { opacity: 0.85; }
.cc-aside-status .cc-stat-cta.cc-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px dashed var(--border-color);
}

.cc-contact-row { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--text-secondary); }
.cc-contact-row > div span.cc-contact-label {
  color: var(--text-soft);
  display: block;
  font-size: 11.5px;
  margin-block-end: 3px;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .cc-hero,
  .cc-hero *,
  .cc-hero *::before,
  .cc-hero *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* === Responsive === */
@media (max-width: 1100px) {
  .cc-body-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .cc-ident { flex-wrap: wrap; }
  .cc-ident-actions { inline-size: 100%; justify-content: flex-end; }
}
@media (max-width: 700px) {
  .cc-billing-summary { grid-template-columns: repeat(2, 1fr); }
  .cc-bs-cell:nth-child(2) { border-inline-end: 0; }
  .cc-group-invoice { flex-direction: column; align-items: flex-start; }
  .cc-gi-actions { inline-size: 100%; }
  .cc-gi-btn { flex: 1; justify-content: center; }
  .cc-bsession { padding: 16px; }
  .cc-bsession-head { flex-direction: column; gap: 10px; }
  .cc-bsession-pills { justify-content: flex-start; }
  .cc-bstat { padding: 10px 6px; }
  .cc-bstat-value { font-size: 14px; }
  .cc-bsession-actions-row { flex-direction: column; }
  .cc-ident-name { font-size: 26px; }
  .cc-stat-row { grid-template-columns: 1fr; }
}

/* ========================================================================
   Client Directory — "Living Connections" (cd-living)
   ======================================================================== */
.client-directory-container.cd-living {
  max-inline-size: 1100px;
  margin-inline: auto;
  padding-block: 4px 24px;
}

.cd-living .cd-header { margin-block-end: 28px; }
.cd-living .cd-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 500;
  margin-block-end: 14px;
}
.cd-living .cd-title {
  font-family: var(--font-family);
  font-size: 40px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-primary);
}
.cd-living .cd-title-num {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.cd-living .cd-sub {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 12px 0 0;
  max-inline-size: 50ch;
  line-height: 1.6;
}

/* Toolbar */
.cd-living .cd-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  flex-wrap: wrap;
}
.cd-living .cd-search {
  flex: 1 1 280px;
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  transition: border-color var(--transition-base);
  display: block;
}
.cd-living .cd-search:focus-within { border-color: var(--border-color); }
.cd-living .cd-search svg {
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-soft);
  fill: none;
  stroke-width: 1.7;
  pointer-events: none;
}
.cd-living .cd-search input {
  width: 100%;
  border: none;
  background: transparent;
  padding-block: 12px;
  padding-inline-start: 18px;
  padding-inline-end: 42px;
  font: 400 14px/1 var(--font-family);
  color: var(--text-primary);
  outline: none;
  text-align: start;
}
.cd-living .cd-search input::placeholder { color: var(--text-soft); }
[dir="ltr"] .cd-living .cd-search svg {
  inset-inline-end: auto;
  inset-inline-start: 16px;
}
[dir="ltr"] .cd-living .cd-search input {
  padding-inline-start: 42px;
  padding-inline-end: 18px;
}

.cd-living .cd-filters {
  display: flex;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 4px;
}
.cd-living .cd-filters button {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cd-living .cd-filters button:hover { color: var(--text-primary); }
.cd-living .cd-filters button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.cd-living .cd-filters .cd-count {
  color: var(--text-soft);
  font-weight: 400;
  font-size: 12px;
}
.cd-living .cd-filters button.active .cd-count { color: var(--text-secondary); }

.cd-living .cd-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 999px;
  font: 500 13px/1 var(--font-family);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background var(--transition-base), transform var(--transition-base);
}
.cd-living .cd-new-btn:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
}
.cd-living .cd-new-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.cd-living .cd-import-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font: 500 12.5px/1 var(--font-family);
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.cd-living .cd-import-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.cd-living .cd-import-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

/* Groups */
.cd-living .cd-group { margin-block-start: 28px; }
.cd-living .cd-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-block-end: 10px;
  padding-inline: 6px;
  flex-wrap: wrap;
}
.cd-living .cd-group-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-weight: 600;
  margin: 0;
}
.cd-living .cd-group-hint {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 400;
}

.cd-living .cd-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Row */
.cd-living .cd-row {
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1.6fr) minmax(0, 1.2fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-base);
  background: transparent;
  border: none;
  inline-size: 100%;
  text-align: start;
  font-family: var(--font-family);
}
.cd-living .cd-row:hover { background: var(--bg-secondary); }
.cd-living .cd-row:hover .cd-chev { opacity: 1; transform: translateX(0); }

/* Avatar — organic blob */
.cd-living .cd-avatar {
  inline-size: 44px;
  block-size: 44px;
  display: grid;
  place-items: center;
  font: 600 14px/1 var(--font-family);
  color: hsl(40 10% 18%);
  background: var(--peach);
  position: relative;
  flex-shrink: 0;
  border-radius: 58% 42% 53% 47% / 50% 56% 44% 50%;
}
.cd-living .cd-avatar.peach  { background: var(--peach); }
.cd-living .cd-avatar.butter { background: var(--butter); }
.cd-living .cd-avatar.sky    { background: var(--sky); }
.cd-living .cd-avatar.lilac  { background: var(--lilac); }
.cd-living .cd-avatar.sage   { background: var(--sage); color: hsl(40 10% 96%); }
.cd-living .cd-avatar.teal   { background: var(--teal); color: hsl(40 10% 96%); }
.cd-living .cd-avatar.clay   { background: var(--clay); color: hsl(40 10% 96%); }

.cd-living .cd-name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.cd-living .cd-row-sub {
  font-size: 13px;
  color: var(--text-soft);
  margin-block-start: 3px;
}
.cd-living .cd-row-sub .cd-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-soft);
  opacity: 0.5;
  margin-inline: 8px;
  vertical-align: middle;
}

.cd-living .cd-cadence {
  font-size: 13px;
  color: var(--text-secondary);
}
.cd-living .cd-cadence-em {
  color: var(--text-primary);
  font-weight: 500;
}

.cd-living .cd-next {
  text-align: end;
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-inline-size: 110px;
}
.cd-living .cd-next .cd-day {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
}
.cd-living .cd-next .cd-time {
  color: var(--text-soft);
  margin-block-start: 2px;
}

.cd-living .cd-chev {
  width: 22px;
  height: 22px;
  color: var(--text-soft);
  opacity: 0;
  transition: opacity var(--transition-base), transform var(--transition-base);
  transform: translateX(4px);
}
[dir="rtl"] .cd-living .cd-chev { transform: translateX(-4px); }
.cd-living .cd-chev svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* Inline status pill */
.cd-living .cd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11px/1 var(--font-family);
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  margin-inline-start: 8px;
  vertical-align: middle;
}
.cd-living .cd-pill.new   { background: var(--success-light); color: var(--success-color); }
.cd-living .cd-pill.care  { background: var(--warning-light); color: var(--warning-color); }
.cd-living .cd-pill.pause { background: var(--bg-tertiary); color: var(--text-soft); }

/* Resting group — muted */
.cd-living .cd-group.cd-resting .cd-row { opacity: 0.78; }
.cd-living .cd-group.cd-resting .cd-row:hover { opacity: 1; }
.cd-living .cd-group.cd-resting .cd-name { font-weight: 500; }

/* Active editing highlight on a row */
.cd-living .cd-row.cd-active-edit {
  background: var(--accent-light);
  box-shadow: inset 0 0 0 1px var(--border-color);
}

/* Active client highlight (newly created) — gentle pulse */
.cd-living .cd-row.cd-new-highlight {
  animation: cdRowFlash 1.6s ease-out 1;
}
@keyframes cdRowFlash {
  0%   { background: var(--accent-light); }
  100% { background: transparent; }
}

/* Soft footer note */
.cd-living .cd-leaf-note {
  margin-block-start: 56px;
  padding: 18px 22px;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.55;
  max-inline-size: 720px;
}
.cd-living .cd-leaf-note .cd-leaf {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Empty state inside the directory */
.cd-living .cd-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}
.cd-living .cd-empty strong {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  margin-block-end: 6px;
}

@media (max-width: 820px) {
  .cd-living .cd-row {
    grid-template-columns: 44px 1fr auto;
    gap: 12px;
  }
  .cd-living .cd-cadence,
  .cd-living .cd-chev { display: none; }
  .cd-living .cd-next { min-inline-size: 0; }
  .cd-living .cd-title { font-size: 32px; }
  .cd-living .cd-title-num { font-size: 44px; }
}

/* ========================================================================
   Daily Quote — "פתגם היום" (overview content column, after "היום")
   ======================================================================== */
.daily-quote {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 20px 24px 22px;
  margin-block-start: 28px;
  overflow: hidden;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.daily-quote[hidden] { display: none; }

.daily-quote .dq-mark {
  font-family: var(--font-serif);
  font-size: 72px;
  line-height: 0.6;
  color: var(--peach);
  opacity: 0.6;
  margin-block-start: 6px;
  user-select: none;
}
.daily-quote .dq-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-block-end: 12px;
}
.daily-quote .dq-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  font-weight: 600;
}
.daily-quote .dq-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-hover);
  display: none;
}
.daily-quote .dq-text {
  font-family: var(--font-serif);
  font-size: 24px;
  font-style: italic;
  line-height: 1.45;
  color: var(--text-primary);
  margin: 0;
  text-wrap: pretty;
}
.daily-quote .dq-author {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, var(--text-soft));
  margin-block-start: 14px;
  letter-spacing: 0.01em;
}
.daily-quote .dq-author::before {
  content: '— ';
  opacity: 0.6;
}
.daily-quote .dq-author:empty { display: none; }
.daily-quote .dq-author:empty::before { content: none; }

/* holiday tints — one theme per occasion */
.daily-quote.is-holiday .dq-badge { display: inline-block; }

.daily-quote.h-honey {
  background: linear-gradient(180deg, hsl(36 62% 94%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(36 48% 80%);
}
.daily-quote.h-honey .dq-mark { color: hsl(28 55% 58%); }
.daily-quote.h-honey .dq-badge { background: hsl(36 60% 88%); color: hsl(28 45% 36%); }

.daily-quote.h-sky {
  background: linear-gradient(180deg, hsl(208 45% 94%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(208 38% 80%);
}
.daily-quote.h-sky .dq-mark { color: hsl(208 45% 58%); }
.daily-quote.h-sky .dq-badge { background: hsl(208 48% 88%); color: hsl(208 42% 36%); }

.daily-quote.h-slate {
  background: linear-gradient(180deg, hsl(220 24% 94%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(220 18% 82%);
}
.daily-quote.h-slate .dq-mark { color: hsl(220 20% 60%); }
.daily-quote.h-slate .dq-badge { background: hsl(220 22% 88%); color: hsl(220 22% 38%); }

.daily-quote.h-gold {
  background: linear-gradient(180deg, hsl(45 72% 92%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(45 55% 78%);
}
.daily-quote.h-gold .dq-mark { color: hsl(43 70% 50%); }
.daily-quote.h-gold .dq-badge { background: hsl(45 66% 85%); color: hsl(40 55% 33%); }

.daily-quote.h-blue {
  background: linear-gradient(180deg, hsl(210 55% 93%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(210 45% 78%);
}
.daily-quote.h-blue .dq-mark { color: hsl(212 58% 55%); }
.daily-quote.h-blue .dq-badge { background: hsl(210 55% 86%); color: hsl(212 52% 36%); }

.daily-quote.h-rose {
  background: linear-gradient(180deg, hsl(345 56% 95%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(345 40% 84%);
}
.daily-quote.h-rose .dq-mark { color: hsl(345 55% 65%); }
.daily-quote.h-rose .dq-badge { background: hsl(345 50% 90%); color: hsl(345 45% 42%); }

.daily-quote.h-sage {
  background: linear-gradient(180deg, hsl(108 30% 93%) 0%, var(--bg-secondary) 72%);
  border-color: hsl(108 24% 78%);
}
.daily-quote.h-sage .dq-mark { color: hsl(108 24% 48%); }
.daily-quote.h-sage .dq-badge { background: hsl(108 28% 86%); color: hsl(108 26% 30%); }

@media (max-width: 820px) {
  .daily-quote { padding: 18px 18px 20px; gap: 14px; }
  .daily-quote .dq-mark { font-size: 56px; }
  .daily-quote .dq-text { font-size: 20px; }
}

/* ========================================================================
   Aphorism Feedback — interactive daily-quote with thumbs + reasons +
   source-picker. Drop-in from design/_inbox/design_handoff_aphorism_feedback
   (2026-05-31). Wired to mindbalance.aphorisms + aphorism_feedback +
   aphorism_source_preferences.
   ======================================================================== */

/* --- Card --- */
.aphorism-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--hairline, var(--border-color));
  border-radius: var(--radius-md);
  padding: 22px 24px 16px;
  margin-block-start: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base), opacity var(--transition-base);
  overflow: hidden;
}
.aphorism-card[hidden] { display: none; }
.aphorism-card::before {
  content: '”';
  position: absolute;
  inset-block-start: -18px;
  inset-inline-start: 16px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 96px;
  line-height: 1;
  color: var(--accent-color);
  opacity: 0.10;
  pointer-events: none;
}
.aphorism-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.aphorism-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-block-end: 14px; position: relative; z-index: 1;
}
.aphorism-card-eyebrow {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-soft, var(--text-secondary)); font-weight: 600;
}
.aphorism-next {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-soft, var(--text-secondary)); font-weight: 500;
  background: none; border: none; padding: 4px 6px; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition-base), background var(--transition-base);
}
.aphorism-next:hover { color: var(--text-secondary); background: var(--bg-tertiary); }
.aphorism-next svg { inline-size: 13px; block-size: 13px; }

.aphorism-body { position: relative; z-index: 1; transition: opacity 0.3s ease; }
.aphorism-card.is-loading .aphorism-body { opacity: 0; }

.aphorism-card-text {
  font-size: 1.4rem; line-height: 1.6; font-weight: 500;
  color: var(--text-primary); margin: 0; text-wrap: pretty;
}
.aphorism-card-en {
  font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary);
  margin-block-start: 10px; text-wrap: pretty;
}
.aphorism-card-en.is-hidden { display: none; }
.aphorism-toggle-en {
  background: none; border: none; padding: 0; margin-block-start: 8px;
  font-size: 12px; color: var(--text-soft, var(--text-secondary)); font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.aphorism-toggle-en:hover { color: var(--text-secondary); }
.aphorism-card-meta {
  font-size: 13px; color: var(--text-soft, var(--text-secondary));
  margin-block-start: 14px; font-weight: 500;
}

.aphorism-action-row {
  display: flex; align-items: center; gap: 8px;
  margin-block-start: 18px; padding-block-start: 14px;
  border-block-start: 1px solid var(--hairline, var(--border-color));
  position: relative; z-index: 1;
}
.aphorism-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  block-size: 38px; min-inline-size: 38px; padding-inline: 11px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid transparent; border-radius: 999px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.aphorism-action-btn svg { inline-size: 17px; block-size: 17px; }
.aphorism-action-btn:hover { transform: translateY(-1px); }
.aphorism-action-btn .btn-label {
  max-inline-size: 0; overflow: hidden; white-space: nowrap;
  opacity: 0; transition: max-inline-size var(--transition-base), opacity var(--transition-base);
}
.aphorism-action-btn.is-selected .btn-label { max-inline-size: 120px; opacity: 1; }
.aphorism-action-btn.up.is-selected     { background: var(--accent-color); color: #fff; }
.aphorism-action-btn.down.is-selected   { background: var(--warning-color); color: #fff; }
.aphorism-action-btn.snooze.is-selected { background: var(--text-secondary); color: var(--bg-secondary); }
.aphorism-spacer { flex: 1; }

/* Snoozed placeholder */
.aphorism-card.is-snoozed .aphorism-body,
.aphorism-card.is-snoozed .aphorism-action-row { display: none; }
.aphorism-snoozed {
  display: none; flex-direction: column; align-items: flex-start; gap: 10px;
  padding-block: 18px 8px; position: relative; z-index: 1;
}
.aphorism-card.is-snoozed .aphorism-snoozed { display: flex; }
.aphorism-card.is-snoozed { opacity: 0.55; }
.aphorism-snoozed-text { font-size: 1.05rem; font-weight: 500; color: var(--text-secondary); }
.aphorism-restore {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--accent-color);
  text-decoration: underline; text-underline-offset: 2px;
}
.aphorism-restore:hover { color: var(--accent-hover); }

/* Empty feed (all sources off) */
.aphorism-empty { display: none; padding-block: 6px 8px; position: relative; z-index: 1; }
.aphorism-card.is-empty .aphorism-body,
.aphorism-card.is-empty .aphorism-action-row { display: none; }
.aphorism-card.is-empty .aphorism-empty { display: block; }
.aphorism-empty p { margin: 0; color: var(--text-secondary); font-size: 0.95rem; }

/* --- Downvote Reason Sheet / Modal --- */
.feedback-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(38, 37, 34, 0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}
.feedback-backdrop.is-open { opacity: 1; visibility: visible; }
.feedback-sheet {
  inline-size: min(440px, 100%);
  background: var(--bg-secondary);
  border: 1px solid var(--hairline, var(--border-color));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
  transform: translateY(12px) scale(0.98);
  transition: transform var(--transition-base);
}
.feedback-backdrop.is-open .feedback-sheet { transform: translateY(0) scale(1); }
.feedback-sheet h3 { margin: 0; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.feedback-sheet .sheet-sub { margin: 6px 0 20px; font-size: 13px; color: var(--text-secondary); }
.feedback-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.feedback-chip {
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 15px; font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.feedback-chip:hover { border-color: var(--border-color); }
.feedback-chip.is-selected {
  background: var(--accent-light); color: var(--accent-hover);
  border-color: hsl(108 16% 78%);
}
.feedback-other-wrap { margin-block-start: 14px; max-block-size: 0; overflow: hidden; transition: max-block-size var(--transition-base); }
.feedback-other-wrap.is-open { max-block-size: 160px; }
.feedback-other-wrap textarea {
  inline-size: 100%; min-block-size: 76px; resize: vertical;
  font-family: inherit; font-size: 14px; color: var(--text-primary);
  background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.feedback-other-wrap textarea:focus { outline: none; border-color: var(--accent-color); }
.feedback-actions { display: flex; gap: 10px; justify-content: flex-end; margin-block-start: 22px; }
.aphorism-card-host .btn-ghost,
.feedback-sheet .btn-ghost,
.feedback-sheet .btn-primary {
  border-radius: 999px; padding: 11px 20px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.feedback-sheet .btn-ghost { background: none; border: 1px solid var(--border-color); color: var(--text-secondary); }
.feedback-sheet .btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.feedback-sheet .btn-primary { background: var(--accent-color); border: 1px solid transparent; color: #fff; }
.feedback-sheet .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* --- Source Preferences Panel (in Settings) --- */
.source-prefs {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}
.source-prefs h3 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.source-prefs .prefs-sub { margin: 6px 0 18px; font-size: 13px; color: var(--text-secondary); }
.source-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.source-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--bg-tertiary); color: var(--text-secondary);
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 15px 10px 13px;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.source-chip .chk {
  inline-size: 17px; block-size: 17px; border-radius: 5px;
  border: 1.5px solid var(--text-soft, var(--text-secondary)); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--transition-base), border-color var(--transition-base);
}
.source-chip .chk svg { inline-size: 11px; block-size: 11px; opacity: 0; transition: opacity var(--transition-base); }
.source-chip.is-enabled { background: var(--accent-light); color: var(--accent-hover); border-color: hsl(108 16% 78%); }
.source-chip.is-enabled .chk { background: var(--accent-color); border-color: var(--accent-color); }
.source-chip.is-enabled .chk svg { opacity: 1; }
.source-chip[data-desc]::after {
  content: attr(data-desc);
  position: absolute; inset-block-end: calc(100% + 8px); inset-inline-start: 50%;
  transform: translateX(50%) translateY(4px);
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  padding: 6px 10px; border-radius: var(--radius-sm);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 5;
}
.source-chip:hover::after { opacity: 1; transform: translateX(50%) translateY(0); }
.prefs-links { display: flex; gap: 18px; margin-block-start: 18px; }
.prefs-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--accent-color);
  text-decoration: underline; text-underline-offset: 2px;
}
.prefs-link:hover { color: var(--accent-hover); }

/* --- Toast --- */
.toast-stack {
  position: fixed; inset-block-end: 24px; inset-inline-start: 50%;
  transform: translateX(50%); z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--text-primary); color: var(--bg-primary);
  font-size: 13px; font-weight: 500;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast .toast-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--accent-color); }

/* Bottom-sheet on small screens */
@media (max-width: 560px) {
  .feedback-backdrop { align-items: flex-end; padding: 0; }
  .feedback-sheet {
    inline-size: 100%;
    border-end-start-radius: 0; border-end-end-radius: 0;
    transform: translateY(100%);
    padding-block-end: 28px;
  }
  .feedback-backdrop.is-open .feedback-sheet { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .aphorism-card, .aphorism-card *,
  .feedback-backdrop, .feedback-sheet, .feedback-chip, .feedback-other-wrap,
  .source-chip, .toast { transition: none !important; }
}
