/**
 * Design System — ATA & LTA Accounting Firm ERP
 * Modern Purple Dashboard Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Classic light palette (the original corporate light theme) */
  --color-ata: #2563eb;
  --color-lta: #475569;
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-panel: #ffffff;
  --color-bg-muted: #f0f1f3;
  --color-bg-light: #fafafa;
  --color-bg-hover: #f0f1f3;
  --color-bg-subtle: #f8fafc;
  --color-text: #2d2d3f;
  --color-text-main: #1e293b;
  --color-text-muted: #9494a0;
  --color-border: #f0f0f5;
  --color-primary: #2563eb; /* Trust Blue — aligns with other agent worktrees */
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eef1ff;
  --color-primary-alpha: rgba(37, 99, 235, 0.08);
  --color-danger: #ef4444;
  --color-success: #10b981;
  --color-warning: #fbbf24;
  --color-blue: #3b82f6;
  --color-indigo: #6366f1;
  --color-teal: #14b8a6;
  --color-orange: #f97316;
  --color-purple: #a855f7;
  --color-green: #22c55e;
  --color-yellow: #eab308;
  --color-cyan: #06b6d4;
  --color-red: #ef4444;
  --font-sans: "Poppins", "Inter", system-ui, -apple-system, sans-serif;
  --transition-loading: 0.25s;
  --delay-loading: 0.25s;
  --pane-padding-x: 32px;
  --pane-padding-y: 28px;
  --radius-sm: 12px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-xl: 12px;
  --radius-pill: 999px;
  --spacing-xs: 6px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 32px;
  --spacing-xl: 40px;
  --sidebar-width: 200px;
  --sidebar-collapsed-width: 56px;
  --shadow-soft: 0 10px 40px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 15px 35px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 20px 50px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 8px 20px rgba(37, 99, 235, 0.35);

  /* Button & Link Typography Tokens (ERP Industry Standards)
     Ref: SAP Fiori, Microsoft Fluent, Material Design, Oracle Redwoods */
  --btn-font-size: 0.875rem;           /* 14px — standard primary/secondary */
  --btn-font-size-sm: 0.8125rem;       /* 13px — compact buttons */
  --btn-font-size-xs: 0.75rem;         /* 12px — high-density table rows */
  --btn-font-weight: 500;              /* Medium — enterprise standard */
  --btn-font-weight-emphasis: 600;     /* Semi-bold — emphasized/CTA actions */
  --btn-letter-spacing: 0.025em;       /* ~0.35px — SAP/Fluent convention */
  --btn-line-height: 1.43;             /* Enterprise standard for 14px text */
  --link-font-weight: 400;             /* Regular — body/table/form links */
  --link-font-weight-nav: 500;         /* Medium — sidebar navigation links */
  --link-line-height: 1.5;             /* Standard for readability & touch targets */
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg); /* Reset to standard background */
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow: hidden;
}

/* Remove old blobs */
body::before,
body::after {
  display: none;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--link-font-weight);
  line-height: var(--link-line-height);
}

a:hover {
  text-decoration: underline;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Layout */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--spacing-md);
  position: relative;
  z-index: 1;
  background: #0f172a; /* Keep dark background just for login */
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-xl);
  padding: calc(var(--spacing-xl) + 8px);
  box-shadow: var(--shadow-float);
  position: relative;
  overflow: hidden;
}

.login-card h1 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--spacing-xs);
  color: var(--color-text);
}

.login-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-lg);
  font-size: 0.875rem;
}

.login-error {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  text-align: center;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 40px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
  line-height: 1;
  z-index: 2;
}

.password-toggle-btn:hover {
  color: var(--color-text);
  background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .password-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.password-toggle-btn svg {
  display: block;
  pointer-events: none;
}

.password-toggle-btn svg.hidden {
  display: none !important;
}

/* App Shell */
#app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  margin: 0;
  background: var(--color-panel);
  border-radius: 0;
  box-shadow: none;
  border: none;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

@media (max-width: 767.98px) {
  #app-shell {
    height: 100vh;
    width: 100vw;
    margin: 0;
    border-radius: 0;
  }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 16px;
  height: 48px;
  flex-shrink: 0;
  position: relative;
  z-index: 3000;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand .logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.user-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.search-field {
  position: relative;
}

.search-field input {
  width: 260px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-bg);
  font-size: 0.875rem;
  color: var(--color-text);
}
.search-field input::placeholder {
  color: var(--color-text-muted);
}
.search-field input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-border);
}

.header-icon-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  color: var(--color-text-muted);
  transition: background 0.2s;
}
.icon-btn:hover {
  background: var(--color-bg);
}

/* Theme toggle */
.theme-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}
.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.icon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-danger);
  position: absolute;
  top: 6px;
  right: 6px;
}

.icon-dot-secondary {
  background: var(--color-success);
}

.icon-gear {
  width: 16px;
  height: 16px;
  border-radius: 12px;
  border: 2px solid var(--color-text-muted);
}

.entity-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: none;
}

.pill-select {
  border: none;
  background: transparent;
  padding-right: 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  outline: none;
  background-position: right 0 center;
  padding-left: 4px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 10px 2px 2px;
  background: transparent;
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
}

.user-menu-toggle {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.user-menu-toggle:hover {
  color: var(--color-text);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 4px;
}

.user-menu-dropdown.hidden {
  display: none;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.user-menu-item:hover {
  background: var(--color-bg);
}

.user-menu-logout {
  color: var(--color-danger);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: url('https://ui-avatars.com/api/?name=User&background=2563eb&color=fff') center/cover;
  display: inline-block;
}

.avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-bg) center/cover;
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}

.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  margin: 4px 0;
  border-radius: 12px;
}

/* App Layout */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  background: var(--color-bg);
  border-top-left-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 12px;
  box-shadow: 2px 0 10px rgba(0,0,0,0.01);
  z-index: 5;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  -webkit-overflow-scrolling: touch;
  transition: width 0.25s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

/* Sidebar collapse toggle (now in header, Jira-style) */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.sidebar-collapse-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.app-header .sidebar-collapse-btn {
  margin-left: -4px;
}

/* When sidebar is collapsed, rotate header toggle icon */
#app-shell:has(.sidebar.collapsed) .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

/* Hide nav text when collapsed */
.sidebar.collapsed .nav-link-text,
.sidebar.collapsed .nav-badge {
  display: none;
}

.sidebar.collapsed .nav-list {
  padding: 0 6px;
}

.sidebar.collapsed .nav-list li a {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .nav-link-label {
  justify-content: center;
}

.sidebar.collapsed .nav-link-text {
  display: none;
}

.sidebar.collapsed .nav-link-icon {
  margin-right: 0;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 12px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  color: var(--color-text-muted);
  font-weight: var(--link-font-weight-nav);
  border-radius: 12px;
  transition: all 0.2s ease;
  font-size: var(--btn-font-size);
  line-height: var(--link-line-height);
  letter-spacing: var(--btn-letter-spacing);
  white-space: nowrap;
  overflow: hidden;
}

.nav-link-label {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

.nav-link-text {
  text-align: left;
}

.nav-link-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-list li a:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

.nav-list li a.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
  background: var(--color-bg);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: 150px;
}

.content::-webkit-scrollbar {
  width: 8px;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 12px;
}

/* Typography */
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Forms */
.form-stacked {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* Required Field Visual Indicator — Modern Minimal Design Token */
.required-indicator {
  content: "*";
  display: inline-block;
  color: var(--color-danger, #ef4444);
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  margin-left: 3px;
  vertical-align: super;
  transform: translateY(-1px);
  opacity: 0.85;
  user-select: none;
  pointer-events: none;
}

[data-theme="dark"] .required-indicator {
  color: #f87171;
  opacity: 0.9;
}

/* Automatic pseudo-element indicator on form labels containing required controls */
.form-group:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
.form-group.is-required > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
.notion-prop:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
.notion-prop:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) .pw-header-row > label:not(:has(.required-indicator))::after,
.notion-prop.is-required > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
.notion-prop.is-required .pw-header-row > label:not(:has(.required-indicator))::after,
.notion-freeform:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > :is(label, .notion-section-label):not(:has(.required-indicator))::after,
.notion-freeform.is-required > :is(label, .notion-section-label):not(:has(.required-indicator))::after,
.profile-form-group:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > label:not(:has(.required-indicator))::after,
.profile-form-group:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) .pw-header-row > label:not(:has(.required-indicator))::after,
.profile-form-group.is-required > label:not(:has(.required-indicator))::after,
.profile-form-group.is-required .pw-header-row > label:not(:has(.required-indicator))::after,
label.is-required:not(:has(.required-indicator))::after,
label.required:not(:has(.required-indicator))::after,
.notion-section-label.is-required:not(:has(.required-indicator))::after,
.notion-section-heading.is-required:not(:has(.required-indicator))::after,
.form-section.is-required > :is(h3, h4, label):not(:has(.required-indicator))::after,
h3.is-required:not(:has(.required-indicator))::after,
h4.is-required:not(:has(.required-indicator))::after {
  content: "*";
  display: inline-block;
  color: var(--color-danger, #ef4444);
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  margin-left: 3px;
  vertical-align: super;
  transform: translateY(-1px);
  opacity: 0.85;
  user-select: none;
  pointer-events: none;
}

/* Subtle gap compensation for flex label containers */
.notion-prop > label::after,
.pw-header-row > label::after {
  margin-left: -2px;
}

/* Dark mode overrides for required field indicator */
[data-theme="dark"] .form-group:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
[data-theme="dark"] .form-group.is-required > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-prop:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-prop:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) .pw-header-row > label:not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-prop.is-required > label:not(.radio-label):not(.checkbox-label):not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-prop.is-required .pw-header-row > label:not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-freeform:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > :is(label, .notion-section-label):not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-freeform.is-required > :is(label, .notion-section-label):not(:has(.required-indicator))::after,
[data-theme="dark"] .profile-form-group:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) > label:not(:has(.required-indicator))::after,
[data-theme="dark"] .profile-form-group:has(:is(input, select, textarea):is([required], [aria-required="true"], .is-required)) .pw-header-row > label:not(:has(.required-indicator))::after,
[data-theme="dark"] .profile-form-group.is-required > label:not(:has(.required-indicator))::after,
[data-theme="dark"] .profile-form-group.is-required .pw-header-row > label:not(:has(.required-indicator))::after,
[data-theme="dark"] label.is-required:not(:has(.required-indicator))::after,
[data-theme="dark"] label.required:not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-section-label.is-required:not(:has(.required-indicator))::after,
[data-theme="dark"] .notion-section-heading.is-required:not(:has(.required-indicator))::after,
[data-theme="dark"] .form-section.is-required > :is(h3, h4, label):not(:has(.required-indicator))::after,
[data-theme="dark"] h3.is-required:not(:has(.required-indicator))::after,
[data-theme="dark"] h4.is-required:not(:has(.required-indicator))::after {
  color: #f87171;
  opacity: 0.9;
}

/* Suppress visual requirement indicators on the sign-in / login form */
#login-screen label::after,
#login-form label::after,
.login-card label::after,
#login-screen .required-indicator,
#login-form .required-indicator,
[data-theme="dark"] #login-screen label::after,
[data-theme="dark"] #login-form label::after,
[data-theme="dark"] .login-card label::after,
[data-theme="dark"] #login-screen .required-indicator,
[data-theme="dark"] #login-form .required-indicator {
  content: none !important;
  display: none !important;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 36px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239494a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
  min-height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  letter-spacing: var(--btn-letter-spacing);
  line-height: var(--btn-line-height);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid #c7d2e4;
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: #93b0df;
  color: var(--color-text);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--color-primary-dark);
}

.btn-link {
  background: transparent;
  color: var(--color-primary);
  border: none;
  padding: 2px 6px;
  text-decoration: none;
  font-size: var(--btn-font-size-xs);
}

.btn-link:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.btn-link.text-danger,
.btn-link[style*="color:var(--color-danger)"] {
  color: var(--color-danger);
}

.btn-link.text-danger:hover,
.btn-link[style*="color:var(--color-danger)"]:hover {
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
}

.btn-secondary.text-danger {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-secondary.text-danger:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: var(--color-danger);
  color: #dc2626;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

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

.btn-warning {
  background: var(--color-warning);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

/* Table link typography — ERP standard: match body size, regular weight, color-distinguished */
td a {
  font-weight: var(--link-font-weight);
  font-size: inherit;
  line-height: var(--link-line-height);
  letter-spacing: normal;
}

tbody tr {
  transition: background 0.2s;
}

tbody tr:hover {
  background: var(--color-bg);
}

/* Cards */
.card {
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--spacing-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #f4f6fb; color: var(--color-primary); }
.badge-ata { background: #f4f6fb; color: var(--color-primary); }
.badge-lta { background: #fff7ed; color: var(--color-lta); }
.badge-all { background: #e0f2fe; color: #075985; }
.badge-recurring { background: #f3e8ff; color: #6b21a8; }

/* Client entity indication in consolidated view */
.client-entity-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  border-radius: var(--radius-xs, 4px);
  text-transform: uppercase;
  user-select: none;
  vertical-align: middle;
  flex-shrink: 0;
  font-family: inherit;
}

.client-entity-tag.tag-ata {
  background: rgba(37, 99, 235, 0.09);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

.client-entity-tag.tag-lta {
  background: rgba(71, 85, 105, 0.09);
  color: #334155;
  border: 1px solid rgba(71, 85, 105, 0.22);
}

.client-with-entity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.client-with-entity .client-name-text {
  display: inline;
}

.card-v2-desc .client-with-entity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
}

.list-item-meta .client-with-entity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
}

.list-item-title .client-with-entity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

/* WR phase badges — distinct color per phase, aligned with the board/progress palette */
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-preprocessing { background: #dbeafe; color: #1d4ed8; }
.badge-processing { background: #fef3c7; color: #92400e; }
.badge-billing { background: #f3e8ff; color: #7e22ce; }
.badge-disbursement { background: #e0e7ff; color: #4338ca; }
.badge-neutral { background: #f1f5f9; color: #475569; }
.badge-outline {
  background: transparent;
  color: var(--color-text, #334155);
  border: 1px solid var(--color-border, #cbd5e1);
}
.badge-primary {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.badge-secondary {
  background: var(--color-bg-muted, #f1f5f9);
  color: var(--color-text-muted, #475569);
  border: 1px solid var(--color-border, #cbd5e1);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 63, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: var(--spacing-md);
}

.modal {
  background: var(--color-surface);
  border: none;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-float);
}

.modal.modal-wide {
  max-width: 780px;
}

/* Line-item rows inside a modal need to flex properly within the constrained width */
.modal .line-item-row {
  flex-wrap: wrap;
}

.modal .line-item-row .item-type {
  flex: 0 0 120px;
}

.modal .line-item-row .item-desc {
  flex: 2 1 120px;
  min-width: 0;
}

.modal .line-item-row .item-amt {
  flex: 1 1 90px;
  min-width: 70px;
}

.modal .line-item-row .btn {
  flex: 0 0 auto;
}

.modal .modal-body {
  overflow-x: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-body {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) 0 0;
  background: transparent;
}

/* Modal cancel button — ensure it always uses the secondary tier */
.modal-btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 8px 18px;
  border-radius: 12px;
  font-family: inherit;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  letter-spacing: var(--btn-letter-spacing);
  line-height: var(--btn-line-height);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 36px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid #c7d2e4;
}

.modal-btn-cancel:hover {
  background: var(--color-bg);
  border-color: #93b0df;
}

/* ============================================================
 * Notion-inspired typography for plain modal forms
 * (Add Task, Add Time Log, Request/Billing/Disbursement/
 *  Transmittal, Generate modals, etc.)
 * ============================================================ */

/* Modal forms use airy vertical rhythm */
.modal-body .form-stacked {
  gap: 20px;
}

/* Muted uppercase label style matching center-peek notion forms */
.modal-body .form-group {
  gap: 6px;
}

.modal-body .form-group label,
.modal-body .form-section label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* Rounded, background-tinted inputs matching notion property fields */
.modal-body .form-group input[type="text"],
.modal-body .form-group input[type="email"],
.modal-body .form-group input[type="password"],
.modal-body .form-group input[type="number"],
.modal-body .form-group input[type="date"],
.modal-body .form-group input[type="time"],
.modal-body .form-group textarea,
.modal-body .form-group select,
.modal-body .form-group .form-select,
.modal-body .form-group .form-control {
  border-radius: 12px;
  background: var(--color-bg);
  font-weight: 500;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus,
.modal-body .form-group select:focus,
.modal-body .form-group .form-select:focus,
.modal-body .form-group .form-control:focus {
  background: var(--color-surface);
}

/* Read-only modal inputs keep a subtle filled look */
.modal-body .form-group input[readonly] {
  background: var(--color-bg) !important;
  cursor: default;
}

/* Notion-style oversized title input inside modal forms */
.modal-body .form-stacked input[name="title"],
.modal-body .form-stacked .notion-title-input {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  padding: 12px 0 !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--color-text) !important;
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
  width: 100% !important;
  outline: none !important;
  box-shadow: none !important;
}

.modal-body .form-stacked input[name="title"]::placeholder,
.modal-body .form-stacked .notion-title-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.65;
}

/* Section headings inside modal forms */
.modal-body .form-section h4 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

/* Modal property grid for side-by-side related fields */
.modal-body .form-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 20px;
}

/* Modal form action buttons align with notion airy spacing */
.modal-body .form-actions,
.modal-body > form > .btn,
.modal-body > .form-stacked > .btn,
.modal-body .form-stacked > button[type="submit"] {
  margin-top: 4px;
}

/* Notion-style line-item rows inside modal forms */
.modal-body .line-item-row {
  gap: 8px;
  padding: 8px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 8px;
  align-items: center;
}

.modal-body .line-item-row input,
.modal-body .line-item-row select {
  border-radius: 12px;
  background: var(--color-bg);
  font-weight: 500;
}

.modal-body .line-item-row input:focus,
.modal-body .line-item-row select:focus {
  background: var(--color-surface);
}

/* Progress Bar */
.progress {
  width: 100%;
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

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

/* Dashboard / Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(120px, auto);
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}
.bento-item {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.bento-full { grid-column: span 12; }
.bento-half { grid-column: span 6; }
.bento-third { grid-column: span 4; }
.bento-two-thirds { grid-column: span 8; }
.bento-quarter { grid-column: span 3; }

@media (max-width: 1024px) {
  .bento-two-thirds, .bento-half, .bento-third, .bento-quarter { grid-column: span 12; }
}

.kpi-card { background: var(--color-surface); border: none; border-radius: var(--radius-lg); padding: var(--spacing-lg); box-shadow: var(--shadow-card); transition: transform 0.2s; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-card.ata { border-top: none; }
.kpi-card.lta { border-top: none; }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--color-bg); display: flex; align-items: center; justify-content: center; margin-bottom: var(--spacing-sm); color: var(--color-primary); font-weight: bold; }
.kpi-icon.lta-icon { color: var(--color-lta); background: #fff7ed; }
.kpi-label { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 4px; font-weight: 500; }
.kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--color-text); line-height: 1.2; }
.kpi-trend { font-size: 0.75rem; font-weight: 600; margin-top: 4px; }
.kpi-trend.positive { color: var(--color-success); }
.kpi-trend.negative { color: var(--color-danger); }

/* Smooth SVG Charts */
.chart-container { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; width: 100%; min-height: 200px; padding-top: var(--spacing-md); }
.smooth-line-chart { width: 100%; height: 100%; overflow: visible; }
.smooth-line { fill: none; stroke: var(--color-primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 8px 12px rgba(37, 99, 235, 0.4)); }
.smooth-line-bg { fill: url(#primary-gradient); opacity: 0.2; }
.chart-x-axis { font-size: 0.75rem; fill: var(--color-text-muted); }
.donut-chart { width: 100%; max-width: 220px; height: auto; transform: rotate(-90deg); filter: drop-shadow(0 10px 15px rgba(0,0,0,0.05)); }
.donut-segment { fill: none; stroke-width: 16; stroke-linecap: round; }
.donut-primary { stroke: var(--color-primary); }
.donut-secondary { stroke: #22c55e; }
.donut-tertiary { stroke: var(--color-lta); }
.donut-legend { margin-top: var(--spacing-md); width: 100%; display: flex; flex-direction: column; gap: var(--spacing-sm); }
.legend-item { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.legend-label { display: flex; align-items: center; gap: 8px; color: var(--color-text-muted); font-weight: 500; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-value { font-weight: 600; color: var(--color-text); }

.page h1 { margin-bottom: var(--spacing-sm); }
.entity-comparison h2 { margin-bottom: var(--spacing-md); }

/* Actions Bar */
.actions-bar { display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-sm); position: relative; z-index: 26; }
.search-input { flex: 1; max-width: 320px; padding: 10px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-pill); font-family: inherit; font-size: 0.875rem; background: var(--color-surface); }
.empty-state { color: var(--color-text-muted); font-style: italic; text-align: center; padding: var(--spacing-lg); }

.text-center { text-align: center !important; }

/* Inline Errors / Success */
.field-error { display: block; color: var(--color-danger); font-size: 0.75rem; margin-top: var(--spacing-xs); font-weight: 500; }
.field-success { display: block; color: var(--color-success); font-size: 0.75rem; margin-top: var(--spacing-xs); font-weight: 500; }
.field-error.hidden, .field-success.hidden { display: none; }

/* Sidebar Notifications */
.nav-list li a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-badge {
  background: var(--color-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  margin-left: 8px;
  flex-shrink: 0;
}

/* Radio / Checkbox */
.radio-group { display: flex; gap: var(--spacing-lg); }
.radio-label { display: flex; align-items: center; gap: var(--spacing-xs); cursor: pointer; font-size: 0.875rem; font-weight: 500; }
.checkbox-label { display: flex; align-items: center; gap: var(--spacing-xs); cursor: pointer; font-size: 0.875rem; font-weight: 500; }

/* Small Button */
.btn-sm { padding: 6px 12px; font-size: var(--btn-font-size-sm); line-height: var(--btn-line-height); border-radius: 12px; }

/* Form Actions */
.form-actions { display: flex; gap: var(--spacing-sm); margin-top: var(--spacing-lg); }
.form-header-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--spacing-lg); }
.form-actions-top { display: flex; gap: var(--spacing-sm); align-items: center; }

/* Shared form view-mode switcher for full-page breadcrumbs */
.form-view-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.form-view-switcher-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
}

.form-view-switcher-btn:hover,
.form-view-switcher-btn[aria-expanded="true"] {
  background: var(--color-bg);
  color: var(--color-text);
}

.form-view-switcher-menu {
  top: 38px;
  right: 0;
}

.actions-bar .breadcrumb-view-switcher {
  margin-right: var(--spacing-sm);
}

/* Template button with dropdown */
.btn-outline {
  background: transparent;
  color: var(--color-primary, #4f6ef7);
  border: 1.5px solid var(--color-primary, #4f6ef7);
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  letter-spacing: var(--btn-letter-spacing);
  line-height: var(--btn-line-height);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn-outline:hover {
  background: var(--color-primary, #4f6ef7);
  color: #fff;
}
.template-btn-wrapper {
  position: relative;
}
.template-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border, #dfdbe3);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 100;
  padding: 4px 0;
  max-height: 280px;
  overflow-y: auto;
}
.template-dropdown.hidden { display: none; }
.template-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-text, #1a1a2e);
  transition: background 0.1s;
}
.template-dropdown-item:hover {
  background: var(--color-bg-muted, #f0f1f3);
}
.template-dropdown-item.active {
  background: var(--color-primary-light, #eef1ff);
  color: var(--color-primary, #4f6ef7);
  font-weight: 600;
}

/* View Mode Toggle */
.view-mode-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #dfdbe3);
  padding: 3px;
  border-radius: 12px;
  width: fit-content;
  align-items: center;
}
.view-mode-toggle button {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0 !important;
  font-weight: 500;
  letter-spacing: var(--btn-letter-spacing);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  height: 32px;
}
.view-mode-toggle button svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}
.view-mode-toggle button:hover {
  background: var(--color-bg-hover, #fafafa);
  color: var(--color-text);
}
.view-mode-toggle button.active {
  background: var(--color-primary, #2563eb);
  color: #ffffff;
  font-size: 0.75rem !important;
  font-weight: 600;
  padding: 6px 16px;
}

/* Module Tab Navigation */
.module-tab-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  border-bottom: 1px solid #d1d5db;
  margin-bottom: 12px;
  position: sticky;
  z-index: 110;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  margin-top: -8px;
}

.billing-tab-page .module-tab-nav {
  top: var(--billing-title-bar-height, 48px);
}

.operations-tab-page .module-tab-nav,
.operations-list-page .module-tab-nav {
  top: var(--operations-title-bar-height, 48px);
}

.disbursement-tab-page .module-tab-nav {
  top: var(--disbursement-title-bar-height, 48px);
}

.transmittal-tab-page .module-tab-nav {
  top: var(--transmittal-title-bar-height, 48px);
}

.clients-tab-page .module-tab-nav {
  top: var(--clients-title-bar-height, 48px);
}

.admin-tab-page .module-tab-nav {
  top: var(--admin-title-bar-height, 48px);
}

.billing-tab-page .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--billing-title-bar-height, 48px) - var(--billing-tab-nav-height, 45px) - var(--billing-toolbar-height, 40px) - 80px);
}

.billing-tab-page .board-column-v2 {
  max-height: none;
}

.billing-tab-page .board-cards-scroll {
  overflow-y: visible;
}

.billing-tab-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--billing-title-bar-height, 48px) + var(--billing-tab-nav-height, 45px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

.billing-tab-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 8px;
  background: transparent;
  padding: 0;
}

.billing-tab-page .toolbar-sticky-container .view-mode-toggle {
  margin-bottom: 0;
}

.billing-tab-page .toolbar-sticky-container.grouped-board-active:has(.jira-toolbar) {
  padding-bottom: 12px;
  margin-bottom: 0;
}

.billing-tab-page .board-column-header-v2 {
  position: sticky;
  top: calc(var(--billing-title-bar-height, 48px) + var(--billing-tab-nav-height, 45px) + var(--billing-toolbar-height, 0px));
  z-index: 20;
}

.billing-tab-page {
  --board-column-header-top: calc(var(--billing-title-bar-height, 48px) + var(--billing-tab-nav-height, 45px) + var(--billing-toolbar-height, 0px));
}

.operations-tab-page .board-v2,
.operations-list-page .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--operations-title-bar-height, 48px) - var(--operations-tab-nav-height, 45px) - var(--operations-toolbar-height, 40px) - 80px);
}

.operations-tab-page .board-column-v2,
.operations-list-page .board-column-v2 {
  max-height: none;
}

.operations-tab-page .board-cards-scroll,
.operations-list-page .board-cards-scroll {
  overflow-y: visible;
}

.operations-tab-page .toolbar-sticky-container,
.operations-list-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--operations-title-bar-height, 48px) + var(--operations-tab-nav-height, 45px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

/* Jira toolbar variant should match other modules' board spacing when not grouped. */
.operations-tab-page .toolbar-sticky-container:has(.jira-toolbar):not(.grouped-board-active),
.operations-list-page .toolbar-sticky-container:has(.jira-toolbar):not(.grouped-board-active) {
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.operations-tab-page .toolbar-sticky-container .filters-bar,
.operations-list-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 8px;
  background: transparent;
  padding: 0;
}

.operations-tab-page .toolbar-sticky-container .view-mode-toggle,
.operations-list-page .toolbar-sticky-container .view-mode-toggle {
  margin-bottom: 0;
}

.operations-tab-page .board-column-header-v2,
.operations-list-page .board-column-header-v2 {
  position: sticky;
  top: calc(var(--operations-title-bar-height, 48px) + var(--operations-tab-nav-height, 45px) + var(--operations-toolbar-height, 0px));
  z-index: 20;
}

.disbursement-tab-page .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--disbursement-title-bar-height, 48px) - var(--disbursement-tab-nav-height, 45px) - var(--disbursement-toolbar-height, 40px) - 80px);
}

.disbursement-tab-page .board-column-v2 {
  max-height: none;
}

.disbursement-tab-page .board-cards-scroll {
  overflow-y: visible;
}

.disbursement-tab-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--disbursement-title-bar-height, 48px) + var(--disbursement-tab-nav-height, 45px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

.disbursement-tab-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 8px;
  background: transparent;
  padding: 0;
}

.disbursement-tab-page .toolbar-sticky-container .view-mode-toggle {
  margin-bottom: 0;
}

.disbursement-tab-page .toolbar-sticky-container.grouped-board-active:has(.jira-toolbar) {
  padding-bottom: 12px;
  margin-bottom: 0;
}

.disbursement-tab-page .board-column-header-v2 {
  position: sticky;
  top: calc(var(--disbursement-title-bar-height, 48px) + var(--disbursement-tab-nav-height, 45px) + var(--disbursement-toolbar-height, 0px));
  z-index: 20;
}

.disbursement-tab-page {
  --board-column-header-top: calc(var(--disbursement-title-bar-height, 48px) + var(--disbursement-tab-nav-height, 45px) + var(--disbursement-toolbar-height, 0px));
}

.transmittal-tab-page .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--transmittal-title-bar-height, 48px) - var(--transmittal-tab-nav-height, 45px) - var(--transmittal-toolbar-height, 40px) - 80px);
}

.transmittal-tab-page .board-column-v2 {
  max-height: none;
}

.transmittal-tab-page .board-cards-scroll {
  overflow-y: visible;
}

.transmittal-tab-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--transmittal-title-bar-height, 48px) + var(--transmittal-tab-nav-height, 45px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

.transmittal-tab-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 8px;
  background: transparent;
  padding: 0;
}

.transmittal-tab-page .toolbar-sticky-container .view-mode-toggle {
  margin-bottom: 0;
}

.transmittal-tab-page .toolbar-sticky-container.grouped-board-active:has(.jira-toolbar) {
  padding-bottom: 12px;
  margin-bottom: 0;
}

.transmittal-tab-page .board-column-header-v2 {
  position: sticky;
  top: calc(var(--transmittal-title-bar-height, 48px) + var(--transmittal-tab-nav-height, 45px) + var(--transmittal-toolbar-height, 0px));
  z-index: 20;
}

.transmittal-tab-page {
  --board-column-header-top: calc(var(--transmittal-title-bar-height, 48px) + var(--transmittal-tab-nav-height, 45px) + var(--transmittal-toolbar-height, 0px));
}

.documents-tab-page .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--documents-title-bar-height, 48px) - var(--documents-toolbar-height, 40px) - 80px);
}

.documents-tab-page .board-column-v2 {
  max-height: none;
}

.documents-tab-page .board-cards-scroll {
  overflow-y: visible;
}

.documents-tab-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--documents-title-bar-height, 48px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

.documents-tab-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 0;
  background: transparent;
  padding: 0;
}

.documents-tab-page .toolbar-sticky-container .view-mode-toggle {
  margin-bottom: 0;
}

.documents-tab-page .toolbar-sticky-container.grouped-board-active:has(.jira-toolbar) {
  padding-bottom: 12px;
  margin-bottom: 0;
}

.documents-tab-page .board-column-header-v2 {
  position: sticky;
  top: calc(var(--documents-title-bar-height, 48px) + var(--documents-toolbar-height, 0px));
  z-index: 20;
}

.documents-tab-page {
  --board-column-header-top: calc(var(--documents-title-bar-height, 48px) + var(--documents-toolbar-height, 0px));
}

.clients-tab-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--clients-title-bar-height, 48px) + var(--clients-tab-nav-height, 45px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

.clients-tab-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 0;
  background: transparent;
  padding: 0;
}

.admin-tab-page .toolbar-sticky-container {
  position: sticky;
  top: calc(var(--admin-title-bar-height, 48px) + var(--admin-tab-nav-height, 45px));
  z-index: 24;
  background: var(--color-bg, #f4f6fb);
  padding-top: 8px;
  padding-bottom: 12px;
  margin-top: -8px;
  margin-bottom: 16px;
}

.admin-tab-page .toolbar-sticky-container .filters-bar {
  position: static;
  margin-bottom: 0;
  background: transparent;
  padding: 0;
}

.admin-tab-page .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--admin-title-bar-height, 48px) - var(--admin-tab-nav-height, 45px) - var(--admin-toolbar-height, 40px) - 80px);
}

.admin-tab-page .board-column-v2 {
  max-height: none;
}

.admin-tab-page .board-cards-scroll {
  overflow-y: visible;
}

.admin-tab-page .board-column-header-v2 {
  position: sticky;
  top: calc(var(--admin-title-bar-height, 48px) + var(--admin-tab-nav-height, 45px) + var(--admin-toolbar-height, 0px));
  z-index: 20;
}

.module-tab-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: 12px 16px calc(12px + 1px);
  border: none;
  background: transparent;
  color: var(--color-text, #2d2d3f);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.module-tab-link:hover { color: var(--color-text); }
.module-tab-link.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 700; }
.module-tab-link svg { flex-shrink: 0; }
.module-badge-count {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border);
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 700;
  line-height: 1.4;
}
.module-tab-link.active .module-badge-count {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Modern content section spacing — separates page content from the navbar/toolbar
   without altering the toolbar-to-navbar gap on list/board pages. */
.page-content-section {
  color: var(--color-text);
  line-height: 1.5;
}

.module-tab-nav + .page-content-section {
  padding: 24px 0 var(--spacing-lg) !important;
}

.toolbar-sticky-container + .page-content-section,
.module-tab-nav + .toolbar-sticky-container + .page-content-section {
  padding-top: var(--spacing-sm);
}

.page-content-section > .page-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.page-content-section > .page-section-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

/* Card Grid */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--spacing-lg); }
.wr-card { display: flex; flex-direction: column; background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--spacing-lg); box-shadow: var(--shadow-card); }
.wr-meta { display: flex; flex-direction: column; gap: var(--spacing-xs); font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: var(--spacing-md); }
.progress-wrap { display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-sm); }
.progress-label { font-size: 0.8125rem; color: var(--color-text-muted); white-space: nowrap; font-weight: 500; }
.card-actions { margin-top: auto; padding-top: var(--spacing-md); }

/* Client & Audit data cards — modern backlog-style card lists */
.client-cards-list,
.audit-cards-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.client-card,
.audit-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.client-card:hover,
.audit-card:hover {
  border-color: var(--color-border-strong, var(--color-border));
  box-shadow: var(--shadow-card, 0 4px 12px rgba(0,0,0,0.06));
}

.client-card-header,
.audit-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.client-card-title-row,
.audit-card-title-row {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-sm);
  min-width: 0;
}

.client-card-key,
.audit-card-key {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.client-card-title,
.audit-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  opacity: 0;
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}

.client-card:hover .client-card-actions {
  opacity: 1;
}

.client-card-badges,
.audit-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.client-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.client-card-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.client-card-meta-label,
.client-card-section-label,
.audit-card-details-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.client-card-meta-value,
.client-card-section-value,
.audit-card-details-value {
  font-size: 0.875rem;
  color: var(--color-text);
  word-break: break-word;
}

.client-card-sections {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}

.client-card-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-card-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.audit-card-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}

/* Jira backlog role tags */
.jira-backlog-tag-role {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.jira-backlog-tag-role-admin { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.jira-backlog-tag-role-manager { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.jira-backlog-tag-role-accounting { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.jira-backlog-tag-role-operations { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.jira-backlog-tag-role-documentation { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.jira-backlog-tag-role-hr { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

[data-theme="dark"] .jira-backlog-tag-role-admin { background: rgba(153,27,27,0.2); color: #fca5a5; border-color: rgba(252,165,165,0.3); }
[data-theme="dark"] .jira-backlog-tag-role-manager { background: rgba(146,64,14,0.2); color: #fcd34d; border-color: rgba(253,224,71,0.3); }
[data-theme="dark"] .jira-backlog-tag-role-accounting { background: rgba(7,89,133,0.25); color: #7dd3fc; border-color: rgba(125,211,252,0.3); }
[data-theme="dark"] .jira-backlog-tag-role-operations { background: rgba(22,101,52,0.25); color: #86efac; border-color: rgba(134,239,172,0.3); }
[data-theme="dark"] .jira-backlog-tag-role-documentation { background: rgba(91,33,182,0.25); color: #c4b5fd; border-color: rgba(196,181,253,0.3); }
[data-theme="dark"] .jira-backlog-tag-role-hr { background: rgba(71,85,105,0.25); color: #cbd5e1; border-color: rgba(203,213,225,0.3); }

/* Jira backlog status tags */
.jira-backlog-tag-status {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.jira-backlog-tag-status-active { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.jira-backlog-tag-status-disabled { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

[data-theme="dark"] .jira-backlog-tag-status-active { background: rgba(22,101,52,0.25); color: #86efac; border-color: rgba(134,239,172,0.3); }
[data-theme="dark"] .jira-backlog-tag-status-disabled { background: rgba(153, 27, 27, 0.2); color: #fca5a5; border-color: rgba(252, 165, 165, 0.3); }

/* Workflow Progress Bar */
.workflow-progress { display: flex; gap: 6px; margin-bottom: var(--spacing-md); overflow-x: auto; }
.progress-step { flex: 1; padding: 8px 6px; text-align: center; background: var(--color-border); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.progress-step.completed { background: var(--color-success); color: #fff; }
.progress-step.active { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-primary); }

/* Section Header */
.section-header { margin-top: var(--spacing-xl); margin-bottom: var(--spacing-md); }
.form-section { margin-top: var(--spacing-lg); background: var(--color-bg); padding: var(--spacing-lg); border-radius: var(--radius-lg); }
.form-section h3 { margin-bottom: var(--spacing-md); }
.form-section h4 { margin: var(--spacing-md) 0 var(--spacing-sm); font-size: 1rem; }

/* Task Rows */
.task-row { display: flex; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-sm); }
.task-title-input { flex: 1; }
.task-assignee-wrapper {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  width: 100%;
}
.task-row .task-assignee-wrapper,
.task-row-v2 .task-assignee-wrapper,
.task-table-v2 .task-assignee-wrapper {
  width: auto;
  min-width: 180px;
  max-width: 420px;
  flex-shrink: 0;
}
.task-assignee-wrapper .searchable-dropdown {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: none;
}
.task-assignee-wrapper .searchable-dropdown .searchable-dropdown-input {
  height: 36px;
  font-size: 0.875rem;
  min-width: 160px;
}

/* Co-assignee chips */
.co-assignee-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.co-assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
}

.co-assignee-chip-remove {
  cursor: pointer;
  font-weight: 600;
  padding: 0 2px;
  color: #3b82f6;
}

.co-assignee-chip-remove:hover {
  color: #1d4ed8;
}

.co-assignee-chip.readonly {
  cursor: default;
  pointer-events: none;
  opacity: 0.85;
}

/* Task-row multi-avatar assignee display */
.assignee-avatars {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.assignee-avatars .avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e0ecfe center/cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #1e40af;
  border: 1px solid #fff;
}

.assignee-avatars .assignee-name {
  font-size: 0.8125rem;
  color: #1e3a8a;
}

.assignee-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: help;
}

/* Custom Multi-select Dropdown styling */
.multi-select-dropdown {
  position: relative;
  display: inline-block;
  min-width: 150px;
}
.multi-select-btn {
  width: 100%;
  padding: 8px 28px 8px 12px;
  font-family: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 36px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239494a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.multi-select-btn:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.multi-select-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  width: 100%;
  min-width: 200px;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 4px;
  padding: var(--spacing-xs, 4px);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ccc);
  border-radius: var(--radius-sm, 12px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.multi-select-menu.show {
  display: block;
}
.multi-select-option {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm, 8px);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  border-radius: var(--radius-sm, 12px);
  color: var(--color-text, #333);
  margin-bottom: 2px;
  user-select: none;
}
.multi-select-option:hover {
  background: var(--color-bg-hover, #f0f1f3);
}
.multi-select-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

/* Template-locked task rows */
.task-row.template-locked .task-title-input,
.task-row.template-locked .task-pred .multi-select-btn {
  background-color: var(--color-bg-muted, #f0f1f3);
  color: var(--color-text-muted, #888);
  cursor: not-allowed;
  opacity: 0.7;
  pointer-events: none;
}
.task-row.template-locked .btn-danger {
  display: none;
}
.tasks-template-locked .btn-ghost[data-role="add-task"] {
  display: none;
}

/* Template-locked form fields (title, description, due date, client, priority) */
.form-group.template-locked input,
.form-group.template-locked select,
.form-group.template-locked textarea {
  background-color: var(--color-bg-muted, #f0f1f3);
  color: var(--color-text-muted, #888);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Task Dependencies */
.dependency-list { font-size: 0.8125rem; color: var(--color-text-muted); margin-bottom: var(--spacing-xs); }
.dependency-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.dependency-item { margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.predecessor-completed { color: var(--color-success); }
.predecessor-pending { color: var(--color-warning); }
.predecessor-cancelled { color: var(--color-danger); }

/* Invoice Styles */
.line-item-row { display: flex; align-items: center; gap: var(--spacing-sm); margin-bottom: var(--spacing-sm); }
.line-item-row select, .line-item-row input { flex: 1; }
.line-item-row .item-type { flex: 0 0 130px; }
.line-item-row .item-vat { flex: 0 0 140px; }

.invoice-totals { background: var(--color-bg); border-radius: var(--radius-md); padding: var(--spacing-md); margin: var(--spacing-lg) 0; max-width: 360px; margin-left: auto; }
.total-row { display: flex; justify-content: space-between; padding: var(--spacing-xs) 0; font-size: 0.875rem; font-weight: 500; }
.total-grand { font-weight: 700; font-size: 1.125rem; border-top: 1px solid var(--color-border); margin-top: var(--spacing-sm); padding-top: var(--spacing-sm); color: var(--color-primary); }

.invoice-detail { max-width: 720px; margin: 0 auto; background: var(--color-surface); padding: var(--spacing-xl); border-radius: var(--radius-xl); box-shadow: var(--shadow-card); }
.invoice-detail.wide { max-width: 1100px; width: calc(100% - var(--spacing-xl)); margin: var(--spacing-lg) auto; border-radius: var(--radius-lg); }
.invoice-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--spacing-lg); }
.invoice-meta { margin-bottom: var(--spacing-lg); font-size: 0.875rem; color: var(--color-text-muted); }
.invoice-meta p { margin-bottom: 4px; }
.invoice-info-box { background: var(--color-bg); border-radius: var(--radius-md); padding: var(--spacing-md); font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: var(--spacing-lg); }
.invoice-info-box p { margin-bottom: 4px; }

.kpi-sub { font-size: 0.8125rem; color: var(--color-text-muted); margin-bottom: var(--spacing-xs); }

/* Print */
@media print {
  nav, header, .actions-bar, .btn, .form-actions { display: none !important; }
  body { background: var(--color-surface); }
  #app-shell { box-shadow: none; margin: 0; padding: 0; width: 100%; max-height: none; border-radius: 0; }
  .content { background: var(--color-surface); padding: 0; }
  .invoice-detail { max-width: 100%; box-shadow: none; padding: 0; margin: 0; }
}

/* Admin Panel */
.admin-tabs { display: flex; gap: var(--spacing-sm); margin-bottom: var(--spacing-lg); }
.reset-section { background: var(--color-bg); border-radius: var(--radius-lg); padding: var(--spacing-lg); margin-bottom: var(--spacing-lg); }
.reset-section h3 { margin-bottom: var(--spacing-sm); }
.reset-section p { color: var(--color-text-muted); font-size: 0.875rem; margin-bottom: var(--spacing-md); }
.reset-confirm { display: flex; align-items: center; gap: var(--spacing-sm); margin-top: var(--spacing-sm); flex-wrap: wrap; }

.reset-section--subtle {
  background: transparent;
  border-top: 1px dashed var(--color-border);
  border-radius: 0;
  padding: var(--spacing-md) 0 0;
  margin-bottom: 0;
  margin-top: var(--spacing-xl);
}

.reset-section--subtle h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-xs);
}

.reset-section--subtle p {
  font-size: 0.75rem;
  margin-bottom: var(--spacing-sm);
}
.audit-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-md); margin-bottom: var(--spacing-lg); }
.audit-filters .form-select { max-width: 200px; }

.doc-type-badge-original { background: #f4f6fb; color: var(--color-text); }
.doc-type-badge-generated { background: #dbeafe; color: var(--color-primary); }
.handover-completed { color: var(--color-success); font-weight: 600; }
.handover-pending { color: var(--color-text-muted); }

/* User Department Badges and Layout Overrides */
.jira-backlog-row-tags--columns .jira-backlog-tag-department,
.jira-backlog-tag-department {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 4px !important;
  overflow: visible !important;
  max-width: 100% !important;
  justify-content: flex-start !important;
}

.user-dept-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-muted, #f1f5f9);
  color: var(--color-text-muted);
  white-space: nowrap;
}

[data-theme="dark"] .user-dept-badge {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
}

/* Color Coding based on department */
.user-dept-badge--administration {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
[data-theme="dark"] .user-dept-badge--administration {
  background: rgba(153, 27, 27, 0.2);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.3);
}

.user-dept-badge--management {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
[data-theme="dark"] .user-dept-badge--management {
  background: rgba(146, 64, 14, 0.2);
  color: #fcd34d;
  border-color: rgba(253, 224, 71, 0.3);
}

.user-dept-badge--accounting {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}
[data-theme="dark"] .user-dept-badge--accounting {
  background: rgba(7, 89, 133, 0.25);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.3);
}

.user-dept-badge--operations {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
[data-theme="dark"] .user-dept-badge--operations {
  background: rgba(22, 101, 52, 0.25);
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.3);
}

.user-dept-badge--documentation {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #ddd6fe;
}
[data-theme="dark"] .user-dept-badge--documentation {
  background: rgba(91, 33, 182, 0.25);
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.3);
}

.user-dept-badge--hr {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
[data-theme="dark"] .user-dept-badge--hr {
  background: rgba(71, 85, 105, 0.25);
  color: #cbd5e1;
  border-color: rgba(203, 213, 225, 0.3);
}

/* ─── Admin Pending Approvals (reference-image layout) ─────────────────── */
.admin-tabs-v2 {
  display: flex;
  gap: var(--spacing-xl);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-lg);
}
.admin-tab-v2 {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: var(--spacing-sm) 0 calc(var(--spacing-sm) + 2px);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}
.admin-tab-v2:hover { color: var(--color-text); }
.admin-tab-v2.active { color: var(--color-primary); }
.admin-tab-v2.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 12px 12px 0 0;
}
.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}

.approval-category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}
.approval-category-card:last-child { margin-bottom: 0; }

.approval-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--spacing-md);
}
.approval-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.15s ease;
}
.approval-filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.approval-filter-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.approval-filter-pill.active .approval-filter-pill-count {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.approval-filter-pill.disabled,
.approval-filter-pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.approval-filter-pill.disabled:hover,
.approval-filter-pill:disabled:hover {
  border-color: var(--color-border);
  color: var(--color-text);
}
.approval-filter-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.approval-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
}
.approval-category-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}
.approval-category-title .count {
  color: var(--color-text-muted);
  font-weight: 500;
  margin-left: 6px;
}
.approve-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-success);
  background: transparent;
  color: var(--color-success);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.approve-all-btn:hover {
  background: var(--color-success);
  color: #fff;
}
.approve-all-btn svg {
  width: 14px;
  height: 14px;
}

.approval-items-list {
  display: flex;
  flex-direction: column;
}
.approval-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease;
  position: relative;
}
.approval-item:last-child { border-bottom: none; }
.approval-item:hover,
.approval-item:focus-within {
  background: var(--color-bg-light);
}
.approval-item-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
}
.approval-item-icon svg {
  width: 16px;
  height: 16px;
}
.approval-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.approval-item-key {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.approval-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}
.approval-item-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.35;
}
.approval-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.approval-item-meta .submitter-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.approval-item-meta .submitter-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.approval-item-meta .submitter-role {
  font-weight: 500;
  color: var(--color-text);
}
.approval-item-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.approval-item-date svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}
.approval-item-amount {
  margin-left: auto;
  font-weight: 600;
  color: var(--color-text);
}
.approval-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.approval-item:hover .approval-item-actions,
.approval-item:focus-within .approval-item-actions {
  opacity: 1;
  visibility: visible;
}
.approval-item-actions .btn {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  min-height: 26px;
}
.approval-item-actions .btn-reject {
  background: transparent;
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}
.approval-item-actions .btn-reject:hover {
  background: var(--color-danger);
  color: #fff;
}
.approval-item-actions .btn-approve {
  background: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: #fff;
}
.approval-item-actions .btn-approve:hover {
  background: var(--color-primary-dark, var(--color-primary));
}

/* Archive page bulk-selection checkboxes */
.archive-row-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  flex-shrink: 0;
}

.archive-row-checkbox,
.archive-category-select-all {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.archive-category-select-all {
  margin-left: 8px;
}

.archive-page-bulk-bar {
  z-index: 100;
}

.dms-detail-section { margin-top: var(--spacing-xl); }
.dms-detail-section h3 { margin-bottom: var(--spacing-md); }
.version-table tbody tr:last-child { font-weight: 600; background: var(--color-bg); }

/* ─── Reports & Analytics ────────────────────────────────────────────── */
.report-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.report-card {
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  height: 480px; /* Fixed standardized height */
  overflow-y: auto; /* Enable internal vertical scrolling */
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  -webkit-overflow-scrolling: touch;
}

/* Custom Scrollbar for Report Cards */
.report-card::-webkit-scrollbar {
  width: 6px;
}
.report-card::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 12px;
}

.report-card-wide {
  grid-column: 1 / -1;
}

.report-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

.report-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin: var(--spacing-md) 0 var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-mini-stat {
  padding: var(--spacing-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

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

/* CSS Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-md);
  height: 220px;
  padding-top: var(--spacing-md);
}

.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 40px;
}

.bar-track {
  display: flex;
  align-items: flex-end;
  width: 40px;
  height: 180px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.bar {
  width: 100%;
  background: var(--color-primary);
  border-radius: 12px;
  min-height: 4px;
  transition: height 0.4s ease;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.bar-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--spacing-sm);
  text-align: center;
  font-weight: 500;
}

.bar-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 4px;
}

/* Task Expandable Rows */
.task-expand {
  background: var(--color-bg);
}

.task-expand-inner {
  padding: var(--spacing-md);
  border-left: 3px solid var(--color-primary);
  margin-left: var(--spacing-md);
}

.task-doc-row {
  background: var(--color-bg);
}

.task-doc-row td {
  border-bottom: none;
  padding: 0;
}

/* Accordion Panels inside Task Expand */
.accordion-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-sm);
  background: var(--color-surface);
  overflow: hidden;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  background: var(--color-bg-alt);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  user-select: none;
  transition: background 0.15s ease;
}

.accordion-header:hover {
  background: var(--color-border);
}

.accordion-header::after {
  content: '▾';
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  margin-left: var(--spacing-sm);
}

.accordion-panel.collapsed .accordion-header::after {
  transform: rotate(-90deg);
}

.accordion-content {
  padding: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  animation: accordionOpen 0.2s ease-out;
}

.accordion-panel.collapsed .accordion-content {
  display: none;
}

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

/* Print Voucher Styles */
@media print {
  nav, header, .actions-bar, .btn, .form-actions, .view-mode-toggle, .filters-bar {
    display: none !important;
  }
  body { background: var(--color-surface); }
  #app-shell { box-shadow: none; margin: 0; padding: 0; width: 100%; max-height: none; border-radius: 0; }
  .content { background: var(--color-surface); padding: 0; }
  .invoice-detail { max-width: 100%; box-shadow: none; padding: 0; margin: 0; }
  .bir-footer { display: block !important; }
  .voucher-only { display: block !important; }
  .invoice-only { display: none !important; }
}

.voucher-only { display: none; }

/* Task Completion Stat */
.report-stat {
  display: flex;
  align-items: baseline;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-md);
}

.report-stat span:first-child {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.report-stat-label {
  font-size: 1rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Report Tables */
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.report-table th,
.report-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.report-table th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
}

.report-table th.num,
.report-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Fund Split */
.fund-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.fund-box {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
}

.fund-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
  font-weight: 600;
}

.fund-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Entity P&L */
.pl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.pl-card {
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
}

.pl-card.ata {
  border-top: 4px solid var(--color-primary);
}

.pl-card.lta {
  border-top: 4px solid var(--color-lta);
}

.pl-card h3 {
  margin: 0 0 var(--spacing-md);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: none;
  letter-spacing: normal;
}

.pl-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.875rem;
}

.pl-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.pl-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pl-divider {
  border-top: 1px solid var(--color-border);
  margin: var(--spacing-sm) 0;
}

.pl-total {
  font-weight: 700;
  font-size: 1.125rem;
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
}

.pl-total .pl-value.positive {
  color: var(--color-success);
}

.pl-total .pl-value.negative {
  color: var(--color-danger);
}

/* Input Error State */
.input-error {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.board-view {
  display: flex;
  gap: var(--spacing-md);
  width: 100%;
  overflow-x: hidden;
  padding-bottom: var(--spacing-sm);
}

.board-column {
  flex: 1;
  min-width: 0;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.board-column-header {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  padding: var(--spacing-sm) var(--spacing-md);
  background: #e2e8f0; /* Distinct light gray-blue */
  border-radius: var(--radius-sm);
  border-bottom: 2px solid #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: var(--spacing-sm);
}

.board-card {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  border-left: 4px solid transparent;
}

.board-card-urgent { border-left-color: var(--color-danger); }
.board-card-priority { border-left-color: var(--color-warning); }
.board-card-low { border-left-color: var(--color-success); }

.board-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.board-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.board-card-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* Compact List View */
.list-view {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.list-item:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* WR detail list view rows should not look like cards nested inside task-group-v2 */
.task-list-no-card .list-item,
.task-list-no-card.operations-list-view .list-item {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--border);
}
.task-list-no-card .list-item:hover,
.task-list-no-card.operations-list-view .list-item:hover {
  background: var(--color-bg-hover);
  transform: none;
  box-shadow: none;
}
.task-list-no-card .list-item:last-child,
.task-list-no-card.operations-list-view .list-item:last-child {
  border-bottom: none;
}

.operations-list-view .list-item {
  display: grid;
  grid-template-columns: 1fr 150px 120px;
  align-items: center;
  gap: var(--spacing-md);
}

.operations-list-view .list-item > .badge {
  justify-self: end;
}

.operations-list-view .list-item > span:not(.badge) {
  justify-self: end;
}

.list-item-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.list-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Related Records Panel */
.related-records {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.related-records h3 {
  margin-bottom: var(--spacing-md);
  font-size: 1rem;
}

.related-record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border);
}

/* Filters Bar */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3, 12px);
  margin-bottom: 12px;
  position: sticky;
  top: 76px;
  z-index: 100;
  background: var(--color-bg, #f4f6fb);
  padding: 8px 0;
}

.filters-bar .form-select,
.filters-bar input:not([type="checkbox"]):not(.jira-filter-search):not(.jira-filter-date-input):not(.jira-search-input) {
  min-width: 120px;
  height: 34px;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 7px 28px 7px 10px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--color-border, #dfdbe3);
  background-color: var(--color-surface, #ffffff);
  box-sizing: border-box;
}

.filters-bar .form-select {
  background-position: right 10px center;
  padding-right: 28px;
}

.filters-bar .btn,
.filters-bar .btn-sm {
  height: 34px;
  padding: 7px 12px;
  font-size: 0.875rem;
  border-radius: var(--radius-sm, 12px);
}

/* Standard system-wide filter/search inputs */
.search-input {
  height: 32px;
  padding: 6px 14px;
  font-size: 0.875rem;
  border-radius: var(--radius-pill);
}

/* Transmittal */
.transmittal-letter {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  font-family: Georgia, serif;
  line-height: 1.8;
  width: 700px;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.tracking-number {
  font-family: monospace;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

/* Transmittal Print Options & Dynamic Fields */
.transmittal-print-options {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-sizing: border-box;
  overflow: hidden;
}

.transmittal-options-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.transmittal-options-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.transmittal-dynamic-fields {
  margin-top: var(--spacing-sm);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  align-items: start;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .transmittal-dynamic-fields {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
}

.transmittal-field-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 0;
}

.transmittal-field-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0;
}

.transmittal-dynamic-input {
  width: 100%;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.transmittal-dynamic-input:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.transmittal-dynamic-textarea {
  width: 100%;
  height: 68px;
  min-height: 68px;
  max-height: 68px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-text);
  background: var(--color-bg);
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.transmittal-dynamic-textarea:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

/* Transmittal Letter Preview Styles */
.preview-container {
  font-family: Arial, Helvetica, sans-serif;
  width: 100%;
  box-sizing: border-box;
}

.preview-header-table {
  width: 100% !important;
  border: 2px solid #000 !important;
  border-collapse: collapse !important;
  margin-bottom: 15px !important;
  table-layout: fixed !important;
}

.preview-header-table td {
  border: 2px solid #000 !important;
  padding: 6px 10px !important;
  vertical-align: top !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  box-sizing: border-box !important;
}

.preview-title-cell {
  text-align: center !important;
  font-weight: bold !important;
  font-size: 12pt !important;
  letter-spacing: 0.5px !important;
  padding: 8px !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

.preview-doc-no-cell {
  width: 55% !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

.preview-date-cell {
  width: 45% !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

.preview-label-red {
  color: #c2272d !important;
  font-weight: bold !important;
  margin-right: 5px !important;
}

.preview-label-bold {
  font-weight: bold !important;
  margin-right: 5px !important;
}

.preview-from-cell {
  width: 55% !important;
  line-height: 1.4 !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  box-sizing: border-box !important;
}

.preview-to-cell {
  width: 45% !important;
  line-height: 1.4 !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  box-sizing: border-box !important;
}

.preview-underline-line {
  border-bottom: 1.5px solid #000 !important;
  min-height: 16px !important;
  margin-top: 3px !important;
  padding-bottom: 1px !important;
  font-weight: bold !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

.preview-document-box {
  border: 2px solid #000 !important;
  position: relative !important;
  margin-bottom: 15px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.preview-document-title {
  font-weight: bold !important;
  padding: 6px 10px !important;
  border-bottom: 2px solid #000 !important;
  background-color: var(--color-surface) !important;
  font-size: 10pt !important;
  color: var(--color-text) !important;
}

.preview-document-table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
}

.preview-table-header-cell {
  border-bottom: 2px solid #000 !important;
  padding: 6px 10px !important;
  font-weight: bold !important;
  text-align: left !important;
  font-size: 10pt !important;
  color: var(--color-text) !important;
  background-color: var(--color-surface) !important;
}

.preview-category-header-cell {
  width: 35% !important;
  border-right: 2px solid #000 !important;
}

.preview-document-header-cell {
  width: 65% !important;
}

.preview-doc-row {
  height: 22px !important;
}

.preview-doc-cell {
  border-bottom: 1px solid #000 !important;
  padding: 4px 10px !important;
  font-size: 10pt !important;
  text-align: left !important;
  word-break: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
}

.preview-category-cell {
  font-weight: bold !important;
  border-right: 1px solid #000 !important;
  width: 35% !important;
}

.preview-document-cell {
  width: 65% !important;
}

.preview-document-table tr:last-child .preview-doc-cell {
  border-bottom: none !important;
}

.preview-received-stamp {
  position: absolute !important;
  right: 12% !important;
  top: 50% !important;
  transform: translateY(-50%) rotate(-7deg) !important;
  border: 4px double #1e40af !important;
  color: #1e40af !important;
  padding: 6px 12px !important;
  text-align: center !important;
  background: var(--color-surface) !important;
  border-radius: 12px !important;
  font-family: 'Courier New', Courier, monospace !important;
  font-weight: bold !important;
  pointer-events: none !important;
  z-index: 100 !important;
}

.preview-stamp-title {
  font-size: 14pt !important;
  letter-spacing: 2px !important;
  border-bottom: 2px solid #1e40af !important;
  margin-bottom: 4px !important;
  padding-bottom: 1px !important;
}

.preview-stamp-date {
  font-size: 11pt !important;
}

.preview-signature-container {
  margin-top: 30px !important;
  width: 100% !important;
  max-width: 400px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

.preview-sig-info {
  display: flex !important;
  justify-content: space-between !important;
  padding: 0 20px !important;
  font-weight: bold !important;
  font-size: 11pt !important;
  min-height: 20px !important;
}

.preview-sig-name {
  flex: 2 !important;
  text-align: center !important;
}

.preview-sig-date {
  flex: 1 !important;
  text-align: right !important;
}

.preview-sig-line {
  border-top: 1.5px solid #000 !important;
  margin-top: 2px !important;
}

.preview-sig-label {
  font-size: 9pt !important;
  color: var(--color-text-muted) !important;
  margin-top: 6px !important;
}

/* Document Lifecycle */
.lifecycle-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lifecycle-collected { background: #fee2e2; color: #991b1b; }
.lifecycle-with_documentations { background: #fef3c7; color: #92400e; }
.lifecycle-scanned { background: #dcfce7; color: #166534; }
.lifecycle-in_envelope { background: #dbeafe; color: #1d4ed8; }
.lifecycle-stored { background: #f3e8ff; color: #6b21a8; }

/* Pending Changes Diff */
.diff-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

.diff-current,
.diff-proposed {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
}

.diff-proposed {
  border: 2px solid var(--color-warning);
}

/* Multi-entry rows */
.multi-entry-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.multi-entry-row input,
.multi-entry-row select {
  flex: 1;
}

.multi-entry-row .btn-sm {
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 767.98px) {
  .menu-toggle {
    display: block;
  }

  #app-shell {
    margin: 0;
    height: 100vh;
    border-radius: 0;
    width: 100%;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .header-actions {
    display: none;
  }

  .app-header .sidebar-collapse-btn {
    display: none;
  }

  .header-actions.show {
    display: flex;
    position: fixed;
    top: 56px;
    right: 0;
    left: 0;
    background: var(--color-surface);
    padding: var(--spacing-md);
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
    z-index: 40;
    box-shadow: var(--shadow-card);
  }

  .content {
    padding: var(--spacing-md);
  }
}

/* Project Card Grid (Inspired by Decem App) */
.project-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-md);
  padding: var(--spacing-sm) 0;
  min-height: calc(100vh - 300px);
}

.project-card {
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Card Themes */
.card-blue   { background: #3b82f6; }
.card-orange { background: #f97316; }
.card-purple { background: #a855f7; }
.card-green  { background: #22c55e; }
.card-red    { background: #ef4444; }
.card-teal   { background: #06b6d4; }

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.project-card-category {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.project-card-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background 0.2s ease;
}

.project-card:hover .project-card-arrow {
  background: rgba(255, 255, 255, 0.3);
}

.project-card-title {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
  line-height: 1.2;
}

.project-card-tasks {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: auto;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: var(--spacing-lg);
}

.project-card-amount {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-card-avatars {
  display: flex;
  align-items: center;
}

.avatar-xs {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background-size: cover;
  background-position: center;
  background-color: #cbd5e1;
  margin-left: -10px;
}

.avatar-xs:first-child {
  margin-left: 0;
}

.avatar-xs-more {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: -10px;
}


/* Integrated Project Cards in Board View */
.board-card-integrated {
  padding: var(--spacing-sm);
  min-height: 160px;
  margin-bottom: var(--spacing-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.board-card-integrated .project-card-title {
  font-size: 1.125rem;
}

.board-card-integrated .project-card-amount {
  font-size: 1.125rem;
}

.board-card-integrated .project-card-arrow {
  width: 28px;
  height: 28px;
  font-size: 1rem;
}

.board-column {
  background: #fafafa; /* Slightly lighter gray to contrast with white headers */
  border: 1px solid #e2e8f0;
}

/* Board View V2 (Reference Style) */
.board-v2 {
  display: flex;
  gap: 8px;
  min-height: calc(100vh - 280px);
  width: 100%;
  overflow-x: auto;
  padding-bottom: var(--spacing-sm, 8px);
}

.board-column-v2 {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: var(--radius-md, 12px);
  background: var(--color-bg, #f8fafc);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  max-height: calc(100vh - 280px);
}

.board-column-v2::before {
  content: none;
}


.board-column-v2:last-child {
  border-right: 1px solid var(--color-border, #cbd5e1);
}

.board-column-header-v2 {
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-bg-light, #f1f5f9);
  border-bottom: 1px solid var(--color-border, #cbd5e1);
  border-radius: var(--radius-md, 12px) var(--radius-md, 12px) 0 0;
}

.board-column-header-v2::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--column-phase-color, transparent);
  border-radius: var(--radius-md, 12px) var(--radius-md, 12px) 0 0;
}

.project-detail-v2 .board-v2 {
  overflow: visible;
  min-height: calc(100vh - var(--project-detail-title-bar-height, 48px) - var(--project-detail-toolbar-height, 40px) - 250px);
}

.project-detail-v2 .board-column-v2 {
  max-height: none;
}

.project-detail-v2 .board-cards-scroll {
  overflow-y: visible;
}

.project-detail-v2 .board-column-header-v2 {
  position: sticky;
  top: calc(var(--project-detail-title-bar-height, 48px) + var(--project-detail-toolbar-height, 40px));
  z-index: 20;
}



.board-column-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-column-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--column-phase-color);
}

.board-column-dot svg {
  width: 14px;
  height: 14px;
}

.board-column-count {
  padding: 1px 7px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 700;
}

.board-column-actions {
  display: flex;
  gap: 4px;
}

.board-column-add {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 12px);
  background: var(--color-surface, #ffffff);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.board-column-add:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

@media (min-width: 1024px) {
  .board-v2 {
    gap: 8px;
    overflow-x: hidden;
  }
  .board-column-v2 {
    min-width: 120px;
    flex: 1 1 0%;
  }
}


.board-cards-scroll {
  flex: 1;
  padding: 0 var(--spacing-sm);
  overflow-y: auto;
}

.board-card-v2 {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  border: 1px solid var(--color-border, #cbd5e1);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.board-card-v2:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: var(--color-text-muted, #94a3b8);
  transform: translateY(-1px);
}

.card-v2-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-v2-category {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.card-v2-date {
  font-size: 0.75rem;
  color: #64748b;
}

.card-v2-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--spacing-md);
}

.card-v2-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  flex-shrink: 0;
  margin-top: 2px;
}

.card-v2-checkbox.checked {
  background: #2563eb;
  border-color: #2563eb;
  position: relative;
}

.card-v2-checkbox.checked::after {
  content: '✓';
  color: #fff;
  font-size: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.card-v2-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #0f172a;
  line-height: 1.4;
}

.card-v2-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-v2-meta-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-v2-progress {
  width: 40px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.card-v2-progress-fill {
  height: 100%;
  background: #64748b;
}

.card-v2-meta-text {
  font-size: 0.75rem;
  color: #64748b;
}

.card-v2-meta-icon {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-v2-avatars {
  display: flex;
  align-items: center;
}

/* ── Compact Board Card — exact 5-section reference structure ── */
.board-card-v2.compact {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e8ecf1);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.board-card-v2.compact:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  border-color: var(--color-border, #d1d5db);
  transform: translateY(-1px);
}

/* Optimistic board cards are not draggable and cannot be dropped on. */
.kanban-card-optimistic {
  cursor: not-allowed;
  opacity: 0.8;
}

/* 1. Header Row */
.card-v2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-v2-key-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.card-v2-key-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-v2-key-icon svg {
  width: 14px;
  height: 14px;
}

.card-v2-key {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-v2-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--color-surface);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  color: var(--color-text-muted);
  background: transparent;
}

.card-v2-status-dot:has(.card-v2-progress-ring) {
  border: none;
  box-shadow: none;
  background: transparent;
}

.card-v2-progress-ring {
  width: 14px;
  height: 14px;
  display: block;
}

.card-v2-progress-ring circle {
  transition: stroke-dashoffset 0.3s ease;
}

.card-v2-menu {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 12px;
  flex-shrink: 0;
  padding: 0;
  margin: -4px -6px -4px 0;
}

.card-v2-menu:hover {
  background: var(--color-bg-hover);
  color: var(--color-text);
}

/* 2. Title */
.board-card-v2.compact .card-v2-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.board-card-v2.compact .card-v2-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 4px;
}

[data-theme="dark"] .board-card-v2.compact .card-v2-title {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

/* 3. Description (client name) */
.board-card-v2.compact .card-v2-desc {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 3b. Additional detail (work-request description) */
.board-card-v2.compact .card-v2-detail {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.85;
}

/* Extra badges (transition / approval chips) */
.board-card-v2.compact .card-v2-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -2px;
}

/* 4. Metadata Row: calendar left, priority right */
.card-v2-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-v2-meta-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.card-v2-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.card-v2-meta-icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-v2-meta-icon svg {
  width: 14px;
  height: 14px;
}

.card-v2-meta-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-card-v2.compact .card-v2-priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.board-card-v2.compact .card-v2-priority svg {
  width: 14px;
  height: 14px;
}

.board-card-v2.compact .card-v2-priority-high,
.board-card-v2.compact .card-v2-priority-urgent { color: var(--color-danger); }
.board-card-v2.compact .card-v2-priority-priority { color: #f97316; }
.board-card-v2.compact .card-v2-priority-medium { color: var(--color-warning); }
.board-card-v2.compact .card-v2-priority-low { color: var(--color-success); }
.board-card-v2.compact .card-v2-priority-normal { color: var(--color-text-muted); }

[data-theme="dark"] .board-card-v2.compact .card-v2-priority-priority { color: #fb923c; }

/* 5. Footer Row: avatars left, badges + counts right */
.board-card-v2.compact .card-v2-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border, #e8ecf1);
}

.board-card-v2.compact .card-v2-footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Stacking context elevation when menu is active */
.board-column-v2.menu-open {
  z-index: 10 !important;
}
.board-card-v2.menu-open {
  z-index: 15 !important;
}
.card-v2-action-menu.menu-open {
  z-index: 16 !important;
}

.board-card-v2.compact .card-v2-action-menu {
  position: relative;
  margin-left: auto;
}

.board-card-v2.compact .action-menu-list {
  min-width: 150px;
  right: 0;
  left: auto;
  top: calc(100% + 4px);
  bottom: auto;
  transform-origin: top right;
}

.board-card-v2.compact .action-menu-list.open-up {
  top: auto;
  bottom: calc(100% + 4px);
  transform-origin: bottom right;
}

.board-card-v2.compact .action-menu-list .action-menu-item {
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
}

.board-card-v2.compact .card-v2-footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.board-card-v2.compact .card-v2-footer-item,
.board-card-v2.compact .card-v2-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.board-card-v2.compact .card-v2-footer .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.board-card-v2.compact .card-v2-footer-item svg,
.board-card-v2.compact .card-v2-count svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.board-card-v2.compact .card-v2-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 2px;
}

.board-card-v2.compact .card-v2-avatars .avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-surface);
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg-muted);
  margin-left: -8px;
}

.board-card-v2.compact .card-v2-avatars .avatar-xs:first-child {
  margin-left: 0;
}

/* ── Board action menu ── */
.board-card-v2.compact .action-menu-list,
.board-column-v2 .action-menu-list {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
  padding: var(--spacing-xs, 6px) 0;
  min-width: 170px;
  z-index: 100;
}

.board-card-v2.compact .action-menu-list .action-menu-item,
.board-column-v2 .action-menu-list .action-menu-item {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--color-text);
  gap: 8px;
  border-radius: 0;
}

.board-card-v2.compact .action-menu-list .action-menu-item:hover,
.board-column-v2 .action-menu-list .action-menu-item:hover {
  background: var(--color-bg-hover, #f0f1f3);
  color: var(--color-primary);
}

.board-card-v2.compact .action-menu-list .action-menu-item.danger:hover,
.board-column-v2 .action-menu-list .action-menu-item.danger:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
}

.board-card-v2.compact .action-menu-list .action-menu-item.primary,
.board-column-v2 .action-menu-list .action-menu-item.primary {
  color: var(--color-primary);
}

.board-card-v2.compact .action-menu-list .action-menu-item.primary:hover,
.board-column-v2 .action-menu-list .action-menu-item.primary:hover {
  background: var(--color-primary-alpha, rgba(37, 99, 235, 0.08));
}

.board-card-v2.compact .action-menu-list .action-menu-item svg,
.board-column-v2 .action-menu-list .action-menu-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ── Board column header actions ── */
.board-column-header-v2 {
  gap: var(--spacing-sm, 12px);
}

.board-column-header-v2 .board-column-title {
  flex: 1;
  min-width: 0;
}

.board-column-header-v2 .board-column-count {
  background: var(--color-bg, #f4f6fb);
  border: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text-muted);
  font-weight: 600;
  margin-left: 2px;
}

.board-column-header-v2 .board-column-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.board-column-header-v2 .board-column-actions .board-column-add,
.board-column-header-v2 .board-column-actions .board-column-menu {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 12px);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.board-column-header-v2 .board-column-actions .board-column-add:hover,
.board-column-header-v2 .board-column-actions .board-column-menu:hover {
  color: var(--color-primary);
  background: var(--color-bg-hover, #f0f1f3);
  border-color: var(--color-border, #e2e8f0);
}

/* ── Board drag & drop visuals ── */
.board-card-v2.compact.dragging {
  opacity: 0.6;
  transform: rotate(2deg);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  cursor: grabbing;
}

.board-column-v2.drag-over {
  background: color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 92%);
  border-color: var(--column-phase-color, var(--color-primary));
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 70%);
}

.board-column-v2.drag-over .board-cards-scroll {
  background: color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 96%);
  border-radius: 0 0 var(--radius-md, 12px) var(--radius-md, 12px);
}

.board-card-v2.drag-placeholder {
  height: 3px;
  min-height: 3px;
  padding: 0;
  margin: 6px 0;
  border: none;
  border-radius: 12px;
  background: var(--column-phase-color, var(--color-primary));
  box-shadow: 0 0 0 1px var(--color-surface), 0 0 0 2px var(--column-phase-color, var(--color-primary));
  pointer-events: none;
  opacity: 1;
  transition: none;
}

.board-column-v2.collapsed {
  min-width: 48px;
  flex: 0 0 48px;
}

.board-column-v2.collapsed .board-cards-scroll,
.board-column-v2.collapsed .board-column-count,
.board-column-v2.collapsed .board-column-add {
  display: none;
}

.board-column-v2.collapsed .board-column-header-v2 {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: var(--spacing-sm) var(--spacing-xs);
}

.board-column-v2.collapsed .board-column-title {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.board-column-v2.collapsed .board-column-label {
  display: none;
}

.board-column-v2.collapsed .board-column-title .board-column-dot {
  margin: 0;
}

.board-column-v2.collapsed .board-column-title .board-column-count {
  display: inline-flex;
  padding: 1px 5px;
  font-size: 0.6875rem;
}

/* Project Detail Redesign (Pixel Perfect Style) */
.project-detail-v2 {
  background: var(--bg);
  min-height: 100%;
}

.project-header-v2 {
  background: var(--color-surface);
  padding: var(--spacing-md) var(--spacing-lg) 0;
  border-bottom: 1px solid #e2e8f0;
}

.breadcrumb-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: var(--spacing-md);
}

.breadcrumb-link {
  color: #3b82f6;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #94a3b8;
  font-weight: 400;
}

.project-tabs-v2 {
  display: flex;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-sm);
}

.project-tab {
  padding: 12px 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.project-tab:hover {
  color: #1e293b;
}

.project-tab.active {
  color: #10b981; /* Green active state from reference */
  border-bottom-color: #10b981;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-list-v2 {
  padding: var(--spacing-lg);
}

.task-group-v2 {
  background: var(--color-surface);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}

.task-group-header {
  background: #f1f5f9;
  padding: var(--spacing-sm) var(--spacing-md);
  font-weight: 700;
  font-size: 0.875rem;
  color: #334155;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.task-group-count {
  font-weight: 400;
  color: #64748b;
}

.task-table-v2 {
  width: 100%;
  border-collapse: collapse;
}

.task-table-v2 th {
  text-align: left;
  padding: 12px var(--spacing-md);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid #cbd5e1;
  background: var(--color-surface);
}

.task-table-v2 td {
  padding: 12px var(--spacing-md);
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.875rem;
  vertical-align: middle;
}

.task-table-v2 tbody tr {
  transition: background 0.15s ease;
}

.task-table-v2 tbody tr:hover {
  background: #f8fafc;
}

.task-v2-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.task-v2-checkbox.checked {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.task-v2-checkbox.checked::after {
  content: '✓';
  font-size: 12px;
}

.task-v2-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-v2-title {
  font-weight: 500;
  color: #0f172a;
}

.task-v2-title.completed {
  text-decoration: line-through;
  color: #94a3b8;
}

.status-badge-v2 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
}

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

.priority-badge-v2 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.task-group-footer {
  padding: 12px var(--spacing-md);
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-xl);
  font-weight: 700;
  color: #0f172a;
  border-top: 2px solid #cbd5e1;
}

/* Modern Progress Indicator Styles */
.modern-progress-wrapper {
  padding: 40px var(--spacing-xl);
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}

.modern-progress-track {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 12px;
}

.modern-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #10b981; /* Success Green */
  border-radius: 12px;
  transition: width 0.4s ease;
}

.modern-progress-step {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modern-progress-dot {
  width: 16px;
  height: 16px;
  background: var(--color-surface);
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  z-index: 2;
  transition: all 0.3s;
}

.modern-progress-dot.completed {
  background: #10b981;
  border-color: #10b981;
}

.modern-progress-dot.active {
  width: 20px;
  height: 20px;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.modern-progress-dot.completed::after {
  content: '✓';
  color: #fff;
  font-size: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.modern-progress-label {
  position: absolute;
  top: 24px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  transition: color 0.3s;
}

.modern-progress-label.active {
  color: #1e293b;
  font-weight: 700;
}

/* Breadcrumb Title Bar & Page Headings */
.page-title-bar-v2,
.page > h1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: -20px;
  margin-top: -20px;
  padding: 20px 0 8px;
  margin-bottom: 0;
  background: var(--color-bg);
  z-index: 120;
}

.breadcrumb-h1,
.page-title-h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.75rem;
}

.page-title-h1 {
  color: var(--color-text);
  font-weight: 700;
}

.breadcrumb-base {
  color: #3b82f6;
  text-decoration: none;
}

.breadcrumb-base:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  color: #cbd5e1;
  font-weight: 400;
}

.wr-title-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 6px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .wr-title-badge {
  background: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
  color: var(--color-text, #f8fafc);
}

[data-theme="dark"] .breadcrumb-base,
[data-theme="dark"] .breadcrumb-link {
  color: var(--color-primary, #d4b8ff);
}

[data-theme="dark"] .breadcrumb-v2 .breadcrumb-link,
[data-theme="dark"] .breadcrumb-h1 .breadcrumb-base {
  color: var(--color-primary, #d4b8ff);
}

/* Detail Info Info */
.detail-sub-header {
  margin-bottom: var(--spacing-md);
  color: #64748b;
  font-size: 0.875rem;
  display: flex;
  gap: var(--spacing-lg);
}

/* ─── Identity Bar (WR detail header redesign) ────────────────── */
.identity-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.identity-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.identity-parent {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.identity-parent:hover {
  text-decoration: underline;
}
.identity-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  line-height: 1.2;
  margin: 0;
}
.identity-sub {
  color: var(--color-text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.identity-sub .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-border);
}
.identity-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Beautified Detail Sub-Header (legacy compat) */
.detail-sub-header-v2 {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 8px 0;
  margin-bottom: var(--spacing-lg);
  font-size: 0.875rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.detail-info-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.detail-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.detail-info-value {
  font-weight: 600;
  color: #334155;
}

/* Detail Filter Tray */
.detail-filters-tray {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: #f1f5f9;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-end;
  animation: slideDown 0.2s ease-out;
}

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

/* Status Dropdown Styling for Detail View */
.status-dropdown-v2 {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 8px;
  padding-left: 24px !important;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 140px;
}

.status-dropdown-v2:hover {
  background: rgba(0,0,0,0.02);
  border-color: #e2e8f0;
}

.status-dropdown-v2 option:disabled {
  color: #94a3b8;
  background: #f1f5f9;
}

/* Status Dropdown Wrapper with Right Arrow */
.status-dropdown-wrapper-v2 {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.status-dropdown-wrapper-v2 .status-dropdown-caret {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.85;
  z-index: 5;
}

/* Task Table Footer Alignment */
.task-table-v2 tfoot td {
  padding: 16px var(--spacing-md);
  font-weight: 700;
  color: #1e293b;
  border-top: 2px solid #e2e8f0;
}

/* Task Accordion Styles */
.task-row-v2 {
  cursor: pointer;
  transition: background-color 0.2s;
}

.task-row-v2:hover {
  background-color: #fafafa;
}

.task-details-row {
  background-color: #fcfdfe;
}

.task-details-container {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid #f1f5f9;
}

.task-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
}

.details-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: var(--spacing-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.details-content-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item-v2 {
  font-size: 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

/* Task Row Caret Indicator */
.task-v2-row-caret {
  font-size: 1.25rem;
  line-height: 1;
  color: #94a3b8;
  width: 20px;
  display: inline-flex;
  justify-content: center;
  transition: transform 0.2s;
}

.task-row-v2.expanded .task-v2-row-caret {
  transform: rotate(90deg);
}

/* Clearer Separation in Task Details */
.task-details-grid {
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
}

.task-details-col:not(:last-child) {
  border-right: 1px solid #e2e8f0;
  padding-right: var(--spacing-lg);
}

/* Improve Inline Add Buttons */
.btn-add-inline {
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.15);
  font-weight: var(--btn-font-weight-emphasis);
  letter-spacing: var(--btn-letter-spacing);
}

.btn-add-inline:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.btn-xs {
  padding: 2px 8px;
  font-size: 0.6875rem; /* ~11px */
  letter-spacing: var(--btn-letter-spacing);
  line-height: var(--btn-line-height);
  border-radius: 12px;
  min-height: 24px;
  gap: 4px;
}

/* Dynamic Route Button */
.btn-route-dynamic {
  font-weight: var(--btn-font-weight-emphasis);
  border-width: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-route-dynamic:not(.btn-disabled) {
  animation: pulse-route 2s infinite;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

.btn-route-dynamic:not(.btn-disabled):hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 12px rgba(16, 185, 129, 0.25);
  animation: none; /* Stop pulse on hover */
}

@keyframes pulse-route {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.btn-route-dynamic.btn-disabled {
  opacity: 1;
  cursor: not-allowed;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
  box-shadow: none;
}

/* Modal Message Wrappers (Redesign V2) — signal / confirm / alert modals */
.modal-message-wrapper {
  padding: var(--spacing-xl) var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 12px;
  border: 1px solid transparent;
}

.modal-message-wrapper.type-danger {
  background: color-mix(in oklab, var(--color-danger) 6%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-danger) 14%, var(--color-border));
}
.modal-message-wrapper.type-warning {
  background: color-mix(in oklab, var(--color-warning) 8%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-warning) 16%, var(--color-border));
}
.modal-message-wrapper.type-success {
  background: color-mix(in oklab, var(--color-success) 7%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-success) 14%, var(--color-border));
}
.modal-message-wrapper.type-info {
  background: color-mix(in oklab, var(--color-primary) 5%, var(--color-surface));
  border-color: color-mix(in oklab, var(--color-primary) 12%, var(--color-border));
}

.modal-icon-v2 {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border-width: 4px;
  border-style: solid;
}

.modal-message-wrapper.type-danger .modal-icon-v2 {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.modal-message-wrapper.type-warning .modal-icon-v2 {
  color: var(--color-warning);
  border-color: var(--color-warning);
}

.modal-message-wrapper.type-success .modal-icon-v2 {
  color: var(--color-success);
  border-color: var(--color-success);
}

.modal-message-wrapper.type-info .modal-icon-v2 {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.modal-icon-v2 svg {
  width: 40px;
  height: 40px;
  stroke-width: 1.75;
}

.modal-text {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0;
  line-height: 1.6;
  max-width: 400px;
  white-space: pre-wrap;
}

.modal-message-wrapper .modal-footer {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  width: 100%;
  background: transparent;
  padding: var(--spacing-md) 0 0;
  margin-top: var(--spacing-lg);
  border-radius: 0;
}

.modal-btn-sure {
  padding: 10px 24px;
  font-weight: 600;
  border-radius: 12px;
}

.modal-message-wrapper .modal-btn-cancel {
  padding: 10px 24px;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-weight: 600;
  border-radius: 12px;
}

.modal-message-wrapper .modal-btn-cancel:hover {
  background: var(--color-bg-muted);
  color: var(--color-text);
}

/* ==========================================================================
   Dashboard Calendar Widget
   ========================================================================== */

/* Card wrapper */
.calendar-card {
  padding: 0 !important;
  overflow: hidden;
}

.calendar-card .card-title {
  display: none;
}

/* Dashboard root */
.calendar-dashboard {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 480px;
}

/* Header bar: title | view toggle | date nav */
.calendar-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.calendar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

/* View toggle: Day / Week / Month */
.calendar-view-toggle {
  display: flex;
  gap: 2px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.calendar-view-btn {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-view-btn:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.calendar-view-btn.active {
  background: var(--color-primary);
  color: #fff;
}

/* Date navigation */
.calendar-date-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.calendar-nav-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  min-width: 160px;
  text-align: center;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 1rem;
  font-weight: 700;
}

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

.calendar-today-btn {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-today-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Main area */
.calendar-main-area {
  flex: 1;
  overflow: hidden;
}

/* ─── Month View ─────────────────────────────────────────────────────────── */

.calendar-view-month {
  display: flex;
  gap: var(--spacing-lg);
  height: 100%;
  padding: var(--spacing-lg);
}

.calendar-grid-panel {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  flex: 1;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: 2px solid transparent;
  background: transparent;
  min-height: 44px;
}

.calendar-day:hover {
  background: var(--color-bg);
}

.calendar-day.other-month {
  color: var(--color-text-muted);
  opacity: 0.4;
}

.calendar-day.today {
  border-color: var(--color-primary);
  font-weight: 700;
  background: rgba(37, 99, 235, 0.05);
}

.calendar-day.selected {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.calendar-day.selected:hover {
  background: var(--color-primary-dark);
}

.calendar-day.has-events {
  font-weight: 600;
}

.calendar-day-dots {
  display: flex;
  gap: 3px;
  margin-top: 2px;
  position: absolute;
  bottom: 4px;
}

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

.calendar-dot.wr { background: var(--color-primary); }
.calendar-dot.disbursement { background: var(--color-success); }
.calendar-dot.both { background: var(--color-warning); }

/* Sidebar (shared) */
.calendar-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  border-left: 1px solid var(--color-border);
  padding-left: var(--spacing-lg);
  overflow-y: auto;
  min-width: 0;
}

.calendar-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.calendar-sidebar-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}

.calendar-sidebar-count {
  background: var(--color-bg);
  color: var(--color-text);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}

.calendar-item {
  display: flex;
  flex-direction: column;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  position: relative;
}

.calendar-item:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-soft);
}

.calendar-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.calendar-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.calendar-item-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.calendar-item-details {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--color-border);
  display: none;
  animation: accordionOpen 0.2s ease-out;
}

.calendar-item.expanded .calendar-item-details {
  display: block;
}

.calendar-item.expanded {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: var(--shadow-soft);
}

.calendar-item-caret {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.calendar-item.expanded .calendar-item-caret {
  transform: rotate(90deg);
}

.calendar-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.8125rem;
}

.calendar-detail-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.calendar-detail-value {
  font-weight: 600;
  color: var(--color-text);
}

.calendar-detail-value.amount {
  color: var(--color-primary);
}

.calendar-empty-state {
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-sm);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-style: italic;
}

.calendar-entity-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.calendar-entity-badge.ata {
  background: #dbeafe;
  color: #1d4ed8;
}

.calendar-entity-badge.lta {
  background: #f1f5f9;
  color: #64748b;
}

/* Status indicators on calendar items */
.calendar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calendar-status-dot.due-today { background: var(--color-danger); }
.calendar-status-dot.due-soon { background: var(--color-warning); }
.calendar-status-dot.due-later { background: var(--color-success); }

/* ─── Week View ──────────────────────────────────────────────────────────── */

.calendar-view-week {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  height: 100%;
  padding: var(--spacing-lg);
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--spacing-sm);
  flex: 1;
  min-height: 0;
}

.calendar-week-col {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  overflow: hidden;
  min-width: 0;
}

.calendar-week-col.today {
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.03);
}

.calendar-week-col.has-events {
  background: var(--color-surface);
}

.calendar-week-day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.calendar-week-day-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.calendar-week-day-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 2px;
}

.calendar-week-col.today .calendar-week-day-num {
  color: var(--color-primary);
}

.calendar-week-events {
  flex: 1;
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
}

.calendar-week-empty {
  text-align: center;
  padding: var(--spacing-md) 0;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-style: italic;
}

.calendar-week-event {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--spacing-sm);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-week-event.event-disbursement {
  border-left-color: var(--color-success);
}

.calendar-week-event:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.calendar-week-event-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-week-event-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.calendar-sidebar-week {
  border-left: none;
  border-top: 1px solid var(--color-border);
  padding-left: 0;
  padding-top: var(--spacing-md);
  flex-direction: row;
  gap: var(--spacing-lg);
}

.calendar-sidebar-week .calendar-sidebar-section {
  flex: 1;
}

/* ─── Day View ───────────────────────────────────────────────────────────── */

.calendar-view-day {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--spacing-lg);
  overflow-y: auto;
}

.calendar-day-timeline {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--color-border);
}

.calendar-day-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.calendar-day-section {
  margin-bottom: var(--spacing-lg);
}

.calendar-day-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-xs);
  border-bottom: 1px solid var(--color-border);
}

.calendar-day-empty {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--color-text-muted);
  font-style: italic;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

/* Responsive Calendar */
@media (max-width: 1024px) {
  .calendar-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .calendar-view-month {
    flex-direction: column;
  }

  .calendar-sidebar {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: var(--spacing-lg);
    max-height: 400px;
  }

  .calendar-week-grid {
    grid-template-columns: repeat(4, 1fr);
    overflow-y: auto;
  }

  .calendar-sidebar-week {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .calendar-week-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-view-toggle {
    width: 100%;
  }

  .calendar-date-nav {
    width: 100%;
    justify-content: space-between;
  }
}

/* --- Wrapper / Trigger --- */
.mdp-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  min-width: 140px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.mdp-wrapper:hover {
  border-color: var(--color-primary);
}

.mdp-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.mdp-display {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mdp-display.mdp-placeholder {
  color: var(--color-text-muted);
}

.mdp-icon {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.mdp-wrapper:hover .mdp-icon {
  color: var(--color-primary);
}

/* --- Overlay & Dialog --- */
.mdp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
  padding: 16px;
}

.mdp-overlay.mdp-visible {
  background: rgba(0, 0, 0, 0.4);
}

.mdp-dialog {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 328px;
  max-width: 100%;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.mdp-visible .mdp-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* --- Header --- */
.mdp-header {
  background: var(--color-primary);
  color: #ffffff;
  padding: 20px 24px 16px;
}

.mdp-header-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-bottom: 4px;
}

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

.mdp-header-date {
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.3;
}

.mdp-edit-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.mdp-edit-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* --- Body --- */
.mdp-body {
  padding: 8px 16px 0;
}

/* --- Navigation --- */
.mdp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 8px;
}

.mdp-month-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: background 0.15s ease;
}

.mdp-month-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.mdp-nav-arrows {
  display: flex;
  gap: 4px;
}

.mdp-nav-arrow {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background 0.15s ease;
}

.mdp-nav-arrow:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* --- Calendar Grid --- */
.mdp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  padding-bottom: 8px;
}

.mdp-day-header {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 8px 0;
  user-select: none;
}

.mdp-day {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.mdp-day:hover {
  background: rgba(37, 99, 235, 0.08);
}

.mdp-day.mdp-today {
  box-shadow: inset 0 0 0 1.5px var(--color-text-muted);
}

.mdp-day.mdp-selected {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.mdp-day.mdp-selected:hover {
  background: var(--color-primary-dark);
}

/* --- Year Panel --- */
.mdp-year-panel {
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.mdp-year-panel::-webkit-scrollbar {
  width: 4px;
}

.mdp-year-panel::-webkit-scrollbar-track {
  background: transparent;
}

.mdp-year-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}

.mdp-year-btn {
  padding: 8px 4px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mdp-year-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

.mdp-year-btn.mdp-year-active {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

/* --- Manual Input --- */
.mdp-manual-area {
  padding: 16px 0 12px;
}

.mdp-manual-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  text-align: center;
  letter-spacing: 2px;
  transition: border-color 0.2s ease;
}

.mdp-manual-input:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mdp-manual-input::placeholder {
  color: var(--color-text-muted);
  letter-spacing: 1px;
}

/* --- Footer --- */
.mdp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 16px 12px;
}

.mdp-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.mdp-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

.mdp-btn.mdp-btn-ok {
  color: var(--color-primary);
}

/* --- Hidden utility --- */
.mdp-overlay .hidden,
.mdp-body .hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 400px) {
  .mdp-dialog {
    width: 100%;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .mdp-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .mdp-visible .mdp-dialog {
    transform: translateY(0);
  }

  .mdp-dialog {
    transform: translateY(100%);
  }
}

/* ==========================================================================
   Material Time Picker
   ========================================================================== */

/* --- Wrapper / Trigger --- */
.mtp-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  min-width: 140px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}

.mtp-wrapper:hover {
  border-color: var(--color-primary);
}

.mtp-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.mtp-display {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mtp-display.mtp-placeholder {
  color: var(--color-text-muted);
}

.mtp-icon {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.mtp-wrapper:hover .mtp-icon {
  color: var(--color-primary);
}

/* --- Overlay & Dialog --- */
.mtp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  transition: background 0.2s ease;
  padding: 16px;
}

.mtp-overlay.mtp-visible {
  background: rgba(0, 0, 0, 0.4);
}

.mtp-dialog {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 320px;
  max-width: 100%;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.mtp-visible .mtp-dialog {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* --- Header --- */
.mtp-header {
  padding: 20px 24px 16px;
}

.mtp-header-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.mtp-time-display {
  display: flex;
  align-items: center;
  gap: 2px;
}

.mtp-time-box {
  font-family: inherit;
  font-size: 2.8rem;
  font-weight: 600;
  width: 80px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mtp-time-box:hover {
  background: #e8e8f0;
}

.mtp-time-box.mtp-time-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
}

.mtp-time-colon {
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 0 4px;
  line-height: 1;
}

/* --- AM/PM --- */
.mtp-ampm {
  display: flex;
  flex-direction: column;
  margin-left: 12px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.mtp-ampm-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mtp-ampm-btn:first-child {
  border-bottom: 1px solid var(--color-border);
}

.mtp-ampm-btn:hover {
  background: rgba(37, 99, 235, 0.06);
}

.mtp-ampm-btn.mtp-ampm-active {
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
}

/* --- Body --- */
.mtp-body {
  padding: 8px 24px 0;
  display: flex;
  justify-content: center;
  min-height: 280px;
}

.mtp-clock-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- Clock Face --- */
.mtp-clock-face {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--color-bg);
  position: relative;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.mtp-center-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.mtp-hand {
  position: absolute;
  width: 2px;
  background: var(--color-primary);
  left: 50%;
  bottom: 50%;
  transform-origin: bottom center;
  transition: transform 0.15s ease, height 0.15s ease;
  z-index: 2;
  border-radius: 12px;
}

.mtp-hand-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: left 0.15s ease, top 0.15s ease;
}

/* --- Clock Numbers --- */
.mtp-number {
  position: absolute;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 50%;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 4;
}

.mtp-number:hover {
  background: rgba(37, 99, 235, 0.08);
}

.mtp-number.mtp-number-selected {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* --- Manual Input Mode --- */
.mtp-manual-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 0;
}

.mtp-manual-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mtp-manual-input {
  width: 80px;
  height: 72px;
  text-align: center;
  font-family: inherit;
  font-size: 2.4rem;
  font-weight: 600;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mtp-manual-input:focus {
  border-color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.mtp-manual-input::placeholder {
  color: var(--color-text-muted);
  font-size: 1.2rem;
  font-weight: 400;
}

.mtp-manual-colon {
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--color-text);
}

.mtp-manual-labels {
  display: flex;
  gap: 60px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* --- Footer --- */
.mtp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
}

.mtp-keyboard-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.mtp-keyboard-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

.mtp-btn-group {
  display: flex;
  gap: 8px;
}

.mtp-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.mtp-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* --- Hidden utility --- */
.mtp-overlay .hidden,
.mtp-body .hidden {
  display: none !important;
}

/* --- Responsive --- */
@media (max-width: 400px) {
  .mtp-dialog {
    width: 100%;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .mtp-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .mtp-visible .mtp-dialog {
    transform: translateY(0);
  }

  .mtp-dialog {
    transform: translateY(100%);
  }

  .mtp-time-box {
    font-size: 2.2rem;
    width: 64px;
    height: 60px;
  }

  .mtp-time-colon {
    font-size: 2.2rem;
  }

  .mtp-clock-face {
    width: 240px;
    height: 240px;
  }
}

/* --- Linear Activity Bar --- */
.activity-bar-container {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--spacing-lg);
}

.activity-bar-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.linear-activity-bar {
  height: 12px;
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  display: flex;
  overflow: hidden;
  position: relative;
}

.activity-segment {
  height: 100%;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
}

.activity-segment.ata { background: var(--color-primary); }
.activity-segment.lta { background: var(--color-success); }
.activity-segment.outstanding { background: var(--color-warning); }

.activity-legend {
  display: flex;
  gap: 20px;
  margin-top: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* --- Week View Styles --- */
.calendar-week-grid, .calendar-day-grid {
  display: grid;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
  position: relative;
  background: var(--color-surface);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  -webkit-overflow-scrolling: touch;
}

.calendar-week-grid::-webkit-scrollbar,
.calendar-day-grid::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.calendar-week-grid::-webkit-scrollbar-track,
.calendar-day-grid::-webkit-scrollbar-track {
  background: transparent;
}
.calendar-week-grid::-webkit-scrollbar-thumb,
.calendar-day-grid::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 12px;
}

.calendar-week-grid {
  --time-width: 70px;
  --day-width: calc((100% - var(--time-width)) / 7);
  --row-height: 72px;
  --header-height: 56px;
  grid-template-columns: var(--time-width) repeat(7, var(--day-width));
  grid-template-rows: var(--header-height) repeat(10, var(--row-height));
}

.calendar-day-grid {
  grid-template-columns: var(--time-width) 1fr;
  grid-template-rows: var(--header-height) repeat(10, var(--row-height));
  --time-width: 70px;
  --row-height: 72px;
  --header-height: 56px;
}

.week-time-label {
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 8px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-align: right;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  height: 100%;
}

.week-time-label.current-hour {
  background: rgba(37, 99, 235, 0.05);
  color: var(--color-primary);
}

.week-cell.current-hour-cell {
  background: rgba(37, 99, 235, 0.02);
}

.week-time-label.empty {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-surface);
}

.week-day-header {
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-surface);
  box-shadow: 0 1px 0 var(--color-border);
  height: 100%;
  justify-content: center;
}

.week-day-header .day-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 600;
}

.week-day-header .day-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.week-day-header.today {
  color: #ef4444;
}
.week-day-header.today .day-name,
.week-day-header.today .day-num {
  color: #ef4444;
}

.week-cell {
  border-right: 1px dashed var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 8px 4px;
  position: relative;
  transition: background 0.2s;
  cursor: pointer;
  height: 100%;
}

.week-cell:hover {
  background: #fafafa;
}

/* The vertical red line for today */
.week-vertical-time-bubble {
  position: absolute;
  top: 4px;
  background: #fee2e2;
  color: #ef4444;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  z-index: 40;
  white-space: nowrap;
  transform: translateX(-50%);
}

.week-vertical-time-line-wrap {
  position: absolute;
  top: var(--header-height);
  height: calc(10 * var(--row-height));
  pointer-events: none;
  z-index: 1; /* Below events */
  width: 0;
}

.week-vertical-time-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: #ef4444;
}

.week-vertical-time-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -2.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
}

/* Week Event Overlays (Spanning Bars) */
.week-events-overlay {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.week-event-overlay {
  position: absolute;
  height: 26px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 2px 8px;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s, filter 0.2s;
  cursor: pointer;
  pointer-events: auto;
  z-index: 10;
}

.week-event-overlay:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  z-index: 20;
}

.week-event-overlay.completed {
  opacity: 0.6;
  text-decoration: line-through;
  box-shadow: none;
}

/* Event Pills */
.week-event-pill {
  display: flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 12px;
  color: #fff;
  margin-bottom: 4px;
  transition: transform 0.2s, filter 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
}

.week-event-pill:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  z-index: 5;
}

.week-event-pill.completed {
  opacity: 0.6;
  text-decoration: line-through;
  box-shadow: none;
}

.week-event-avatars {
  display: flex;
  align-items: center;
  margin-right: 4px;
  flex-shrink: 0;
}

.week-event-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.8);
  margin-left: -6px;
  background: #cbd5e1;
}
.week-event-avatar:first-child {
  margin-left: 0;
}

.week-event-title {
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  padding-right: 4px;
}

.week-event-arrow {
  width: 14px;
  height: 14px;
  background: var(--color-surface);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
  opacity: 0.9;
}

/* Multi-day spanning visuals: flatten side radii so adjacent pills look like one continuous strip */
.week-event-pill.span-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -4px;
  padding-left: 10px;
}
.week-event-pill.span-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  margin-right: -4px;
  padding-right: 10px;
}
.week-event-pill.span-left.span-right {
  border-radius: 0;
  margin-left: -4px;
  margin-right: -4px;
}

/* Distinct pill colors */
.bg-green-500 { background: linear-gradient(135deg, #22c55e, #16a34a); }
.bg-cyan-500 { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.bg-blue-500 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-purple-500 { background: linear-gradient(135deg, #a855f7, #9333ea); }
.bg-orange-500 { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-yellow-500 { background: linear-gradient(135deg, #eab308, #ca8a04); }

/* --- Refined Calendar Filters --- */
.calendar-view-toggle {
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  border: none;
}

.calendar-view-toggle .view-btn {
  padding: 8px 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-view-toggle .view-btn.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.calendar-today-btn {
  background: #fafafa;
  border: 1px solid #e2e8f0;
  padding: 8px 18px;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.calendar-arrow-btn {
  border-color: #e2e8f0;
  color: #64748b;
  background: var(--color-surface);
}

.calendar-arrow-btn:hover {
  background: #fafafa;
  color: #1e293b;
}

/* Plotted Events Refinements */
.calendar-event-badge.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

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

.calendar-cell.today .day-number {
  background: #2563eb;
}

/* --- Dashboard Calendar Card Styles --- */
.dashboard-calendar-card {
  display: flex;
  flex-direction: row;
  height: 640px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  padding: 0 !important;
}

.calendar-main-view {
  flex: 7;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-sidebar {
  flex: 5;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  -webkit-overflow-scrolling: touch;
}

.calendar-sidebar::-webkit-scrollbar {
  width: 6px;
}
.calendar-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.calendar-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 12px;
}

/* Header */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.calendar-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-month-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  font-family: var(--font-sans);
}

.calendar-today-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-today-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
}

.calendar-nav-arrows {
  display: flex;
  gap: 6px;
}

.calendar-arrow-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
  font-weight: bold;
}

.calendar-arrow-btn:hover {
  background: var(--color-bg);
  border-color: var(--color-text-muted);
}

.calendar-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-view-toggle {
  display: flex;
  background: var(--color-bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.calendar-view-toggle .view-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border: none;
  background: none;
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-view-toggle .view-btn.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.calendar-create-btn {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border: none;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-create-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.03);
}

/* Grid & Cells */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 36px repeat(6, 1fr);
  gap: 4px;
  flex: 1;
  overflow: hidden;
  height: 100%;
  position: relative;
}

/* Month View Event Overlays (Spanning Bars) */
.month-events-overlay {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.month-event-overlay {
  position: absolute;
  height: 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 1px 6px;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s, filter 0.2s;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
}

.month-event-overlay:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  z-index: 10;
}

.month-event-overlay.completed {
  opacity: 0.6;
  text-decoration: line-through;
  box-shadow: none;
}

/* Auto-scroll for month cells with > 2 badges */
.calendar-cell-events.auto-scroll {
  overflow-y: auto;
  max-height: 44px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.calendar-cell-events.auto-scroll::-webkit-scrollbar {
  display: none;
}

.calendar-day-name {
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-cell {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  min-height: 0;
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.calendar-cell:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
}

.calendar-cell.other-month {
  opacity: 0.4;
}

.calendar-cell.today {
  border-color: var(--color-primary);
  background: var(--color-surface);
}

.calendar-cell.selected-day {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.15);
}

.day-number-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 2px;
}

.day-number {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-cell.today .day-number {
  background: var(--color-primary);
  color: #fff;
}

/* Plotted events inside cells */
.calendar-cell-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.calendar-cell-events::-webkit-scrollbar {
  width: 3px;
}
.calendar-cell-events::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 12px;
}

.cell-events-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.calendar-event-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 12px;
  font-size: 9px;
  font-weight: 500;
  color: var(--color-text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.calendar-event-badge.wr-badge {
  background: #eff6ff;
  border-left-color: var(--color-primary);
}

.calendar-event-badge.db-badge {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

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

.status-completed { background: var(--color-success); }
.status-approved { background: #3b82f6; }
.status-under-review { background: var(--color-warning); }
.status-submitted { background: #94a3b8; }
.status-draft { background: #cbd5e1; }

.events-more {
  font-size: 8px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 2px;
}

/* Sidebar */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-border);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
}

.sidebar-section {
  margin-bottom: var(--spacing-lg);
}

.sidebar-section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.05em;
}

.sidebar-item {
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  padding: 12px var(--spacing-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.sidebar-item:hover {
  transform: translateX(2px);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.sidebar-item.expanded {
  border-color: var(--color-primary);
  background: #fcfdfe;
}

.sidebar-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.item-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.item-arrow {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
}

.sidebar-item.expanded .item-arrow {
  transform: rotate(90deg);
}

.sidebar-item-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
  animation: slideDown 0.2s ease-out;
}

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

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-bottom: 6px;
}

.detail-lbl {
  color: var(--color-text-muted);
  font-weight: 500;
}

.detail-val {
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

.detail-desc {
  margin-top: 8px;
  background: var(--color-bg);
  padding: 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--color-text);
  border-left: 3px solid var(--color-primary);
}

@media (max-width: 1024px) {
  .dashboard-calendar-card {
    flex-direction: column;
  }
  .calendar-sidebar {
    border-left: none;
    border-top: 1px solid var(--color-border);
    max-height: 400px;
  }
}

/* ─── Searchable Dropdown (Combobox) ─── */
.searchable-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 160px;
  max-width: 240px;
}

.searchable-dropdown-input {
  width: 100%;
  padding: 6px 48px 6px 10px !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-sm) !important;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer;
  min-height: 32px !important;
  height: 32px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.searchable-dropdown-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.searchable-dropdown-input:focus {
  outline: none;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  cursor: text;
}

.searchable-dropdown-clear {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: color 0.2s ease-in-out;
  line-height: 1;
}

.searchable-dropdown-clear:hover {
  color: #64748b;
}

.searchable-dropdown-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  z-index: 1;
}

.searchable-dropdown.open .searchable-dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.searchable-dropdown-listbox {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  padding: 4px 0;
}

.searchable-dropdown.open .searchable-dropdown-listbox {
  display: block;
  animation: searchDropFadeIn 0.15s ease-out;
}

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

.searchable-dropdown-item {
  padding: 7px 12px;
  font-size: 0.8125rem;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s ease;
  border-radius: 12px;
  margin: 0 4px;
}

.searchable-dropdown-item:hover,
.searchable-dropdown-item.highlighted {
  background: var(--color-primary-alpha, rgba(37, 99, 235, 0.08));
}

.searchable-dropdown-item.selected {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-alpha, rgba(37, 99, 235, 0.06));
}

.searchable-dropdown-item.selected.highlighted {
  background: var(--color-primary-alpha, rgba(37, 99, 235, 0.12));
}

.searchable-dropdown-empty {
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

/* Scrollbar styling for the listbox */
.searchable-dropdown-listbox::-webkit-scrollbar {
  width: 6px;
}

.searchable-dropdown-listbox::-webkit-scrollbar-track {
  background: transparent;
}

.searchable-dropdown-listbox::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 12px;
}

.searchable-dropdown-listbox::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* In .filters-bar context, match spacing with sibling selects */
.filters-bar .searchable-dropdown {
  min-width: 120px;
}

.filters-bar .searchable-dropdown-input {
  border-radius: var(--radius-sm, 12px) !important;
  height: 34px;
  min-height: 34px !important;
  font-size: 0.875rem;
  padding: 6px 48px 6px 10px !important;
}

/* Responsive: stack on small screens */
@media (max-width: 640px) {
  .searchable-dropdown {
    min-width: 120px;
    max-width: 100%;
  }
}

/* Filter Field Wrapper with Clear Button */
.filter-field-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.filter-field-wrapper select,
.filter-field-wrapper input {
  width: 100%;
}

.filters-bar .filter-field-wrapper.has-value select.form-select,
.audit-filters .filter-field-wrapper.has-value select.form-select,
.task-view-toolbar .filter-field-wrapper.has-value select.form-select {
  padding-right: 44px !important;
}

.filters-bar .filter-field-wrapper.has-value input,
.audit-filters .filter-field-wrapper.has-value input {
  padding-right: 52px !important;
}

/* Date input dynamic sizing (material datepicker replaces the native input) */
.filters-bar .filter-field-wrapper input[type="date"],
.audit-filters .filter-field-wrapper input[type="date"],
.filters-bar .filter-field-wrapper:has(.mdp-wrapper) .mdp-wrapper,
.audit-filters .filter-field-wrapper:has(.mdp-wrapper) .mdp-wrapper,
.filter-field-wrapper:has(.mdp-wrapper) .mdp-wrapper {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 6px 12px 6px 32px !important; /* Make room for left inclined calendar icon */
  box-sizing: border-box !important;
  font-size: 0.875rem !important;
  border-radius: var(--radius-sm, 12px) !important;
  transition: width 0.15s ease-in-out, min-width 0.15s ease-in-out, max-width 0.15s ease-in-out;
}

.filters-bar .filter-field-wrapper.has-value input[type="date"],
.audit-filters .filter-field-wrapper.has-value input[type="date"],
.filters-bar .filter-field-wrapper.has-value:has(.mdp-wrapper) .mdp-wrapper,
.audit-filters .filter-field-wrapper.has-value:has(.mdp-wrapper) .mdp-wrapper {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 6px 12px 6px 32px !important;
  box-sizing: border-box !important;
  font-size: 0.875rem !important;
  border-radius: var(--radius-sm, 12px) !important;
}

/* Prepended icons inside filter fields */
.filter-field-wrapper .filter-field-icon,
.searchable-dropdown .searchable-dropdown-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #9494a0);
  pointer-events: none;
  display: flex;
  align-items: center;
  z-index: 10;
}

/* Adjust paddings when icon is present */
.filter-field-wrapper.has-icon select.form-select,
.filter-field-wrapper.has-icon input {
  padding-left: 32px !important;
}

.searchable-dropdown.has-icon .searchable-dropdown-input {
  padding-left: 32px !important;
}

/* Style calendar icon to align left within date picker trigger */
.filter-field-wrapper .mdp-wrapper {
  padding-left: 32px !important;
}
.filter-field-wrapper .mdp-wrapper .mdp-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
}

/* Reserve right space for the clear icon so selected date text doesn't overlap it */
.filter-field-wrapper.has-value .mdp-display {
  padding-right: 44px;
}

/* Keep the clear icon the same distance from the material datepicker calendar indicator as on other fields */
.filter-field-wrapper:has(.mdp-wrapper) .filter-field-clear {
  right: 40px;
}

.filter-field-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

.filter-field-clear {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transition: color 0.2s ease-in-out;
  line-height: 1;
}

.filter-field-clear:hover {
  color: #64748b;
}

/* ─── Workflow UI Additions (inline ground worker autocomplete & checklist builder) ─── */

.inline-ground-worker-autocomplete {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: none !important;
}

.task-assignee-wrapper .inline-ground-worker-autocomplete {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.inline-ground-worker-autocomplete .searchable-dropdown-input {
  height: 36px;
  min-height: 36px !important;
  font-size: 0.875rem;
}

.checklist-items-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.checklist-items-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: var(--spacing-xs);
}

.checklist-items-list > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px !important;
  background: var(--color-surface, #ffffff) !important;
  border: 1px solid var(--color-border, #e2e8f0) !important;
  border-radius: 12px;
}

.checklist-items-list > div > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

.checklist-items-list .btn {
  flex-shrink: 0;
}

/* Checklist rows inside task detail accordions */
.task-details-col .detail-item-v2:has(> input[type="checkbox"]) {
  padding: 6px 8px !important;
  gap: 10px !important;
  align-items: center !important;
}

.checklist-assignee-dropdown,
.modal-checklist-assignee {
  max-width: 150px;
  min-width: 120px;
  flex-shrink: 0;
}

.checklist-assignee-dropdown .searchable-dropdown-input,
.modal-checklist-assignee .searchable-dropdown-input {
  height: 28px;
  min-height: 28px !important;
  font-size: 0.8125rem;
  padding: 4px 32px 4px 8px !important;
}

.checklist-item-row {
  flex-wrap: nowrap;
}

/* WR task detail — two-pane accordion */
.task-details-panes { display: flex; gap: 16px; align-items: flex-start; }
.task-details-left, .task-details-right { flex: 1; min-width: 0; background: var(--color-surface); border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; }
.task-details-left { flex: 1.1; }
.task-details-right { flex: 0.9; }
.task-details-left .task-details-col,
.task-details-right .task-details-col { border-right: none; padding-right: 0; margin-bottom: 24px; }
.task-details-left .task-details-col:last-child,
.task-details-right .task-details-col:last-child { margin-bottom: 0; }
.checklist-item-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid #f1f5f9; }
.checklist-item-row:last-child { border-bottom: none; }
.checklist-item-row.blocked { opacity: 0.6; background: #fafafa; }
.checklist-item-checkbox { flex-shrink: 0; }
.checklist-item-text { flex: 1; font-size: 0.9rem; }
.checklist-item-text.completed { text-decoration: line-through; color: #10b981; }
.checklist-time-pill { font-size: 0.75rem; background: #e0f2fe; color: #0369a1; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.checklist-assignee-dropdown { max-width: 160px; }
.checklist-add-row { display: flex; gap: 8px; margin-top: 12px; }
.time-log-group { margin-bottom: 12px; }
.time-log-group-title { font-weight: 600; font-size: 0.85rem; color: #64748b; margin-bottom: 4px; }
.time-log-entry { display: flex; justify-content: space-between; font-size: 0.85rem; color: #334155; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.dependency-mini-map { font-size: 0.85rem; color: #64748b; }
.dependency-mini-map .dep-chain { margin-bottom: 6px; }
@media (max-width: 768px) {
  .task-details-panes { flex-direction: column; }
}

/* Phase C: task table checklist, actions, and row selection styles */
.checklist-progress-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checklist-progress-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
}

.checklist-progress-ring {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.checklist-progress-ring svg {
  width: 100%;
  height: 100%;
  display: block;
}

.task-actions-cell {
  display: inline-flex;
  gap: 6px;
  white-space: nowrap;
}

.task-row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0;
  margin: 0;
}

.status-dropdown-v2 option:disabled {
  color: #94a3b8;
}

/* ─── Task View Toolbar & Bulk Actions (Redesign) ───────────────────────── */
.task-view-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
  position: sticky;
  top: 76px;
  z-index: 100;
  flex-wrap: wrap;
}

.group-toggle {
  display: inline-flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2px;
}

.group-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.group-toggle button svg {
  display: block;
  flex-shrink: 0;
}

.group-toggle button.active {
  background: var(--color-primary);
  color: #fff;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s cubic-bezier(0.2, 0, 0, 1), border-color 0.15s cubic-bezier(0.2, 0, 0, 1), color 0.15s cubic-bezier(0.2, 0, 0, 1);
}

.filter-chip:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-chip.active {
  background: color-mix(in oklab, var(--color-primary), transparent 88%);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-chip .count {
  font-weight: 700;
}

/* ─── Checklist View Mode (Notion-style) ────────────────────────────────── */
.checklist-view-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-bg);
  padding: 8px 0;
}

/* When checklist view is inside WR detail, remove the outer card gap/shadow so it doesn't look nested */
.task-list-no-card .checklist-view-container {
  background: transparent;
  padding: 0;
  gap: var(--space-2);
}

.checklist-view-item-wrap {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.task-list-no-card .checklist-view-item-wrap {
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.checklist-view-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  transition: background-color 0.15s ease;
  cursor: pointer;
  min-height: 44px;
}

.checklist-view-row:hover {
  background-color: color-mix(in oklab, var(--color-primary), transparent 97%);
}

.checklist-view-row.task-level {
  border-bottom: 1px solid var(--color-border);
  font-weight: 500;
  color: var(--color-text);
  background-color: var(--color-surface);
}

.checklist-view-row.task-level:last-child {
  border-bottom: none;
}

.checklist-view-row.task-level.is-completed .checklist-view-title,
.checklist-view-row.task-level.completed .checklist-view-title {
  text-decoration: line-through;
  color: var(--color-text-muted);
  opacity: 0.65;
}

.checklist-view-row.sub-level {
  padding-left: 40px;
  font-size: 0.875rem;
  color: var(--color-text);
  border-bottom: 1px solid color-mix(in oklab, var(--color-border), transparent 60%);
  background-color: color-mix(in oklab, var(--color-surface), var(--color-bg) 30%);
}

.checklist-view-row.sub-level:last-child {
  border-bottom: none;
}

.checklist-view-row.sub-level.is-completed,
.checklist-view-row.sub-level.completed {
  background-color: color-mix(in oklab, var(--color-success) 4%, transparent);
}

.checklist-view-row.sub-level.is-completed .checklist-view-title,
.checklist-view-row.sub-level.completed .checklist-view-title {
  text-decoration: line-through;
  color: var(--color-text-muted);
  opacity: 0.65;
}

.checklist-view-row.blocked {
  opacity: 0.6;
}

/* Checkbox styling */
.checklist-view-cb {
  width: 16px;
  height: 16px;
  accent-color: var(--color-success);
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.checklist-view-cb:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Title text */
.checklist-view-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Meta wrapper */
.checklist-view-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.checklist-view-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: color-mix(in oklab, var(--color-text-muted), transparent 92%);
  padding: 2px 6px;
  border-radius: 12px;
}

.checklist-view-hours {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: color-mix(in oklab, var(--color-text-muted), transparent 90%);
  padding: 2px 6px;
  border-radius: 12px;
}

/* Connective lines for Notion style sub-items */
.checklist-view-sub-container {
  position: relative;
}

.checklist-view-sub-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 22px;
  left: 22px;
  width: 1px;
  background-color: var(--color-border);
}

.inline-cl-spacer {
  width: 16px;
  position: relative;
  flex-shrink: 0;
}

.inline-cl-spacer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -17px;
  width: 18px;
  height: 1px;
  background-color: var(--color-border);
}

.bulk-action-bar {
  position: sticky;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--color-text), transparent 92%);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.bulk-selection-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-right: auto;
}

.bulk-clear-link {
  font-size: 13px;
  color: var(--color-danger);
  text-decoration: none;
  font-weight: 600;
}

.bulk-clear-link:hover {
  text-decoration: underline;
}

.bulk-assign-wrap .searchable-dropdown-input {
  height: 32px;
  font-size: 13px;
}

.group-header-stats {
  font-weight: 500;
  color: var(--color-text-muted);
}

/* ─── EOD reminder (redesign notice pattern) ──────────────────────────── */
.eod-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  border: 1px solid color-mix(in oklab, var(--color-warning), transparent 75%);
  background: color-mix(in oklab, var(--color-warning), transparent 93%);
}

.eod-request-link {
  font-size: 12px;
  color: #b45309;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 12px;
  font-weight: 500;
}

.eod-request-link:hover {
  color: #92400e;
}

.checklist-delete-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.task-empty-state {
  text-align: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  max-width: 480px;
  margin: var(--spacing-md) auto;
}

.task-empty-state svg {
  color: #94a3b8;
  margin-bottom: var(--spacing-sm);
}

.task-empty-state p {
  color: #64748b;
  margin-bottom: var(--spacing-md);
  font-size: 0.9rem;
}

/* ─── Shared Empty-State Component v2 (Notion-inspired, minimal) ───────────── */
.empty-state-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-lg);
  border-radius: var(--radius-md);
  background: var(--color-bg-light);
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  max-width: 520px;
  margin: var(--spacing-lg) auto;
}

.empty-state-v2.compact {
  padding: var(--spacing-lg);
  margin: 0;
  max-width: none;
  background: transparent;
  border: none;
}

.empty-state-v2 .empty-state-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.empty-state-v2.compact .empty-state-icon {
  width: 36px;
  height: 36px;
  margin-bottom: var(--spacing-sm);
}

.empty-state-v2 .empty-state-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.empty-state-v2.compact .empty-state-icon svg {
  width: 18px;
  height: 18px;
}

.empty-state-v2 .empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--spacing-xs);
  line-height: 1.4;
}

.empty-state-v2 .empty-state-body {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0 0 var(--spacing-md);
  line-height: 1.5;
  max-width: 360px;
}

.empty-state-v2 .empty-state-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.empty-state-v2 .empty-state-clear {
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0;
}

.empty-state-v2 .empty-state-clear:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Inline empty state used inside grid cards (e.g., Related Financials) */
.empty-state-v2.card-empty {
  padding: var(--spacing-lg);
  background: transparent;
  border: 1px dashed var(--color-border);
  margin: 0;
  max-width: none;
}

/* Inline empty state used inside board columns */
.board-cards-scroll > .empty-state-v2 {
  margin: var(--spacing-sm) 0;
  padding: var(--spacing-lg) var(--spacing-sm);
  background: transparent;
  border: none;
}

/* Inline empty state used inside table/list containers */
.task-list > .empty-state-v2,
.list-view + .empty-state-v2,
.board-v2 + .empty-state-v2 {
  margin: var(--spacing-lg) auto;
}

/* Inline co-assignee picker in task table cells and WR form rows */
.inline-coassignee-dropdown {
  width: 100%;
  min-width: 120px;
  max-width: 180px;
}

.inline-coassignee-dropdown .searchable-dropdown-input {
  height: 30px;
  min-height: 30px !important;
  font-size: 0.8125rem;
  padding: 0 8px;
}

.task-coassignee-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.wr-task-row-coassignees {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 180px;
  max-width: 420px;
  flex-shrink: 0;
}

/* ─── Work Request Task List Redesign ────────────────────────────── */
.lifecycle-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.lifecycle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.lifecycle-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 600;
}
.lifecycle-actions {
  display: flex;
  gap: 8px;
}
.stage-tracker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.stage-tracker.stacked {
  display: block;
  padding-bottom: 0;
  margin-bottom: 0;
}
.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 110px;
  position: relative;
  text-align: center;
}
.stage-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--color-text-muted);
}
.stage.active .stage-dot {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}
.stage.completed .stage-dot {
  border-color: var(--color-success);
  background: var(--color-success);
  color: #fff;
}
.stage-label {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.stage.active .stage-label {
  color: var(--color-primary);
  font-weight: 600;
}
.stage.completed .stage-label {
  color: var(--color-success);
}
.stage-connector {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  min-width: 24px;
  margin-top: -28px;
}
.stage-connector.completed {
  background: var(--color-success);
}

.routing-block {
  border-top: 1px solid color-mix(in oklab, var(--color-warning), transparent 75%);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}
.routing-block.blocked,
.routing-block.ready {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border-top: none;
}
.routing-block.blocked {
  background: color-mix(in oklab, var(--color-warning), transparent 92%);
}
.routing-block.ready {
  background: color-mix(in oklab, var(--color-success), transparent 92%);
}
.routing-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}
.routing-list {
  margin: 8px 0 0;
  padding-left: 24px;
  color: var(--color-text-muted);
  font-size: 14px;
}
.routing-list li {
  margin-bottom: 4px;
}
.search-input {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 220px;
}
.search-input:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary), transparent 70%);
}

/* ─── Work Request Detail Redesign Tokens ───
   Scoped to .project-detail-v2 so they match ERP_Work-Request_Redesign/index.html
   one-to-one without altering the rest of the app theme. */
.project-detail-v2,
.side-pane {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-warm: var(--surface);
  --fg: #111111;
  --fg-2: var(--fg);
  --muted: #6b6b6b;
  --meta: var(--muted);
  --border: #dfdbe3;
  --border-soft: var(--border);
  --accent: #2563eb;
  --accent-on: #ffffff;
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);
  --accent-active: color-mix(in oklab, var(--accent), black 14%);
  --success: #17a34a;
  --warn: #eab308;
  --danger: #dc2626;
  --font-display: "Inter", -apple-system, system-ui, sans-serif;
  --font-body: "Inter", -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --leading-body: 1.5;
  --leading-tight: 1.2;
  --tracking-display: -0.01em;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 12px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 2px 8px color-mix(in oklab, var(--fg), transparent 92%);
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 70%);
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  font-family: var(--font-body);
  background: var(--bg);
}

/* ─── Task List Redesign Styles ─── */
.task-list, .detail-panel, .task-list .task-row, .task-row-footer {
  /* Spacing and helper tokens from redesign index.html */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --elev-raised: 0 2px 8px color-mix(in oklab, var(--fg), transparent 92%);
  --focus-ring: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 70%);
}

.task-list {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  overflow: visible; /* Prevent dropdown clipping */
}

/* Ensure corners are rounded when overflow is visible */
.task-list .group-header:first-child,
.task-list .table-header:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* WR detail task list should not look like a nested card inside task-group-v2 */
.task-list.task-list-no-card {
  border: none;
  border-radius: 0;
  background: transparent;
}

.task-list .group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.task-list .group-title {
  font-weight: 700;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.task-list .group-meta {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  color: var(--muted);
  font-size: var(--text-xs);
}

.task-list .progress-ring {
  width: 18px;
  height: 18px;
}

.task-list .table-header {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1.8fr) minmax(150px, 1.2fr) 110px 120px 100px minmax(160px, 1.4fr) 80px 100px;
  gap: 0;
  padding: var(--space-3) var(--space-5);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 50;
}

.task-list .table-header span {
  padding: 0 var(--space-2);
  min-width: 0;
  display: flex;
  align-items: center;
}
.task-list .table-header span:first-child {
  padding-left: 0;
}

@media (max-width: 1100px) {
  .task-list .table-header {
    display: none;
  }
}

.task-list .task-row {
  display: grid;
  grid-template-columns: 36px minmax(180px, 1.8fr) minmax(150px, 1.2fr) 110px 120px 100px minmax(160px, 1.4fr) 80px 100px;
  gap: 0;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  transition: background var(--motion-fast) var(--ease-standard);
}

.task-list .task-row:hover {
  background: color-mix(in oklab, var(--accent), transparent 97%);
}

.task-list .task-row.expanded {
  background: color-mix(in oklab, var(--accent), transparent 95%);
  border-bottom: none;
}

.task-list .task-row.selected {
  background: color-mix(in oklab, var(--accent), transparent 92%);
}

@media (max-width: 1100px) {
  .task-list .task-row {
    grid-template-columns: 36px 1fr;
    gap: var(--space-3) 0;
    padding: var(--space-4);
  }
  .task-list .task-row .cell {
    min-width: 0;
  }
}

.task-list .cell {
  padding: 0 var(--space-2);
  min-width: 0;
}

.task-list .cell-linked {
  min-width: 0;
  max-width: 100%;
}

.task-list .cell-linked .badge,
.task-list .cell-linked .task-link-required-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.task-list .cell:first-child {
  padding-left: 0;
}

.task-list .cell-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.task-list .caret {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform var(--motion-fast) var(--ease-standard);
  flex-shrink: 0;
}

.task-list .expanded .caret {
  transform: rotate(90deg);
}

.task-list .title-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.task-list .title-main {
  font-weight: 600;
}

.task-list .title-main.done {
  text-decoration: line-through;
  color: var(--muted);
}

.task-list .title-sub {
  color: var(--muted);
  font-size: var(--text-xs);
}

.task-list .assignee-cell {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.task-list .assignee-main {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.task-list .avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
}

.task-list .assignee-name {
  font-weight: 500;
}

.task-list .coassignees {
  display: flex;
  gap: var(--space-1);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.search-input-wrapper .search-input {
  padding-left: 32px;
}

.btn-icon-start {
  margin-right: 4px;
  vertical-align: middle;
}

.task-list .coassignee-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  color: var(--muted);
}

.task-group-v2 .status-select,
.status-dropdown-wrapper-v2 .status-select,
.task-list .status-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 20px 4px 6px !important;
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--surface);
  cursor: pointer;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.status-select:focus-visible,
.task-list .status-select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.status-select option,
.task-list .status-select option {
  font-weight: 500;
}

.task-list .checklist-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.task-list .progress-text {
  font-size: var(--text-xs);
  color: var(--muted);
}

.task-list .time-cell {
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
  color: var(--muted);
}

.task-list .actions-cell {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-start;
  align-items: center;
  padding-right: 0;
}

.task-list .action-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.task-list .action-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent), transparent 96%);
}

.task-list .action-icon.primary {
  color: var(--accent);
  border-color: var(--accent);
}

.task-list .action-icon.primary:hover {
  background: color-mix(in oklab, var(--accent), transparent 90%);
}

.task-list .action-menu {
  position: relative;
  display: inline-block;
}

.task-list .action-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-raised);
  padding: var(--space-2) 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.task-list .action-menu-list.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.task-list .action-menu-list.open-up {
  top: auto;
  bottom: calc(100% + 4px);
  transform: translateY(4px);
}

.task-list .action-menu-list.open-up.open {
  transform: translateY(0);
}

.task-list .action-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

.task-list .action-menu-item:hover {
  background: var(--bg);
  color: var(--accent);
}

.task-list .action-menu-item.danger:hover {
  color: var(--danger);
  background: color-mix(in oklab, var(--danger), transparent 95%);
}

.task-list .action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--text-xs);
  cursor: pointer;
}

.task-list .action-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.task-list .detail-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

/* ─── Task detail accordion ────────────────────────────────────── */
.detail-panel {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 20px;
  overflow: hidden;
  transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.detail-panel.hidden {
  display: none;
}

.detail-panel.collapsed {
  display: none;
}

.task-list .task-row.expanded + .detail-panel,
.detail-panel:not(.hidden):not(.collapsed) {
  display: grid;
  opacity: 1;
  border-bottom: 1px solid var(--border);
}

.detail-panel .detail-pane {
  border-left: 1px solid var(--border);
  padding-left: 24px;
}

@media (max-width: 1100px) {
  .detail-panel {
    grid-template-columns: 1fr;
  }
  .detail-panel .detail-pane {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 20px;
  }
}


.detail-panel .detail-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.detail-panel .checklist-item,
.side-pane-toggle-content .checklist-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) auto 75px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 12px;
  transition: background-color 0.2s ease, border-left-color 0.2s ease;
}

.detail-panel .checklist-item.is-completed,
.side-pane-toggle-content .checklist-item.is-completed,
.detail-panel .checklist-item.completed,
.side-pane-toggle-content .checklist-item.completed {
  background-color: color-mix(in oklab, var(--color-success) 6%, transparent);
  border-left-color: var(--color-success);
}

.detail-panel .checklist-item.is-completed .checklist-text span,
.side-pane-toggle-content .checklist-item.is-completed .checklist-text span,
.detail-panel .checklist-item.completed .checklist-text span,
.side-pane-toggle-content .checklist-item.completed .checklist-text span {
  text-decoration: line-through;
  color: var(--color-text-muted);
  opacity: 0.65;
}

.detail-panel .checklist-item input[type="checkbox"]:checked,
.side-pane-toggle-content .checklist-item input[type="checkbox"]:checked {
  accent-color: var(--color-success);
}

.detail-panel .checklist-item > *,
.side-pane-toggle-content .checklist-item > * {
  min-width: 0;
}

.detail-panel .checklist-item .hours-pill,
.side-pane-toggle-content .checklist-item .hours-pill {
  justify-self: end;
  white-space: nowrap;
}

.detail-panel .checklist-item > div:last-child,
.side-pane-toggle-content .checklist-item > div:last-child {
  justify-self: end;
}

/* Invisible-table layout: task name and assignees/co-assignees share equal width; hour column stays narrow */
.checklist-item .task-assignee-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.checklist-item .task-assignee-wrapper > * {
  flex: 1 1 0;
  min-width: 0;
}

.checklist-item .task-assignee-wrapper .checklist-assignee-dropdown,
.checklist-item .task-assignee-wrapper .inline-coassignee-dropdown,
.checklist-item .task-assignee-wrapper .task-coassignee-wrap {
  min-width: 0;
  width: 100%;
  max-width: none;
  margin-top: 0 !important;
}

.checklist-item .task-assignee-wrapper .searchable-dropdown-input {
  width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 4px 32px 4px 8px !important;
  font-size: 0.8125rem;
}

.checklist-item .task-assignee-wrapper .task-coassignee-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.detail-panel .checklist-item:last-child,
.side-pane-toggle-content .checklist-item:last-child {
  border-bottom: none;
}

.detail-panel .checklist-item.locked,
.side-pane-toggle-content .checklist-item.locked {
  opacity: .55;
}

.detail-panel .checklist-item input[type="checkbox"],
.side-pane-toggle-content .checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.detail-panel .checklist-text,
.side-pane-toggle-content .checklist-text {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.detail-panel .checklist-text > span:first-child,
.side-pane-toggle-content .checklist-text > span:first-child {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.checklist-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  background: #334155;
  color: #94a3b8;
  border: 1px solid #475569;
  line-height: 1.5;
}

.checklist-category-badge.badge-doc {
  background: #1e3a5f;
  color: #93c5fd;
  border-color: #2563eb;
}

.checklist-period-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  background: #14532d;
  color: #86efac;
  border: 1px solid #22c55e;
  line-height: 1.5;
}

.detail-panel .lock-hint,
.side-pane-toggle-content .lock-hint {
  font-size: var(--text-xs);
  color: var(--warn);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.detail-panel .hours-pill,
.side-pane-toggle-content .hours-pill {
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: color-mix(in oklab, var(--accent), transparent 88%);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

.detail-panel .add-checklist {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.detail-panel .add-checklist input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.detail-panel .add-checklist input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

/* ─── Detail right pane ───────────────────────────────────────── */
.detail-panel .detail-pane {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.detail-panel .detail-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--surface);
}

.detail-panel .empty-state {
  color: var(--muted);
  font-size: var(--text-sm);
  text-align: center;
  padding: var(--space-6) 0;
}

.detail-panel .history-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}

.detail-panel .history-item:last-child {
  border-bottom: none;
}

.detail-panel .history-meta {
  color: var(--muted);
  font-size: var(--text-xs);
}

.detail-panel .dep-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.detail-panel .dep-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.detail-panel .dep-arrow {
  color: var(--muted);
}

/* General Actions Dropdown Menu styles (unprefixed) */
.action-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), background var(--motion-fast) var(--ease-standard);
}

.action-icon:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent), transparent 96%);
}

.action-icon.primary {
  color: var(--accent);
  border-color: var(--accent);
}

.action-icon.primary:hover {
  background: color-mix(in oklab, var(--accent), transparent 90%);
}

.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-raised);
  padding: var(--space-2) 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.action-menu-list.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

.action-menu-item:hover {
  background: var(--bg);
  color: var(--accent);
}

.action-menu-item.danger:hover {
  color: var(--danger);
  background: color-mix(in oklab, var(--danger), transparent 95%);
}

/* ─── Redesign: Additional utility classes ──────────────────────── */
.badge-muted {
  background: var(--color-bg);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

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

.font-mono {
  font-family: ui-monospace, "JetBrains Mono", monospace;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─── Redesign: Financials grid ──────────────────────────────────── */
.financials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .financials-grid {
    grid-template-columns: 1fr;
  }
}

.financial-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  background: var(--color-surface);
}

.financial-card h4 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.financial-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

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

/* ─── Text utilities ──────────────────────────────────────────────── */
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }

/* ─── Work Request Detail Redesign Overrides ─────────────────────────
   These ensure all design tokens in the WR detail view are one-to-one
   with ERP_Work-Request_Redesign/index.html. */

.project-detail-v2 .identity-parent { color: var(--accent); }
.project-detail-v2 .identity-title { color: var(--fg); }
.project-detail-v2 .identity-sub { color: var(--muted); }
.project-detail-v2 .identity-sub .dot { background: var(--border); }

.project-detail-v2 .lifecycle-card {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-md);
}
.project-detail-v2 .lifecycle-label { color: var(--muted); }
.project-detail-v2 .stage-tracker { padding-bottom: var(--space-3); margin-bottom: var(--space-4); }
.project-detail-v2 .stage-dot {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
}
.project-detail-v2 .stage.active .stage-dot {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-on);
}
.project-detail-v2 .stage.completed .stage-dot {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.project-detail-v2 .stage-label { color: var(--muted); }
.project-detail-v2 .stage.active .stage-label { color: var(--accent); }
.project-detail-v2 .stage.completed .stage-label { color: var(--success); }
.project-detail-v2 .stage-connector { background: var(--border); }
.project-detail-v2 .stage-connector.completed { background: var(--success); }

.project-detail-v2 .routing-block {
  border-top-color: color-mix(in oklab, var(--warn), transparent 75%);
}
.project-detail-v2 .routing-block.blocked,
.project-detail-v2 .routing-block.ready {
  border-radius: var(--radius-sm);
  border-top: none;
}
.project-detail-v2 .routing-block.blocked {
  background: color-mix(in oklab, var(--warn), transparent 92%);
}
.project-detail-v2 .routing-block.ready {
  background: color-mix(in oklab, var(--success), transparent 92%);
}
.project-detail-v2 .routing-title { color: var(--fg); }
.project-detail-v2 .routing-list { color: var(--muted); }

.project-detail-v2 .search-input {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.project-detail-v2 .search-input:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.project-detail-v2 .task-view-toolbar {
  background: var(--bg);
}
.project-detail-v2 .group-toggle {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-sm);
}
.project-detail-v2 .group-toggle button {
  color: var(--muted);
  font-size: var(--text-xs);
  transition: background var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}
.project-detail-v2 .group-toggle button.active {
  background: var(--accent);
  color: var(--accent-on);
}
.project-detail-v2 .filter-chips { gap: var(--space-2); }
.project-detail-v2 .filter-chip {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}
.project-detail-v2 .filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.project-detail-v2 .filter-chip.active {
  background: color-mix(in oklab, var(--accent), transparent 88%);
  border-color: var(--accent);
  color: var(--accent);
}
.project-detail-v2 .checklist-view-row:hover {
  background-color: color-mix(in oklab, var(--accent), transparent 97%);
}
.project-detail-v2 .checklist-view-cb {
  accent-color: var(--accent);
}
.project-detail-v2 .checklist-view-row.sub-level.is-completed,
.project-detail-v2 .checklist-view-row.sub-level.completed {
  background-color: color-mix(in oklab, var(--accent) 4%, transparent);
}

/* Remove nested-card appearance in WR detail table/list/checklist views */
.project-detail-v2 .task-list.task-list-no-card {
  border: none;
  border-radius: 0;
  background: transparent;
}
.project-detail-v2 .task-list-no-card .list-item,
.project-detail-v2 .task-list-no-card.operations-list-view .list-item {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--border);
}
.project-detail-v2 .task-list-no-card .list-item:hover,
.project-detail-v2 .task-list-no-card.operations-list-view .list-item:hover {
  background: color-mix(in oklab, var(--fg), transparent 96%);
  transform: none;
  box-shadow: none;
}
.project-detail-v2 .task-list-no-card .checklist-view-container {
  background: transparent;
  padding: 0;
  gap: var(--space-2);
}
.project-detail-v2 .task-list-no-card .checklist-view-item-wrap {
  border-radius: var(--radius-sm);
  box-shadow: none;
}

.project-detail-v2 .bulk-action-bar {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-raised);
  transition: transform var(--motion-base) var(--ease-standard), opacity var(--motion-base) var(--ease-standard);
}
.project-detail-v2 .bulk-selection-label { color: var(--fg); }
.project-detail-v2 .bulk-clear-link { color: var(--danger); }

.project-detail-v2 .eod-banner {
  border: 1px solid color-mix(in oklab, var(--accent), transparent 80%);
  background: color-mix(in oklab, var(--accent), transparent 96%);
  border-radius: var(--radius-sm);
}
.project-detail-v2 .eod-request-link { color: var(--muted); }
.project-detail-v2 .eod-request-link:hover { color: var(--accent); }

.project-detail-v2 .task-group-v2 {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-md);
}
.project-detail-v2 .task-group-header {
  background: var(--bg);
  color: var(--fg);
}
.project-detail-v2 .task-group-count,
.project-detail-v2 .group-header-stats { color: var(--muted); }
.project-detail-v2 .task-table-v2 th {
  color: var(--muted);
  border-bottom-color: var(--border);
}
.project-detail-v2 .task-table-v2 td {
  border-bottom-color: var(--border);
  font-size: var(--text-sm);
}
.project-detail-v2 .task-v2-title {
  color: var(--fg);
  font-weight: 600;
}
.project-detail-v2 .task-v2-title.is-completed,
.project-detail-v2 .task-v2-title.completed { color: var(--muted); }
.project-detail-v2 .task-group-footer {
  color: var(--fg);
  border-top-color: var(--border);
}
.project-detail-v2 .task-v2-checkbox {
  border-color: var(--border);
  border-radius: var(--radius-sm);
}
.project-detail-v2 .task-v2-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.project-detail-v2 .financials-grid { gap: var(--space-5); }
.project-detail-v2 .financial-card {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius-md);
}
.project-detail-v2 .financial-card h4 { font-size: var(--text-sm); color: var(--fg); }
.project-detail-v2 .financial-row {
  border-bottom-color: var(--border);
  font-size: var(--text-sm);
  color: var(--fg);
}

.project-detail-v2 .status-select {
  border-color: var(--border);
  background: var(--surface);
  color: var(--fg);
}
.project-detail-v2 .status-select:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}


/* ─── Work Request Detail card/badge token overrides ───────────────── */
.project-detail-v2 .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: none;
  margin-bottom: var(--space-5);
}
.project-detail-v2 .card-title {
  font-size: var(--text-lg);
  color: var(--fg);
}

.project-detail-v2 .badge-info {
  background: color-mix(in oklab, var(--accent), transparent 88%);
  color: var(--accent);
}
.project-detail-v2 .badge-success {
  background: color-mix(in oklab, var(--success), transparent 88%);
  color: var(--success);
}
.project-detail-v2 .badge-warning {
  background: color-mix(in oklab, var(--warn), transparent 88%);
  color: color-mix(in oklab, var(--warn), black 30%);
}
.project-detail-v2 .badge-danger {
  background: color-mix(in oklab, var(--danger), transparent 88%);
  color: var(--danger);
}
.project-detail-v2 .badge-muted {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.project-detail-v2 .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
}
.project-detail-v2 .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.project-detail-v2 .btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--fg);
}
.project-detail-v2 .btn-ghost {
  color: var(--muted);
  border-color: transparent;
}
.project-detail-v2 .btn-ghost:hover {
  color: var(--fg);
  background: color-mix(in oklab, var(--fg), transparent 96%);
}
.project-detail-v2 .btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}
.project-detail-v2 .btn-danger:hover {
  background: color-mix(in oklab, var(--danger), transparent 92%);
}

.project-detail-v2 .task-view-toolbar {
  background: var(--bg);
  border-bottom-color: var(--border);
  position: sticky;
  top: var(--project-detail-title-bar-height, 48px);
  z-index: 100;
}

.project-detail-v2 .card-compact {
  padding: var(--space-4);
}

.project-detail-v2 .task-table-v2 tfoot td {
  color: var(--fg);
  border-top-color: var(--border);
}

.project-detail-v2 .task-row-checkbox {
  accent-color: var(--accent);
}

.project-detail-v2 .btn-primary {
  box-shadow: none;
}

.project-detail-v2 .detail-sub-header-v2 {
  margin-bottom: var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
  background: var(--bg);
}
.project-detail-v2 .detail-sub-header-v2 .detail-info-label {
  color: var(--muted);
}
.project-detail-v2 .detail-sub-header-v2 .detail-info-value {
  color: var(--fg);
}
.project-detail-v2 .page-title-bar-v2,
.project-detail-v2 .page > h1 {
  margin-bottom: 0;
  background: var(--bg);
}

.title-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.project-detail-v2 .title-bar-actions .identity-badges {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: nowrap;
}

@media (max-width: 1024px) {
  .page-title-bar-v2 {
    flex-wrap: wrap;
  }
  .title-bar-actions {
    flex-wrap: wrap;
  }
  .project-detail-v2 .title-bar-actions .identity-badges {
    flex-wrap: wrap;
  }
}

/* Force assignee dropdowns to fit inside the table cell */
.project-detail-v2 .task-list .assignee-cell {
  min-width: 0;
  overflow: visible;
}
.project-detail-v2 .task-list .assignee-cell .task-assignee-wrapper {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  gap: var(--space-1);
}
.project-detail-v2 .task-list .assignee-cell .task-assignee-wrapper .searchable-dropdown {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.project-detail-v2 .task-list .assignee-cell .task-assignee-wrapper .searchable-dropdown-input {
  min-width: 0 !important;
  width: 100%;
}
.project-detail-v2 .task-list .assignee-cell .inline-coassignee-dropdown {
  min-width: 80px;
  max-width: 120px;
  flex-shrink: 0;
}

/* Stacked assignee display in task table (non-Draft phases) */
.assignee-avatars-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-start;
}

.assignee-avatar-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.assignee-avatar-row .avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  margin-left: 0;
}

.assignee-avatar-row .assignee-name {
  font-size: var(--text-sm);
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assignee-overflow {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 600;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* ============================================================
 * Modular Side-Pane Detail View
 * Notion-inspired slide-in panel for quick-viewing records.
 * Reusable across any module.
 * ============================================================ */

.side-pane-overlay {
  display: none !important;
}

.side-pane {
  position: fixed;
  top: 0;
  right: 0;
  width: min(50vw, 760px);
  min-width: 320px;
  height: 100vh;
  background: var(--color-surface);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  border-left: 1px solid var(--color-border);
}
.side-pane.open {
  transform: translateX(0);
}

/* Notion-style collapsible sections */
.side-pane-toggle-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--color-text);
  user-select: none;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  margin-top: -1px; /* collapse double borders */
}
.side-pane-toggle-header::before {
  content: '▼';
  font-size: 9px;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}
.side-pane-toggle-header.collapsed::before {
  transform: rotate(-90deg);
}
.side-pane-toggle-content {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
}
.side-pane-toggle-content.collapsed {
  display: none;
}

.side-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}

.side-pane-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-pane-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-pane-close-btn,
.side-pane-expand-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.side-pane-close-btn:hover,
.side-pane-expand-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.side-pane-close-btn svg,
.side-pane-expand-btn svg {
  width: 16px;
  height: 16px;
}

.side-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.side-pane-title-section {
  padding: 24px 24px 16px;
}

.side-pane-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 20px;
}

.side-pane-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin: 0 0 8px;
  word-break: break-word;
}

.side-pane-view-details {
  font-size: 0.8125rem;
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
}
.side-pane-view-details:hover {
  text-decoration: underline;
}

.side-pane-properties {
  padding: 8px 24px 16px;
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: 8px;
  column-gap: 8px;
  border-bottom: 1px solid var(--color-border);
}

.side-pane-prop-row {
  display: contents;
}

.side-pane-prop-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.side-pane-prop-label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--color-text-muted);
}

.side-pane-prop-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text);
  font-weight: 600;
}

.side-pane-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.side-pane-section:last-child {
  border-bottom: none;
}

.side-pane-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 12px;
}

.side-pane-description {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.side-pane-task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-pane-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--color-bg);
  font-size: 0.8125rem;
  transition: background 0.15s ease;
}

.side-pane-task-item:hover {
  background: color-mix(in srgb, var(--color-primary), transparent 93%);
}

.side-pane-task-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-text-muted);
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.side-pane-task-checkbox.completed {
  background: var(--color-success);
  border-color: var(--color-success);
}

.side-pane-task-checkbox.completed::after {
  content: '';
  width: 6px;
  height: 3px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}

.side-pane-task-name {
  flex: 1;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-pane-task-name.completed {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.side-pane-task-status {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  flex-shrink: 0;
}

.side-pane-progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.side-pane-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.side-pane-progress-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.4s ease;
}

.side-pane-progress-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  min-width: 32px;
  text-align: right;
}

.side-pane-summary-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.list-item.side-pane-active,
.board-card-v2.side-pane-active {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--color-primary), transparent 95%) !important;
}

@media (max-width: 900px) {
  .side-pane {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
  }
}

@media print {
  .side-pane, .side-pane-overlay {
    display: none !important;
  }
}

/* Notion-style Embed Buttons */
.notion-embed-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
  width: 100%;
  text-align: left;
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 500;
}
.notion-embed-option:hover {
  background: color-mix(in srgb, var(--color-primary), transparent 93%);
  border-color: var(--color-primary);
}
.notion-embed-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}



/* Align table header text with row content */
.task-list .table-header span:nth-child(2) {
  padding-left: var(--space-1);
}

/* Vertically center all task row cells */
.task-list .task-row {
  align-items: center;
}

/* Side Pane Assignee and Co-assignee styles */
.side-pane-primary-assignee-dropdown,
.side-pane-coassignee-dropdown {
  width: 100%;
  max-width: 220px;
}

.side-pane-primary-assignee-dropdown .searchable-dropdown-input,
.side-pane-coassignee-dropdown .searchable-dropdown-input {
  height: 28px;
  min-height: 28px !important;
  font-size: 0.8125rem;
  padding: 4px 32px 4px 8px !important;
}

/* Notion-Style Embed Popover */
.notion-embed-popover {
  position: absolute;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 360px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  padding: 12px;
  box-sizing: border-box;
}

.notion-popover-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
}

.notion-tab-btn {
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}

.notion-tab-btn.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Notion-style Document Preview Side Pane */
.document-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2500;
  display: flex;
  justify-content: flex-end;
}

.document-preview-pane {
  width: min(760px, 100vw);
  height: 100vh;
  background: var(--color-surface);
  box-shadow: var(--shadow-float, -4px 0 24px rgba(0, 0, 0, 0.15));
  display: flex;
  flex-direction: column;
  animation: slideInPreview 0.25s ease-out;
}

@keyframes slideInPreview {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.document-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.document-preview-title {
  flex: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
}

.document-preview-viewer {
  flex: 1;
  overflow: auto;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-bg, #f8f9fa);
}

.document-preview-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--color-surface, #fff);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.document-preview-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.document-preview-meta {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.document-preview-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.docx-preview-container {
  overflow: auto;
  height: 100%;
  width: 100%;
  padding: 24px 16px;
  background: var(--color-bg, #f1f5f9);
  box-sizing: border-box;
}

.docx-preview-container .docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}

.docx-preview-container .docx-wrapper > section.docx {
  background: #ffffff !important;
  color: #1a202c !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  border-radius: 4px !important;
  margin-bottom: 20px !important;
}

[data-theme="dark"] .document-preview-overlay {
  background: rgba(0, 0, 0, 0.75);
}

[data-theme="dark"] .docx-preview-container {
  background: #0f172a;
}

.receipt-selected-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  margin-top: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.receipt-selected-card:hover {
  border-color: var(--color-primary, #6366f1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.receipt-selected-thumb-wrap {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e2e8f0);
  flex-shrink: 0;
  cursor: pointer;
  background: var(--color-bg, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.receipt-selected-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.receipt-selected-thumb-wrap:hover img {
  transform: scale(1.08);
}

.receipt-selected-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-bg, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
}

.receipt-selected-name {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary, #6366f1);
  cursor: pointer;
  text-decoration: underline;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
}

.receipt-selected-meta {
  font-size: 0.72rem;
  color: var(--color-text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.receipt-type-pill {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.2;
}

.receipt-type-pill.pill-img {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.receipt-type-pill.pill-pdf {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.receipt-type-pill.pill-doc {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.receipt-type-pill.pill-other {
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
}



.notion-popover-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notion-popover-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 0.8125rem;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: inherit;
}

.notion-popover-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.notion-popover-submit {
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.notion-popover-submit:hover {
  filter: brightness(0.95);
}

.notion-popover-hint {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 4px;
}

.notion-popover-file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.notion-popover-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.15s ease;
  color: var(--color-text);
}

.notion-popover-file-item:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary), transparent 95%);
}

/* Notion Drag and Drop Zone and Header Styles */
.notion-popover-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: var(--color-bg);
  transition: all 0.2s ease;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.notion-popover-dropzone:hover, .notion-popover-dropzone.dragover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary), transparent 97%);
  color: var(--color-primary);
}
.notion-popover-dropzone svg {
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}
.notion-popover-dropzone:hover svg, .notion-popover-dropzone.dragover svg {
  color: var(--color-primary);
}
.notion-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.notion-popover-title {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-text);
}
.notion-popover-close {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.notion-popover-close:hover {
  color: var(--color-text);
}

/* Ensure scrolled-to cards and rows remain visible below sticky headers */
.board-card-v2,
.board-card-v2 *,
.board-card,
.board-card *,
.list-item,
.list-item *,
.task-row,
.task-row *,
tbody tr,
tbody tr * {
  scroll-margin-top: 164px;
}

/* Prevent task-list container from acting as scroll parent/clipping container for sticky column headers */
.project-detail-v2 .task-list {
  overflow: visible;
}

/* Remove transparent margin-bottom gap below toolbar to prevent cards from clipping through on scroll */
.project-detail-v2 .task-view-toolbar {
  margin-bottom: 0;
}

/* Maintain clean spacing for the first task group in table view */
.project-detail-v2 .task-list .task-group-v2:first-child {
  margin-top: 16px;
}

/* ─── Side Pane Form Panel Layout ─── */
/* When a form is rendered inside the side panel, restructure the layout */

/* Hide the page title bar when inside the panel */
.side-pane-body .side-pane-form-wrapper .page-title-bar-v2 {
  display: none !important;
}

.side-pane--side-peek .side-pane-header {
  padding: 8px 16px;
}

.side-pane--side-peek .side-pane-body {
  padding: 0 16px;
}

/* Panel form title (Notion-style, compact padding) */
.side-pane-form-title {
  padding: 16px 40px 8px;
}

.side-pane-form-title .side-pane-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 10px;
  font-size: 22px;
}

.side-pane-form-title h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.3;
}

/* Form content area inside panel */
.side-pane-form-content {
  padding: 8px 40px 100px;
}

.side-pane-form-content .form-stacked {
  margin: 0;
}

/* Notion-like wider, airy property grid inside side-peek panels */
.side-pane-form-content .notion-property-grid {
  gap: 16px 32px;
  max-width: none;
}

.side-pane-form-content .notion-property-grid .notion-prop {
  padding: 0;
}

.side-pane-form-content .notion-property-grid .notion-prop-select,
.side-pane-form-content .notion-property-grid input,
.side-pane-form-content .notion-property-grid textarea {
  font-size: 0.875rem;
}

/* Collapsible sections inside side-peek forms */
.side-pane-form-content .notion-collapsible {
  margin-top: 24px;
}

.side-pane-form-content .notion-collapsible .notion-toggle-header {
  padding: 12px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.side-pane-form-content .notion-collapsible .notion-toggle-body {
  padding: 16px 0;
  border: none;
  padding-left: 0;
}

/* Notion-style labels and headings inside side-peek forms */
.side-pane-form-content .notion-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.side-pane-form-content .form-group {
  margin-bottom: var(--spacing-md);
}

/* Sticky footer for action buttons */
.side-pane-form-footer {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  flex-shrink: 0;
}

.side-pane-form-footer .btn {
  min-width: 100px;
}

/* ─── Side Pane Form Field Visibility Enhancements ─── */
/* Scoped visibility improvements for form fields within the side panel */
.side-pane-body input[type="text"],
.side-pane-body input[type="email"],
.side-pane-body input[type="password"],
.side-pane-body input[type="number"],
.side-pane-body input[type="date"],
.side-pane-body textarea,
.side-pane-body select,
.side-pane-body .form-select,
.side-pane-body .multi-select-btn {
  background-color: #fafafa !important; /* Shaded background to contrast against white panel background */
  border: 1px solid #cbd5e1 !important; /* Visible slate border (contrast ratio ~ 2:1 on off-white, 3:1 on white) */
  border-radius: 12px !important;
  color: var(--color-text) !important;
  font-weight: 500 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
}

/* Custom dropdown chevron for select inputs inside panel */
.side-pane-body select,
.side-pane-body .multi-select-btn {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 32px !important;
}

/* Searchable dropdown input visibility override */
.side-pane-body .searchable-dropdown-input {
  background-color: #fafafa !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  color: var(--color-text) !important;
  font-weight: 500 !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
}

/* Hover States */
.side-pane-body input[type="text"]:hover,
.side-pane-body input[type="email"]:hover,
.side-pane-body input[type="password"]:hover,
.side-pane-body input[type="number"]:hover,
.side-pane-body input[type="date"]:hover,
.side-pane-body textarea:hover,
.side-pane-body select:hover,
.side-pane-body .form-select:hover,
.side-pane-body .multi-select-btn:hover,
.side-pane-body .searchable-dropdown-input:hover {
  border-color: #94a3b8 !important;
}

/* Focus States */
.side-pane-body input[type="text"]:focus,
.side-pane-body input[type="email"]:focus,
.side-pane-body input[type="password"]:focus,
.side-pane-body input[type="number"]:focus,
.side-pane-body input[type="date"]:focus,
.side-pane-body textarea:focus,
.side-pane-body select:focus,
.side-pane-body .form-select:focus,
.side-pane-body .multi-select-btn:focus,
.side-pane-body .searchable-dropdown-input:focus {
  background-color: #ffffff !important; /* Switch to crisp white background on focus */
  border-color: var(--color-primary) !important; /* Highlight with Trust Blue */
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  outline: none !important;
}

/* Labels and Group Styling */
.side-pane-body .form-group label {
  color: #374151 !important; /* High contrast dark slate gray for legibility */
  font-weight: 600 !important; /* Semibold for visual hierarchy */
  font-size: 0.8125rem !important; /* Crisp readability */
  margin-bottom: 6px !important;
  display: inline-block !important;
}

/* File Upload Controls */
.side-pane-body input[type="file"] {
  padding: 6px 10px !important;
  border: 1px dashed #cbd5e1 !important;
  background-color: #fafafa !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  width: 100% !important;
  color: var(--color-text) !important;
  font-size: 0.8125rem !important;
}

.side-pane-body input[type="file"]::file-selector-button {
  background: var(--color-primary) !important;
  color: white !important;
  border: none !important;
  padding: 6px 12px !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  margin-right: 8px !important;
  font-size: 0.8125rem !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  transition: opacity 0.2s !important;
}

.side-pane-body input[type="file"]::file-selector-button:hover {
  opacity: 0.9 !important;
}

/* Radio buttons and Checkboxes */
.side-pane-body input[type="radio"],
.side-pane-body input[type="checkbox"] {
  accent-color: var(--color-primary) !important;
  cursor: pointer !important;
}

.side-pane-body .radio-label,
.side-pane-body .checkbox-label {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* ============================================================
 * Notion-inspired Side-Pane View Modes
 * side-peek, center-peek, full-page, new-tab + view menu
 * ============================================================ */

.side-pane {
  --pane-width: 50vw;
  width: var(--pane-width);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.2s ease;
}

/* Side peek: right drawer spans to the center of the screen, Notion-style */
.side-pane.side-pane--side-peek {
  transform: translateX(100%);
  --pane-width: min(50vw, 720px);
}
.side-pane.side-pane--side-peek.open {
  transform: translateX(0);
}

/* Center peek: focused modal panel with dimmed overlay */
.side-pane.side-pane--center-peek {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: min(720px, 92vw);
  height: auto;
  max-height: 86vh;
  min-height: 200px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  /* Center-peek panels should scroll their body, not the whole panel. */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.side-pane.side-pane--center-peek.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Overlay only used by center-peek */
.side-pane-overlay {
  display: block !important; /* override legacy display:none */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
}
.side-pane-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Resize handle for side-peek */
.side-pane-resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 1002;
  background: transparent;
  transition: background 0.15s ease;
}
.side-pane-resize-handle:hover,
.side-pane-resize-handle.active,
.side-pane.resizing .side-pane-resize-handle {
  background: rgba(47, 111, 235, 0.25);
}

/* Header: minimal, action-only */
.side-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
  gap: 8px;
}
.side-pane-header-left,
.side-pane-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.side-pane-close-btn,
.side-pane-expand-btn,
.side-pane-view-menu-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
}
.side-pane-close-btn:hover,
.side-pane-expand-btn:hover,
.side-pane-view-menu-btn:hover,
.side-pane-view-menu-btn[aria-expanded="true"] {
  background: var(--color-bg);
  color: var(--color-text);
}

.side-pane-view-menu {
  position: absolute;
  top: 52px;
  right: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  min-width: 200px;
  z-index: 1003;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.side-pane-view-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.side-pane-view-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.side-pane-view-menu-item:hover {
  background: var(--color-bg);
}
.side-pane-view-menu-item.active {
  background: color-mix(in srgb, var(--color-primary), transparent 90%);
  color: var(--color-primary);
}
.side-pane-view-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor;
}
.side-pane-view-menu-divider {
  height: 1px;
  background: var(--color-border);
  margin: 6px 0;
}

.side-pane-view-menu-header {
  padding: 6px 10px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.side-pane-view-default-submenu {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}

.side-pane-view-default-submenu.hidden {
  display: none;
}

.side-pane-view-menu-check {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 700;
}

/* ============================================================
 * Notion-style Line Item / Task / Transmittal Item Lists
 * Shared pattern for billing, workflow, transmittal forms
 * ============================================================ */

.notion-line-items {
  margin: 0 0 var(--spacing-lg, 24px);
}

.notion-line-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.notion-line-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.notion-line-item-row:hover {
  border-color: color-mix(in srgb, var(--color-primary), var(--color-border) 70%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.notion-line-item-row:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary), transparent 85%);
}

.notion-line-item-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.notion-line-item-row:hover .notion-line-item-drag {
  opacity: 1;
}

.notion-line-item-type {
  flex: 0 0 140px;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 6px 24px 6px 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 8px center;
  cursor: pointer;
}

.notion-line-item-desc {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 4px 6px;
  font-size: 0.875rem;
  color: var(--color-text);
  outline: none;
}

.notion-line-item-desc::placeholder {
  color: var(--color-text-muted);
}

.notion-line-item-amt {
  flex: 0 0 120px;
  min-width: 0;
  border: none;
  border-bottom: 1px dashed var(--color-border);
  background: transparent;
  padding: 4px 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  outline: none;
}

.notion-line-item-amt::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}

.notion-line-item-amt:focus {
  border-bottom-color: var(--color-primary);
}

.notion-line-item-remove {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.notion-line-item-row:hover .notion-line-item-remove,
.notion-line-item-remove:focus {
  opacity: 1;
}

.notion-line-item-remove:hover {
  background: color-mix(in srgb, var(--color-danger, #dc2626), transparent 90%);
  color: var(--color-danger, #dc2626);
}

.notion-sub-row {
  background: var(--color-bg);
  border-color: var(--color-border);
}

.notion-add-line-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.notion-add-line-item:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

/* Workflow task row extends the base line-item pattern */
.wr-task-row {
  flex-wrap: wrap;
  gap: 8px 12px;
}

.wr-task-row .task-title-input {
  flex: 1 1 100%;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 4px 6px;
  font-size: 0.875rem;
  color: var(--color-text);
  outline: none;
}

.wr-task-row .task-title-input::placeholder {
  color: var(--color-text-muted);
}

.wr-task-row .task-assignee-wrapper,
.wr-task-row .wr-task-row-coassignees,
.wr-task-row .task-pred {
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .notion-line-item-row {
    flex-wrap: wrap;
  }
  .notion-line-item-type {
    flex: 1 1 100%;
  }
  .notion-line-item-desc {
    flex: 1 1 100%;
  }
  .notion-line-item-amt {
    flex: 1 1 auto;
    text-align: left;
  }
}

.notion-template-picker {
  position: relative;
  display: inline-block;
  margin: 12px 0;
}

.side-pane .form-header-bar,
.side-pane .notion-form .form-header-bar,
.side-pane .notion-form > .page-title-bar-v2,
.side-pane .notion-form > .form-actions-top {
  display: none !important;
}

.notion-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.notion-prop {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notion-prop label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.notion-prop label svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-text-muted);
  flex-shrink: 0;
}

.notion-prop-input,
.notion-prop-select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notion-prop-input:focus,
.notion-prop-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary), transparent 80%);
  background: var(--color-surface);
}

.notion-input-with-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notion-input-with-btn .notion-prop-input {
  flex: 1;
}

.notion-prop-checkbox {
  justify-content: center;
}

.notion-radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.notion-radio-group .radio-label {
  font-size: 0.875rem;
  color: var(--color-text);
  font-weight: 500;
}

.notion-checkbox-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.notion-checkbox-group .checkbox-label {
  font-size: 0.875rem;
  color: var(--color-text);
  font-weight: 500;
}

.notion-freeform {
  margin: 16px 0;
}

.notion-section-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.notion-title-input {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  padding: 8px 0 !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  width: 100% !important;
  color: var(--color-text) !important;
}

.notion-title-input:focus {
  outline: none !important;
  border: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.notion-freeform-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notion-freeform-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary), transparent 80%);
  background: var(--color-surface);
}

.notion-freeform-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  min-height: 80px;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.notion-freeform-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary), transparent 80%);
  background: var(--color-surface);
}

.notion-file-input {
  width: 100%;
  padding: 8px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  background: var(--color-bg);
  cursor: pointer;
}

.notion-totals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}

.notion-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.notion-total-grand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  padding-top: 6px;
  border-top: 1px dashed var(--color-border);
}

.notion-collapsible {
  margin-top: 8px;
}

.notion-toggle-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  user-select: none;
}

.notion-toggle-header::before {
  content: '▼';
  font-size: 9px;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  display: inline-block;
}

.notion-toggle-header.collapsed::before {
  transform: rotate(-90deg);
}

.notion-toggle-body {
  padding-left: 18px;
}

.notion-collapsible.hidden {
  display: none;
}

.notion-collapsible:not(.open) .notion-toggle-body {
  display: none;
}

/* Center-peek body scrolls within rounded panel */
.side-pane--center-peek .side-pane-body {
  max-height: calc(86vh - 110px);
  overflow-y: auto;
  padding: 0 16px;
  flex: 1 1 auto;
  min-height: 0;
}

/* Center-peek form layout: spacious padding matching Notion's modal aesthetic */
.side-pane--center-peek .side-pane-header {
  padding: 8px 16px;
}

.side-pane--center-peek .side-pane-form-title {
  padding: 20px 40px 12px;
}

.side-pane--center-peek .side-pane-form-content {
  padding: 8px 40px 100px;
}

@media (max-width: 900px) {
  .side-pane.side-pane--side-peek {
    width: 100vw !important;
    max-width: 100vw !important;
    --pane-width: 100vw;
  }
  .side-pane.side-pane--center-peek {
    width: 100vw;
    max-width: 100vw;
    top: auto;
    bottom: 0;
    left: 0;
    transform: translateY(100%);
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
  }
  .side-pane.side-pane--center-peek.open {
    transform: translateY(0);
  }
}

/* Split Combo Button Layout */
.split-btn-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  margin-left: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.split-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

.split-btn-right {
  padding-left: 8px;
  padding-right: 8px;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

/* Premium Dropdown Menu */
.split-btn-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.06), 
    0 4px 6px -2px rgba(0, 0, 0, 0.03),
    0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 100;
  min-width: 240px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform-origin: top right;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.split-btn-menu.hidden {
  display: none !important;
}

/* Menu Item Design */
.split-btn-menu .dropdown-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: transparent;
  border: none;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text, #2d2d3f);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  border-radius: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

.split-btn-menu .dropdown-item:hover {
  background: var(--color-bg, #f4f6fb);
  color: var(--color-primary, #1e3a8a);
}

.split-btn-menu .dropdown-item svg {
  color: var(--color-text-muted, #64748b);
  transition: color 0.15s ease;
}

.split-btn-menu .dropdown-item:hover svg {
  color: var(--color-primary, #1e3a8a);
}

/* ─── Side Pane Task Row Layout & Aesthetics (Notion & Jira Inspired) ─── */
.side-pane-body .task-row {
  display: grid;
  grid-template-columns: 24px 1fr 28px;
  gap: 8px 10px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  border-left: 3px solid var(--color-primary, #2563eb);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  position: relative;
  align-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color 0.15s ease;
}

/* Subtle, non-obnoxious hover state */
.side-pane-body .task-row:hover {
  border-color: #94a3b8;
}

[data-theme="dark"] .side-pane-body .task-row {
  background: var(--color-surface, #252525);
  border-color: var(--color-border, #3a3a3a);
  border-left-color: var(--color-primary, #d4b8ff);
}

[data-theme="dark"] .side-pane-body .task-row:hover {
  border-color: var(--color-bg-muted, #2f2f2f);
}

/* Caret Toggle Button */
.task-row-toggle {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted, #64748b);
  transition: transform 0.15s ease;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  grid-column: 1 / 2;
}

.task-row-toggle:hover {
  color: var(--color-text, #1e293b);
}

.task-row-toggle svg {
  width: 14px;
  height: 14px;
}

.task-row:not(.collapsed) .task-row-toggle {
  transform: rotate(90deg);
}

/* Hide metadata rows when task row is collapsed */
.task-row.collapsed .task-assignee-wrapper,
.task-row.collapsed .wr-task-row-coassignees,
.task-row.collapsed .task-pred {
  display: none !important;
}

/* Title Input */
.side-pane-body .task-row .task-title-input {
  grid-column: 2 / 3;
  width: 100%;
  font-weight: 600 !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  background-color: var(--color-bg-light, #fafafa) !important;
  padding: 4px 10px !important;
  font-size: 0.875rem !important;
  height: 32px !important;
  border-radius: 12px !important;
  color: var(--color-text, #0f172a) !important;
  transition: border-color 0.15s ease, background-color 0.15s ease !important;
}

.side-pane-body .task-row .task-title-input:hover {
  border-color: #94a3b8 !important;
  background-color: #ffffff !important;
}

.side-pane-body .task-row .task-title-input:focus {
  border-color: var(--color-primary, #2563eb) !important;
  background-color: #ffffff !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="dark"] .side-pane-body .task-row .task-title-input {
  background-color: var(--color-bg) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

[data-theme="dark"] .side-pane-body .task-row .task-title-input:hover,
[data-theme="dark"] .side-pane-body .task-row .task-title-input:focus {
  border-color: var(--color-primary, #d4b8ff) !important;
}

/* Delete Button */
.side-pane-body .task-row .btn-danger {
  grid-column: 3 / 4;
  width: 28px !important;
  height: 28px !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background-color: transparent !important;
  border: none !important;
  color: var(--color-text-muted, #94a3b8) !important;
  font-size: 1.15rem !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.side-pane-body .task-row .btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

/* Metadata Fields Container (Assignee, Co-assignee, Dependency) */
.side-pane-body .task-row .task-assignee-wrapper,
.side-pane-body .task-row .wr-task-row-coassignees,
.side-pane-body .task-row .task-pred {
  grid-column: 1 / 4;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-top: 4px;
}

/* Label pseudo-elements with monochrome SVGs */
.side-pane-body .task-row .task-assignee-wrapper::before {
  content: "Assignee";
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
  width: 95px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: left center;
  padding-left: 20px;
}

.side-pane-body .task-row .wr-task-row-coassignees::before {
  content: "Co-assignee";
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
  width: 95px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: left center;
  padding-left: 20px;
}

.side-pane-body .task-row .task-pred::before {
  content: "Dependency";
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
  width: 95px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 14px 14px;
  background-position: left center;
  padding-left: 20px;
}

/* Fields (Dropdowns & Inputs inside metadata) */
.side-pane-body .task-row .task-assignee-wrapper .searchable-dropdown,
.side-pane-body .task-row .wr-task-row-coassignees .inline-coassignee-dropdown,
.side-pane-body .task-row .task-pred .multi-select-btn {
  flex: 1;
  min-width: 0;
}

.side-pane-body .task-row .searchable-dropdown-input,
.side-pane-body .task-row .multi-select-btn {
  height: 32px !important;
  font-size: 0.8125rem !important;
  border: 1px solid var(--color-border, #cbd5e1) !important;
  background-color: var(--color-bg-light, #fafafa) !important;
  border-radius: 12px !important;
  color: var(--color-text, #0f172a) !important;
  box-sizing: border-box !important;
}

.side-pane-body .task-row .searchable-dropdown-input:focus,
.side-pane-body .task-row .multi-select-btn:focus {
  border-color: var(--color-primary, #2563eb) !important;
  background-color: #ffffff !important;
}

/* Crucial fix: padding for searchable-dropdown input (reserves space for user icon) */
.side-pane-body .task-row .searchable-dropdown-input {
  padding: 4px 8px !important;
}

.side-pane-body .task-row .searchable-dropdown.has-icon .searchable-dropdown-input {
  padding-left: 32px !important;
}

.side-pane-body .task-row .multi-select-btn {
  min-height: 32px !important;
  padding: 4px 28px 4px 10px !important;
  background-position: right 8px center !important;
}

.side-pane-body .task-row .task-assignee-wrapper .searchable-dropdown {
  flex: 1;
  min-width: 140px;
}

.side-pane-body .task-row .task-pred .multi-select-btn {
  flex: 1;
  min-width: 140px;
}

/* Co-assignee specific overrides */
.side-pane-body .task-row .wr-task-row-coassignees .co-assignee-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.side-pane-body .task-row .wr-task-row-coassignees .co-assignee-chip {
  padding: 2px 6px;
  font-size: 0.7rem;
  background: var(--color-bg-light, #f1f5f9);
  color: var(--color-text-muted, #64748b);
  border: 1px solid var(--color-border, #e2e8f0);
  font-weight: 500;
  border-radius: 12px;
}

[data-theme="dark"] .side-pane-body .task-row .wr-task-row-coassignees .co-assignee-chip {
  background: var(--color-bg-muted, #2f2f2f);
  color: var(--color-text-muted, #a1a1aa);
  border-color: var(--color-border, #3a3a3a);
}

.side-pane-body .task-row .wr-task-row-coassignees .inline-coassignee-dropdown {
  flex: 1 1 auto;
  min-width: 120px !important;
}

/* ============================================================
 * Side Pane — Notion-style spacious polish
 * Generous whitespace, clear typographic hierarchy, and a
 * borderless, oversized title field for all creation forms.
 * ============================================================ */

/* --- Generous, consistent spacing & typography --- */
.side-pane-header {
  padding: 14px 20px;
}

.side-pane-title-section {
  padding: 28px 32px 20px;
}

.side-pane-form-title {
  padding: 28px 32px 12px;
}

.side-pane-form-title h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
}

.side-pane-icon {
  width: 40px;
  height: 40px;
  font-size: 22px;
  margin-bottom: 14px;
  border-radius: 12px;
}

.side-pane-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.side-pane-properties {
  padding: 12px 32px 20px;
  grid-template-columns: 150px 1fr;
  row-gap: 14px;
  column-gap: 16px;
}

.side-pane-prop-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.side-pane-prop-value {
  font-size: 0.875rem;
  font-weight: 500;
}

.side-pane-section {
  padding: 24px 32px;
}

.side-pane-section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 14px;
}

.side-pane-description {
  font-size: 0.875rem;
  line-height: 1.65;
}

.side-pane-toggle-header {
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 700;
}

.side-pane-toggle-content {
  padding: 18px 32px;
}

.side-pane-form-content {
  padding: 8px 40px 140px;
}

.side-pane-form-footer {
  padding: 12px 40px;
}

/* === Notion-inspired form spacing: typography groups fields ===
   We keep title/description blocks close to the top, then use a single
   compact property grid. Vertical rhythm is driven by section headings,
   not by heavy box padding. */
.side-pane-form-content .notion-freeform {
  margin: 0 0 24px;
}

.side-pane-form-content .notion-freeform--title {
  margin: 0 0 28px;
}

.side-pane-form-content .notion-property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px 24px;
  margin: 0 0 28px;
}

.side-pane-form-content .notion-prop {
  margin: 0;
}

.side-pane-form-content .form-group {
  margin: 0 0 20px;
}

/* Section heading sits outside its content box so the label reads as
   belonging to the group rather than floating inside it. */
.notion-section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--color-text);
  margin: 40px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.notion-line-items {
  margin-top: 0;
}

.notion-add-line-item {
  padding: 8px 12px;
  margin-top: 4px;
}

.notion-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  color: var(--color-text-muted);
}

/* Alias used by several JS modules for the warning badge variant */
.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

/* --- Borderless, oversized creation title --- */
.notion-title-input,
.notion-title-input:focus,
.notion-title-input:focus-visible,
.notion-title-input:active {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  padding: 12px 0 !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--color-text) !important;
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
  width: 100% !important;
  outline: none !important;
  box-shadow: none !important;
}

.notion-title-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.65;
}

/* Title inputs must stay borderless and background-free in all contexts. */
.notion-freeform-input.notion-title-input,
.notion-freeform-input.notion-title-input:focus,
.notion-freeform-input.notion-title-input:focus-visible,
.notion-freeform-input.notion-title-input:active {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Beat the generic side-pane-body input overrides for the title field */
.side-pane-body .notion-form .notion-title-input,
.side-pane-body .notion-form .notion-title-input:focus,
.side-pane-body .notion-form .notion-title-input:focus-visible,
.side-pane-body .notion-form .notion-title-input:active {
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  padding: 12px 0 !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--color-text) !important;
  letter-spacing: -0.02em !important;
  line-height: 1.25 !important;
  box-shadow: none !important;
  outline: none !important;
}

.side-pane-body .notion-form .notion-title-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.65;
}

/* Dark mode title inputs: keep them completely plain — no glow, no border,
   no background. The caret color is the only focus cue. */
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input,
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input:focus,
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input:focus-visible,
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  text-shadow: none !important;
  animation: none !important;
  caret-color: var(--color-primary, #d4b8ff);
}

/* ============================================================
 * Side Pane — Dark-mode polish (scoped to the panel)
 * Triggered by a parent `data-theme="dark"` attribute.
 * ============================================================ */

[data-theme="dark"] .side-pane {
  --color-bg: #191919;
  --color-surface: #252525;
  --color-panel: #252525;
  --color-bg-muted: #2f2f2f;
  --color-bg-light: #2f2f2f;
  --color-bg-hover: #2f2f2f;
  --color-text: #f4f4f5;
  --color-text-muted: #a1a1aa;
  --color-border: #4a4a4a;
  --color-primary: #d4b8ff;
  --color-primary-dark: #b388ff;
  --color-primary-light: rgba(212, 184, 255, 0.18);
  --color-primary-alpha: rgba(212, 184, 255, 0.14);
  --color-danger: #ff8585;
  --color-danger-bg: #450a0a;
  --color-danger-text: #fca5a5;
  --color-danger-border: #7f1d1d;
  --color-success: #34d399;
  --color-success-bg: #064e3b;
  --color-success-text: #6ee7b7;
  --color-success-border: #065f46;
  --color-warning: #fbbf24;
  --color-warning-bg: #451a03;
  --color-warning-text: #fcd34d;
  --color-warning-border: #78350f;
  --color-info-bg: #1e3a8a;
  --color-info-text: #93c5fd;
  --color-info-border: #1e40af;
  color-scheme: dark;
}

[data-theme="dark"] .side-pane .badge-success { background: #14532d; color: #86efac; }
[data-theme="dark"] .side-pane .badge-danger { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .side-pane .badge-warning,
[data-theme="dark"] .side-pane .badge-warn { background: #713f12; color: #fde047; }
[data-theme="dark"] .side-pane .badge-info { background: #312e81; color: #c4b5fd; }
[data-theme="dark"] .side-pane .badge-muted {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

[data-theme="dark"] .side-pane-body input[type="text"],
[data-theme="dark"] .side-pane-body input[type="email"],
[data-theme="dark"] .side-pane-body input[type="password"],
[data-theme="dark"] .side-pane-body input[type="number"],
[data-theme="dark"] .side-pane-body input[type="date"],
[data-theme="dark"] .side-pane-body textarea,
[data-theme="dark"] .side-pane-body select,
[data-theme="dark"] .side-pane-body .form-select,
[data-theme="dark"] .side-pane-body .multi-select-btn,
[data-theme="dark"] .side-pane-body .searchable-dropdown-input {
  background-color: var(--color-bg) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

[data-theme="dark"] .side-pane-body input[type="text"]:hover,
[data-theme="dark"] .side-pane-body input[type="email"]:hover,
[data-theme="dark"] .side-pane-body input[type="password"]:hover,
[data-theme="dark"] .side-pane-body input[type="number"]:hover,
[data-theme="dark"] .side-pane-body input[type="date"]:hover,
[data-theme="dark"] .side-pane-body textarea:hover,
[data-theme="dark"] .side-pane-body select:hover,
[data-theme="dark"] .side-pane-body .form-select:hover,
[data-theme="dark"] .side-pane-body .multi-select-btn:hover,
[data-theme="dark"] .side-pane-body .searchable-dropdown-input:hover {
  border-color: var(--color-bg-muted) !important;
}

[data-theme="dark"] .side-pane-body input[type="text"]:focus,
[data-theme="dark"] .side-pane-body input[type="email"]:focus,
[data-theme="dark"] .side-pane-body input[type="password"]:focus,
[data-theme="dark"] .side-pane-body input[type="number"]:focus,
[data-theme="dark"] .side-pane-body input[type="date"]:focus,
[data-theme="dark"] .side-pane-body textarea:focus,
[data-theme="dark"] .side-pane-body select:focus,
[data-theme="dark"] .side-pane-body .form-select:focus,
[data-theme="dark"] .side-pane-body .multi-select-btn:focus,
[data-theme="dark"] .side-pane-body .searchable-dropdown-input:focus {
  background-color: var(--color-surface) !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-primary-alpha), inset 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="dark"] .side-pane-body .form-group label {
  color: var(--color-text) !important;
}

[data-theme="dark"] .side-pane-body .radio-label,
[data-theme="dark"] .side-pane-body .checkbox-label {
  color: var(--color-text) !important;
}

[data-theme="dark"] .side-pane-body select,
[data-theme="dark"] .side-pane-body .multi-select-btn {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

[data-theme="dark"] .side-pane-body input[type="file"] {
  border-color: var(--color-border) !important;
  background-color: var(--color-bg) !important;
  color: var(--color-text) !important;
}

[data-theme="dark"] .side-pane-body input[type="file"]::file-selector-button {
  background: var(--color-primary) !important;
  color: #191919 !important;
}

[data-theme="dark"] .side-pane-body .notion-form .notion-title-input,
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input:focus,
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input:focus-visible,
[data-theme="dark"] .side-pane-body .notion-form .notion-title-input:active {
  background: transparent !important;
  border: none !important;
  color: var(--color-text) !important;
  caret-color: var(--color-primary, #d4b8ff);
  box-shadow: none !important;
  outline: none !important;
  text-shadow: none !important;
  animation: none !important;
}

[data-theme="dark"] .side-pane-body .notion-form .notion-title-input::placeholder {
  color: var(--color-text-muted);
}

[data-theme="dark"] .side-pane-body .notion-line-item-row:hover {
  border-color: var(--color-bg-muted);
}

[data-theme="dark"] .side-pane-body .notion-line-item-desc::placeholder,
[data-theme="dark"] .side-pane-body .notion-line-item-amt::placeholder,
[data-theme="dark"] .side-pane-body .wr-task-row .task-title-input::placeholder {
  color: var(--color-text-muted);
}

/* ==========================================================================
   Completed Item Indication Styles (Table, Board, List, Checklist)
   ========================================================================== */

/* Shared Completed Utility Rules */
.is-completed .title-main,
.is-completed .card-v2-title,
.is-completed .list-item-title,
.is-completed .checklist-view-title,
.is-completed .checklist-text span {
  text-decoration: line-through;
  text-decoration-color: var(--color-text-muted, #9494a0);
  text-decoration-color: color-mix(in oklab, var(--color-text, #2d2d3f) 20%, transparent);
  color: var(--color-text-muted, #9494a0);
}
.is-completed .badge,
.is-completed .avatar-xs,
.is-completed .card-v2-progress,
.is-completed .caret {
  filter: grayscale(60%) opacity(70%);
}

/* View-Specific Backgrounds & Borders (with legacy browser fallbacks) */

/* 1. Table View */
.task-list .task-row.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-success, #10b981) 2.5%, var(--color-surface, #ffffff));
}
.task-list .task-row.is-completed .cell {
  color: var(--color-text-muted, #9494a0);
}

/* 2. Board View */
.board-v2 .board-card-v2.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-success, #10b981) 2.5%, var(--color-surface, #ffffff));
  border-left-color: var(--color-success, #10b981);
}

/* 3. List View */
.operations-list-view .list-item.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-success, #10b981) 2.5%, var(--color-surface, #ffffff));
  border-left: 3px solid var(--color-success, #10b981);
}

/* 4. Checklist View */
.checklist-view-container .checklist-view-row.task-level.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-success, #10b981) 3%, var(--color-surface, #ffffff));
  border-left: 3px solid var(--color-success, #10b981);
}
.checklist-view-container .checklist-view-row.sub-level.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-success, #10b981) 5%, transparent);
}
.project-detail-v2 .checklist-view-container .checklist-view-row.sub-level.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-primary, #2563eb) 5%, transparent);
}

/* 5. Detail Panel / Side Pane Checklists */
.detail-panel .checklist-item.is-completed,
.side-pane-toggle-content .checklist-item.is-completed {
  background-color: var(--color-surface, #ffffff);
  background-color: color-mix(in oklab, var(--color-success, #10b981) 6%, transparent);
  border-left-color: var(--color-success, #10b981);
}

[data-theme="dark"] .side-pane-view-menu {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .side-pane-view-menu-item:hover {
  background: var(--color-bg-muted);
}

[data-theme="dark"] .side-pane-view-menu-divider {
  background: var(--color-border);
}

[data-theme="dark"] .side-pane-overlay.open {
  background: rgba(0, 0, 0, 0.55);
}

/* ── Loading Overlay Screen ── */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(244, 246, 251, 0.55);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity var(--transition-loading, 0.25s) cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#loading-screen.hidden {
  display: none !important;
}

html.loading-active #loading-screen:not(.hidden) {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 48px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-md);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.04),
    0 1px 3px rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-family: var(--font-sans);
}

/* ============================================================
 * Notion/Jira Inspired Premium Loading Animation & Overlay
 * ============================================================ */

.loading-spinner,
.blocking-spinner {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner::before,
.blocking-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 3.5px;
  background: conic-gradient(from 0deg, transparent 0%, var(--color-primary, #6366f1) 35%, #a855f7 75%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: aura-spin 0.9s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.45));
}

.loading-spinner::after,
.blocking-spinner::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary, #6366f1), #a855f7);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.6);
  animation: core-pulse 1.3s ease-in-out infinite alternate;
}

.blocking-modal-overlay {
  z-index: 10000 !important;
  cursor: wait !important;
  backdrop-filter: blur(14px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
  background: rgba(15, 23, 42, 0.42) !important;
  animation: overlay-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.blocking-overlay-card {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  border-radius: 20px !important;
  box-shadow:
    0 24px 48px -12px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.7) inset,
    0 2px 4px rgba(0, 0, 0, 0.04) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  padding: 32px 28px !important;
  max-width: 400px !important;
  width: 90% !important;
  animation: blocking-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden !important;
  position: relative !important;
}

[data-theme="dark"] .blocking-overlay-card {
  background: rgba(30, 35, 48, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset !important;
}

.loading-shimmer-bar {
  width: 100%;
  height: 4px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  margin-top: 16px;
}

.loading-shimmer-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--color-primary, #6366f1), #a855f7, transparent);
  border-radius: 9999px;
  animation: shimmer-slide 1.4s ease-in-out infinite;
}

.loading-text {
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: loading-text-pulse 1.2s ease-in-out infinite alternate;
}

/* Google-style Indeterminate Linear Progress Loader */
.google-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: rgba(26, 115, 232, 0.15);
  overflow: hidden;
  z-index: 100;
}

.google-loader-bar {
  width: 100%;
  height: 100%;
  background-color: var(--color-primary, #1a73e8);
  animation: google-loader-anim 1.5s infinite linear;
  transform-origin: 0% 50%;
}

@keyframes google-loader-anim {
  0% {
    transform: translateX(-100%) scaleX(0.15);
  }
  50% {
    transform: translateX(-20%) scaleX(0.5);
  }
  100% {
    transform: translateX(100%) scaleX(0.15);
  }
}

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

@keyframes core-pulse {
  0% { transform: scale(0.72); opacity: 0.5; }
  100% { transform: scale(1.18); opacity: 1; }
}

@keyframes shimmer-slide {
  0% { left: -50%; }
  100% { left: 100%; }
}

@keyframes overlay-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blocking-fade-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes loading-text-pulse {
  0% { opacity: 0.45; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============================================================
 * Global Dark Mode
 * Respects the `data-theme="dark"` attribute set by the toggle.
 * ============================================================ */

[data-theme="dark"] {
  /* Notion-inspired dark palette — warm neutral greys, lifted surfaces,
     readable off-whites, and the existing purple primary. */
  --color-bg: #191919;            /* canvas: keep Notion black base */
  --color-surface: #252525;       /* cards, panels — one step above canvas */
  --color-panel: #252525;
  --color-bg-muted: #2f2f2f;      /* hover/elevated states */
  --color-bg-light: #2f2f2f;
  --color-bg-hover: #2f2f2f;
  --color-bg-subtle: #1e1e24;
  --color-text: #f4f4f5;          /* warm off-white — easier on the eyes than #fff */
  --color-text-main: #f4f4f5;
  --color-text-muted: #a1a1aa;    /* warm grey — matches neutral palette */
  --color-border: #4a4a4a;        /* visible separation on dark surfaces */
  --color-primary: #d4b8ff;       /* kept: light purple accent */
  --color-primary-dark: #b388ff;  /* kept: deeper purple hover */
  --color-primary-light: rgba(212, 184, 255, 0.18);
  --color-primary-alpha: rgba(212, 184, 255, 0.14);
  --color-danger: #ff8585;
  --color-danger-bg: #450a0a;
  --color-danger-text: #fca5a5;
  --color-danger-border: #7f1d1d;
  --color-success: #34d399;
  --color-success-bg: #064e3b;
  --color-success-text: #6ee7b7;
  --color-success-border: #065f46;
  --color-warning: #fbbf24;
  --color-warning-bg: #451a03;
  --color-warning-text: #fcd34d;
  --color-warning-border: #78350f;
  --color-info-bg: #1e3a8a;
  --color-info-text: #93c5fd;
  --color-info-border: #1e40af;
  color-scheme: dark;
}

/* Notion popover submit button */
[data-theme="dark"] .notion-popover-submit { color: #191919; }

/* Split button dropdown menu in dark mode */
[data-theme="dark"] .split-btn-menu {
  background: var(--color-surface, #252525);
  border-color: var(--color-border, #4a4a4a);
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.4), 
    0 4px 6px -2px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .split-btn-menu .dropdown-item {
  color: var(--color-text, #f4f4f5);
}
[data-theme="dark"] .split-btn-menu .dropdown-item svg {
  color: var(--color-text-muted, #a1a1aa);
}
[data-theme="dark"] .split-btn-menu .dropdown-item:hover {
  background: var(--color-bg-muted, #2f2f2f);
  color: var(--color-primary, #d4b8ff);
}
[data-theme="dark"] .split-btn-menu .dropdown-item:hover svg {
  color: var(--color-primary, #d4b8ff);
}

/* WR task detail panes */
[data-theme="dark"] .task-details-left,
[data-theme="dark"] .task-details-right { border-color: var(--color-border); }
[data-theme="dark"] .checklist-item-row { border-bottom-color: var(--color-border); }
[data-theme="dark"] .checklist-item-row.blocked { background: var(--color-bg-muted); }
[data-theme="dark"] .checklist-item-text.completed { color: var(--color-success); }
[data-theme="dark"] .checklist-time-pill { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
[data-theme="dark"] .time-log-group-title,
[data-theme="dark"] .dependency-mini-map,
[data-theme="dark"] .checklist-progress-text { color: var(--color-text-muted); }
[data-theme="dark"] .time-log-entry { color: var(--color-text); border-bottom-color: var(--color-border); }

/* Empty states */
[data-theme="dark"] .empty-state,
[data-theme="dark"] .task-empty-state { background: var(--color-bg-muted); border-color: var(--color-border); }
[data-theme="dark"] .task-empty-state svg,
[data-theme="dark"] .task-empty-state p { color: var(--color-text-muted); }

[data-theme="dark"] .empty-state-v2 {
  background: var(--color-bg-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
[data-theme="dark"] .empty-state-v2.compact,
[data-theme="dark"] .empty-state-v2.card-empty,
[data-theme="dark"] .board-cards-scroll > .empty-state-v2 {
  background: transparent;
}
[data-theme="dark"] .empty-state-v2 .empty-state-icon {
  background: var(--color-bg);
  color: var(--color-text-muted);
}
[data-theme="dark"] .empty-state-v2 .empty-state-title { color: var(--color-text); }
[data-theme="dark"] .empty-state-v2 .empty-state-body { color: var(--color-text-muted); }
[data-theme="dark"] .empty-state-v2 .empty-state-clear { color: var(--color-primary); }
[data-theme="dark"] .empty-state-v2 .empty-state-clear:hover { color: var(--color-primary-dark); }

/* Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--color-border); }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

[data-theme="dark"] body,
[data-theme="dark"] #app-shell,
[data-theme="dark"] .app-layout,
[data-theme="dark"] .content {
  background: var(--color-bg);
}

[data-theme="dark"] #login-screen {
  background: var(--color-bg);
}

[data-theme="dark"] .app-header,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .kpi-card,
[data-theme="dark"] .bento-item,
[data-theme="dark"] .report-card,
[data-theme="dark"] .wr-card,
[data-theme="dark"] .list-item,
[data-theme="dark"] .modal,
[data-theme="dark"] .login-card,
[data-theme="dark"] .invoice-detail,
[data-theme="dark"] .board-column-v2,
[data-theme="dark"] .board-card-v2,
[data-theme="dark"] .project-header-v2,
[data-theme="dark"] .task-group-v2 {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .nav-list li a:hover,
[data-theme="dark"] .icon-btn:hover,
[data-theme="dark"] .sidebar-collapse-btn:hover,
[data-theme="dark"] .side-pane-close-btn:hover,
[data-theme="dark"] .side-pane-expand-btn:hover,
[data-theme="dark"] .side-pane-view-menu-btn:hover {
  background: var(--color-bg);
}

[data-theme="dark"] .nav-list li a.active {
  box-shadow: 0 8px 20px rgba(212, 184, 255, 0.25);
}

[data-theme="dark"] .board-column {
  background: var(--color-bg);
  border-color: var(--color-border);
}

[data-theme="dark"] .board-column-header {
  background: var(--color-bg-muted);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .board-column-v2 {
  background: var(--color-bg);
  border-color: var(--color-border);
}

[data-theme="dark"] .board-column-header-v2 {
  background: var(--color-bg-muted);
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .board-card-v2 {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .board-card-v2:hover {
  border-color: var(--color-text-muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .board-column-title {
  color: var(--color-text);
}

[data-theme="dark"] .board-column-count {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

[data-theme="dark"] .board-column-header-v2 .board-column-actions .board-column-add,
[data-theme="dark"] .board-column-header-v2 .board-column-actions .board-column-menu {
  color: var(--color-text-muted);
}

[data-theme="dark"] .board-column-header-v2 .board-column-actions .board-column-add:hover,
[data-theme="dark"] .board-column-header-v2 .board-column-actions .board-column-menu:hover {
  color: var(--color-text);
  background: var(--color-bg-muted);
  border-color: var(--color-border);
}

[data-theme="dark"] .board-card-v2.compact .action-menu-list,
[data-theme="dark"] .board-column-v2 .action-menu-list {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .board-column-v2.drag-over {
  background: color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 88%);
  border-color: var(--column-phase-color, var(--color-primary));
}

[data-theme="dark"] .board-card-v2.drag-placeholder {
  background: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-surface), 0 0 0 2px var(--color-primary);
}

[data-theme="dark"] .task-table-v2 th {
  color: var(--color-text-muted);
  border-bottom-color: var(--color-border);
  background: var(--color-surface);
}

[data-theme="dark"] .task-table-v2 td {
  border-bottom-color: var(--color-border);
}

[data-theme="dark"] .task-table-v2 tbody tr:hover {
  background: var(--color-bg-muted);
}

[data-theme="dark"] .task-v2-title {
  color: var(--color-text);
}

[data-theme="dark"] .task-v2-title.completed {
  color: var(--color-text-muted);
}

[data-theme="dark"] .status-badge-v2 {
  color: var(--color-text-muted);
}

[data-theme="dark"] .task-group-footer {
  color: var(--color-text);
  border-top-color: var(--color-border);
}

[data-theme="dark"] .card-v2-category,
[data-theme="dark"] .card-v2-date {
  color: var(--color-text-muted);
}

[data-theme="dark"] .card-v2-title {
  color: var(--color-text);
}

[data-theme="dark"] .card-v2-progress {
  background: var(--color-bg-muted);
}

[data-theme="dark"] .card-v2-progress-fill {
  background: var(--color-text-muted);
}

[data-theme="dark"] .card-v2-meta-text,
[data-theme="dark"] .card-v2-meta-icon {
  color: var(--color-text-muted);
}

[data-theme="dark"] .list-item:hover {
  background: var(--color-bg-muted);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] .multi-select-btn:focus,
[data-theme="dark"] .searchable-dropdown-input:focus {
  box-shadow: 0 0 0 3px rgba(212, 184, 255, 0.18);
}

[data-theme="dark"] .filters-bar,
[data-theme="dark"] .task-view-toolbar,
[data-theme="dark"] .toolbar-sticky-container,
[data-theme="dark"] .module-tab-nav,
[data-theme="dark"] .page-title-bar-v2,
[data-theme="dark"] .project-detail-v2 .task-view-toolbar,
[data-theme="dark"] .related-records,
[data-theme="dark"] .reset-section,
[data-theme="dark"] .form-section,
[data-theme="dark"] .invoice-totals,
[data-theme="dark"] .modal-footer {
  background: var(--color-bg);
  border-color: var(--color-border);
}

[data-theme="dark"] .modal-overlay,
[data-theme="dark"] .side-pane-overlay.open {
  background: rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .module-tab-link {
  color: var(--color-text);
  border-bottom-color: transparent;
}

[data-theme="dark"] .module-tab-link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

[data-theme="dark"] .view-mode-toggle,
[data-theme="dark"] .group-toggle,
[data-theme="dark"] .calendar-view-toggle,
[data-theme="dark"] .search-input,
[data-theme="dark"] .search-field input,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .form-select,
[data-theme="dark"] .multi-select-btn,
[data-theme="dark"] .searchable-dropdown-input,
[data-theme="dark"] .search-input {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Dark mode buttons: colored surfaces keep dark text for contrast;
   muted/outline buttons stay dark-themed so they don't look like light-mode leftovers. */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-success:hover,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-warning:hover,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-danger:hover,
[data-theme="dark"] .view-mode-toggle button.active,
[data-theme="dark"] .calendar-view-toggle .view-btn.active,
[data-theme="dark"] .progress-step.active,
[data-theme="dark"] .progress-step.completed {
  color: #191919;
}

[data-theme="dark"] .view-mode-toggle button.active,
[data-theme="dark"] .calendar-view-toggle .view-btn.active,
[data-theme="dark"] .progress-step.active {
  background: var(--color-primary);
}

[data-theme="dark"] .progress-step.completed {
  background: var(--color-success);
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .modal-btn-cancel {
  background: var(--color-bg-muted);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .modal-btn-cancel:hover {
  background: var(--color-border);
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

[data-theme="dark"] .btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-primary);
}

[data-theme="dark"] .btn-ghost:hover {
  background: var(--color-primary-alpha);
  border-color: var(--color-primary-alpha);
  color: var(--color-primary);
}

[data-theme="dark"] .btn-link {
  color: var(--color-primary);
  text-decoration: none;
  background: transparent;
}
[data-theme="dark"] .btn-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
  background: transparent;
}

[data-theme="dark"] .badge-success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-danger { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-warning,
[data-theme="dark"] .badge-warn { background: #713f12; color: #fde047; }
[data-theme="dark"] .badge-info { background: #312e81; color: #c4b5fd; }
[data-theme="dark"] .badge-muted {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

/* Redesign views define their own local tokens — override them in dark mode */
[data-theme="dark"] .project-detail-v2,
[data-theme="dark"] .side-pane {
  --bg: #191919;
  --surface: #252525;
  --surface-warm: #252525;
  --fg: #f4f4f5;
  --fg-2: #f4f4f5;
  --muted: #a1a1aa;
  --meta: #a1a1aa;
  --border: #4a4a4a;
  --border-soft: #4a4a4a;
  --accent: #d4b8ff;
  --accent-on: #191919;
  --accent-hover: #b388ff;
  --accent-active: #3b82f6;
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #ff8585;
  --danger-bg: #450a0a;
  --danger-text: #fca5a5;
  --danger-border: #7f1d1d;
}

/* ============================================================
 * Dark Mode — Component Polish
 * Additional overrides for components that ship hardcoded light
 * palette values or that need extra contrast on the new dark surface.
 * ============================================================ */

/* Entity & phase badges: swap light pastel fills for dark surface tints */
[data-theme="dark"] .badge-ata { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }
[data-theme="dark"] .badge-lta { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
[data-theme="dark"] .badge-all { background: rgba(14, 165, 233, 0.18); color: #7dd3fc; }
[data-theme="dark"] .badge-recurring { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
[data-theme="dark"] .badge-draft { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
[data-theme="dark"] .badge-preprocessing { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }
[data-theme="dark"] .badge-processing { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-theme="dark"] .badge-billing { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }
[data-theme="dark"] .badge-disbursement { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
[data-theme="dark"] .badge-neutral { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
[data-theme="dark"] .badge-outline {
  background: transparent;
  color: var(--color-text, #e2e8f0);
  border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="dark"] .badge-primary {
  background: rgba(79, 138, 250, 0.2);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.3);
}
[data-theme="dark"] .badge-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}

/* Dark mode client entity tag overrides */
[data-theme="dark"] .client-entity-tag.tag-ata {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

[data-theme="dark"] .client-entity-tag.tag-lta {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(203, 213, 225, 0.3);
}

/* Document lifecycle badges */
[data-theme="dark"] .lifecycle-collected { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .lifecycle-with_documentations { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-theme="dark"] .lifecycle-scanned { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-theme="dark"] .lifecycle-in_envelope { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }
[data-theme="dark"] .lifecycle-stored { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }

/* DMS document type badges */
[data-theme="dark"] .doc-type-badge-original { background: var(--color-bg-muted); color: var(--color-text); }
[data-theme="dark"] .doc-type-badge-generated { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }

/* KPI icons */
[data-theme="dark"] .kpi-icon { background: var(--color-bg-muted); }
[data-theme="dark"] .kpi-icon.lta-icon { background: rgba(148, 163, 184, 0.18); }

/* Assignee chips & avatars (outside side-pane) */
[data-theme="dark"] .co-assignee-chip {
  background: rgba(37, 99, 235, 0.12);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
}
[data-theme="dark"] .co-assignee-chip-remove { color: #93c5fd; }
[data-theme="dark"] .co-assignee-chip-remove:hover { color: #bfdbfe; }
[data-theme="dark"] .assignee-avatars .avatar-xs {
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  border-color: var(--color-surface);
}
[data-theme="dark"] .assignee-avatars .assignee-name { color: #bfdbfe; }

/* Calendar entity badges */
[data-theme="dark"] .calendar-entity-badge.ata { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }
[data-theme="dark"] .calendar-entity-badge.lta { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }

/* Multi-select dropdown menus */
[data-theme="dark"] .multi-select-menu {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Signal modal (message / confirm / warning / error) — dark mode overrides */
[data-theme="dark"] .modal-message-wrapper.type-danger .modal-icon-v2 { color: var(--color-danger-text); border-color: var(--color-danger-text); }
[data-theme="dark"] .modal-message-wrapper.type-warning .modal-icon-v2 { color: var(--color-warning-text); border-color: var(--color-warning-text); }
[data-theme="dark"] .modal-message-wrapper.type-success .modal-icon-v2 { color: var(--color-success-text); border-color: var(--color-success-text); }
[data-theme="dark"] .modal-message-wrapper.type-info .modal-icon-v2 { color: var(--color-info-text); border-color: var(--color-info-text); }

[data-theme="dark"] .modal-message-wrapper.type-danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
}
[data-theme="dark"] .modal-message-wrapper.type-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
}
[data-theme="dark"] .modal-message-wrapper.type-success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}
[data-theme="dark"] .modal-message-wrapper.type-info {
  background: var(--color-info-bg);
  border-color: var(--color-info-border);
}

[data-theme="dark"] .modal-message-wrapper .modal-text { color: var(--color-text); }

/* Remove the dark "lip" behind signal-modal action buttons */
[data-theme="dark"] .modal-message-wrapper .modal-footer {
  background: transparent;
  border-color: transparent;
}

[data-theme="dark"] .modal-message-wrapper .modal-btn-cancel {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
[data-theme="dark"] .modal-message-wrapper .modal-btn-cancel:hover {
  background: color-mix(in oklab, var(--color-text) 10%, transparent);
  border-color: var(--color-text-muted);
}

[data-theme="dark"] .modal-message-wrapper.type-danger .modal-btn-sure {
  background: var(--color-danger);
  color: var(--color-bg);
  border-color: var(--color-danger);
}
[data-theme="dark"] .modal-message-wrapper.type-danger .modal-btn-sure:hover {
  background: var(--color-danger-text);
  border-color: var(--color-danger-text);
}

[data-theme="dark"] .modal-message-wrapper.type-danger .modal-btn-cancel {
  border-color: var(--color-danger-border);
  color: var(--color-danger-text);
}
[data-theme="dark"] .modal-message-wrapper.type-danger .modal-btn-cancel:hover {
  background: color-mix(in oklab, var(--color-danger-text) 12%, transparent);
  border-color: var(--color-danger-text);
}

[data-theme="dark"] .modal-text { color: var(--color-text); }

/* Cancel/destructive buttons inside redesign views must stay readable in dark mode */
[data-theme="dark"] .project-detail-v2 .btn-danger,
[data-theme="dark"] .side-pane-body .task-row .btn-danger {
  color: var(--color-danger-text) !important;
}
[data-theme="dark"] .project-detail-v2 .btn-danger {
  background: color-mix(in oklab, var(--color-danger), transparent 90%) !important;
  border: 1px solid var(--color-danger-border) !important;
}
[data-theme="dark"] .project-detail-v2 .btn-danger:hover {
  background: color-mix(in oklab, var(--color-danger), transparent 82%) !important;
  border-color: var(--color-danger) !important;
}
[data-theme="dark"] .side-pane-body .task-row .btn-danger:hover {
  color: var(--color-danger) !important;
}

/* Month/Date picker header: light primary bg needs dark text */
[data-theme="dark"] .mdp-header,
[data-theme="dark"] .mdp-header .mdp-edit-btn,
[data-theme="dark"] .mdp-header .mdp-edit-btn:hover { color: #191919; }
[data-theme="dark"] .mdp-edit-btn:hover { background: rgba(0, 0, 0, 0.12); }
[data-theme="dark"] .mdp-month-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* Searchable dropdown */
[data-theme="dark"] .searchable-dropdown-clear { color: var(--color-text-muted); }
[data-theme="dark"] .searchable-dropdown-clear:hover { color: var(--color-text); }
[data-theme="dark"] .searchable-dropdown-input:focus {
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}
[data-theme="dark"] .searchable-dropdown-listbox {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .searchable-dropdown-item:hover,
[data-theme="dark"] .searchable-dropdown-item.highlighted,
[data-theme="dark"] .searchable-dropdown-item.selected,
[data-theme="dark"] .searchable-dropdown-item.selected.highlighted {
  background: var(--color-bg-muted);
}

/* Invoice & form accents */
[data-theme="dark"] .invoice-info-box { background: var(--color-bg); }
[data-theme="dark"] .form-section { background: var(--color-bg); }
[data-theme="dark"] .total-grand { color: var(--color-primary); }
[data-theme="dark"] .diff-proposed { border-color: var(--color-warning); }

/* Tables: hover row and zebra helpers */
[data-theme="dark"] tbody tr:hover { background: var(--color-bg-muted); }
[data-theme="dark"] th { background: var(--color-surface); border-bottom-color: var(--color-border); color: var(--color-text-muted); }
[data-theme="dark"] td { border-bottom-color: var(--color-border); }

/* Breadcrumb & detail header hardcoded tints */
[data-theme="dark"] .detail-sub-header,
[data-theme="dark"] .detail-sub-header-v2,
[data-theme="dark"] .detail-info-label,
[data-theme="dark"] .detail-info-value { color: var(--color-text-muted); }
[data-theme="dark"] .detail-sub-header-v2 { border-bottom-color: var(--color-border); }

/* Workflow progress steps */
[data-theme="dark"] .progress-step { background: var(--color-bg-muted); color: var(--color-text-muted); }

/* Stage dots */
[data-theme="dark"] .stage.active .stage-dot,
[data-theme="dark"] .stage.completed .stage-dot { color: #191919; }

/* Sidebar notification badge */
[data-theme="dark"] .nav-badge { color: #191919; }

/* Calendar selected day */
[data-theme="dark"] .calendar-day.selected { color: #191919; }

/* Dashboard activity segments */
[data-theme="dark"] .activity-segment { color: #191919; }

/* Redesigned calendar (dashboard-calendar-card) */
[data-theme="dark"] .calendar-header-right .calendar-view-toggle .view-btn.active,
[data-theme="dark"] .calendar-create-btn,
[data-theme="dark"] .calendar-cell.today .day-number,
[data-theme="dark"] .month-event-overlay { color: #191919; }
[data-theme="dark"] .week-event-arrow { color: var(--color-text); }

/* Group toggle / filter chips */
[data-theme="dark"] .group-toggle button.active { color: #191919; }

/* Module tab counts */
[data-theme="dark"] .module-badge-count { background: var(--color-bg-muted); color: var(--color-text-muted); }
[data-theme="dark"] .module-tab-link.active .module-badge-count { background: var(--color-primary-alpha); color: var(--color-primary); border-color: var(--color-primary); }

/* Notion popover submit button */
[data-theme="dark"] .notion-popover-submit { color: #191919; }

/* WR task detail panes */
[data-theme="dark"] .task-details-left,
[data-theme="dark"] .task-details-right { border-color: var(--color-border); }
[data-theme="dark"] .checklist-item-row { border-bottom-color: var(--color-border); }
[data-theme="dark"] .checklist-item-row.blocked { background: var(--color-bg-muted); }
[data-theme="dark"] .checklist-item-text.completed { color: var(--color-success); }
[data-theme="dark"] .checklist-time-pill { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
[data-theme="dark"] .time-log-group-title,
[data-theme="dark"] .dependency-mini-map,
[data-theme="dark"] .checklist-progress-text { color: var(--color-text-muted); }
[data-theme="dark"] .time-log-entry { color: var(--color-text); border-bottom-color: var(--color-border); }

/* Empty states */
[data-theme="dark"] .empty-state,
[data-theme="dark"] .task-empty-state { background: var(--color-bg-muted); border-color: var(--color-border); }
[data-theme="dark"] .task-empty-state svg,
[data-theme="dark"] .task-empty-state p { color: var(--color-text-muted); }

[data-theme="dark"] .empty-state-v2 {
  background: var(--color-bg-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}
[data-theme="dark"] .empty-state-v2.compact,
[data-theme="dark"] .empty-state-v2.card-empty,
[data-theme="dark"] .board-cards-scroll > .empty-state-v2 {
  background: transparent;
}
[data-theme="dark"] .empty-state-v2 .empty-state-icon {
  background: var(--color-bg);
  color: var(--color-text-muted);
}
[data-theme="dark"] .empty-state-v2 .empty-state-title { color: var(--color-text); }
[data-theme="dark"] .empty-state-v2 .empty-state-body { color: var(--color-text-muted); }
[data-theme="dark"] .empty-state-v2 .empty-state-clear { color: var(--color-primary); }
[data-theme="dark"] .empty-state-v2 .empty-state-clear:hover { color: var(--color-primary-dark); }

/* Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--color-border); }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

/* Redesigned My Submissions Staff Page Custom Styles */
.circular-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 6px;
  transition: all 0.2s ease;
}

.module-tab-link.active .circular-count-badge {
  background: var(--color-primary-alpha);
  color: var(--color-primary);
}

.module-tab-link:not(.active) .circular-count-badge {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
}

/* ── Jira-style compact Operations toolbar ─────────────────────────────── */

.jira-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  flex-wrap: wrap;
}

.jira-toolbar .jira-group-trigger,
.jira-toolbar .jira-filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--color-border, #dfdbe3);
  border-radius: var(--radius-sm, 12px);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #1f2937);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.jira-toolbar .jira-group-trigger:hover,
.jira-toolbar .jira-filter-trigger:hover {
  background: var(--color-bg-hover, #f0f1f3);
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}

.jira-toolbar .jira-group-trigger.active {
  background: color-mix(in oklab, var(--color-primary, #2563eb), transparent 92%);
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary, #2563eb);
}

.jira-toolbar .jira-group-trigger.active:hover {
  background: color-mix(in oklab, var(--color-primary, #2563eb), transparent 88%);
}

.jira-toolbar .jira-group-trigger svg,
.jira-toolbar .jira-filter-trigger svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.jira-toolbar .jira-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-primary, #2563eb);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}

.jira-toolbar .jira-clear-filters {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 4px;
  background: transparent;
  border: none;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease;
}

.jira-toolbar .jira-clear-filters:hover {
  color: var(--color-primary, #2563eb);
}

.jira-toolbar .view-mode-toggle {
  margin-left: 0;
  margin-right: 0;
}

.jira-toolbar .jira-group-wrap .jira-group-dropdown,
.jira-toolbar .jira-sort-wrap .jira-sort-dropdown {
  left: auto;
  right: 0;
}

/* Jira dropdown shared shell */
.jira-dropdown {
  position: absolute;
  z-index: 100;
  top: calc(100% + 6px);
  left: 0;
  min-width: 520px;
  max-width: calc(100vw - 32px);
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.jira-dropdown.hidden {
  display: none;
}

/* Group dropdown (simple list) */
.jira-group-dropdown {
  min-width: 180px;
  border-radius: 12px;
}

.jira-group-dropdown .jira-dropdown-body {
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.jira-group-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm, 12px);
  background: transparent;
  color: var(--color-text, #1f2937);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.jira-group-option:hover {
  background: var(--color-bg-hover, #f0f1f3);
}

.jira-group-option.active {
  background: color-mix(in oklab, var(--color-primary, #2563eb), transparent 92%);
  color: var(--color-primary, #2563eb);
}

.jira-group-option .checkmark {
  width: 16px;
  height: 16px;
  color: var(--color-primary, #2563eb);
}

/* Filter dropdown two-pane layout */
.jira-filter-dropdown {
  display: flex;
  flex-direction: column;
  width: 450px;
  height: 320px;
  min-height: 320px;
  max-height: 320px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.18), 0 8px 16px -6px rgba(0, 0, 0, 0.08);
}

.jira-filter-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
}

.jira-filter-categories {
  width: 160px;
  flex-shrink: 0;
  background: var(--color-bg, #f8fafc);
  border-right: 1px solid var(--color-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  padding: 8px 6px 0 6px;
}

.jira-filter-categories-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.jira-filter-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text, #1f2937);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.jira-filter-category:hover {
  background: var(--color-bg-hover, #f0f1f3);
}

.jira-filter-category.active {
  background: color-mix(in oklab, var(--color-primary, #2563eb), transparent 90%);
  border-left-color: var(--color-primary, #2563eb);
  border-radius: 12px 12px 12px 12px;
  color: var(--color-primary, #2563eb);
  font-weight: 600;
}

.jira-filter-category .cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--color-border, #e2e8f0);
  color: var(--color-text-muted, #6b7280);
  font-size: 0.6875rem;
  font-weight: 600;
}

.jira-filter-category.active .cat-count {
  background: var(--color-primary, #2563eb);
  color: #fff;
}

.jira-filter-categories-footer {
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  margin-top: auto;
}

.jira-filter-categories-footer .jira-filter-clear-all {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.jira-filter-categories-footer .jira-filter-clear-all:hover:not(.disabled) {
  color: var(--color-primary, #2563eb);
}

.jira-filter-categories-footer .jira-filter-clear-all.disabled {
  opacity: 0.4;
  cursor: default;
}

.jira-filter-values {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.jira-filter-values-header {
  position: relative;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.jira-filter-values-header .jira-filter-search-icon {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted, #94a3b8);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jira-filter-values-header .jira-filter-search {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  background: var(--color-bg, #f8fafc);
  color: var(--color-text, #1f2937);
  font-size: 0.8125rem;
  font-family: inherit;
}

.jira-filter-values-header .jira-filter-search:focus-visible {
  outline: none;
  border-color: var(--color-primary, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary, #2563eb), transparent 88%);
}

[data-theme="dark"] .jira-filter-values-header .jira-filter-search-icon {
  color: var(--color-text-muted);
}

.jira-filter-values-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}

.jira-filter-select-date-wrap {
  padding: 6px 10px 4px 10px;
  border: none;
  margin-bottom: 4px;
}

.jira-filter-select-date-wrap .mdp-wrapper {
  width: 100%;
}

.jira-filter-datepicker-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted, #64748b);
}

.jira-filter-datepicker-wrap .mdp-wrapper {
  width: 100%;
}

.jira-filter-datepicker-wrap .mdp-display {
  font-size: 0.8125rem;
  height: 32px;
  padding: 0 10px 0 30px;
}

.jira-filter-value-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text, #1f2937);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.jira-filter-value-item:hover {
  background: var(--color-bg-hover, #f0f1f3);
}

.jira-filter-value-item input[type="checkbox"],
.jira-filter-checkbox {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  min-height: 15px !important;
  max-height: 15px !important;
  padding: 0 !important;
  margin: 0 !important;
  accent-color: var(--color-primary, #2563eb);
  flex-shrink: 0;
  cursor: pointer;
}

.jira-filter-values-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.8125rem;
}

.jira-filter-values-footer {
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text-muted, #6b7280);
  font-size: 0.8125rem;
  margin-top: auto;
}

.jira-filter-values-footer .jira-filter-clear-cat {
  background: transparent;
  border: none;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.jira-filter-values-footer .jira-filter-clear-cat:hover:not(.disabled) {
  color: var(--color-primary, #2563eb);
}

.jira-filter-values-footer .jira-filter-clear-cat.disabled {
  opacity: 0.4;
  cursor: default;
}

.jira-filter-global-footer {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 14px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-bg, #f8fafc);
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
}

.jira-filter-shortcut-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #64748b);
}

.jira-filter-shortcut-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: var(--color-text, #334155);
  background-color: var(--color-bg-muted, #e2e8f0);
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: 12px;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

/* Ensure toolbar dropdown anchors are positioned correctly */
.jira-toolbar .jira-group-wrap,
.jira-toolbar .jira-filter-wrap,
.jira-toolbar .jira-sort-wrap {
  position: relative;
}

/* ─── Jira-style inline search ────────────────────────────────── */
.jira-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.jira-search-icon {
  position: absolute;
  left: 10px;
  pointer-events: none;
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
  z-index: 1;
}
.jira-search-input {
  padding: 7px 32px 7px 32px !important;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 12px);
  font-size: 0.8125rem;
  font-family: inherit;
  font-weight: 500;
  min-width: 200px;
  max-width: 280px;
  height: 34px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.jira-search-input::placeholder {
  color: var(--color-text-muted);
  font-weight: 400;
}
.jira-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary), transparent 75%);
}
.jira-search-clear {
  position: absolute;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}
.jira-search-clear:hover {
  color: var(--color-text);
  background: var(--color-border);
}
.jira-search-clear.hidden {
  display: none;
}

/* Operations toolbar overrides */
.operations-tab-page .toolbar-sticky-container:has(.jira-toolbar),
.operations-list-page .toolbar-sticky-container:has(.jira-toolbar) {
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* For grouped boards, preserve the toolbar container's bottom padding while
   removing the transparent bottom margin. The solid padding background bridges
   the gap, and the first group section header sits flush against it. */
.operations-tab-page .toolbar-sticky-container.grouped-board-active:has(.jira-toolbar),
.operations-list-page .toolbar-sticky-container.grouped-board-active:has(.jira-toolbar) {
  padding-bottom: 12px;
  margin-bottom: 0;
}

/* ── Grouped board phase sections (Jira-style sticky headers) ──────────── */

.operations-tab-page,
.operations-list-page {
  --board-column-header-top: calc(var(--operations-title-bar-height, 48px) + var(--operations-tab-nav-height, 45px) + var(--operations-toolbar-height, 0px));
}

.board-phase-section {
  margin-bottom: var(--space-3, 12px);
}

.board-phase-section:last-child {
  margin-bottom: 0;
}

.board-phase-header {
  position: sticky;
  top: calc(var(--board-column-header-top, 0px) + var(--board-column-header-height, 56px));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--color-bg-light, #f1f5f9);
  border-bottom: 1px solid var(--color-border, #cbd5e1);
  border-radius: var(--radius-sm, 12px) var(--radius-sm, 12px) 0 0;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--color-text, #0f172a);
}

.board-phase-header::before {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--column-phase-color, transparent);
  border-radius: var(--radius-sm, 12px) var(--radius-sm, 12px) 0 0;
}

.board-phase-header .board-phase-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-phase-header .board-phase-count {
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
  font-size: 0.75rem;
}

/* Make sure grouped columns do not independently scroll so sticky phase headers stack */
.operations-tab-page .board-column-v2.grouped .board-cards-scroll {
  overflow-y: visible;
}

/* ── Grouped board rows (Jira-style swimlanes) ─────────────────────────── */

.board-grouped-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 16px);
  padding-bottom: var(--space-4, 16px);
}

.board-group-section {
  --board-group-title-width: 220px;
  --board-group-title-height: 52px;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface, #ffffff);
}

.board-group-section.collapsed .board-group-phase-row,
.board-group-section.collapsed .board-group-body {
  display: none;
}

.board-group-section.collapsed .board-group-collapse svg {
  transform: rotate(-90deg);
}

.board-group-section {
  position: relative;
}

/* Sticky wrapper: holds the group title row and phase heading row as one sticky unit.
   The top edge is deliberately square so it meets the sticky toolbar bottom without
   leaving corner gaps; the section's own border-radius still rounds the outer corners. */
.board-group-sticky-wrap {
  position: sticky;
  top: var(--board-column-header-top, 0);
  z-index: 23;
  background: var(--color-surface, #ffffff);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  overflow: hidden;
}

/* Group title row: full-width, sits inside the sticky wrapper */
.board-group-title-row {
  display: flex;
  align-items: center;
  height: var(--board-group-title-height, 52px);
  padding: 0 12px;
}

.board-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}

.board-group-title:hover {
  opacity: 0.85;
}

.board-group-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.board-group-collapse:hover {
  color: var(--color-primary, #2563eb);
}

.board-group-collapse svg {
  transition: transform 0.15s ease;
}

.board-group-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
  background-position: center;
}

.board-group-avatars {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.board-group-avatars .avatar-xs {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid var(--color-surface, #fff);
  background-size: cover;
  background-position: center;
  margin-left: -8px;
}

.board-group-avatars .avatar-xs:first-child {
  margin-left: 0;
}

.board-group-avatar-overflow {
  background: var(--color-bg-muted, #e2e8f0);
  color: var(--color-text-muted, #64748b);
}

.board-group-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board-group-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-group-count {
  display: inline;
  font-size: 0.75rem;
  color: var(--color-text-muted, #64748b);
  font-weight: 500;
  margin-left: 4px;
}

/* Phase heading row: sits inside the sticky wrapper beneath the group title */
.board-group-phase-row {
  display: grid;
  grid-template-columns: repeat(var(--phase-count), minmax(180px, 1fr));
  background: var(--color-surface, #ffffff);
}

.board-group-phase-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-left: 1px solid var(--color-border, #e2e8f0);
}

.board-group-phase-header:first-child {
  border-left: none;
}

.phase-header-top {
  height: 3px;
  border-radius: 12px;
  background: var(--phase-color, transparent);
}

.phase-header-body {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phase-header-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text, #0f172a);
  letter-spacing: 0.02em;
}

.phase-header-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}

.board-group-body {
  display: grid;
  grid-template-columns: repeat(var(--phase-count), minmax(180px, 1fr));
  background: var(--color-bg, #f8fafc);
}

.board-group-column {
  min-height: 120px;
  padding: var(--space-3, 12px);
  border-left: 1px solid var(--color-border, #e2e8f0);
}

.board-group-column:first-child {
  border-left: none;
}

.board-group-column .board-card-v2 {
  margin-bottom: var(--space-3, 12px);
}

.board-group-column .board-card-v2:last-child {
  margin-bottom: 0;
}

.board-group-column.drag-over {
  background: color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 92%);
  border-color: var(--column-phase-color, var(--color-primary));
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 70%);
}

/* Dark mode overrides */
[data-theme="dark"] .jira-toolbar .jira-group-trigger,
[data-theme="dark"] .jira-toolbar .jira-filter-trigger {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .jira-toolbar .jira-group-trigger:hover,
[data-theme="dark"] .jira-toolbar .jira-filter-trigger:hover {
  background: var(--color-bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

[data-theme="dark"] .jira-toolbar .jira-filter-badge {
  background: var(--color-primary);
  color: #191919;
}

[data-theme="dark"] .jira-dropdown {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .jira-filter-categories,
[data-theme="dark"] .jira-filter-categories-footer,
[data-theme="dark"] .jira-filter-values-header,
[data-theme="dark"] .jira-filter-values-footer,
[data-theme="dark"] .jira-filter-global-footer {
  background: var(--color-bg);
  border-color: var(--color-border);
}

[data-theme="dark"] .jira-filter-shortcut-hint kbd {
  color: var(--color-text);
  background-color: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .jira-filter-category,
[data-theme="dark"] .jira-group-option,
[data-theme="dark"] .jira-filter-value-item {
  color: var(--color-text);
}

[data-theme="dark"] .jira-filter-category:hover,
[data-theme="dark"] .jira-group-option:hover,
[data-theme="dark"] .jira-filter-value-item:hover {
  background: var(--color-bg-hover);
}

[data-theme="dark"] .jira-filter-category.active,
[data-theme="dark"] .jira-group-option.active {
  background: color-mix(in oklab, var(--color-primary), transparent 85%);
  color: var(--color-primary);
}

[data-theme="dark"] .jira-filter-values-header .jira-filter-search {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .jira-filter-values-empty {
  color: var(--color-text-muted);
}

[data-theme="dark"] .jira-filter-category .cat-count {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
}

/* Redesigned Admin Review Card */
.admin-review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  padding: 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

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

.admin-review-submitter-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-alpha);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.admin-review-meta-text {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.admin-review-meta-text strong {
  color: var(--color-text);
  font-weight: 600;
}

.admin-review-status-badge {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(217, 119, 6, 0.2);
}

/* Full-page detail layouts */
.pending-detail-full-page,
.request-detail-full-page {
  width: 100%;
  box-sizing: border-box;
}

.request-detail-full-page > .notion-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  padding: 24px !important;
  box-shadow: var(--shadow-card);
}

/* Warning block */
.notion-warning-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ef4444;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

/* Notion property grid */
.notion-property-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.notion-property-row {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.notion-property-label {
  width: 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.notion-property-label svg {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.notion-property-value {
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notion-property-value-warning {
  color: #ef4444;
  font-style: italic;
}

[data-theme="dark"] .jira-filter-category.active .cat-count {
  background: var(--color-primary);
  color: #191919;
}

[data-theme="dark"] .jira-toolbar .jira-group-trigger.active {
  background: color-mix(in oklab, var(--color-primary), transparent 85%);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

[data-theme="dark"] .board-phase-header {
  background: var(--color-bg-light);
  border-color: var(--color-border);
  color: var(--color-text);
}

[data-theme="dark"] .board-group-section {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .board-group-sticky-wrap,
[data-theme="dark"] .board-group-phase-row {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .board-group-title:hover {
  opacity: 0.85;
}

[data-theme="dark"] .board-group-phase-header,
[data-theme="dark"] .board-group-column {
  border-color: var(--color-border);
}

[data-theme="dark"] .board-group-column.drag-over {
  background: color-mix(in oklab, var(--column-phase-color, var(--color-primary)), transparent 88%);
  border-color: var(--column-phase-color, var(--color-primary));
}

[data-theme="dark"] .board-group-name {
  color: var(--color-text);
}

[data-theme="dark"] .phase-header-label {
  color: var(--color-text);
}

[data-theme="dark"] .board-group-body {
  background: var(--color-bg);
}

/* ── Jira-style Backlog Component ──────────── */
.jira-backlog-container {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

/* Wide table-like backlogs can scroll horizontally so no detail is clipped. */
.jira-backlog-container--columns {
  overflow-x: auto;
}

.jira-backlog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-bg-light, #fafafa);
  border-bottom: 1px solid var(--color-border);
}

.jira-backlog-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.jira-backlog-chevron {
  display: none !important;
}

.jira-backlog-title-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.jira-backlog-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.jira-backlog-subtitle {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.jira-backlog-count-badge {
  background: var(--color-bg-muted, #f1f5f9);
  color: var(--color-text-muted);
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.jira-backlog-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jira-backlog-body {
  transition: max-height 0.2s ease-in-out;
}

.jira-backlog-body.collapsed {
  max-height: 0 !important;
  overflow: hidden;
}

.jira-backlog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--color-bg-light, #fafafa);
  border-top: 1px solid var(--color-border);
}

.jira-pagination-info {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.audit-log-details-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 8px;
  word-break: break-word;
  vertical-align: middle;
}

.jira-backlog-list {
  background: var(--color-surface);
}

.jira-backlog-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s ease;
  font-size: 0.84rem;
  color: var(--color-text);
  min-height: 38px;
}

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

.jira-backlog-row:hover {
  background: var(--color-bg-light, #fafafa);
}

.jira-backlog-row.selected {
  background: color-mix(in oklab, var(--color-primary), transparent 94%);
}

.jira-backlog-row-checkbox-wrap {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
}

.jira-backlog-row-checkbox {
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.1s ease;
  width: 13px;
  height: 13px;
  accent-color: var(--color-primary);
}

.jira-backlog-row:hover .jira-backlog-row-checkbox,
.jira-backlog-row-checkbox:checked {
  opacity: 1;
}

.jira-backlog-row-icon {
  display: flex;
  align-items: center;
  margin-right: 10px;
  color: var(--color-primary);
}

.jira-backlog-row-key {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-right: 12px;
  width: 75px;
  flex-shrink: 0;
}

.jira-backlog-row-title {
  flex-grow: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jira-backlog-row-tags {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 24px;
  margin-right: 12px;
}

.jira-backlog-tag {
  background: var(--color-bg-muted, #f1f5f9);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- 2026 Premium Dashboard Redesign --- */
.dashboard-welcome-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px var(--spacing-lg); /* Reduced padding to make banner more compact */
  margin-bottom: var(--spacing-md); /* Reduced margin */
  backdrop-filter: blur(16px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.6s ease-out;
}

.dashboard-welcome-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.03) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;
}

.welcome-title {
  font-size: 1.45rem; /* Reduced font size to save space */
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.02em;
}

.welcome-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

.welcome-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  width: 100%;
  height: 100%;
  background-color: var(--color-success);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3.5); opacity: 0; }
}

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

/* Premium KPI Strip - Compact sizing to save vertical space */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md); /* Reduced gap */
  margin-bottom: var(--spacing-md); /* Reduced margin */
  width: 100%;
}

.premium-kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md); /* Compact radius */
  padding: 10px 14px; /* Reduced padding from var(--spacing-lg) */
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.premium-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-primary-alpha);
}

.premium-kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--color-primary));
  opacity: 0.8;
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px; /* Reduced from var(--spacing-sm) */
}

.kpi-icon-wrap {
  width: 30px; /* Reduced from 38px */
  height: 30px; /* Reduced from 38px */
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem; /* Reduced from 1.1rem */
  background: var(--icon-bg, var(--color-bg-muted));
}

.kpi-trend-pill {
  font-size: 0.7rem; /* Reduced from 0.75rem */
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}
.kpi-trend-pill.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}
.kpi-trend-pill.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.kpi-main {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  font-size: 0.8rem; /* Reduced from 0.875rem */
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0px;
}

.kpi-big-num {
  font-size: 1.35rem; /* Reduced from 1.6rem */
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}


/* Sidebar Item Dark Mode handling */
.sidebar-item.expanded {
  background: #f4f7fb; /* Better light theme contrast */
  border-color: var(--color-primary);
}

[data-theme="dark"] .sidebar-item.expanded {
  background: var(--color-bg-muted) !important; /* Proper dark state background */
  border-color: var(--color-primary) !important;
}

[data-theme="dark"] .sidebar-item {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .sidebar-item:hover {
  border-color: var(--color-primary);
}

[data-theme="dark"] .detail-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .detail-desc {
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-text);
}

/* Command Bar */
.calendar-command-container {
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar-command-bar {
  display: flex;
  gap: var(--spacing-sm);
  width: 100%;
}

.command-input-wrap {
  position: relative;
  flex: 1;
}

.command-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.command-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.command-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}

.command-help-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.command-help-text code {
  background: var(--color-bg);
  padding: 1px 4px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

/* Timeline View */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-lg);
  overflow-y: auto;
  flex: 1;
}

.timeline-date-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.timeline-date-header {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timeline-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.timeline-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  cursor: pointer;
}

.timeline-card:hover {
  transform: translateX(4px);
  border-color: var(--color-text-muted);
}

.timeline-card-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex: 1;
}

.timeline-type-icon {
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
}

.timeline-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.timeline-card-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.timeline-card-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* Scheduler controls */
.scheduler-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.control-pill {
  font-size: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 4px;
}

.notion-property-value-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.notion-property-value-link:hover {
  text-decoration: underline;
}

.notion-property-value-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Title Section */
.notion-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.notion-title-icon {
  color: var(--color-text);
  opacity: 0.6;
}

.notion-title-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* Checklist Section */
.notion-section-divider {
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

.notion-sub-section {
  font-size: 0.875rem;
}

.notion-sub-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

.notion-sub-section-content {
  color: var(--color-text-muted);
  font-style: italic;
}

.jira-backlog-tag.tag-primary {
  background: color-mix(in oklab, var(--color-primary), transparent 90%);
  border-color: color-mix(in oklab, var(--color-primary), transparent 75%);
  color: var(--color-primary);
}

.jira-backlog-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.1s ease;
  min-width: max-content;
}

.jira-backlog-row:hover .jira-backlog-row-actions {
  opacity: 1;
}

/* Pin the actions column to the right edge of wide table-like backlogs
   so it remains visible while the rest of the row scrolls horizontally. */
.jira-backlog-row--columns .jira-backlog-row-actions {
  position: sticky;
  right: 16px;
  background: var(--color-surface);
  z-index: 2;
  padding-left: 8px;
  padding-right: 8px;
  justify-content: flex-end;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.04);
}

.jira-backlog-row:hover .jira-backlog-row-actions,
.jira-backlog-row.selected .jira-backlog-row-actions {
  background: var(--color-bg-light, #fafafa);
}

.jira-backlog-columns-header .jira-backlog-col-header--actions:last-child {
  position: sticky;
  right: 16px;
  background: var(--color-bg-light, #fafafa);
  z-index: 3;
  padding-left: 8px;
  padding-right: 8px;
  text-align: right;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.04);
}

.jira-backlog-col-header--lead {
  padding-left: 8px;
}

.jira-backlog-col-header--right {
  text-align: right !important;
  padding-right: 8px;
}

.jira-backlog-tag.jira-backlog-col-cell--right {
  justify-self: end !important;
  text-align: right !important;
  margin-left: auto;
}

/* Empty checkbox spacer used when selectable=false to preserve column alignment. */
.jira-backlog-row-checkbox-wrap--spacer {
  width: 100%;
}

/* Column-aligned backlog rows (table-like grid) */
.jira-backlog-row--columns {
  display: grid;
  align-items: start;
  column-gap: 12px;
  row-gap: 4px;
  padding: 10px 16px;
}

/* In column mode, lead items become grid cells and must not carry their flex-era margins. */
.jira-backlog-row--columns .jira-backlog-row-checkbox-wrap {
  margin-right: 0;
  width: 100%;
  justify-content: center;
}

.jira-backlog-row--columns .jira-backlog-row-icon {
  margin-right: 0;
  width: 100%;
  justify-content: center;
}

.jira-backlog-row--columns .jira-backlog-row-key {
  margin-right: 0;
  width: 100%;
}

.jira-backlog-row--columns .jira-backlog-row-title {
  min-width: 0;
  width: 100%;
  overflow: visible;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Fixed title width keeps long names on a single line while the rest of the
   grid scrolls horizontally. */
.jira-backlog-row--fixed-title .jira-backlog-row-title {
  white-space: nowrap;
}

.jira-backlog-columns-header {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--color-bg-light, #fafafa);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.jira-backlog-col-header {
  overflow: visible;
  white-space: nowrap;
  min-width: 0;
  text-align: left;
}

/* Column headers share the same left origin as the badge content inside each
   column track, so the header text lines up with the text inside a left-aligned
   badge (which has 8px of horizontal padding). */
.jira-backlog-container--columns .jira-backlog-columns-header .jira-backlog-col-header:not(.jira-backlog-col-header--spacer):not(.jira-backlog-col-header--actions) {
  padding-left: 8px;
}

.jira-backlog-row-tags--columns {
  display: contents;
}

/* In column mode the badge should shrink to its content and only its left edge
   needs to line up with the column. The column track width is fixed, but the
   badge background expands naturally to fit its text and may cross the right
   boundary of the column if needed. */
.jira-backlog-row-tags--columns .jira-backlog-tag {
  width: auto;
  min-width: 0;
  max-width: 100%;
  justify-self: start;
  justify-content: flex-start;
  overflow: hidden;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.jira-backlog-row-tags--columns .jira-backlog-tag > * {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.jira-backlog-tag-placeholder {
  min-height: 1px;
}

.jira-backlog-tag-role,
.jira-backlog-tag-action,
.jira-backlog-tag-entity,
.jira-backlog-tag-status {
  justify-content: center !important;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* In column mode the left edge of every badge should line up, so remove
   forced centering and let the badge shrink to its content from the left. */
.jira-backlog-row-tags--columns .jira-backlog-tag-role,
.jira-backlog-row-tags--columns .jira-backlog-tag-action,
.jira-backlog-row-tags--columns .jira-backlog-tag-entity,
.jira-backlog-row-tags--columns .jira-backlog-tag-status {
  justify-content: flex-start !important;
  text-align: left;
}

.jira-backlog-tag-client,
.jira-backlog-tag-category,
.jira-backlog-tag-item {
  justify-content: flex-start !important;
  font-weight: 500;
}

.jira-backlog-tag-schedule {
  justify-content: flex-start !important;
  color: var(--color-text-muted);
}

.hidden-tag-placeholder {
  background: transparent !important;
  border: none !important;
  color: transparent !important;
  padding: 0 !important;
  min-height: 0 !important;
  pointer-events: none !important;
}

/* Retainer check column: a simple centered check with no badge background. */
.jira-backlog-tag-retainer-check {
  background: transparent !important;
  border: none !important;
  color: var(--color-success, #16a34a);
  padding: 0;
  justify-self: center;
}

.jira-backlog-row-secondary {
  grid-column: 1 / -1;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jira-backlog-row--columns .jira-backlog-row-secondary {
  margin-top: 0;
}

/* Inline toolbar placed between backlog header and body */
.jira-backlog-toolbar {
  padding: 8px 16px 0;
}

.jira-backlog-toolbar:empty {
  display: none;
}

/* User avatar for backlog rows (audit log, etc.) */
.backlog-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.backlog-avatar--image {
  background-repeat: no-repeat;
  color: transparent;
}

/* Dark mode overrides for Jira backlog */
[data-theme="dark"] .jira-backlog-header {
  background: var(--color-bg-light);
}

[data-theme="dark"] .jira-backlog-count-badge {
  background: var(--color-bg-muted);
}

[data-theme="dark"] .jira-backlog-row:hover {
  background: var(--color-bg-light);
}

[data-theme="dark"] .jira-backlog-tag {
  background: var(--color-bg-muted);
}

/* ── Jira Backlog Tag Types & Color Coding ──────────── */
.jira-backlog-tag-client {
  background: var(--color-bg-muted, #f1f5f9);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  font-weight: 500;
}

.jira-backlog-tag-category {
  background: color-mix(in oklab, var(--color-primary), transparent 93%);
  color: var(--color-primary);
  border-color: color-mix(in oklab, var(--color-primary), transparent 80%);
  font-weight: 600;
}

.jira-backlog-tag-amount {
  font-weight: 700;
  color: var(--color-text);
  border-color: var(--color-border);
  background: var(--color-surface);
}

.jira-backlog-tag-points {
  background: var(--color-bg-muted, #f1f5f9);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0;
}

/* Schedule Color Schemes */
.jira-backlog-tag-schedule {
  font-weight: 600;
  border-radius: 12px;
}
.jira-backlog-tag-schedule-monthly {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.jira-backlog-tag-schedule-weekly {
  background: #d1fae5;
  color: #047857;
  border-color: #a7f3d0;
}
.jira-backlog-tag-schedule-quarterly {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.jira-backlog-tag-schedule-annually {
  background: #fce7f3;
  color: #be185d;
  border-color: #fbcfe8;
}

/* Fund Source Color Schemes */
.jira-backlog-tag-fund {
  font-weight: 600;
  border-radius: 12px;
}
.jira-backlog-tag-fund-firmfund {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.jira-backlog-tag-fund-clientfund {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

/* Dark Mode Overrides for Tag Types */
[data-theme="dark"] .jira-backlog-tag-client {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
[data-theme="dark"] .jira-backlog-tag-amount {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .jira-backlog-tag-points {
  background: var(--color-bg-muted);
  color: var(--color-text);
  border-color: var(--color-border);
}
[data-theme="dark"] .jira-backlog-tag-schedule-monthly {
  background: rgba(3, 105, 161, 0.15);
  color: #38bdf8;
  border-color: rgba(3, 105, 161, 0.3);
}
[data-theme="dark"] .jira-backlog-tag-schedule-weekly {
  background: rgba(4, 120, 87, 0.15);
  color: #34d399;
  border-color: rgba(4, 120, 87, 0.3);
}
[data-theme="dark"] .jira-backlog-tag-schedule-quarterly {
  background: rgba(180, 83, 9, 0.15);
  color: #fbbf24;
  border-color: rgba(180, 83, 9, 0.3);
}
[data-theme="dark"] .jira-backlog-tag-schedule-annually {
  background: rgba(190, 24, 93, 0.15);
  color: #f472b6;
  border-color: rgba(190, 24, 93, 0.3);
}
[data-theme="dark"] .jira-backlog-tag-fund-firmfund {
  background: rgba(3, 105, 161, 0.15);
  color: #38bdf8;
  border-color: rgba(3, 105, 161, 0.3);
}
[data-theme="dark"] .jira-backlog-tag-fund-clientfund {
  background: rgba(180, 83, 9, 0.15);
  color: #fbbf24;
  border-color: rgba(180, 83, 9, 0.3);
}
[data-theme="dark"] .jira-backlog-tag-category {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.3);
}

/* Audit / activity action tags */
.jira-backlog-tag-action {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
  border-radius: 12px;
}

.jira-backlog-tag-action-create {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.jira-backlog-tag-action-update {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}

.jira-backlog-tag-action-delete,
.jira-backlog-tag-action-archive {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.jira-backlog-tag-action-approve,
.jira-backlog-tag-action-complete {
  background: #d1fae5;
  color: #047857;
  border-color: #a7f3d0;
}

.jira-backlog-tag-action-reject {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.jira-backlog-tag-action-login,
.jira-backlog-tag-action-info {
  background: #e0e7ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.jira-backlog-tag-action-logout {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.jira-backlog-tag-action-release {
  background: #ccfbf1;
  color: #115e59;
  border-color: #99f6e4;
}

.jira-backlog-tag-action-warning {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fed7aa;
}

[data-theme="dark"] .jira-backlog-tag-action-create {
  background: rgba(22, 101, 52, 0.2);
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-update {
  background: rgba(7, 89, 133, 0.25);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-delete,
[data-theme="dark"] .jira-backlog-tag-action-archive {
  background: rgba(153, 27, 27, 0.2);
  color: #fca5a5;
  border-color: rgba(252, 165, 165, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-approve,
[data-theme="dark"] .jira-backlog-tag-action-complete {
  background: rgba(4, 120, 87, 0.2);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-reject {
  background: rgba(180, 83, 9, 0.2);
  color: #fbbf24;
  border-color: rgba(253, 224, 71, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-login,
[data-theme="dark"] .jira-backlog-tag-action-info {
  background: rgba(55, 48, 163, 0.2);
  color: #a5b4fc;
  border-color: rgba(165, 180, 252, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-logout {
  background: rgba(71, 85, 105, 0.25);
  color: #cbd5e1;
  border-color: rgba(203, 213, 225, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-release {
  background: rgba(17, 94, 89, 0.25);
  color: #5eead4;
  border-color: rgba(94, 234, 212, 0.3);
}

[data-theme="dark"] .jira-backlog-tag-action-warning {
  background: rgba(154, 52, 18, 0.2);
  color: #fdba74;
  border-color: rgba(253, 186, 116, 0.3);
}

/* ============================================================
 * Admin Audit Log Details Modal & Business / Operations Context
 * Theme-aware styles for light and dark modes
 * ============================================================ */

.audit-log-details-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--color-text, #1e293b);
}

.audit-summary-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-sm, 8px);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .audit-summary-card {
  background: var(--color-surface, #252525);
  border-color: var(--color-border, #3f3f46);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.audit-detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-detail-label {
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .audit-detail-label {
  color: var(--color-text-muted, #a1a1aa);
}

.audit-detail-value {
  font-weight: 500;
  color: var(--color-text, #1e293b);
  word-break: break-word;
}

[data-theme="dark"] .audit-detail-value {
  color: var(--color-text, #f4f4f5);
}

/* Insight Context Cards (Operations, Tasks, Billing, Disbursements, etc.) */
.audit-insight-card {
  background: var(--color-bg-muted, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 8px);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.2s, border-color 0.2s;
}

[data-theme="dark"] .audit-insight-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--color-border, #3f3f46);
}

/* Specific Operations & Task Operations Context Theme-Aware Styling */
.audit-insight-card.audit-insight-card--operations {
  background: rgba(37, 99, 235, 0.04);
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .audit-insight-card.audit-insight-card--operations {
  background: rgba(79, 138, 250, 0.08);
  border-color: rgba(79, 138, 250, 0.28);
}

.audit-insight-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  padding-bottom: 8px;
}

[data-theme="dark"] .audit-insight-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.audit-insight-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--color-text, #1e293b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .audit-insight-title {
  color: var(--color-text, #f4f4f5);
}

.audit-insight-title svg {
  color: var(--color-primary, #2563eb);
  flex-shrink: 0;
}

[data-theme="dark"] .audit-insight-title svg {
  color: var(--color-primary, #93c5fd);
}

.audit-insight-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--color-bg-muted, #f1f5f9);
  color: var(--color-text-muted, #475569);
  border: 1px solid var(--color-border, #cbd5e1);
}

[data-theme="dark"] .audit-insight-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, 0.15);
}

.audit-insight-card--operations .audit-insight-badge {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .audit-insight-card--operations .audit-insight-badge {
  background: rgba(79, 138, 250, 0.2);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.35);
}

.audit-insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  font-size: 12.5px;
  margin-top: 4px;
}

.audit-insight-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.audit-insight-label {
  font-size: 10.5px;
  color: var(--color-text-muted, #64748b);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.025em;
}

[data-theme="dark"] .audit-insight-label {
  color: var(--color-text-muted, #a1a1aa);
}

.audit-insight-val {
  font-weight: 500;
  color: var(--color-text, #0f172a);
  word-break: break-word;
}

[data-theme="dark"] .audit-insight-val {
  color: var(--color-text, #f4f4f5);
}

.audit-insight-link {
  color: var(--color-primary, #2563eb);
  text-decoration: underline;
  font-weight: 600;
  word-break: break-word;
  cursor: pointer;
  transition: color 0.15s;
}

.audit-insight-link:hover {
  color: var(--color-primary-dark, #1d4ed8);
}

[data-theme="dark"] .audit-insight-link {
  color: var(--color-primary, #93c5fd);
}

[data-theme="dark"] .audit-insight-link:hover {
  color: #dbeafe;
}

/* Audit Visual Diff & Raw JSON Section */
.audit-diff-view {
  width: 100%;
}

.audit-diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-surface, #ffffff);
}

[data-theme="dark"] .audit-diff-table {
  background: var(--color-surface, #252525);
  border-color: var(--color-border, #3f3f46);
}

.audit-diff-table thead {
  background: var(--color-bg-muted, #f8fafc);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  text-align: left;
}

[data-theme="dark"] .audit-diff-table thead {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: var(--color-border, #3f3f46);
}

.audit-diff-table th {
  padding: 6px 10px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
  font-size: 11px;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .audit-diff-table th {
  color: var(--color-text-muted, #a1a1aa);
}

.audit-diff-table tr {
  border-bottom: 1px solid var(--color-border, #f1f5f9);
}

[data-theme="dark"] .audit-diff-table tr {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.audit-diff-table td {
  padding: 6px 10px;
  color: var(--color-text, #1e293b);
}

[data-theme="dark"] .audit-diff-table td {
  color: var(--color-text, #f4f4f5);
}

.audit-diff-tag-removed {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  font-family: monospace;
  font-size: 11.5px;
}

[data-theme="dark"] .audit-diff-tag-removed {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.audit-diff-tag-added {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  font-family: monospace;
  font-size: 11.5px;
}

[data-theme="dark"] .audit-diff-tag-added {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.audit-raw-json-pre {
  background: var(--color-bg-muted, #f8fafc);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: monospace;
  font-size: 12px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--color-text, #1e293b);
}

[data-theme="dark"] .audit-raw-json-pre {
  background: rgba(0, 0, 0, 0.25);
  border-color: var(--color-border, #3f3f46);
  color: #e2e8f0;
}

/* ── Backlog Tags Fixed-Width Column Alignment ──────────── */
.jira-backlog-tag-client {
  min-width: 160px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  justify-content: flex-start;
}

.jira-backlog-tag-schedule {
  min-width: 100px;
  justify-content: center;
}

.jira-backlog-tag-category {
  min-width: 120px;
  justify-content: center;
}

.jira-backlog-tag-fund {
  min-width: 110px;
  justify-content: center;
}

.jira-backlog-tag-amount {
  min-width: 120px;
  justify-content: flex-end;
}

/* ── Floating Bulk Action Bar ──────────── */
.jira-backlog-bulk-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #22252a;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideUpFade 0.2s cubic-bezier(0.15, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@keyframes slideUpFade {
  from {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.jira-backlog-bulk-count {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.75rem;
}

.jira-backlog-bulk-divider {
  color: rgba(255, 255, 255, 0.3);
  font-weight: 300;
}

.jira-backlog-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jira-backlog-bulk-actions .btn {
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
}

.jira-backlog-bulk-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.jira-backlog-bulk-close:hover {
  color: #ffffff;
}

[data-theme="dark"] .jira-backlog-bulk-bar {
  background: #1d2125;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
}

.timezone-dropdown {
  background: transparent;
  border: none;
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  outline: none;
}

/* Toast Banner */
.command-feedback-toast {
  background: var(--color-surface);
  border-left: 4px solid var(--color-success);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--spacing-md) var(--spacing-lg) 0;
  animation: fadeInDown 0.3s ease-out;
  box-shadow: var(--shadow-sm);
}

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

/* Skeleton Loading styles */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-bg-muted) 50%, var(--color-bg) 75%);
  background-size: 200% 100%;
  animation: loadingSkeleton 1.5s infinite;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.skeleton-row {
  height: 48px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.skeleton-text {
  display: inline-block;
  height: 1em;
  width: 100%;
  border-radius: 4px;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-bg-muted) 50%, var(--color-bg) 75%);
  background-size: 200% 100%;
  animation: loadingSkeleton 1.5s infinite;
  pointer-events: none;
}

.skeleton-avatar {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.route-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.2s ease;
  z-index: 5;
}

[data-theme="dark"] .route-loading-overlay {
  background: rgba(23, 23, 30, 0.6);
}

.route-skeleton-pane {
  width: 100%;
  max-width: 1200px;
  padding: var(--spacing-md);
}

.route-skeleton-header {
  margin-bottom: var(--spacing-md);
}

.route-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.utils-toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.utils-toast {
  background: var(--color-surface);
  color: var(--color-text);
  border-left: 4px solid var(--color-success);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: 12px 16px;
  min-width: 240px;
  max-width: 360px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  font-size: 0.875rem;
}

.utils-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.utils-toast-error { border-left-color: var(--color-danger); }
.utils-toast-warning { border-left-color: var(--color-warning); }
.utils-toast-info { border-left-color: var(--color-primary); }

.utils-toast strong {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.skeleton-cell {
  background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-bg-muted) 50%, var(--color-bg) 75%);
  background-size: 200% 100%;
  animation: loadingSkeleton 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 100%;
  width: 100%;
}

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

/* ── Jira-inspired Grid/Table View ─────────────────────────────── */
.jira-table-container {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  margin-bottom: 24px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.jira-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  color: var(--color-text);
}

.jira-table th,
.jira-table td {
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  vertical-align: middle;
}

.jira-table th {
  background: var(--color-bg-light, #f4f5f7);
  font-weight: 600;
  color: var(--color-text-muted);
  height: 36px;
  white-space: nowrap;
}

.jira-table tr.jira-row:hover {
  background: var(--color-bg-muted, #f4f5f7);
}

.jira-table tr.selected {
  background: var(--color-bg-muted, #deebff) !important;
}

[data-theme="dark"] .jira-table th {
  background: #1d2125;
}

[data-theme="dark"] .jira-table tr.jira-row:hover {
  background: #22272b;
}

[data-theme="dark"] .jira-table tr.selected {
  background: #1c3d5a !important;
}

.jira-th-work {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jira-header-chevron {
  color: var(--color-text-muted);
  font-size: 11px;
}

.jira-row-chevron-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  transition: transform 0.2s ease;
  outline: none;
}

.jira-row-chevron-btn.expanded {
  transform: rotate(90deg);
}

.jira-work-cell-content {
  display: flex;
  align-items: center;
}

.jira-epic-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #8777d9;
  color: #fff;
  border-radius: 12px;
  font-size: 9px;
  margin-right: 6px;
  font-weight: bold;
  flex-shrink: 0;
}

.jira-task-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #4c9aff;
  color: #fff;
  border-radius: 12px;
  font-size: 9px;
  margin-right: 6px;
  font-weight: bold;
  flex-shrink: 0;
}

.jira-key-link {
  color: var(--color-link, #0052cc);
  text-decoration: none;
  font-weight: 500;
  margin-right: 8px;
  white-space: nowrap;
}

.jira-key-link:hover {
  text-decoration: underline;
}

.jira-name-text {
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jira-avatar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.jira-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.jira-avatar-unassigned {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg-muted, #dfe1e6);
  color: var(--color-text-muted, #5e6c84);
  font-size: 11px;
  flex-shrink: 0;
}

/* Contact details list (used in client table cells and detail panels) */
.cd-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cd-entry {
  line-height: 1.35;
}

.cd-entry-name {
  font-weight: 500;
}

.cd-entry-value {
  font-size: 12px;
  color: var(--color-text-muted);
}

.jira-priority-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.jira-priority-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  align-items: center;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  vertical-align: middle;
}

.jira-priority-icon-bar {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 12px;
}

.jira-status-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.jira-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  letter-spacing: 0.5px;
  outline: none;
  transition: filter 0.15s;
}

.jira-status-pill:hover {
  filter: brightness(0.9);
}

.jira-status-pill-todo {
  background: var(--color-bg-muted, #dfe1e6);
  color: var(--color-text, #42526e);
}

.jira-status-pill-done {
  background: #e3fcef;
  color: #006644;
}

[data-theme="dark"] .jira-status-pill-todo {
  background: #2c3e50;
  color: #cbd5e0;
}

[data-theme="dark"] .jira-status-pill-done {
  background: #0f3d2c;
  color: #8ce8c5;
}

.jira-status-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 120px;
  overflow: hidden;
}

.jira-status-dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  color: var(--color-text);
  transition: background 0.15s;
}

.jira-status-dropdown-item:hover {
  background: var(--color-bg-muted);
}

.jira-table-footer {
  background: var(--color-bg-light, #f4f5f7);
  border-top: 1px solid var(--color-border);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-muted);
  height: 38px;
}

[data-theme="dark"] .jira-table-footer {
  background: #1d2125;
}

.jira-footer-create-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  outline: none;
  font-size: 13px;
}

.jira-footer-create-btn:hover {
  background: rgba(9, 30, 66, 0.08);
  color: var(--color-text);
}

[data-theme="dark"] .jira-footer-create-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.jira-footer-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jira-footer-refresh-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.jira-footer-refresh-btn:hover {
  background: rgba(9, 30, 66, 0.08);
  color: var(--color-text);
}

[data-theme="dark"] .jira-footer-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.jira-footer-refresh-btn svg {
  transition: transform 0.3s ease;
}

.jira-footer-refresh-btn:active svg {
  transform: rotate(180deg);
}

/* Accordion details */
.jira-accordion-tr {
  background: var(--color-bg-light, #fafafa) !important;
}

[data-theme="dark"] .jira-accordion-tr {
  background: #1a1d20 !important;
}

.jira-accordion-details-container {
  display: flex;
  gap: 32px;
  width: 100%;
}

.jira-accordion-details-section {
  flex: 1;
}

.jira-accordion-details-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 4px;
}

.jira-details-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  font-size: 13px;
}

.jira-details-lbl {
  font-weight: 600;
  color: var(--color-text-muted);
}

.jira-details-val {
  color: var(--color-text);
}

.jira-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.jira-details-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.jira-details-list-item-key {
  font-weight: 600;
  color: var(--color-link);
  text-decoration: none;
}

.jira-details-list-item-key:hover {
  text-decoration: underline;
}

.jira-details-list-item-title {
  color: var(--color-text);
}

.jira-details-list-item-status {
  margin-left: auto;
}

.jira-trash-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.jira-trash-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

[data-theme="dark"] .jira-trash-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ── DataTable shared component ──────────── */
.data-table-view {
  position: relative;
  width: 100%;
}

/* Container wrapper */
.data-table-view.jira-backlog-container {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

/* Table overrides */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  margin: 0;
}

table.data-table thead tr {
  background: var(--color-bg-light, #fafafa);
  border-bottom: 1px solid var(--color-border);
}

table.data-table th {
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-light, #fafafa);
  text-align: left;
}

table.data-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s ease;
}

table.data-table tbody tr:last-child {
  border-bottom: none;
}

table.data-table tbody tr:hover {
  background: var(--color-bg-light, #fafafa);
}

table.data-table tbody tr.selected {
  background: color-mix(in oklab, var(--color-primary), transparent 94%);
}

table.data-table td {
  padding: 10px 16px;
  font-size: 0.84rem;
  color: var(--color-text);
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border);
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Key Column (First data column after checkbox) */
table.data-table td.dt-key-col {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  width: 75px;
}

/* Title/Name Column (Second data column) */
table.data-table td.dt-title-col {
  font-weight: 600;
  color: var(--color-text);
}

/* Icon style matching Jira backlog icon */
table.data-table td.dt-icon-cell {
  width: 24px;
  min-width: 24px;
  padding-right: 0 !important;
  padding-left: 10px !important;
  color: var(--color-primary);
  vertical-align: middle;
}

table.data-table td.dt-icon-cell svg {
  display: block;
}

/* Checkbox Column */
table.data-table th.dt-checkbox-col,
table.data-table td.dt-checkbox-col {
  width: 28px;
  min-width: 28px;
  padding: 10px 10px;
  text-align: center;
}

table.data-table td.dt-checkbox-col input[type="checkbox"],
table.data-table th.dt-checkbox-col input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
  accent-color: var(--color-primary);
  display: block;
  margin: 0 auto;
}

/* Hide checkbox by default, reveal on hover or when checked */
table.data-table--selectable tbody tr .dt-row-checkbox {
  opacity: 0;
  transition: opacity 0.1s ease;
}

table.data-table--selectable tbody tr:hover .dt-row-checkbox,
table.data-table--selectable tbody tr .dt-row-checkbox:checked {
  opacity: 1;
}

/* Actions Column hover reveal and styling */
table.data-table td.dt-actions-col,
table.data-table th.dt-actions-col {
  padding-left: 8px;
  padding-right: 16px;
  text-align: right;
}

table.data-table td.dt-actions-col button {
  opacity: 0;
  transition: opacity 0.15s;
}

table.data-table tr:hover td.dt-actions-col button {
  opacity: 1;
}

/* Align cell alignments */
table.data-table td.dt-cell--left,
table.data-table th.dt-cell--left {
  text-align: left;
}

table.data-table td.dt-cell--center,
table.data-table th.dt-cell--center {
  text-align: center;
}

table.data-table td.dt-cell--right,
table.data-table th.dt-cell--right {
  text-align: right;
}

/* Title cell with stacked badges */
.dt-title-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dt-title-cell .dt-title-link {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
}

.dt-title-cell .dt-title-link:hover {
  color: var(--color-primary);
}

.dt-title-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dt-title-badges .badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dt-title-badges .badge-info {
  background: var(--color-info-bg, rgba(59, 130, 246, 0.12));
  color: var(--color-info, #3b82f6);
}

.dt-title-badges .badge-success {
  background: var(--color-success-bg, rgba(34, 197, 94, 0.12));
  color: var(--color-success, #22c55e);
}

.dt-title-badges .badge-warning {
  background: var(--color-warning-bg, rgba(245, 158, 11, 0.12));
  color: var(--color-warning, #f59e0b);
}

.dt-title-badges .badge-danger {
  background: var(--color-danger-bg, rgba(239, 68, 68, 0.12));
  color: var(--color-danger, #ef4444);
}

.dt-title-badges .badge-purple {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.dt-title-badges .badge-muted {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
}

/* Priority pills */
.dt-priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
}

.dt-priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dt-priority-urgent {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.dt-priority-medium {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.dt-priority-low {
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
}

.dt-priority-muted {
  background: transparent;
  color: var(--color-text-muted);
}

/* Bulk bar used inside DataTable */
.data-table-bulk-bar.hidden {
  display: none !important;
}

.data-table-bulk-bar .jira-backlog-bulk-actions {
  gap: 8px;
}

/* ==========================================================================
   Profile Page — Adapted to spec (preserving system theme scheme)
   ========================================================================== */
.profile-page {
  max-width: 840px;
  margin: 0 auto;
  padding: 8px 0 32px 0;
}

.profile-header {
  margin-bottom: 24px;
}

.profile-header .page-title-h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.profile-header .page-subtitle {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
}

.profile-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
}

.profile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  position: relative;
}

.profile-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.profile-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px 0;
}

.profile-card-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
}

.profile-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 4px;
}

.profile-avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.profile-avatar-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-user-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.profile-upload-btn {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.profile-upload-btn:hover {
  text-decoration: underline;
  color: var(--color-primary-dark);
}

.profile-upload-status {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 640px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
}

.profile-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin: 0;
}

.profile-input,
.profile-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-light);
  color: var(--color-text);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-input:focus,
.profile-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
  background: var(--color-surface);
}

.profile-input:disabled {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.85;
}

.profile-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
  padding-right: 38px;
}

[data-theme="dark"] .profile-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
}

.profile-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.profile-save-btn {
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  background: var(--color-primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.profile-save-btn:hover {
  background: var(--color-primary-dark);
}

.profile-save-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Work Request Table View — Adapted to Target Spec (preserving system scheme)
   ========================================================================== */

/* Middle branch design icon cell between checkbox and title */
.dt-icon-cell {
  width: 24px !important;
  min-width: 24px !important;
  text-align: center;
  padding: 0 4px !important;
  color: var(--color-text-muted);
}

.dt-row-branch-icon {
  display: inline-block;
  vertical-align: middle;
  opacity: 0.85;
  color: var(--color-text-muted);
}

/* Category & Document Badges */
.badge-standard {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  text-transform: uppercase;
}

.badge-financial-action {
  background: rgba(180, 83, 9, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  text-transform: uppercase;
}

.badge-items {
  background: rgba(147, 51, 234, 0.25);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
}

.badge-no-docs {
  background: rgba(153, 27, 27, 0.3);
  color: #fca5a5;
  border: 1px solid rgba(252, 165, 165, 0.25);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  text-transform: uppercase;
}

/* Priority pills */
.dt-priority-urgent {
  background: rgba(153, 27, 27, 0.3) !important;
  color: #f87171 !important;
  border: 1px solid rgba(248, 113, 113, 0.3) !important;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
}

.dt-priority-normal {
  background: rgba(161, 98, 7, 0.25) !important;
  color: #facc15 !important;
  border: 1px solid rgba(250, 204, 21, 0.3) !important;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* Blocker warning badge in actions column */
.dt-blocker-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
}

/* Light mode overrides for system scheme */
[data-theme="light"] .badge-standard {
  background: #f1f5f9;
  color: #475569;
  border-color: #cbd5e1;
}

[data-theme="light"] .badge-financial-action {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

[data-theme="light"] .badge-items {
  background: #f3e8ff;
  color: #7e22ce;
  border-color: #d8b4fe;
}

[data-theme="light"] .badge-no-docs {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

[data-theme="light"] .dt-priority-urgent {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}

[data-theme="light"] .dt-priority-normal {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fcd34d !important;
}

[data-theme="light"] .dt-blocker-badge {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

/* Simple Circular Spinner for Loading Details */
.simple-spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  min-height: 60vh;
  width: 100%;
  box-sizing: border-box;
}

.simple-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-text-muted);
  border-radius: 50%;
  animation: aura-spin 0.8s linear infinite;
}

.simple-spinner-text {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ─── Redesign: Checklist and inline editing classes ───────────────── */
.checklist-items-container .checklist-item-flex {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.checklist-item-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.checklist-item-top-row .checklist-text {
  flex: 1;
  min-width: 0;
}

.checklist-item-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.checklist-item-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding-left: 28px;
}

.checklist-item-bottom-row-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-left: 24px;
}

.checklist-item-bottom-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.checklist-item-bottom-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.checklist-items-container .inline-edit-input {
  font-size: 0.9rem;
  padding: 2px 6px;
  height: 26px;
  width: 100%;
}

.checklist-items-container .checklist-item-builder-row {
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.checklist-items-container .checklist-builder-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================================================
   Modern Guarded Password Validation & Inline Feedback (Admin / Users)
   ========================================================================== */

.pw-prop-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 4px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pw-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 4px;
}

.pw-header-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  white-space: nowrap;
}

.pw-header-row label svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-text-muted);
}

.pw-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.pw-generate-btn:hover {
  background: var(--color-primary-alpha);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.pw-generate-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

.pw-input-wrapper {
  position: relative !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.pw-input-wrapper .pw-input {
  width: 100% !important;
  padding-right: 44px !important;
  font-family: inherit;
  letter-spacing: normal;
  box-sizing: border-box !important;
}

.pw-input.pw-input-error {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.pw-input.pw-input-success {
  border-color: var(--color-success) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.pw-toggle-btn {
  position: absolute !important;
  right: 10px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  padding: 6px !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--color-text-muted) !important;
  cursor: pointer !important;
  border-radius: 6px !important;
  z-index: 2 !important;
  line-height: 1 !important;
  transition: color 0.15s ease, background-color 0.15s ease !important;
  box-shadow: none !important;
}

.pw-toggle-btn:hover {
  color: var(--color-text) !important;
  background: var(--color-bg) !important;
}

.pw-toggle-btn svg {
  pointer-events: none !important;
  display: block !important;
}

.pw-meter-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.pw-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.pw-meter-title {
  color: var(--color-text-muted);
  font-weight: 500;
}

.pw-meter-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.pw-meter-badge.strength-none {
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
}

.pw-meter-badge.strength-weak {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.pw-meter-badge.strength-fair {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.pw-meter-badge.strength-good {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.pw-meter-badge.strength-strong {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pw-meter-segments {
  display: flex;
  gap: 6px;
  width: 100%;
  height: 5px;
}

.pw-meter-segment {
  flex: 1;
  height: 100%;
  border-radius: 999px;
  background: var(--color-border);
  transition: background-color 0.25s ease;
}

.pw-meter-segment.active-weak {
  background: #ef4444;
}

.pw-meter-segment.active-fair {
  background: #f59e0b;
}

.pw-meter-segment.active-good {
  background: #3b82f6;
}

.pw-meter-segment.active-strong {
  background: #10b981;
}

.pw-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 12px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.pw-rule-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--color-bg);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
}

.pw-rule-item.is-met {
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .pw-rule-item.is-met {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.pw-rule-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.pw-rule-item.is-met .pw-rule-icon {
  color: #10b981;
  transform: scale(1.1);
}

.pw-rule-text {
  font-weight: 500;
  line-height: 1.2;
}

.pw-shake {
  animation: pwShake 0.4s ease-in-out;
}

@keyframes pwShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

[data-theme="dark"] .pw-prop-container {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .pw-rule-item {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .pw-generate-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--color-border);
}

@media (max-width: 480px) {
  .pw-header-row {
    flex-wrap: wrap;
    gap: 6px;
  }
  .pw-checklist {
    grid-template-columns: 1fr;
  }
}

.pw-profile-guardrails {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 4px;
}

[data-theme="dark"] .pw-profile-guardrails {
  background: rgba(255, 255, 255, 0.02);
}

.pw-match-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pw-match-badge.match-yes {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.pw-match-badge.match-no {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.pw-match-helper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 6px;
  min-height: 18px;
  transition: all 0.2s ease;
}

.pw-match-helper.match-yes {
  color: #10b981;
}

.pw-match-helper.match-no {
  color: #ef4444;
}

.pw-match-helper.match-empty {
  color: var(--color-text-muted);
}

.pw-match-helper svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Always strictly align New Password and Confirm Password fields in the row */
.profile-form-grid.pw-aligned-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  row-gap: 8px;
  align-items: start;
}

@media (min-width: 641px) {
  .profile-form-grid.pw-aligned-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto auto !important;
    column-gap: 20px !important;
    row-gap: 8px !important;
    align-items: start !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-new,
  .profile-form-grid.pw-aligned-grid .pw-col-confirm {
    display: contents !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-new .pw-header-row {
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-self: end !important;
    margin-bottom: 0 !important;
    min-height: 28px !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-confirm .pw-header-row {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: end !important;
    margin-bottom: 0 !important;
    min-height: 28px !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-new .pw-input-wrapper {
    grid-column: 1 !important;
    grid-row: 2 !important;
    align-self: start !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-confirm .pw-input-wrapper {
    grid-column: 2 !important;
    grid-row: 2 !important;
    align-self: start !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-new .pw-match-helper {
    grid-column: 1 !important;
    grid-row: 3 !important;
    align-self: start !important;
    margin-top: 0 !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-confirm .pw-match-helper {
    grid-column: 2 !important;
    grid-row: 3 !important;
    align-self: start !important;
    margin-top: 0 !important;
  }
}

@media (max-width: 640px) {
  .profile-form-grid.pw-aligned-grid {
    grid-template-columns: 1fr !important;
    row-gap: 14px !important;
  }
  .profile-form-grid.pw-aligned-grid .pw-col-new,
  .profile-form-grid.pw-aligned-grid .pw-col-confirm {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
}

/* -------------------------------------------------- */
/* Task Row Deep-Linking & Highlight                  */
/* -------------------------------------------------- */
.task-row--highlighted {
  border-left: 4px solid var(--color-primary, #2563eb) !important;
  background-color: color-mix(in oklab, var(--color-primary, #2563eb) 12%, transparent) !important;
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary, #2563eb) 35%, transparent) !important;
  transition: all 0.3s ease-in-out;
  animation: taskRowHighlightPulse 2s ease-in-out 3;
}

@keyframes taskRowHighlightPulse {
  0% {
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary, #2563eb) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in oklab, var(--color-primary, #2563eb) 60%, transparent);
  }
  100% {
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-primary, #2563eb) 35%, transparent);
  }
}

/* -------------------------------------------------- */
/* Global Command Palette (Cmd+K / Ctrl+K)            */
/* -------------------------------------------------- */
.command-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
  animation: cmdFadeIn 0.15s ease-out;
}

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

.command-palette-modal {
  width: 640px;
  max-width: 92vw;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cmdSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmdSlideDown {
  from { transform: translateY(-12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.command-palette-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  gap: 12px;
}

.command-palette-search-icon {
  color: var(--color-text-muted, #94a3b8);
  flex-shrink: 0;
}

.command-palette-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
  color: var(--color-text, #0f172a);
}

.command-palette-input::placeholder {
  color: var(--color-text-muted, #94a3b8);
}

.command-palette-esc-hint {
  font-size: 10px;
  font-family: inherit;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--color-bg-subtle, #f1f5f9);
  color: var(--color-text-muted, #64748b);
  border: 1px solid var(--color-border, #cbd5e1);
}

.command-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 0;
}

.command-palette-category {
  padding: 8px 16px 4px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted, #94a3b8);
}

.command-palette-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.command-palette-item.selected,
.command-palette-item:hover {
  background: color-mix(in oklab, var(--color-primary, #2563eb) 10%, transparent);
}

.cmd-item-icon {
  font-size: 16px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.cmd-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-subtitle {
  font-size: 11.5px;
  color: var(--color-text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.cmd-item-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--color-bg-subtle, #f1f5f9);
  color: var(--color-text-muted, #475569);
  font-weight: 500;
  flex-shrink: 0;
}

.command-palette-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--color-text-muted, #64748b);
}

.command-palette-empty-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.command-palette-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--color-border, #e2e8f0);
  background: var(--color-bg-subtle, #f8fafc);
  font-size: 11px;
  color: var(--color-text-muted, #64748b);
}

.cmd-shortcut-tip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cmd-shortcut-tip kbd {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #cbd5e1);
  color: var(--color-text, #334155);
}

.cmd-palette-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 8px;
}

.cmd-palette-btn-kbd {
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.12);
}






/* ════════════════════════════════════════════════════════════════════════
   QoL Enhancements (UX_RECOMMENDATIONS_DRAFT)
   ════════════════════════════════════════════════════════════════════════ */

/* ── 2.3 Loading buttons ── */
.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
button.is-loading { cursor: progress; opacity: 0.85; }

/* ── 2.2 Discard-changes bottom sheet ── */
.discard-guard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 12000;
  backdrop-filter: blur(2px);
}
.discard-guard-sheet {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 16px 16px 0 0;
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  box-shadow: 0 -12px 32px rgba(15, 23, 42, 0.18);
  animation: discard-sheet-in 0.18s ease-out;
}
@keyframes discard-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.discard-guard-title { font-size: 1rem; font-weight: 700; color: var(--color-text); margin-bottom: 6px; }
.discard-guard-body { font-size: 0.875rem; color: var(--color-text-muted); margin: 0 0 16px; }
.discard-guard-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ── 4.1 Consolidated-view banner & dual-tone accent ── */
body.entity-consolidated .app-header,
body.entity-consolidated .topbar {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #2563eb 0%, #2563eb 50%, #10b981 50%, #10b981 100%) 1;
}
.consolidated-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
  white-space: nowrap;
}
.consolidated-banner .consolidated-dot-ata { color: #2563eb; }
.consolidated-banner .consolidated-dot-lta { color: #10b981; }
.badge-consolidated {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(16, 185, 129, 0.14));
  color: var(--color-text);
  border: 1px solid var(--color-border, #e2e8f0);
}

/* ── 4.1 Entity pill toggle on create forms ── */
.entity-pill-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: var(--color-bg, #f4f6fb);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 999px;
}
.entity-pill {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.entity-pill:hover { color: var(--color-text); }
.entity-pill.active {
  background: var(--color-surface, #fff);
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
.entity-pill-toggle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: var(--spacing-sm, 12px); }
.entity-pill-toggle-wrap .entity-pill-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

/* ── 3.1 Kanban drag handles ── */
.card-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 2px;
  border-radius: 6px;
  color: var(--color-text-muted);
  cursor: grab;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  touch-action: none;
  flex-shrink: 0;
}
.board-card-v2:hover .card-drag-handle,
.board-card-v2:focus-within .card-drag-handle,
.board-card-v2.menu-open .card-drag-handle { opacity: 1; }
.card-drag-handle:hover { background: var(--color-bg-hover, #f0f1f3); color: var(--color-text); }
.card-drag-handle:active { cursor: grabbing; }
.board-card-v2.compact { cursor: pointer; }

/* ── 2.3 Optimistic card sync shimmer ── */
@keyframes card-sync-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }
}
.board-card-v2.card-syncing {
  animation: card-sync-pulse 0.9s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.75;
}

/* ── 3.2 WIP threshold badges ── */
.board-column-count.wip-warn {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}
.board-column-count.wip-over {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}
.board-column-collapse {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 12px);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.board-column-collapse:hover { color: var(--color-primary); background: var(--color-bg-hover, #f0f1f3); }
.board-column-v2.collapsed .board-column-collapse svg { transform: rotate(180deg); }
.board-column-v2.collapsed .board-column-collapse { opacity: 1; }

/* ── 5.2 Actionable vs informational badges ── */
.nav-badge.badge-actionable {
  background: #f59e0b;
  color: #fff;
}
.nav-badge.badge-info {
  background: var(--color-border, #cbd5e1);
  color: var(--color-text-muted, #475569);
  font-weight: 600;
}

/* ── 6.2 Compact table density ── */
.density-compact .report-table th,
.density-compact .report-table td,
.density-compact table.data-table th,
.density-compact table.data-table td,
.density-compact .data-table th,
.density-compact .data-table td { padding: 4px 10px; }
.density-compact .list-item { padding-top: 6px; padding-bottom: 6px; }
.table-density-toggle { display: inline-flex; align-items: center; gap: 6px; }

/* ── 5.1 Pending-change diff highlights ── */
.diff-panel { gap: var(--spacing-md, 16px); }
.diff-table-changed td { vertical-align: top; }
.diff-table-changed .diff-old { color: var(--color-text-muted); text-decoration: line-through; }
.diff-table-changed .diff-new { color: #b45309; font-weight: 600; }

/* ── Dark theme adjustments ── */
[data-theme="dark"] .discard-guard-sheet { background: var(--color-surface, #1f1f1f); }
[data-theme="dark"] .board-column-count.wip-warn { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.5); }
[data-theme="dark"] .board-column-count.wip-over { background: rgba(239, 68, 68, 0.16); color: #f87171; border-color: rgba(239, 68, 68, 0.5); }
[data-theme="dark"] .nav-badge.badge-info { background: rgba(148, 163, 184, 0.3); color: #cbd5e1; }
[data-theme="dark"] .consolidated-banner { background: linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(16, 185, 129, 0.18)); }
[data-theme="dark"] .entity-pill-toggle { background: rgba(148, 163, 184, 0.12); }
[data-theme="dark"] .entity-pill.active { background: var(--color-surface, #1f1f1f); color: #93c5fd; }
