/* ══════════════════════════════════════════════════════════════════════════
   eDiary · Redesign Layer — "The Partner's Desk"
   High-density professional cockpit tailored for chartered accountants,
   audit leaders, and article trainees.
   Crafted in accordance with UI-Taste / Anti-UI-Slop principles.
   Loaded AFTER app/core.css. Pure presentation layer.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens & Animation Variables ──────────────────────────────────────── */
:root {
  --font: 'Geist', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: var(--font);
  --mono: 'Geist Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Neutral ramp: Architectural Zinc */
  --ink-900: #18181B; --ink-800: #27272A; --ink-700: #3F3F46; --ink-600: #52525B;
  --ink-500: #71717A; --ink-400: #8A8A93; --ink-300: #A1A1AA; --ink-200: #D4D4D8;
  --paper-50: #FFFFFF; --paper-100: #F7F7F8; --paper-200: #F1F1F3;
  --paper-300: #E4E4E7; --paper-400: #D4D4D8; --paper-150: #F4F4F6;

  /* The Single Dignified Accent: Warm Brass / True Gold */
  --gold-700: #6F5826; --gold-600: #87692F; --gold-500: #9A7B3F;
  --gold-400: #C4A869; --gold-300: #D6BC86; --gold-100: #F3EBDA; --gold: #9A7B3F;

  /* Status Colors: Clean, Non-Neon */
  --ok-700: #256548; --ok-600: #2F7D5B; --ok-500: #3E9A72; --ok-300: #8CC9AE; --ok-200: #B9DDCB;
  --ok-100: #E3F1EA; --ok-50: #F0F8F4;
  --warn-700: #8F5E17; --warn-600: #B7791F; --warn-500: #C98B2B; --warn-400: #D9A24A;
  --warn-300: #E6BE7B; --warn-200: #F0D6A6; --warn-100: #F8EEDB; --warn-50: #FBF6EA;
  --bad-700: #8F342C; --bad-600: #B4443A; --bad-500: #B4443A; --bad-300: #E0A19B;
  --bad-200: #EBC4C0; --bad-100: #F6E1DF; --bad-50: #FAF0EF;

  /* Radii & Geometry */
  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 14px; --r-2xl: 16px;

  /* Precise Elevation Hierarchy */
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-sm: 0 1px 3px rgba(24, 24, 27, 0.06), 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(24, 24, 27, 0.08), 0 2px 6px -1px rgba(24, 24, 27, 0.04);
  --shadow-lg: 0 12px 32px -4px rgba(24, 24, 27, 0.12), 0 4px 12px -2px rgba(24, 24, 27, 0.06);
  --shadow-modal: 0 20px 48px -8px rgba(15, 23, 42, 0.28), 0 8px 16px -4px rgba(15, 23, 42, 0.08);

  /* Modern Ergonomic Motion Curves */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.1s var(--ease-out);
  --transition: 0.14s var(--ease-out);
  --transition-md: 0.22s var(--ease-out);
}

/* ── 2. Base Typography & Surface ─────────────────────────────────────────── */
html, body {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  color: var(--ink-900);
  background: var(--paper-100);
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
::selection {
  background: rgba(154, 123, 63, 0.22);
  color: inherit;
}

/* ── 3. Smooth Page & Component Transitions ───────────────────────────────── */
@keyframes rd-page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes rd-stat-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes rd-modal-in {
  from {
    opacity: 0;
    transform: perspective(1200px) translate3d(0, 26px, -50px) rotateX(3deg) scale3d(0.96, 0.96, 1);
  }
  to {
    opacity: 1;
    transform: perspective(1200px) translate3d(0, 0, 0) rotateX(0deg) scale3d(1, 1, 1);
  }
}
@keyframes rd-scrim-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes rd-pulse-soft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.88; }
}

/* Unify page entry transitions */
.page.active,
.page.view-section-animated {
  animation: rd-page-in 0.2s var(--ease-out) both !important;
}

/* Cascade reveals for child widgets */
.page.active .ph {
  animation: rd-page-in 0.16s var(--ease-out) both;
}
.page.active .stat,
.page.active .stats-grid > .stat,
.page.active .tile-grid > .tile {
  animation: rd-stat-rise 0.24s var(--ease-out) backwards;
}
.page.active .stats-grid > .stat:nth-child(1),
.page.active .tile-grid > .tile:nth-child(1) { animation-delay: 0.02s; }
.page.active .stats-grid > .stat:nth-child(2),
.page.active .tile-grid > .tile:nth-child(2) { animation-delay: 0.04s; }
.page.active .stats-grid > .stat:nth-child(3),
.page.active .tile-grid > .tile:nth-child(3) { animation-delay: 0.06s; }
.page.active .stats-grid > .stat:nth-child(4),
.page.active .tile-grid > .tile:nth-child(4) { animation-delay: 0.08s; }
.page.active .stats-grid > .stat:nth-child(n+5),
.page.active .tile-grid > .tile:nth-child(n+5) { animation-delay: 0.1s; }

.page.active .hub-card,
.page.active .appr-row,
.page.active .task-card {
  animation: rd-stat-rise 0.26s var(--ease-out) backwards;
}

/* ── 4. Top Bar Polish & Header Architecture ──────────────────────────────── */
header, .topbar {
  height: 58px;
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--paper-300) !important;
  box-shadow: none !important;
  z-index: 100;
  padding: 0 20px;
}
.topbar-title {
  font-family: var(--font) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em !important;
  color: var(--ink-900) !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  min-width: max-content !important;
  flex: 0 0 auto !important;
  margin-right: 12px;
}
.topbar-hub-btn {
  border-radius: var(--r-sm) !important;
  background: var(--paper-100) !important;
  border: 1px solid var(--paper-300) !important;
  color: var(--ink-700) !important;
  transition: all 0.14s var(--ease-out) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar-hub-btn:hover {
  background: var(--paper-200) !important;
  border-color: var(--gold-400) !important;
  color: var(--ink-900) !important;
  transform: translateY(-1px);
}
.topbar-hub-btn:active {
  transform: scale(0.97) !important;
}
.topbar-search {
  border-radius: var(--r-md) !important;
  position: relative;
}
.topbar-search input {
  height: 34px !important;
  border-radius: var(--r-md) !important;
  border: 1px solid var(--paper-300) !important;
  background: var(--paper-50) !important;
  font-size: 13px !important;
  padding-left: 32px !important;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition) !important;
}
.topbar-search input:hover {
  border-color: var(--ink-300) !important;
}
.topbar-search input:focus {
  border-color: var(--gold-500) !important;
  background: #FFF !important;
  box-shadow: 0 0 0 3px rgba(154, 123, 63, 0.18) !important;
}
.topbar .user-chip {
  border-radius: var(--r-md) !important;
  border: 1px solid var(--paper-300) !important;
  background: var(--paper-50) !important;
  padding: 4px 10px !important;
  transition: all 0.14s var(--ease-out) !important;
  cursor: pointer;
}
.topbar .user-chip:hover {
  border-color: var(--gold-400) !important;
  background: var(--paper-100) !important;
  box-shadow: var(--shadow-xs) !important;
}
.topbar .user-chip:active {
  transform: scale(0.98) !important;
}
.topbar-bell {
  border-radius: var(--r-md) !important;
  border: 1px solid var(--paper-300) !important;
  background: var(--paper-50) !important;
  transition: all 0.14s var(--ease-out) !important;
  cursor: pointer;
}
.topbar-bell:hover {
  background: var(--paper-100) !important;
  border-color: var(--gold-400) !important;
  color: var(--ink-900) !important;
}
.topbar-bell:active {
  transform: scale(0.96) !important;
}

/* Page Header */
body .ph {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--paper-300);
}
body .ph-left .pt, body .ph .pt {
  font-family: var(--font);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--ink-900);
}
body .ph-left > .ps:first-child, body .ph-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 6px;
}
body .ph-left .ps:not(:first-child) {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 4px;
}

/* ── 5. Navigation Rail & Sidebar ─────────────────────────────────────────── */
.sidebar, #app-sidebar {
  background: #0F0F12 !important;
  border-right: 1px solid #27272A;
}
.nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}
.nav-item {
  border-radius: 8px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  transition: background-color var(--transition), color var(--transition), transform 0.12s var(--ease-out);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.95);
  transform: translateX(2px);
}
.nav-item:active {
  transform: scale(0.99);
}
.nav-item.active, #app-sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(214, 188, 134, 0.14) 0%, rgba(214, 188, 134, 0.04) 100%) !important;
  color: var(--gold-300) !important;
  border-color: transparent !important;
  box-shadow: inset 3px 0 0 var(--gold-400) !important;
  font-weight: 600;
}
.nav-item i {
  color: rgba(255, 255, 255, 0.45);
  transition: color var(--transition);
}
.nav-item:hover i, .nav-item.active i {
  color: var(--gold-300);
}
.nav-subitem {
  border-radius: 6px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.65);
  transition: all var(--transition);
}
.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
}
.nav-subitem.active {
  background: rgba(214, 188, 134, 0.12);
  color: var(--gold-300);
  font-weight: 600;
}
.nav-badge {
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 11px;
  padding: 1px 7px;
}

/* Sidebar Footer Utility Rack */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 14px !important;
}
.sidebar-footer button {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  border-radius: 8px !important;
  min-height: 36px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  transition: all 0.14s var(--ease-out) !important;
  cursor: pointer;
}
.sidebar-footer button:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  transform: translateY(-1px);
}
.sidebar-footer button:active {
  transform: scale(0.98);
}
#sidebar-signout-btn:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #FCA5A5 !important;
}

/* ── 6. Module Hub: High-End Cockpit ──────────────────────────────────────── */
.hub-header {
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.hub-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.hub-title {
  font-family: var(--font);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--ink-900);
}
.hub-subtitle {
  font-size: 13px;
  color: var(--ink-500);
}
.hub-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--paper-300);
  background: var(--paper-50);
  box-shadow: var(--shadow-xs);
  padding: 18px 18px 16px;
  transition: transform var(--transition-md), box-shadow var(--transition-md), border-color var(--transition-md);
  position: relative;
}
.hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--paper-300);
  height: 2px;
  opacity: 1;
  transition: background var(--transition);
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
}
.hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-400);
}
.hub-card:hover::before {
  background: var(--gold-500);
}
.hub-card-icon {
  background: var(--paper-200) !important;
  color: var(--ink-700) !important;
  border-radius: var(--r-md);
  transition: all var(--transition);
}
.hub-card:hover .hub-card-icon {
  background: var(--gold-100) !important;
  color: var(--gold-700) !important;
}
.hub-card-title {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.012em;
}
.hub-card-subtitle {
  color: var(--ink-500);
  font-weight: 600;
  letter-spacing: 0.07em;
  font-size: 11px;
}
.hub-group-label {
  color: var(--ink-500);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
}
.hub-group-launch {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  padding: 2px 4px;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
}
.hub-group-launch:hover,
.hub-group-launch:focus-visible {
  color: var(--navy);
  background: var(--paper-100);
  outline: 2px solid rgba(30, 64, 175, 0.25);
  outline-offset: 1px;
}
.hub-feature-pill {
  border-radius: var(--r-md);
  border: 1px solid var(--paper-300);
  background: var(--paper-100);
  color: var(--ink-700);
  transition: all 0.14s var(--ease-out);
}
.hub-feature-pill:hover {
  background: var(--paper-50);
  border-color: var(--gold-400);
  color: var(--ink-900);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(24, 24, 27, 0.05);
}
.hub-feature-pill:active {
  transform: scale(0.97);
}
.hub-launch-btn {
  background: var(--ink-900) !important;
  border: 1px solid var(--ink-900) !important;
  color: var(--gold-300) !important;
  border-radius: var(--r-md) !important;
  min-height: 38px !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.15s var(--ease-out) !important;
}
.hub-launch-btn i {
  transition: transform 0.18s var(--ease-out);
}
.hub-launch-btn:hover {
  background: var(--ink-800) !important;
  border-color: var(--gold-500) !important;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 24, 27, 0.14);
}
.hub-launch-btn:hover i {
  transform: translateX(4px);
}
.hub-launch-btn:active {
  transform: scale(0.97) !important;
}

/* ── 6B. Daily Diary Date Nav & Entry Flow ────────────────────────────────── */
#diary-date-nav {
  background: var(--paper-50) !important;
  border: 1px solid var(--paper-300) !important;
  border-radius: var(--r-lg) !important;
  padding: 10px 16px !important;
  margin-bottom: 1.125rem !important;
  box-shadow: var(--shadow-xs) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
#diary-date-lbl {
  font-family: var(--font) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em !important;
  color: var(--ink-900) !important;
}
.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--paper-200);
  border-radius: 10px;
  gap: 2px;
  border: 1px solid var(--paper-300);
}
.seg-btn {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 6px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-600);
  cursor: pointer;
  transition: background 0.14s var(--ease-out), color 0.14s var(--ease-out), transform 0.1s var(--ease-out);
}
.seg-btn:hover {
  color: var(--ink-900);
}
.seg-btn:active {
  transform: scale(0.97);
}
.seg-btn.active {
  background: var(--ink-900);
  color: #FFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.12);
}
#diary-date-nav .diary-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 7px 14px;
  border: 1px solid var(--paper-300);
  border-radius: 8px;
  background: var(--paper-50);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-800);
  cursor: pointer;
  transition: all 0.14s var(--ease-out);
}
#diary-date-nav .diary-pick:hover {
  background: var(--paper-100);
  border-color: var(--gold-400);
  transform: translateY(-1px);
}
#diary-date-nav .diary-pick:active {
  transform: scale(0.97);
}

/* Diary Entry Form Unfolding */
#form-area {
  animation: rd-stat-rise 0.22s var(--ease-out) both;
}
.form-card {
  background: var(--paper-50);
  border: 1px solid var(--paper-300) !important;
  border-radius: var(--r-lg) !important;
  padding: 1.5rem !important;
  margin-bottom: 1.25rem !important;
  box-shadow: var(--shadow-md) !important;
  position: relative;
}
.form-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-500);
  border-top-left-radius: var(--r-lg);
  border-top-right-radius: var(--r-lg);
}
#template-quick-bar {
  background: var(--paper-100) !important;
  border: 1px solid var(--paper-300) !important;
  border-radius: var(--r-md) !important;
  padding: 8px 12px !important;
}
#session-btns-wrap button {
  border-radius: var(--r-sm) !important;
  border: 1px solid var(--paper-300) !important;
  background: var(--paper-50) !important;
  color: var(--ink-800) !important;
  font-weight: 500 !important;
  transition: all 0.14s var(--ease-out) !important;
  cursor: pointer;
}
#session-btns-wrap button:hover {
  background: var(--paper-200) !important;
  border-color: var(--gold-400) !important;
  color: var(--ink-900) !important;
  transform: translateY(-1px);
}
#session-btns-wrap button:active {
  transform: scale(0.96) !important;
}

/* ── 6B.2 Pro-Level Daily Diary 3D Motion & Spatial Cascade (Partner's Desk) ── */
#diary-list, #diary-list-pending, #diary-list-reviewed {
  perspective: 1200px;
  perspective-origin: center top;
}

@keyframes rd-entry-cascade {
  from {
    opacity: 0;
    transform: perspective(1000px) translate3d(0, 18px, -24px) rotateX(-3.5deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0) rotateX(0deg);
  }
}

@keyframes diarySlideNext {
  from {
    opacity: 0;
    transform: perspective(1000px) translate3d(32px, 0, -25px) rotateY(-3.5deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0) rotateY(0deg);
  }
}

@keyframes diarySlidePrev {
  from {
    opacity: 0;
    transform: perspective(1000px) translate3d(-32px, 0, -25px) rotateY(3.5deg);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0) rotateY(0deg);
  }
}

@keyframes diaryFadeIn {
  from {
    opacity: 0;
    transform: perspective(1000px) translate3d(0, 8px, -16px) scale3d(0.985, 0.985, 1);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
}

.diary-slide-next {
  animation: diarySlideNext 0.20s var(--ease-out) both;
}

.diary-slide-prev {
  animation: diarySlidePrev 0.20s var(--ease-out) both;
}

.diary-fade-in {
  animation: diaryFadeIn 0.20s var(--ease-out) both;
}

/* Staggered card entrance for Daily Diary entries */
.diary-entry-card {
  animation: rd-entry-cascade 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, box-shadow;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease !important;
}

.diary-entry-card:nth-child(1) { animation-delay: 0.02s; }
.diary-entry-card:nth-child(2) { animation-delay: 0.05s; }
.diary-entry-card:nth-child(3) { animation-delay: 0.08s; }
.diary-entry-card:nth-child(4) { animation-delay: 0.11s; }
.diary-entry-card:nth-child(5) { animation-delay: 0.14s; }
.diary-entry-card:nth-child(6) { animation-delay: 0.17s; }
.diary-entry-card:nth-child(7) { animation-delay: 0.20s; }
.diary-entry-card:nth-child(8) { animation-delay: 0.23s; }
.diary-entry-card:nth-child(n+9) { animation-delay: 0.25s; }

.diary-entry-card:hover {
  transform: perspective(1000px) translate3d(0, -4px, 12px) rotateX(1deg) !important;
  box-shadow: 0 16px 32px -6px rgba(18, 20, 24, 0.12), 0 6px 14px -2px rgba(18, 20, 24, 0.05) !important;
}

/* Status-specific refined subtle glow accents on hover */
.diary-entry-card.border-success-leaf\/40:hover {
  border-color: rgba(47, 125, 91, 0.55) !important;
  box-shadow: 0 10px 24px -4px rgba(47, 125, 91, 0.12), 0 2px 6px -1px rgba(47, 125, 91, 0.04) !important;
}

.diary-entry-card.border-secondary:hover,
.diary-entry-card.border-outline-variant\/60:hover {
  border-color: rgba(183, 121, 31, 0.45) !important;
  box-shadow: 0 10px 24px -4px rgba(183, 121, 31, 0.10), 0 2px 6px -1px rgba(183, 121, 31, 0.03) !important;
}

.diary-entry-card.border-error-madder:hover {
  border-color: rgba(180, 68, 58, 0.6) !important;
  box-shadow: 0 10px 24px -4px rgba(180, 68, 58, 0.12) !important;
}

/* Staggered rise and hover polish for Diary stats tiles */
#diary-stats .tile {
  animation: rd-stat-rise 0.22s var(--ease-out) both;
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), border-color 0.16s var(--ease-out) !important;
}

#diary-stats .tile:nth-child(1) { animation-delay: 0.02s; }
#diary-stats .tile:nth-child(2) { animation-delay: 0.06s; }
#diary-stats .tile:nth-child(3) { animation-delay: 0.10s; }
#diary-stats .tile:nth-child(4) { animation-delay: 0.14s; }

#diary-stats .tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ── 6B.3 Workday Arc (Timeline Allocation Bar) ────────────────────────── */
.diary-dual-track {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

/* ── Live Playhead Needle & Scrubber (3D GPU Accelerated) ── */
.diary-arc-playhead {
  position: absolute;
  top: -16px;
  bottom: 0;
  width: 2px;
  pointer-events: none;
  z-index: 12;
  transform-style: preserve-3d;
}

.diary-playhead-line {
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 0;
  width: 2px;
  background: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.diary-playhead-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateZ(6px);
  background: #047857;
  color: #FFFFFF;
  font-size: 9px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.45);
}

.playhead-pulse-dot {
  width: 5px;
  height: 5px;
  background: #34D399;
  border-radius: 50%;
  animation: playheadBlink 1.4s infinite ease-in-out;
}

@keyframes playheadBlink {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.3); }
}

.diary-arc-scrubber {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  pointer-events: none;
  z-index: 20;
  transform: translate3d(0, 0, 0);
  transition: opacity 0.1s ease;
}

.diary-scrubber-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--gold-600);
  box-shadow: 0 0 8px rgba(183, 121, 31, 0.7);
}

.diary-scrubber-pill {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%) translateZ(10px);
  background: var(--ink-900);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-xs, 4px);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.diary-track-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.diary-track-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}
.diary-arc-track.track-punch {
  height: 7px;
  background: var(--paper-150);
}
.diary-punch-presence {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--paper-300);
  border-radius: 9999px;
  opacity: 0.85;
  animation: arcSegmentGrow 0.26s var(--ease-out) both;
}
.diary-arc-gap {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(245, 158, 11, 0.28);
  border: 1px dashed var(--warn-500);
  border-radius: 3px;
  cursor: pointer;
  transition: transform 0.14s var(--ease-out), background-color 0.14s ease, box-shadow 0.14s ease;
  animation: arcSegmentGrow 0.28s var(--ease-out) both;
  z-index: 4;
}
.diary-arc-gap:hover {
  background: rgba(245, 158, 11, 0.55);
  transform: scaleY(1.4);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
  z-index: 6;
}
.dot-gap {
  background: var(--warn-500);
  border: 1px dashed var(--warn-700);
  animation: dotPulse 1.8s ease-in-out infinite;
}
.diary-arc-track {
  height: 9px;
  background: var(--paper-200);
  border: 1px solid var(--paper-300);
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(24, 24, 27, 0.05);
  margin-bottom: 8px;
}

.diary-arc-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
  transform-origin: left center;
  animation: arcSegmentGrow 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
  cursor: pointer;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), filter 0.14s ease, box-shadow 0.16s ease;
  will-change: transform;
}

@keyframes arcSegmentGrow {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.diary-arc-segment:hover,
.diary-arc-segment.active-hover {
  transform: perspective(600px) translate3d(0, -2px, 6px) scaleY(1.3) !important;
  filter: brightness(1.15);
  box-shadow: 0 4px 12px rgba(24, 24, 27, 0.22);
  z-index: 5;
}

.arc-seg-approved { background: var(--ok-500); }
.arc-seg-pending { background: var(--gold-500); }
.arc-seg-needs-change { background: var(--warn-500); }
.arc-seg-rejected { background: var(--bad-500); }

.diary-arc-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--ink-600);
}

.diary-arc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.diary-arc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-approved { background: var(--ok-500); box-shadow: 0 0 5px rgba(47, 125, 91, 0.4); }
.dot-pending { background: var(--gold-500); animation: dotPulse 2s ease-in-out infinite; }
.dot-needs-change { background: var(--warn-500); }
.dot-rejected { background: var(--bad-500); }

/* ── Workday Arc Daily Target Sheen & Badge ── */
.diary-arc-target-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(16, 185, 129, 0.22) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: arcSheenWave 3.5s infinite linear;
  z-index: 4;
}
@keyframes arcSheenWave {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.diary-target-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #D1FAE5;
  border: 1px solid #6EE7B7;
  padding: 2px 8px;
  border-radius: 9999px;
  animation: fieldBreathe 2.4s infinite ease-in-out;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── Live Form Score Point Counter & Milestone Pill ── */
@keyframes ptsPop {
  0% { transform: perspective(400px) translate3d(0, 4px, -10px) scale3d(0.88, 0.88, 1); opacity: 0.6; }
  50% { transform: perspective(400px) translate3d(0, -2px, 8px) scale3d(1.22, 1.22, 1); filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.35)); }
  100% { transform: perspective(400px) translate3d(0, 0, 0) scale3d(1, 1, 1); opacity: 1; }
}
.pts-pop {
  display: inline-block;
  animation: ptsPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.pts-milestone-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid #F59E0B;
  color: #92400E;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.03em;
  animation: ptsPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.25);
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Card highlight link with Workday Arc */
.diary-entry-card.diary-card-highlight {
  border-color: var(--gold-500) !important;
  box-shadow: 0 0 0 2px var(--gold-200), 0 8px 24px -4px rgba(24, 24, 27, 0.12) !important;
  transform: translateY(-3px) !important;
}

/* ── 6B.4 Tactile Springs & Fluid Interactions ────────────────────────────── */
.btn, .seg-btn, .diary-pick, .ced-range-btn, .ced-jump-btn {
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease !important;
  will-change: transform;
}
.btn:active, .seg-btn:active, .diary-pick:active, .ced-range-btn:active, .ced-jump-btn:active {
  transform: scale(0.96) translateZ(0) !important;
}

/* Field pulse for auto-fill & AI Polish */
@keyframes fieldBreathe {
  0% {
    box-shadow: 0 0 0 0 rgba(192, 163, 112, 0.6);
    border-color: var(--gold-500);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(192, 163, 112, 0.25);
    border-color: var(--gold-500);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    border-color: var(--paper-300);
  }
}
.field-pulse {
  animation: fieldBreathe 0.65s var(--ease-out) both !important;
}

/* Client Tag Pill spring entrance & exit */
#diary-client-tags span[data-client] {
  animation: pillSpringIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.14s ease, opacity 0.14s ease;
  will-change: transform, opacity;
}
@keyframes pillSpringIn {
  from {
    transform: scale(0.86);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── 6B.5 Shimmer Skeleton Loader ─────────────────────────────────────────── */
.diary-skeleton-card {
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}
.diary-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.7) 50%, transparent 100%);
  animation: skel-sweep 1.2s infinite ease-in-out;
}
.skel-line {
  background: var(--paper-200);
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Complete eDiary — Full Timeline Modal Styles
═══════════════════════════════════════════════════════════ */
#complete-ediary-modal {
  z-index: 1200;
  perspective: 1400px;
}

.ced-modal-container {
  width: 1060px;
  max-width: 96vw;
  height: 90vh;
  max-height: 900px;
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 64px -12px rgba(18, 20, 24, 0.28), 0 16px 32px -8px rgba(0, 0, 0, 0.18);
  position: relative;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity;
  animation: rd-modal-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ced-header {
  padding: 16px 24px;
  background: var(--paper-100);
  border-bottom: 1px solid var(--paper-300);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.ced-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ced-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gold-100);
  color: var(--gold-700);
  border: 1px solid var(--gold-400);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--r-xs);
}

.ced-range-pills {
  display: inline-flex;
  background: var(--paper-200);
  border: 1px solid var(--paper-300);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 3px;
}

.ced-range-btn {
  padding: 4px 11px;
  border: none;
  background: transparent;
  color: var(--ink-600);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all 0.12s var(--ease-out);
}

.ced-range-btn:hover {
  color: var(--ink-900);
}

.ced-range-btn.active {
  background: var(--paper-50);
  color: var(--ink-900);
  box-shadow: var(--shadow-xs);
}

.ced-metrics-ribbon {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 14px 24px;
  background: var(--paper-50);
  border-bottom: 1px solid var(--paper-300);
}

@media (max-width: 768px) {
  .ced-metrics-ribbon {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ced-metric-card {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--paper-100);
  border: 1px solid var(--paper-200);
  transition: transform 0.14s var(--ease-out), border-color 0.14s var(--ease-out);
}

.ced-metric-card:hover {
  transform: translateY(-1px);
  border-color: var(--gold-400);
}

.ced-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
  margin-bottom: 3px;
}

.ced-metric-val {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
}

/* ── Activity Density Heatmap in Complete eDiary ── */
.ced-heatmap-bar {
  padding: 10px 24px 12px 24px;
  background: var(--paper-100);
  border-bottom: 1px solid var(--paper-300);
}
.ced-heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.ced-heatmap-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-600);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ced-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ced-heatmap-grid {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scrollbar-width: thin;
  perspective: 800px;
}
.ced-heat-day {
  flex: 1;
  min-width: 24px;
  max-width: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.ced-heat-day:hover {
  transform: perspective(600px) translate3d(0, -3px, 6px);
}
.ced-heat-box {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-xs, 4px);
  border: 1px solid rgba(24, 24, 27, 0.08);
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.06);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease, border-color 0.16s ease;
  animation: heatBoxFade 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.ced-heat-day:hover .ced-heat-box {
  box-shadow: 0 6px 14px -2px rgba(24, 24, 27, 0.22);
  transform: perspective(600px) scale3d(1.15, 1.15, 1) translateZ(4px);
  z-index: 5;
}
.ced-heat-box.heat-0 { background: var(--paper-200); }
.ced-heat-box.heat-1 { background: #D1FAE5; border-color: #A7F3D0; }
.ced-heat-box.heat-2 { background: #6EE7B7; border-color: #34D399; }
.ced-heat-box.heat-3 { background: #10B981; border-color: #059669; }
.ced-heat-box.heat-4 { background: #047857; border-color: #065F46; }
.ced-heat-lbl {
  font-size: 9.5px;
  font-family: var(--mono);
  color: var(--ink-500);
}
@keyframes heatBoxFade {
  from {
    opacity: 0;
    transform: perspective(600px) translate3d(0, 6px, -12px) scale3d(0.85, 0.85, 1);
  }
  to {
    opacity: 1;
    transform: perspective(600px) translate3d(0, 0, 0) scale3d(1, 1, 1);
  }
}
.ced-filter-bar {
  padding: 12px 24px;
  background: var(--paper-50);
  border-bottom: 1px solid var(--paper-300);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ced-search-input {
  flex: 1;
  min-width: 180px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--paper-300);
  border-radius: var(--r-sm);
  background: var(--paper-100);
  color: var(--ink-900);
  transition: all 0.14s var(--ease-out);
}

.ced-search-input:focus {
  outline: none;
  background: var(--paper-50);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 2px var(--gold-100);
}

.ced-select {
  padding: 6px 10px;
  font-size: 12.5px;
  border: 1px solid var(--paper-300);
  border-radius: var(--r-sm);
  background: var(--paper-50);
  color: var(--ink-900);
  cursor: pointer;
}

.ced-timeline-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: var(--paper-100);
  position: relative;
}

/* Continuous Vertical Timeline Ribbon */
.ced-timeline-wrapper {
  position: relative;
  padding-left: 32px;
}

.ced-timeline-wrapper::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 24px;
  left: 11px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-500) 0%, var(--paper-300) 100%);
  border-radius: 2px;
}

.ced-day-group {
  margin-bottom: 28px;
  position: relative;
  animation: rd-entry-cascade 0.24s var(--ease-out) both;
}

.ced-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
}

.ced-day-node {
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper-50);
  border: 2px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--gold-100);
  z-index: 2;
}

.ced-day-node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-600);
}

.ced-day-title {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ced-day-stats {
  font-size: 12px;
  color: var(--ink-500);
  font-family: var(--mono);
  background: var(--paper-200);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--paper-300);
}

.ced-day-entries {
  display: flex;
  flex-direction: column;
  gap: 10px;
  perspective: 1000px;
}

.ced-entry-card {
  background: var(--paper-50);
  border: 1px solid var(--paper-300);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-xs);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, box-shadow;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.16s ease;
  position: relative;
  overflow: hidden;
}

.ced-entry-card:hover {
  transform: perspective(1000px) translate3d(4px, -2px, 8px) rotateX(0.8deg);
  border-color: var(--gold-400);
  box-shadow: 0 14px 28px -6px rgba(18, 20, 24, 0.12), 0 4px 12px -2px rgba(18, 20, 24, 0.05);
}

.ced-entry-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--paper-400);
  transition: width 0.14s var(--ease-out), background-color 0.14s var(--ease-out);
}

.ced-entry-card:hover::before {
  width: 5px;
}

.ced-entry-card.is-approved::before { background: var(--ok-500); }
.ced-entry-card.is-pending::before { background: var(--warn-500); }
.ced-entry-card.is-rejected::before { background: var(--bad-500); }
.ced-entry-card.is-needs-change::before { background: var(--gold-500); }

.ced-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.ced-time-slot {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ced-duration-pill {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  background: var(--paper-200);
  color: var(--ink-800);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--paper-300);
}

.ced-client-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 4px;
}

.ced-desc-text {
  font-size: 12.5px;
  color: var(--ink-700);
  line-height: 1.5;
  white-space: pre-wrap;
}

.ced-meta-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--paper-300);
}

.ced-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  background: var(--paper-100);
  color: var(--ink-600);
  border: 1px solid var(--paper-300);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ced-jump-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-700);
  background: transparent;
  border: 1px solid var(--paper-300);
  border-radius: var(--r-sm);
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.12s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.ced-jump-btn:hover {
  background: var(--paper-200);
  color: var(--ink-900);
  border-color: var(--gold-400);
  transform: translateY(-1px);
}

ced-jump-btn:active {
  transform: scale(0.96);
}

/* ── 6C. Tab Guides & Architectural Alert Banners ─────────────────────────── */
.tab-guide-card {
  border-radius: var(--r-lg) !important;
  border: 1px solid var(--paper-300) !important;
  background: var(--paper-50) !important;
  box-shadow: var(--shadow-xs) !important;
  margin-bottom: 1rem !important;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.tab-guide-card:hover {
  border-color: var(--paper-400) !important;
  box-shadow: var(--shadow-sm) !important;
}
.tab-guide-header {
  padding: 12px 16px !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper-100);
  border-bottom: 1px solid transparent;
  transition: background-color var(--transition);
}
.tab-guide-header:hover {
  background: var(--paper-150);
}
.tab-guide-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}
.tab-guide-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-600);
}
.tab-guide-toggle i {
  transition: transform 0.2s var(--ease-out);
}
.tab-guide-card.expanded .tab-guide-toggle i,
.tab-guide-card[open] .tab-guide-toggle i {
  transform: rotate(180deg);
}

/* System Warning & Alert Banners */
#unlogged-days-banner,
#mismatch-correction-banner,
#ediary-penalty-banner,
#repetitive-warning-banner,
#day-review-banner,
#pending-fixes-banner,
#bill-pending-banner,
.setup-banner {
  border-radius: var(--r-lg) !important;
  padding: 12px 16px !important;
  margin-bottom: 1rem !important;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px !important;
  line-height: 1.5 !important;
  box-shadow: var(--shadow-xs);
  animation: rd-stat-rise 0.2s var(--ease-out) both;
}
#unlogged-days-banner,
#repetitive-warning-banner {
  background: var(--bad-50) !important;
  border: 1px solid var(--bad-200) !important;
  color: var(--bad-700) !important;
}
#mismatch-correction-banner,
#ediary-penalty-banner,
#day-review-banner,
#pending-fixes-banner,
.setup-banner {
  background: var(--warn-50) !important;
  border: 1px solid var(--warn-200) !important;
  color: var(--warn-700) !important;
}
#bill-pending-banner {
  background: var(--ok-50) !important;
  border: 1px solid var(--ok-200) !important;
  color: var(--ok-700) !important;
}

/* ── 7. Stat Blocks & Metric Tiles ────────────────────────────────────────── */
.card {
  border-radius: var(--r-lg);
  border: 1px solid var(--paper-300);
  background: var(--paper-50);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stat, .tile {
  border-radius: var(--r-lg);
  padding: 16px 18px;
  border: 1px solid var(--paper-300);
  background: var(--paper-50);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.stat:hover, .tile:hover {
  border-color: var(--paper-400);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.stat-n, .tile-v {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
  margin: 10px 0 4px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-900);
  line-height: 1.1;
}
.stat-l, .tile-l {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.stat-delta {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.appr-card {
  border-radius: var(--r-lg);
  border: 1px solid var(--paper-300);
  background: var(--paper-50);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition);
}
.appr-card:hover {
  border-color: var(--paper-400);
  box-shadow: var(--shadow-sm);
}

/* ── 8. Buttons & Controls ────────────────────────────────────────────────── */
.btn {
  min-height: 34px;
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid var(--paper-400);
  background: var(--paper-50);
  color: var(--ink-800);
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.1s var(--ease-out);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover {
  background: var(--paper-100);
  border-color: var(--ink-300);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(24, 24, 27, 0.05);
}
.btn:active {
  transform: scale(0.97) !important;
}
.btn-sm {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--r-sm);
}
.btn-primary {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #FFF;
}
.btn-primary:hover {
  background: var(--ink-700);
  border-color: var(--ink-700);
  color: #FFF;
  box-shadow: 0 2px 6px rgba(24, 24, 27, 0.12);
}
.btn-export {
  background: var(--ink-900);
  color: var(--gold-300);
  border-color: var(--ink-900);
}
.btn-export:hover {
  background: var(--ink-700);
  color: #FFF;
}
.btn-success {
  background: var(--ok-600);
  border-color: var(--ok-600);
  color: #FFF;
}
.btn-success:hover {
  background: var(--ok-700);
  border-color: var(--ok-700);
  color: #FFF;
}
.btn-danger {
  background: var(--bad-600);
  border-color: var(--bad-600);
  color: #FFF;
}
.btn-danger:hover {
  background: var(--bad-700);
  border-color: var(--bad-700);
  color: #FFF;
}
.btn-secondary {
  background: var(--paper-50);
  color: var(--ink-800);
  border: 1px solid var(--paper-400);
}
.btn-secondary:hover {
  background: var(--paper-100);
  border-color: var(--ink-300);
  color: var(--ink-900);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-600);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--paper-200);
  color: var(--ink-900);
}
.btn-gold, .btn-accent {
  background: var(--gold-500, #9A7B3F);
  border-color: var(--gold-600, #836730);
  color: #FFFFFF;
}
.btn-gold:hover, .btn-accent:hover {
  background: var(--gold-600, #836730);
  color: #FFFFFF;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--paper-300);
  color: var(--ink-700);
}
.btn-outline:hover {
  background: var(--paper-100);
  border-color: var(--paper-400);
  color: var(--ink-900);
}
button:focus-visible, a:focus-visible, .tab:focus-visible, .fc:focus-visible, [role=button]:focus-visible {
  outline: 2px solid var(--gold-500) !important;
  outline-offset: 2px !important;
}

/* ── 9. Tabs & Segmented Trays ────────────────────────────────────────────── */
.tabs {
  background: var(--paper-200);
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
  border: 1px solid var(--paper-300);
}
.tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--r-md);
  color: var(--ink-600);
  transition: all var(--transition);
  cursor: pointer;
}
.tab:hover {
  color: var(--ink-900);
}
.tab.active {
  background: var(--paper-50);
  color: var(--ink-900);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08), 0 0 0 1px var(--paper-300);
}
.fc {
  font-size: 13px;
  padding: 5px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--paper-300);
  background: var(--paper-50);
  color: var(--ink-700);
  transition: all var(--transition);
  cursor: pointer;
}
.fc:hover {
  border-color: var(--paper-400);
  color: var(--ink-900);
}
.fc:active {
  transform: scale(0.97);
}
.fc.active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #FFF;
  font-weight: 600;
}
.filter-label {
  letter-spacing: 0.07em;
  font-size: 11px;
  font-weight: 600;
}

/* ── 10. Tables & High-Density Grids ──────────────────────────────────────── */
table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  width: 100%;
}
th {
  background: var(--paper-200);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--paper-300);
  position: sticky;
  top: 0;
  z-index: 10;
}
td {
  font-size: 13px;
  color: var(--ink-700);
  padding: 11px 14px;
  border-bottom: 1px solid var(--paper-300);
}
tbody tr {
  transition: background-color var(--transition);
}
tbody tr:hover td {
  background: var(--paper-100);
}

/* ── 10B. Approvals & Workflows ───────────────────────────────────────────── */
.appr-list {
  background: var(--paper-50);
  border-radius: var(--r-lg);
  border: 1px solid var(--paper-300);
  overflow: hidden;
}
.appr-row {
  transition: background-color var(--transition);
  will-change: transform, opacity;
}
.appr-row:hover {
  background: var(--paper-100);
}
.appr-btn {
  transition: all 0.14s var(--ease-out) !important;
}
.appr-btn:hover {
  transform: translateY(-1px);
}
.appr-btn:active {
  transform: scale(0.96) !important;
}

/* ── Dignified Partner Stamp Seal (Partner Clearance) ── */
.partner-clearance-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-7deg);
  pointer-events: none;
  z-index: 30;
  animation: partnerStampSlam 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes partnerStampSlam {
  0% {
    opacity: 0;
    transform: perspective(600px) translate3d(-50%, -50%, 60px) rotate(-16deg) scale3d(1.5, 1.5, 1);
  }
  65% {
    opacity: 0.98;
    transform: perspective(600px) translate3d(-50%, -50%, 0) rotate(-6deg) scale3d(0.96, 0.96, 1);
  }
  100% {
    opacity: 0.94;
    transform: perspective(600px) translate3d(-50%, -50%, 0) rotate(-7deg) scale3d(1, 1, 1);
  }
}

.stamp-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  border: 2px dashed #B91C1C;
  border-radius: var(--r-sm, 6px);
  background: rgba(254, 242, 242, 0.94);
  color: #B91C1C;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.28), inset 0 0 6px rgba(185, 28, 28, 0.12);
}

.stamp-firm {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.stamp-verdict {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.1;
  border-top: 1px solid rgba(185, 28, 28, 0.4);
  border-bottom: 1px solid rgba(185, 28, 28, 0.4);
  padding: 2px 8px;
  margin: 2px 0;
}

.stamp-date {
  font-size: 8px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.8;
}

.stamp-group .stamp-inner {
  padding: 8px 26px;
  border-width: 2.5px;
}
.stamp-group .stamp-firm {
  font-size: 10px;
}
.stamp-group .stamp-verdict {
  font-size: 20px;
  padding: 3px 14px;
}
.stamp-group .stamp-date {
  font-size: 9.5px;
}

.ced-verified-seal {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 700;
  color: #B91C1C;
  background: #FEE2E2;
  border: 1px dashed #F87171;
  padding: 1px 6px;
  border-radius: var(--r-xs, 4px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Weekly Quota Radial Ring (3D GPU Accelerated) ── */
.diary-weekly-quota {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--paper-100);
  border: 1px solid var(--paper-300);
  border-radius: var(--r-md);
  padding: 4px 12px 4px 8px;
  transform-style: preserve-3d;
  box-shadow: 0 1px 3px rgba(24, 24, 27, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.diary-weekly-quota:hover {
  transform: perspective(600px) translate3d(0, -2px, 6px);
  border-color: var(--gold-400);
  box-shadow: 0 6px 16px -2px rgba(18, 20, 24, 0.1);
}

.quota-radial-box {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quota-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.quota-bg {
  fill: none;
  stroke: var(--paper-300);
  stroke-width: 3.5;
}

.quota-fill {
  fill: none;
  stroke: var(--gold-500);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 0.9s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.4s ease;
}

.quota-fill.is-met {
  stroke: #10B981;
  filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.5));
}

.quota-pct-label {
  position: absolute;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-900);
}

.quota-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.quota-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-500);
}

.quota-sub {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-800);
}

/* ── AI Polish Gold Shimmer Wave & 3D Tactile Response ── */
.field-shimmer-sweep {
  position: relative;
  overflow: hidden;
}

.field-shimmer-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 30%,
    rgba(245, 158, 11, 0.28) 48%,
    rgba(251, 191, 36, 0.5) 50%,
    rgba(245, 158, 11, 0.28) 52%,
    transparent 70%,
    transparent 100%
  );
  background-size: 250% 100%;
  animation: goldShimmerWave 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
  border-radius: inherit;
}

@keyframes goldShimmerWave {
  0% {
    background-position: 150% 0;
    opacity: 0.2;
  }
  30% {
    opacity: 1;
  }
  100% {
    background-position: -150% 0;
    opacity: 0;
  }
}

.field-polishing-loading {
  position: relative;
  border-color: var(--gold-500) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2) !important;
}

.field-polishing-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(245, 158, 11, 0.12) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: fieldLoadingSweep 1.2s infinite linear;
  border-radius: inherit;
  z-index: 10;
}

@keyframes fieldLoadingSweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ai-polish-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #92400E;
  border: 1px solid #F59E0B;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
  animation: ptsPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
  margin-left: 6px;
}

/* ── 11. Form Inputs & Accessibility ──────────────────────────────────────── */
input, select, textarea {
  font-family: var(--font);
  border-radius: var(--r-md);
  border: 1px solid var(--paper-400);
  font-size: 13.5px;
  color: var(--ink-900);
  background: var(--paper-50);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input::placeholder, textarea::placeholder {
  color: var(--ink-400);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(154, 123, 63, 0.18);
}
label, .fg label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-600);
  letter-spacing: 0;
}

/* ── 11B. Modals, Drawers & Overlays ──────────────────────────────────────── */
.modal-overlay,
.rejection-modal,
#today-glance-modal,
#profile-mandatory-overlay,
#send-firm-email-modal {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(8px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(8px) saturate(140%) !important;
  animation: rd-scrim-in 0.2s var(--ease-out) both !important;
}
.modal,
.rejection-box,
#today-glance-doc,
#profile-mandatory-overlay > div,
#send-firm-email-modal > div {
  border-radius: var(--r-xl) !important;
  border: 1px solid var(--paper-300) !important;
  background: var(--paper-50) !important;
  box-shadow: var(--shadow-modal) !important;
  animation: rd-modal-in 0.22s var(--ease-out) both !important;
  overflow: hidden;
}

/* ── 12. Floating Toast & Notification Pill ───────────────────────────────── */
@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: rgba(24, 24, 27, 0.94) !important;
  color: #FFFFFF !important;
  border-radius: var(--r-lg) !important;
  padding: 12px 18px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.32) !important;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
  animation: toast-enter 0.22s var(--ease-out) forwards;
}
.toast.success {
  background: rgba(20, 50, 36, 0.95) !important;
  border-color: rgba(74, 222, 128, 0.25) !important;
  color: #ECFDF5 !important;
}
.toast.error {
  background: rgba(50, 20, 20, 0.95) !important;
  border-color: rgba(248, 113, 113, 0.25) !important;
  color: #FEF2F2 !important;
}

/* Status pills */
.status-pill {
  font-size: 12px !important;
  padding: 3px 10px !important;
  border-radius: 99px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
}
.sp-pending {
  background: var(--warn-100) !important;
  color: var(--warn-700) !important;
  border: 1px solid var(--warn-200);
}
.sp-approved {
  background: var(--ok-100) !important;
  color: var(--ok-700) !important;
  border: 1px solid var(--ok-200);
}
.sp-rejected {
  background: var(--bad-100) !important;
  color: var(--bad-700) !important;
  border: 1px solid var(--bad-200);
}

/* ── 13. Skeletons & Quiet Scrollbars ─────────────────────────────────────── */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--paper-200, #F1F1F3);
  border-radius: 6px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: skel-sweep 1.2s infinite;
}
@keyframes skel-sweep {
  100% { transform: translateX(100%); }
}

.main::-webkit-scrollbar,
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.main::-webkit-scrollbar-track,
::-webkit-scrollbar-track {
  background: var(--paper-100);
  border-radius: 4px;
}
.main::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
  background: var(--paper-400);
  border-radius: 4px;
}
.main::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-500);
}

/* ── 14. Responsive Layout & Reduced Motion ───────────────────────────────── */
@media (max-width: 767px) {
  .btn { min-height: 38px; }
  .btn-sm { min-height: 32px; }
  input, select, textarea { font-size: 16px; }
  body .ph-left .pt, body .ph .pt { font-size: 21px; }
  .stat-n, .tile-v { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .page.active,
  .page.view-section-animated,
  .page.active .ph,
  .page.active .stat,
  .page.active .tile,
  .page.active .stats-grid > .stat,
  .page.active .tile-grid > .tile,
  .page.active .hub-card,
  .page.active .appr-row,
  .toast.show,
  .modal,
  .modal-overlay {
    animation: none !important;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── 15. Attribute Selectors (Mapping legacy inline JS colors onto the palette) ── */
[style*=" color:#64748B" i],[style*=";color:#64748B" i],[style^="color:#64748B" i],[style*=" color: #64748B" i],[style*=";color: #64748B" i],[style^="color: #64748B" i]{color:#71717A !important}
[style*=" color:#475569" i],[style*=";color:#475569" i],[style^="color:#475569" i],[style*=" color: #475569" i],[style*=";color: #475569" i],[style^="color: #475569" i]{color:#52525B !important}
[style*=" color:#334155" i],[style*=";color:#334155" i],[style^="color:#334155" i],[style*=" color: #334155" i],[style*=";color: #334155" i],[style^="color: #334155" i]{color:#3F3F46 !important}
[style*=" color:#0F172A" i],[style*=";color:#0F172A" i],[style^="color:#0F172A" i],[style*=" color: #0F172A" i],[style*=";color: #0F172A" i],[style^="color: #0F172A" i]{color:#18181B !important}
[style*=" color:#1E293B" i],[style*=";color:#1E293B" i],[style^="color:#1E293B" i],[style*=" color: #1E293B" i],[style*=";color: #1E293B" i],[style^="color: #1E293B" i]{color:#27272A !important}
[style*=" color:#CBD5E1" i],[style*=";color:#CBD5E1" i],[style^="color:#CBD5E1" i],[style*=" color: #CBD5E1" i],[style*=";color: #CBD5E1" i],[style^="color: #CBD5E1" i]{color:#D4D4D8 !important}
[style*=" color:#0F2744" i],[style*=";color:#0F2744" i],[style^="color:#0F2744" i],[style*=" color: #0F2744" i],[style*=";color: #0F2744" i],[style^="color: #0F2744" i]{color:#18181B !important}
[style*=" color:#15803D" i],[style*=";color:#15803D" i],[style^="color:#15803D" i],[style*=" color: #15803D" i],[style*=";color: #15803D" i],[style^="color: #15803D" i]{color:#2F7D5B !important}
[style*=" color:#1A6B1A" i],[style*=";color:#1A6B1A" i],[style^="color:#1A6B1A" i],[style*=" color: #1A6B1A" i],[style*=";color: #1A6B1A" i],[style^="color: #1A6B1A" i]{color:#2F7D5B !important}
[style*=" color:#047857" i],[style*=";color:#047857" i],[style^="color:#047857" i],[style*=" color: #047857" i],[style*=";color: #047857" i],[style^="color: #047857" i]{color:#2F7D5B !important}
[style*=" color:#166534" i],[style*=";color:#166534" i],[style^="color:#166534" i],[style*=" color: #166534" i],[style*=";color: #166534" i],[style^="color: #166534" i]{color:#256548 !important}
[style*=" color:#065F46" i],[style*=";color:#065F46" i],[style^="color:#065F46" i],[style*=" color: #065F46" i],[style*=";color: #065F46" i],[style^="color: #065F46" i]{color:#256548 !important}
[style*=" color:#A32D2D" i],[style*=";color:#A32D2D" i],[style^="color:#A32D2D" i],[style*=" color: #A32D2D" i],[style*=";color: #A32D2D" i],[style^="color: #A32D2D" i]{color:#B4443A !important}
[style*=" color:#B91C1C" i],[style*=";color:#B91C1C" i],[style^="color:#B91C1C" i],[style*=" color: #B91C1C" i],[style*=";color: #B91C1C" i],[style^="color: #B91C1C" i]{color:#B4443A !important}
[style*=" color:#DC2626" i],[style*=";color:#DC2626" i],[style^="color:#DC2626" i],[style*=" color: #DC2626" i],[style*=";color: #DC2626" i],[style^="color: #DC2626" i]{color:#B4443A !important}
[style*=" color:#991B1B" i],[style*=";color:#991B1B" i],[style^="color:#991B1B" i],[style*=" color: #991B1B" i],[style*=";color: #991B1B" i],[style^="color: #991B1B" i]{color:#8F342C !important}
[style*=" color:#92400E" i],[style*=";color:#92400E" i],[style^="color:#92400E" i],[style*=" color: #92400E" i],[style*=";color: #92400E" i],[style^="color: #92400E" i]{color:#8F5E17 !important}
[style*=" color:#633806" i],[style*=";color:#633806" i],[style^="color:#633806" i],[style*=" color: #633806" i],[style*=";color: #633806" i],[style^="color: #633806" i]{color:#8F5E17 !important}
[style*=" color:#B45309" i],[style*=";color:#B45309" i],[style^="color:#B45309" i],[style*=" color: #B45309" i],[style*=";color: #B45309" i],[style^="color: #B45309" i]{color:#B7791F !important}
[style*=" color:#7C3AED" i],[style*=";color:#7C3AED" i],[style^="color:#7C3AED" i],[style*=" color: #7C3AED" i],[style*=";color: #7C3AED" i],[style^="color: #7C3AED" i]{color:#6F5826 !important}
[style*="background:#F8FAFC" i],[style*="background: #F8FAFC" i]{background:#F7F7F8 !important}
[style*="background:#F1F5F9" i],[style*="background: #F1F5F9" i]{background:#F1F1F3 !important}
[style*="background:#E2E8F0" i],[style*="background: #E2E8F0" i]{background:#E4E4E7 !important}
[style*="background:#0F2744" i],[style*="background: #0F2744" i]{background:#18181B !important}
[style*="background:#0F172A" i],[style*="background: #0F172A" i]{background:#18181B !important}
[style*="background:#1E293B" i],[style*="background: #1E293B" i]{background:#27272A !important}
[style*="background:#15803D" i],[style*="background: #15803D" i]{background:#2F7D5B !important}
[style*="background:#1A6B1A" i],[style*="background: #1A6B1A" i]{background:#2F7D5B !important}
[style*="background:#047857" i],[style*="background: #047857" i]{background:#2F7D5B !important}
[style*="background:#A32D2D" i],[style*="background: #A32D2D" i]{background:#B4443A !important}
[style*="background:#B91C1C" i],[style*="background: #B91C1C" i]{background:#B4443A !important}
[style*="background:#DC2626" i],[style*="background: #DC2626" i]{background:#B4443A !important}
[style*="background:#B45309" i],[style*="background: #B45309" i]{background:#B7791F !important}
[style*="background:#FEF3C7" i],[style*="background: #FEF3C7" i]{background:#F8EEDB !important}
[style*="background:#FEF2F2" i],[style*="background: #FEF2F2" i]{background:#FAF0EF !important}
[style*="background:#FEE2E2" i],[style*="background: #FEE2E2" i]{background:#F6E1DF !important}
[style*="background:#D1FAE5" i],[style*="background: #D1FAE5" i]{background:#E3F1EA !important}
[style*="background:#F0FDF4" i],[style*="background: #F0FDF4" i]{background:#F0F8F4 !important}
[style*="background:#FFFBF0" i],[style*="background: #FFFBF0" i]{background:#FBF6EA !important}
[style*="background:#FDE68A" i],[style*="background: #FDE68A" i]{background:#F0D6A6 !important}
[style*="solid #E2E8F0" i],[style*="border-color:#E2E8F0" i]{border-color:#E4E4E7 !important}
[style*="solid #CBD5E1" i],[style*="border-color:#CBD5E1" i]{border-color:#D4D4D8 !important}
[style*="solid #15803D" i],[style*="border-color:#15803D" i]{border-color:#2F7D5B !important}
[style*="solid #1A6B1A" i],[style*="border-color:#1A6B1A" i]{border-color:#2F7D5B !important}
[style*="solid #047857" i],[style*="border-color:#047857" i]{border-color:#2F7D5B !important}

.font-serif {
  font-family: var(--mono) !important;
  font-weight: 500 !important;
  letter-spacing: -0.035em;
}
[style*="SourceSerif4" i] {
  font-family: var(--font) !important;
}


/* ── 16. Historical Data Vault (High-Density Compliance Cockpit) ── */
.vault-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3.5rem;
}

.vault-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--paper-300, #E4E4E7);
  flex-wrap: wrap;
}

.vault-header-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-600, #87692F);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vault-header-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-900, #18181B);
  letter-spacing: -0.025em;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vault-header-desc {
  font-size: 13px;
  color: var(--ink-500, #71717A);
  margin: 0;
  line-height: 1.5;
  max-width: 680px;
}

.vault-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Two-pane layout */
.vault-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 980px) {
  .vault-grid {
    grid-template-columns: 1fr;
  }
}

/* Client directory sidebar */
.vault-sidebar {
  background: var(--paper-50, #FFFFFF);
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.vault-search-box {
  padding: 12px 14px;
  border-bottom: 1px solid var(--paper-200, #F1F1F3);
  background: var(--paper-100, #F7F7F8);
  position: relative;
}

.vault-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-md, 8px);
  font-size: 13px;
  background: #FFFFFF;
  color: var(--ink-900, #18181B);
  outline: none;
  transition: all 0.15s ease;
}

.vault-search-input:focus {
  border-color: var(--ink-800, #27272A);
  box-shadow: 0 0 0 2px rgba(24, 24, 27, 0.08);
}

.vault-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400, #8A8A93);
  font-size: 15px;
  pointer-events: none;
}

.vault-roster-list {
  max-height: 640px;
  overflow-y: auto;
}

.vault-client-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--paper-200, #F1F1F3);
  cursor: pointer;
  background: #FFFFFF;
  border-left: 2px solid transparent;
  transition: all 0.14s ease;
  position: relative;
}

.vault-client-item:hover {
  background: var(--paper-100, #F7F7F8);
}

.vault-client-item.is-active {
  background: rgba(247, 247, 248, 0.95);
  border-left: 2px solid var(--gold-500, #9A7B3F);
  box-shadow: inset 0 0 0 1px rgba(154, 123, 63, 0.15);
}

.vault-client-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900, #18181B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-client-meta {
  font-size: 11px;
  color: var(--ink-500, #71717A);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vault-pan-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--paper-200, #F1F1F3);
  color: var(--ink-700, #3F3F46);
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

/* Client Overview Hero Card */
.vault-hero-card {
  background: var(--paper-50, #FFFFFF);
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-lg, 12px);
  padding: 18px 20px;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.vault-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.vault-hero-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink-900, #18181B);
  letter-spacing: -0.02em;
}

.vault-hero-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.vault-hero-meter {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-200, #F1F1F3);
}

.vault-meter-bar {
  height: 8px;
  background: var(--paper-200, #F1F1F3);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.vault-meter-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Toolbar & Details Guide */
.vault-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.vault-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-details {
  background: #FFFFFF;
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-md, 8px);
  margin-bottom: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s ease;
}

.vault-details summary {
  cursor: pointer;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-900, #18181B);
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  background: var(--paper-50, #FFFFFF);
  transition: background 0.12s ease;
}

.vault-details summary:hover {
  background: var(--paper-100, #F7F7F8);
}

.vault-details[open] summary {
  border-bottom: 1px solid var(--paper-200, #F1F1F3);
  background: var(--paper-100, #F7F7F8);
}

.vault-details-content {
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--ink-600, #52525B);
  line-height: 1.55;
}

/* FY Segmented Control */
.vault-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 1.25rem;
}

.vault-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-md, 8px);
  background: #FFFFFF;
  color: var(--ink-700, #3F3F46);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
  text-align: left;
  transition: all 0.15s ease;
}

.vault-tab:hover {
  background: var(--paper-100, #F7F7F8);
  border-color: var(--ink-300, #A1A1AA);
}

.vault-tab.is-active {
  background: var(--ink-900, #18181B);
  border-color: var(--ink-900, #18181B);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.vault-tab-sub {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 2px;
}

/* Year Section Card */
.vault-year-card {
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-lg, 12px);
  margin-bottom: 1.5rem;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: var(--shadow-xs);
}

.vault-year-header {
  background: var(--paper-100, #F7F7F8);
  padding: 12px 18px;
  border-bottom: 1px solid var(--paper-300, #E4E4E7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.vault-year-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-900, #18181B);
  letter-spacing: -0.015em;
}

.vault-year-ay {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-500, #71717A);
  margin-left: 8px;
  font-weight: 500;
}

/* 10-Slot Matrix Grid */
.vault-slot-grid {
  padding: 14px 18px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

/* High-Density Slot Tile */
.vault-slot-tile {
  border: 1px solid var(--paper-300, #E4E4E7);
  background: #FFFFFF;
  border-radius: var(--r-md, 8px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 136px;
  transition: all 0.15s ease;
  position: relative;
}

.vault-slot-tile:hover {
  border-color: var(--ink-300, #A1A1AA);
  box-shadow: var(--shadow-sm);
}

.vault-slot-tile.slot-verified {
  border-color: var(--ok-300, #8CC9AE);
  background: var(--ok-50, #F0F8F4);
}

.vault-slot-tile.slot-synced {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(239, 246, 255, 0.6);
}

.vault-slot-tile.slot-warning {
  border-color: var(--warn-300, #E6BE7B);
  background: var(--warn-50, #FBF6EA);
}

.vault-slot-tile.slot-danger {
  border-color: var(--bad-300, #E0A19B);
  background: var(--bad-50, #FAF0EF);
}

.vault-slot-tile.slot-na {
  border-color: var(--paper-300, #E4E4E7);
  background: var(--paper-150, #F4F4F6);
  opacity: 0.85;
}

.vault-slot-icon {
  font-size: 20px;
  margin-bottom: 6px;
  display: inline-block;
}

.vault-slot-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-900, #18181B);
  line-height: 1.3;
}

.vault-slot-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.vault-slot-btn {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-xs, 4px);
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vault-slot-btn-primary {
  background: var(--ink-900, #18181B);
  border: 1px solid var(--ink-900, #18181B);
  color: #FFFFFF;
}

.vault-slot-btn-primary:hover {
  background: var(--ink-800, #27272A);
}

.vault-slot-btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--paper-300, #E4E4E7);
  color: var(--ink-700, #3F3F46);
}

.vault-slot-btn-secondary:hover {
  background: var(--paper-100, #F7F7F8);
  border-color: var(--ink-400, #8A8A93);
}

.vault-slot-btn-success {
  background: var(--ok-100, #E3F1EA);
  border: 1px solid var(--ok-300, #8CC9AE);
  color: var(--ok-700, #256548);
}

.vault-slot-btn-success:hover {
  background: var(--ok-200, #B9DDCB);
}

/* Modals */
.vault-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.vault-modal-content {
  background: #FFFFFF;
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-lg, 12px);
  max-width: 840px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: vaultModalIn 0.2s var(--ease-out);
}

@keyframes vaultModalIn {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Vault polish (2026-11-04) */
.vault-hero-meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700, #3F3F46);
  margin-bottom: 8px;
}

/* The global 44px touch-target rule (index.html) made the small tile buttons
   tall and clumsy on desktop. Keep bigger targets on touch screens only. */
.vault-shell .vault-slot-btn { min-height: 28px; padding: 4px 10px; }
.vault-shell .vault-tab { min-height: 0; }
.vault-shell .vault-header-actions .btn,
.vault-shell .vault-toolbar .btn { min-height: 36px; }
@media (pointer: coarse) {
  .vault-shell .vault-slot-btn,
  .vault-shell .vault-header-actions .btn,
  .vault-shell .vault-toolbar .btn { min-height: 40px; }
}

/* Year header progress block, shrinks on narrow screens */
.vault-year-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 240px;
  max-width: 420px;
  justify-content: flex-end;
}

/* Narrow screens: the client list stacks above the slots, so keep it short */
@media (max-width: 980px) {
  .vault-roster-list { max-height: 300px; }
}
@media (max-width: 767px) {
  .vault-shell { padding: 1rem 0.75rem 3rem; }
  .vault-header-actions { width: 100%; }
  .vault-header-actions .btn { flex: 1 1 auto; justify-content: center; }
  .vault-year-header { padding: 12px 14px; }
  .vault-year-progress { max-width: none; justify-content: flex-start; }
  .vault-slot-grid { padding: 12px 14px 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
}

/* Vault automatic assignment (2026-11-06) */
.vault-assign-tag {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 5px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-600, #52525B);
  background: var(--paper-150, #F4F4F6); border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: 99px; padding: 1px 8px;
}
.vault-assign-tag.is-mine { color: var(--ok-700, #256548); background: var(--ok-50, #F0F8F4); border-color: var(--ok-300, #8CC9AE); }
.vault-lock-banner {
  display: flex; align-items: center; gap: 8px; margin-bottom: 1rem; padding: 10px 14px;
  border: 1px solid var(--warn-300, #E6BE7B); background: var(--warn-50, #FBF6EA);
  color: var(--warn-700, #8F5E17); border-radius: 8px; font-size: 12.5px; font-weight: 600;
}
.vault-assign-card { padding: 14px 16px; background: #fff; border: 1px solid var(--paper-300, #E4E4E7); border-radius: 12px; }
.vault-assign-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.vault-assign-table th { text-align: left; font-size: 11px; font-weight: 700; color: var(--ink-500, #71717A); padding: 6px 8px; border-bottom: 1px solid var(--paper-300, #E4E4E7); }
.vault-assign-table td { padding: 7px 8px; border-bottom: 1px solid var(--paper-200, #F1F1F3); }
.vault-assign-table .num { text-align: right; font-family: var(--mono); }

/* My Tasks > Vault uploads */
.tasks-view-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--paper-150, #F4F4F6); border: 1px solid var(--paper-300, #E4E4E7); border-radius: 10px; margin-bottom: 14px; }
.tasks-view-switch button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-600, #52525B); cursor: pointer; min-height: 0; }
.tasks-view-switch button.is-active { background: #fff; color: var(--ink-900, #18181B); box-shadow: var(--shadow-xs); }
.tasks-view-switch .count { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--bad-600, #B4443A); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.vmt-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--paper-300, #E4E4E7); border-radius: 10px; background: #fff; margin-bottom: 8px; }
.vmt-card.is-late { border-color: var(--bad-300, #E0A19B); background: var(--bad-50, #FAF0EF); }
.vmt-name { font-size: 13.5px; font-weight: 700; color: var(--ink-900, #18181B); }
.vmt-meta { font-size: 11.5px; color: var(--ink-500, #71717A); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.vmt-bar { width: 120px; height: 6px; background: var(--paper-200, #F1F1F3); border-radius: 99px; overflow: hidden; }
.vmt-bar > span { display: block; height: 100%; border-radius: 99px; }

/* ── Fit-to-screen data tables (2026-11-09, partner request) ───────────────
   Wide tables (Salary 16 cols, Audit AI up to 13, Financials checker 14) forced
   sideways scrolling on 1280px-and-narrower viewports -- i.e. 1920px laptops at
   125-150% Windows scaling. Measured on the 16-column salary table: cell
   horizontal padding of 6px (was 10-14px, mostly set inline, hence !important)
   removes the overflow down to a 1280px viewport. Header letter-spacing is also
   reduced and headers may wrap. Scoped to .main so modals, login and onboarding
   are untouched. Vertical padding is deliberately left alone. */
.main table th,
.main table td { padding-left: 6px !important; padding-right: 6px !important; }
.main table th { letter-spacing: 0.04em !important; white-space: normal; }

/* Where a table is still wider than its wrapper, keep the first column (client /
   employee / period) pinned so rows stay readable while scrolling sideways.
   No effect on tables that fit. Opaque background is required or scrolled cells
   show through the pinned column. */
.main .table-responsive th:first-child,
.main .wt-table-wrap th:first-child,
.main [style*="overflow-x:auto"] > table th:first-child,
.main [style*="overflow-x: auto"] > table th:first-child {
  position: sticky; left: 0; z-index: 12;
}
.main .table-responsive td:first-child,
.main .wt-table-wrap td:first-child,
.main [style*="overflow-x:auto"] > table td:first-child,
.main [style*="overflow-x: auto"] > table td:first-child {
  position: sticky; left: 0; z-index: 2;
  background: var(--paper-50, #fff);
  box-shadow: 1px 0 0 var(--paper-300, #E2E8F0);
}

/* Amounts, counts and badges never break across lines ("₹" on one line, the
   number on the next); text columns still wrap. */
.main table td[style*="text-align:right"],
.main table td[style*="text-align: right"],
.main table td[style*="text-align:center"],
.main table td[style*="text-align: center"] { white-space: nowrap; }

/* Top bar fit (2026-11-09): at 1134-1500px viewports the bar was 115-190px wider
   than the screen and clipped the user chip. Below 1500px drop the low-value text
   (date, sync/passphrase labels -- their dot/lock icons stay, Ctrl+K hint, role
   pill) and shrink the search box. Verified live: overflow 183px -> 0 at 1134px. */
@media (max-width: 1500px) {
  .topbar-date, #sync-label, #master-pass-label { display: none !important; }
  .topbar-search input { width: 150px !important; min-width: 0 !important; }
  .topbar-search kbd, .topbar-search span { display: none !important; }
  .topbar-right { gap: 8px !important; min-width: 0; }
  .topbar .user-chip .role-pill { display: none !important; }
  .topbar .chip-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Salary rules card: the chip row used to show even when the card was collapsed
   and filled a whole screen above the salary table. Show chips only when opened. */
.sal-rules-card:not([open]) .sal-rules-chips { display: none; }
.sal-rules-card:not([open]) > summary > div:first-child { margin-bottom: 0 !important; }

/* ── Collapsible sidebar (2026-11-09, desktop >= 1024px) ──────────────────────
   Collapsed = 64px icon rail (the sidebar is 214px). Gives ~150px of content width on every screen;
   Audit AI and Financials Checker need it most, so they auto-collapse unless the user has chosen
   'expanded' (class .sb-expanded, set by toggleSidebarCollapse in core.js). Below 1024px the existing
   off-canvas drawer is untouched. Nav text sits directly in the .nav-item (no span), hence font-size:0. */
.sb-collapse-btn { display: none; }
@media (min-width: 1024px) {
  .sidebar { transition: width .18s ease; }
  .sb-logo { position: relative; }
  .sb-collapse-btn {
    display: inline-grid; place-items: center; margin-left: auto; flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
    background: transparent; border: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.55);
  }
  .sb-collapse-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
  .sb-collapse-btn:focus-visible { outline: 2px solid var(--gold-500, #c9a84c); outline-offset: 1px; }

  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sidebar { width: 64px; overflow-x: hidden; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sidebar-inner { padding: .5rem 8px; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sb-logo { flex-direction: column; gap: 8px; padding: 12px 0 10px; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sb-logo-text,
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .nav-group-label,
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .nav-subrow,
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sidebar-hub-nav-item span,
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sb-user-area { display: none !important; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sidebar-hub-nav-item { margin: 4px 0 10px; padding: 9px 0; justify-content: center; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .nav-item { font-size: 0; gap: 0; padding: 9px 0; justify-content: center; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .nav-item > i { font-size: 18px; width: auto; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .nav-item.active::before { left: -8px; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .nav-badge {
    position: absolute; top: 1px; right: 3px; margin: 0; font-size: 9.5px; line-height: 13px; padding: 0 4px;
  }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sidebar-footer { font-size: 0; padding: .5rem 8px; }
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .sidebar-footer button {
    font-size: 0 !important; padding: 9px 0 !important; justify-content: center !important; gap: 0 !important;
  }
}

/* Partner salary table tuning (2026-11-09): the eDiary Penalty column (9th) holds long notes such as
   "refund due in Nov-2026" and was forced onto one line by the numeric no-wrap rule above (176px).
   Let it wrap. Below 1500px the Article/Staff label next to the name is dropped (name stays; the
   role is still in the member's detail view). */
.sal-team-tbl td:nth-child(9) { white-space: normal !important; min-width: 96px; max-width: 150px; }
@media (max-width: 1500px) { .sal-team-tbl .sal-role { display: none; } }

/* Collapsed sidebar: the module title ("Audit & Accounts" / "Partner Desk") next to its icon showed as a clipped stub. */
@media (min-width: 1024px) {
  .app:is(.sb-collapsed, :not(.sb-expanded):has(#page-auditai.active, #page-fincheck.active)) .modnav-title span { display: none; }
}


/* ═══════════════════════════════════════════════════════════
   MASTERPLAN STEPS 5, 6, 7: TOUCH CAROUSEL, 3D COIN FLIP, SYNC BEACON
   ═══════════════════════════════════════════════════════════ */

/* Step 5: Mobile & Tablet Touch Carousel for Diary */
#diary-entries {
  touch-action: pan-y;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.diary-touch-swiping {
  user-select: none !important;
  -webkit-user-select: none !important;
  pointer-events: none !important;
}

/* Step 6: Mark Billed 3D Badge Coin Flip */
@keyframes coinFlipBilled {
  0% {
    transform: perspective(600px) rotateX(0deg) scale3d(1, 1, 1);
  }
  50% {
    transform: perspective(600px) rotateX(90deg) scale3d(1.12, 1.12, 1);
    background-color: rgba(47, 125, 91, 0.25) !important;
    color: #2F7D5B !important;
    box-shadow: 0 0 16px rgba(47, 125, 91, 0.45) !important;
  }
  100% {
    transform: perspective(600px) rotateX(0deg) scale3d(1, 1, 1);
    background-color: rgba(47, 125, 91, 0.15) !important;
    color: #2F7D5B !important;
    box-shadow: 0 0 8px rgba(47, 125, 91, 0.2) !important;
  }
}

.coin-flip-billed {
  animation: coinFlipBilled 0.35s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  transform-style: preserve-3d;
}

/* Step 7: Atomic Sync Emerald Pulse Beacon & Late-Night Audit Ambiance */
@keyframes syncBeaconWave {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.85), 0 0 8px rgba(74, 222, 128, 0.6);
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(74, 222, 128, 0), 0 0 12px rgba(74, 222, 128, 0);
    transform: scale(1);
  }
}

.sync-dot.pulse-beacon {
  animation: syncBeaconWave 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1 !important;
}

.late-night-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(183, 121, 31, 0.12);
  border: 1px solid rgba(183, 121, 31, 0.25);
  color: #D97706;
  margin-left: 8px;
  animation: diaryFadeIn 0.3s ease-out both;
}


/* Textarea Direct Gold Glow for AI Polish */
@keyframes taGoldPulse {
  0% {
    border-color: rgba(245, 158, 11, 0.4) !important;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5) !important;
  }
  50% {
    border-color: #F59E0B !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25), 0 0 16px rgba(245, 158, 11, 0.3) !important;
  }
  100% {
    border-color: var(--input-border, #CBD5E1);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0) !important;
  }
}

.ta-gold-shimmer {
  animation: taGoldPulse 0.85s cubic-bezier(0.16, 1, 0.3, 1) both !important;
}

/* Work trackers (Income Tax Tracker etc., desktop): tighter fixed columns, and
   the #, query and Client Name columns stay pinned together when the table is
   still wider than its wrapper. Scoped to tables that have the Work Queries
   column; other .wt-tbl tables are untouched. Layout only. */
@media (min-width: 1024px) {
  .main .wt-tbl:has(th[title="Work Queries"]) :is(th, td):nth-child(1) { width: 30px; min-width: 30px; max-width: 30px; }
  .main .wt-tbl:has(th[title="Work Queries"]) :is(th, td):nth-child(2) { width: 38px; min-width: 38px; max-width: 38px; }
  .main .wt-tbl:has(th[title="Work Queries"]) :is(th, td):nth-child(3) { min-width: 165px !important; }
  .main .wt-tbl:has(th[title="Work Queries"]) th:nth-child(2),
  .main .wt-tbl:has(th[title="Work Queries"]) th:nth-child(3) { position: sticky; z-index: 12; }
  .main .wt-tbl:has(th[title="Work Queries"]) td:nth-child(2),
  .main .wt-tbl:has(th[title="Work Queries"]) td:nth-child(3) {
    position: sticky; z-index: 2; background: var(--paper-50, #fff);
  }
  .main .wt-tbl:has(th[title="Work Queries"]) :is(th, td):nth-child(2) { left: 30px; }
  .main .wt-tbl:has(th[title="Work Queries"]) :is(th, td):nth-child(3) { left: 68px; box-shadow: 1px 0 0 var(--paper-300, #E2E8F0); }
  .main .wt-tbl:has(th[title="Work Queries"]) th:nth-child(3) { background: var(--paper-200); }
  .main .wt-tbl:has(th[title="Work Queries"]) th[style*="80px"] { min-width: 64px !important; }
  .main .wt-tbl:has(th[title="Work Queries"]) th[style*="92px"] { min-width: 84px !important; }
}

/* Drag & Drop direct file target on slot tiles */
.vault-slot-tile.is-drag-over {
  border-color: var(--gold-500, #9A7B3F) !important;
  background: var(--gold-100, #F3EBDA) !important;
  box-shadow: 0 0 0 2px var(--gold-400, #C4A869), var(--shadow-md) !important;
  transform: scale(1.02);
}

/* ── Module Hub Quick Launch Strip ── */
.hub-quick-strip {
  margin-bottom: 1.25rem;
}
.hub-quick-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-50, #FFFFFF);
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-md, 8px);
  padding: 8px 14px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
}
.hub-quick-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-700, #3F3F46);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.hub-quick-items {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hub-quick-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-800, #27272A);
  background: var(--paper-100, #F7F7F8);
  border: 1px solid var(--paper-300, #E4E4E7);
  border-radius: var(--r-sm, 6px);
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.hub-quick-btn:hover {
  background: var(--ink-900, #18181B);
  color: #FFFFFF;
  border-color: var(--ink-900, #18181B);
  box-shadow: var(--shadow-xs);
  transform: translateY(-1px);
}
.hub-quick-btn:hover i {
  color: var(--gold-400, #C4A869);
}
.hub-quick-kbd {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(24, 24, 27, 0.08);
  color: var(--ink-700, #3F3F46);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(24, 24, 27, 0.12);
}
.hub-quick-btn:hover .hub-quick-kbd {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ── 17. Taste-Design Refinements & Global Harmonization ──────────────────── */

/* 17.1 Banned Thick Left-Stripe Eradication (DESIGN.md Rule 4) */
div[style*="border-left: 4px" i],
div[style*="border-left:4px" i],
div[style*="border-left: 3px" i],
div[style*="border-left:3px" i],
.card[style*="border-left:" i] {
  border-left-width: 1px !important;
  border-radius: var(--r-md, 8px) !important;
}

td[style*="border-left: 3px" i],
td[style*="border-left:3px" i] {
  border-left-width: 2px !important;
  border-radius: 0 !important;
}

/* 17.2 Composed Empty States */
.empty,
.empty-state,
.zero-state {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 36px 20px !important;
  background: var(--paper-100, #F8FAFC) !important;
  border: 1px dashed var(--paper-300, #E2E8F0) !important;
  border-radius: var(--r-md, 8px) !important;
  color: var(--ink-500, #64748B) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  gap: 8px !important;
  margin: 16px 0 !important;
}

.empty i,
.empty-state i,
.zero-state i {
  font-size: 28px !important;
  color: var(--ink-400, #94A3B8) !important;
  margin-bottom: 2px !important;
  opacity: 0.85 !important;
}

/* 17.3 Tabular Monospace Directives */
.num,
.pan-cell,
.pan-mono,
.gstin-cell,
.udin-cell,
.amount-cell,
.date-cell,
.time-cell,
.badge-mono,
.tabular-num,
td.num,
th.num,
td[style*="text-align:right" i],
td[style*="text-align: right" i] {
  font-family: var(--mono) !important;
  font-variant-numeric: tabular-nums !important;
}

/* 17.4 Sub-tabs & Segmented Trays */
.sub-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--paper-200);
  padding: 3px;
  border-radius: var(--r-md, 8px);
  border: 1px solid var(--paper-300);
  gap: 2px;
}

.sub-tab {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--r-sm, 6px);
  color: var(--ink-600);
  cursor: pointer;
  transition: all 0.12s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.sub-tab:hover {
  color: var(--ink-900);
}

.sub-tab.active {
  background: var(--paper-50);
  color: var(--ink-900);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(24, 24, 27, 0.08);
  border-color: var(--paper-300);
}

/* Vault: My assigned clients panel (2026-11-11) */
.vault-my-card { background: #fff; border: 1px solid var(--paper-300, #E4E4E7); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow-xs); }
.vault-my-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.vault-my-title { font-weight: 800; font-size: 14px; color: var(--ink-900, #18181B); display: flex; align-items: center; gap: 6px; }
.vault-my-sub { font-size: 12px; color: var(--ink-500, #71717A); margin-top: 2px; }
.vault-my-list { max-height: 360px; overflow-y: auto; display: grid; gap: 8px; }
.vault-my-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--paper-300, #E4E4E7); border-radius: 10px; background: var(--paper-50, #fff); }
.vault-my-item.is-late { border-color: var(--bad-300, #E0A19B); background: var(--bad-50, #FAF0EF); }
.vault-my-main { min-width: 0; flex: 1; }
.vault-my-name { font-size: 13px; font-weight: 700; color: var(--ink-900, #18181B); }
.vault-my-meta { font-size: 11px; color: var(--ink-500, #71717A); margin-top: 2px; font-family: var(--mono); }
.vault-my-pending { font-size: 12px; color: var(--ink-700, #3F3F46); margin-top: 6px; line-height: 1.5; }
.vault-my-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.vault-my-pct { font-family: var(--mono); font-size: 14px; font-weight: 800; }
@media (max-width: 767px) { .vault-my-item { flex-direction: column; } .vault-my-side { flex-direction: row; align-items: center; } }


/* ═══════════════════════════════════════════════════════════
   PC ACTIVITY TETHER & VOICE DICTATION ENHANCEMENTS
   ═══════════════════════════════════════════════════════════ */

/* Tether hover on PC Activity rows */
.pcact-row {
  position: relative;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.16s ease, box-shadow 0.18s ease;
}

.pcact-row:hover {
  background: var(--paper-200, #f1f3f5) !important;
  transform: perspective(800px) translate3d(2px, 0, 4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pcact-row.pcact-tether-active {
  background: rgba(183, 121, 31, 0.12) !important;
  border-left: 3px solid var(--gold-500, #c9a84c) !important;
  transform: perspective(800px) translate3d(4px, 0, 6px);
  box-shadow: 0 4px 12px rgba(183, 121, 31, 0.15);
}

/* Tether highlighted Approvals row */
.appr-row.appr-tether-highlight {
  background: rgba(183, 121, 31, 0.1) !important;
  outline: 2px solid var(--gold-500, #c9a84c) !important;
  outline-offset: -2px;
  transform: perspective(800px) translate3d(0, -2px, 8px) !important;
  box-shadow: 0 8px 20px -4px rgba(183, 121, 31, 0.22) !important;
  z-index: 10;
}

/* Tether highlighted Workday Arc segment */
.diary-arc-segment.arc-tether-highlight {
  filter: brightness(1.35) drop-shadow(0 0 6px var(--gold-500, #c9a84c)) !important;
  transform: perspective(600px) translate3d(0, -3px, 10px) scaleY(1.4) !important;
  z-index: 15 !important;
}

/* Voice Quick-Dictation Pulse & Waves */
.btn-voice-dictate {
  position: relative;
  overflow: visible;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-voice-dictate:hover {
  transform: translateY(-1px) scale(1.02);
}

.btn-voice-dictate:active {
  transform: scale(0.96);
}

.btn-voice-dictate.is-recording {
  background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35), 0 4px 14px rgba(220, 38, 38, 0.4) !important;
  animation: voiceRecPulse 1.2s infinite ease-in-out;
}

@keyframes voiceRecPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7), 0 0 8px rgba(220, 38, 38, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0), 0 0 14px rgba(220, 38, 38, 0.6);
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0), 0 0 8px rgba(220, 38, 38, 0);
    transform: scale(1);
  }
}

.voice-wave-canvas {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.voice-wave-bar {
  width: 2.5px;
  height: 10px;
  background: currentColor;
  border-radius: 2px;
  animation: voiceWaveBounce 0.8s ease-in-out infinite alternate;
}

.voice-wave-bar:nth-child(2) { animation-delay: 0.15s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.3s; }

@keyframes voiceWaveBounce {
  0% { height: 4px; opacity: 0.4; }
  100% { height: 13px; opacity: 1; }
}

/* ════════════════════════════════════════════════════════════════════════
   Unified badges and scrolling tables (2026-11-12; was the ?ui=v2 preview, made permanent).
   1) One status-pill look (the Notices & Scrutiny look: soft tint + thin border) for the
      existing .pill-*, .sp-*, .badge-ok/-pend/-rej classes.
   2) Count badges: soft tone by default; badges carrying their own inline solid red
      (needs attention) are untouched. Amber/gold inline ones share the soft look.
   3) Tables that scroll sideways fade at the right edge while more columns are hidden
      (Chrome/Edge; other browsers see no change).
   ════════════════════════════════════════════════════════════════════════ */
:is(.pill-ok,.pill-warn,.pill-bad,.pill-gold,.pill-ink,.pill-dim,.sp-approved,.sp-pending,.sp-rejected,.badge-ok,.badge-pend,.badge-rej){
  display:inline-flex !important; align-items:center; gap:5px;
  font-size:12px !important; font-weight:600 !important; line-height:1.2;
  padding:3px 9px !important; border-radius:99px !important;
  border:1px solid transparent !important; white-space:nowrap;
}
:is(.pill-ok,.sp-approved,.badge-ok){background:var(--ok-50) !important;color:var(--ok-700) !important;border-color:var(--ok-200) !important}
:is(.pill-warn,.sp-pending,.badge-pend){background:var(--warn-50) !important;color:var(--warn-700) !important;border-color:var(--warn-200) !important}
:is(.pill-bad,.sp-rejected,.badge-rej){background:var(--bad-50) !important;color:var(--bad-700) !important;border-color:var(--bad-200) !important}
.pill-gold{background:var(--gold-100) !important;color:var(--gold-700) !important;border-color:var(--gold-400) !important}
.pill-ink{background:var(--ink-800) !important;color:#fff !important}
.pill-dim{background:var(--paper-200) !important;color:var(--ink-600) !important;border-color:var(--paper-300) !important}

/* Count badges: soft by default (only where no inline background was set) */
:is(.nav-badge,.wt-tab-badge):not([style*="background"]):not(.red){
  background:var(--gold-100); color:var(--gold-700); border:1px solid var(--gold-400);
  font-size:11.5px; padding:0 7px; border-radius:99px;
}

/* Amber/gold count badges that carry an inline colour (Intake, Mail Log, AI Workflow...) get the same soft look,
   so one tab never mixes two tones. Red (needs attention) stays solid. */
.nav-badge:is([style*="--warn-600"],[style*="--gold-500"],[style*="warn-600"]){
  background:var(--gold-100) !important; color:var(--gold-700) !important; border:1px solid var(--gold-400) !important;
}

/* Sideways-scrolling tables: fade the right edge while more columns are hidden.
   When the table is not scrollable the timeline is inactive and nothing is applied. */
@supports (animation-timeline: scroll()) {
  @keyframes ui2-edge-fade {
    0%, 97% { -webkit-mask-image: linear-gradient(to right,#000 calc(100% - 36px),transparent); mask-image: linear-gradient(to right,#000 calc(100% - 36px),transparent); }
    100%    { -webkit-mask-image: linear-gradient(#000,#000); mask-image: linear-gradient(#000,#000); }
  }
  :is(.table-responsive,.wt-table-wrap,[style*="overflow-x:auto"]:has(> table),[style*="overflow-x: auto"]:has(> table)) {
    animation: ui2-edge-fade linear both;
    animation-timeline: scroll(self inline);
  }
}

/* Keep the global issue action available without covering the last editable
   row or horizontal scrollbar. The extra scroll clearance lets bottom content
   move fully above the fixed control; compact desktop/tablet widths use an
   icon-only 44px target instead of laying a 130px pill over table columns. */
#main-content.main {
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

#report-issue-fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 8000;
  min-width: 44px;
  min-height: 44px;
  padding: 11px 18px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 9999px;
  background: var(--ink-900, #18181b);
  color: #fff;
  box-shadow: 0 4px 8px rgba(15, 23, 42, .2);
  font: 600 13px/1 var(--font);
  cursor: pointer;
}

#report-issue-fab:focus-visible {
  outline: 2px solid var(--gold-400, #c4a869);
  outline-offset: 3px;
}

@media (max-width: 1023px) {
  #report-issue-fab {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .report-issue-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
