/* Copyright (c) 2025-2026 Ioannis Belesiotis. All rights reserved.
   This source code is proprietary and confidential. */
/* =========================================================
   APP LOADER — full-screen splash shown during auth + data load
   ========================================================= */
.app-loader {
  position: fixed;
  inset: 0;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.app-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.app-loader-inner img {
  border-radius: 24px;
}

.app-loader-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.app-loader-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.app-loader-sub {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

/* "by Belesio SCS" — parent-company attribution under the splash logo */
.app-loader-company {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.app-loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: loaderSpin 0.75s linear infinite;
}

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

/* =========================================================
   Default: logged-out state */
body.logged-out main,
body.logged-out footer {
  display: none;
}

body.logged-in footer {
  display: block;
}

body.logged-in main {
  display: flex;
}

/* Login screen visibility */
body.logged-in #loginScreen {
  display: none !important;
}

body.logged-out #loginScreen {
  display: flex !important;
}

/* ── Account status banners ─────────────────────────────────────────────── */

/* Trial pill — compact, in header next to settings/avatar */
.trial-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--color-accent);
  margin-right: 4px;
}

.trial-pill-cta {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--color-accent);
  color: #fff;
}

.trial-pill-cta:hover {
  opacity: 0.9;
}

.trial-pill-dismiss {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-text-muted);
  opacity: 0.5;
  padding: 0 2px;
}

.trial-pill-dismiss:hover {
  opacity: 1;
}

/* Full-width banners (suspended, expired, past_due — critical, need attention) */
.account-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  font-size: var(--font-xs);
  font-weight: 500;
  z-index: 100;
}

.account-banner-trial {
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}

.account-banner-suspended {
  background: #fef2f2;
  color: #dc2626;
}

.account-banner-past-due {
  background: #fffbeb;
  color: #d97706;
}

.account-banner-cta {
  font-size: var(--font-xs);
  font-weight: 600;
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background: var(--color-accent);
  color: #fff;
}

.account-banner-suspended .account-banner-cta {
  background: #dc2626;
}

.account-banner-past-due .account-banner-cta {
  background: #d97706;
}

.account-banner-dismiss {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 4px;
}

.account-banner-dismiss:hover {
  opacity: 1;
}

[data-theme="dark"] .account-banner-suspended {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}

[data-theme="dark"] .account-banner-past-due {
  background: rgba(217, 119, 6, 0.15);
  color: #fcd34d;
}

[data-theme="dark"] .account-banner-suspended .account-banner-cta {
  background: #ef4444;
}

[data-theme="dark"] .account-banner-past-due .account-banner-cta {
  background: #f59e0b;
}

/* Suspended: reuse board read-only overrides */
body.account-suspended .allocation-bar {
  cursor: default;
}

body.account-suspended .resize-handle {
  display: none;
}

body.logged-in main {
  opacity: 1;
  transition: opacity 0.25s ease;
}

body.logged-out main {
  opacity: 0;
}

body.logged-out main {
  pointer-events: none;
  -webkit-user-select: none; user-select: none;
}


/* =========================================================
   BLOCK 1 — CATALYST DESIGN TOKENS + RESET + TYPOGRAPHY
   ========================================================= */

/* ------------------------------
   CATALYST DESIGN TOKENS
   ------------------------------ */
:root {
  /* Core surfaces */
  --color-surface: #ffffff;
  --color-surface-alt: #f4f5f9;
  --color-surface-muted: #eaecf4;

  /* Borders */
  --color-border: #dde1ee;
  --color-border-strong: #bfc5dc;

  /* Text */
  --color-text: #2d3250;
  --color-text-muted: #717b9e;
  --color-text-light: #9fa8c4;
  --color-resource-text: #4a5280;

  /* Accent (Soft Slate Indigo) */
  --color-accent: #5B73F5;
  --color-accent-hover: #4a62e3;
  --color-accent-subtle: #eef0fe;

  /* Status colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* Spacing scale */
  --space-xxs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 20px;
  --space-xl: 32px;

  /* Typography scale */
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.375rem;

  /* Line heights */
  --lh-tight: 1.2;
  --lh-normal: 1.4;
  --lh-loose: 1.55;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(74, 108, 247, 0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(74, 108, 247, 0.10), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 32px rgba(74, 108, 247, 0.14), 0 4px 12px rgba(0,0,0,0.08);

  /* Component dimensions */
  --day-width: 40px;
  --row-height: 45px;
  --bar-height: 32px;

  /* Layout anchors */
  --sidebar-width: 250px;
  --header-height: 72px;
  --footer-height: 36px;
}


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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  background: var(--color-surface-alt);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: var(--lh-normal);
  font-size: var(--font-md);
}

ul { list-style: none; }
img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--color-accent-hover); }


/* ------------------------------
   TYPOGRAPHY
   ------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

h1 { font-size: var(--font-xl); letter-spacing: -0.5px; }
h2 { font-size: var(--font-lg); letter-spacing: -0.25px; }
h3 { font-size: var(--font-md); }

.text-sm { font-size: var(--font-sm); color: var(--color-text-muted); }
.text-xs { font-size: var(--font-xs); color: var(--color-text-muted); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }


/* Semantic Typography */
.typo-pane-title {
  font-size: var(--font-lg);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.25px;
}

.typo-row-title {
  font-size: var(--font-md);
  font-weight: 500;
  line-height: var(--lh-tight);
}

.typo-row-meta {
  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: var(--lh-tight);
}

.typo-label {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =========================================================
   BLOCK 2 — CATALYST GLOBAL LAYOUT
   ========================================================= */


main,
.workspace {
  min-height: 0;
}

/* ------------------------------
   HEADER
   ------------------------------ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 var(--space-xl);

  background: var(--color-surface);
  color: var(--color-text);

  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);

  height: var(--header-height);
  flex-shrink: 0;
}

header h1 {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

header h1 img {
  border-radius: 12px;
  display: block;
}

/* Tabs inside header */
.nav-tabs {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  background: var(--color-surface-alt);
  padding: 3px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

/* Calendar stripe legend */
.calendar-legend {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 4px var(--space-md);
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  justify-content: center;
}


.cl-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.cl-swatch {
  width: 24px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.cl-timeoff          { background: #94a3b8; }
.cl-timeoff-pending  { background: repeating-linear-gradient(90deg, #f59e0b 0 6px, transparent 6px 10px); }
.cl-holiday          { background: #f87171; }
.cl-cross-portfolio  { background: #a78bfa; }

/* ------------------------------
   USER AVATAR + DROPDOWN
   ------------------------------ */
.user-menu {
  position: relative;
  flex-shrink: 0;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
  -webkit-user-select: none; user-select: none;
}

.user-avatar:hover {
  opacity: 0.88;
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* when showing a photo, hide the accent background */
.user-avatar:has(.user-avatar-img) {
  background: transparent;
  padding: 0;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown-info {
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-dropdown-name {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-plan {
  padding: 6px 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-xs);
}
.plan-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
}
.plan-credits {
  color: var(--color-text-muted);
  font-size: 11px;
}
.plan-credits.warning { color: var(--color-warning); }
.plan-credits.exhausted { color: var(--color-danger); }

.user-dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0;
}

.user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: var(--font-sm);
  color: var(--color-text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.user-dropdown-item:hover {
  background: var(--color-surface-alt);
  color: var(--color-danger, #e53e3e);
}

/* ------------------------------
   FOOTER (Catalyst Surface)
   ------------------------------ */
footer {
  background: var(--color-surface);
  color: var(--color-text-muted);

  text-align: center;
  font-size: var(--font-sm);

  padding: var(--space-sm);
  height: var(--footer-height);

  display: flex;
  align-items: center;
  justify-content: center;

  border-top: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------
   MAIN CONTAINER
   ------------------------------ */
main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;

  height: calc(100vh - var(--header-height) - var(--footer-height));
  overflow: hidden; /* keep horizontal hidden */ 
  

  background: var(--color-surface-alt);
}

/* ------------------------------
   WORKSPACE (3‑column layout)
   ------------------------------ */
.workspace {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;

  width: 100%;
  height: 100%;
  overflow: hidden;
  min-height: 0;

  background: var(--color-surface-alt);
}

/* =========================================================
   LEFT PANE — RESOURCES (20%)
   ========================================================= */

.resources-pane {
  position: relative;
  flex: 0 0 var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;

  background: var(--color-surface);
  border-right: none;
  box-shadow: none;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
}

/* Header inside left pane */
.resources-pane .pane-header {
  flex: 0 0 auto;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  overflow: hidden;
}

/* Scroll container */
.left-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: auto;

  min-height: 0;
  padding: 0;

  background: var(--color-surface-alt);
}


#resourceList {
  flex: 1 1 auto;
  overflow-y: visible;
  min-height: 0;
  padding: 0;
  margin: 0;
}

/* Resource list item */
.resource-item {
  display: flex;
  align-items: center;

  min-height: var(--row-height);
  padding: 0 var(--space-md);

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: none;

  cursor: pointer;
  transition: background 0.15s ease, min-height 0.3s ease, height 0.3s ease;
}

.resource-item:hover {
  background: var(--color-accent-subtle);
}

/* Avatar + name wrapper */
.resource-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Catalyst avatar */
.resource-avatar {
  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--color-accent);
  color: #fff;

  font-size: var(--font-xs);
  font-weight: 600;

  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.resource-avatar.has-photo {
  background: transparent;
}

.resource-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Name styling */
.resource-name {
  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--color-resource-text);
  letter-spacing: -0.2px;
}
/* Resource pane collapsed state — avatars only */
.resources-pane.collapsed {
  flex: 0 0 48px;
  min-width: 48px;
  max-width: 48px;
}
.resources-pane.collapsed .pane-header {
  visibility: hidden;
  pointer-events: none;
}
.resources-pane.collapsed .resource-filter-bar {
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
}
.resources-pane.collapsed .resource-name {
  display: none;
}
.resources-pane.collapsed .resource-item {
  justify-content: center;
  padding: 0;
}
.resources-pane.collapsed .resource-info {
  gap: 0;
}
/* Collapsed: hide number badge, show red ring on avatar instead */
.resources-pane.collapsed .overalloc-badge {
  display: none;
}
.resources-pane.collapsed .resource-item.overallocated .resource-avatar {
  box-shadow: 0 0 0 2px var(--color-danger);
}

/* Edge toggle — vertically centered pill on the right edge */
.resource-edge-toggle {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 36px;
  padding: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-right: none;
  border-radius: 4px 0 0 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.resource-edge-toggle:hover {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}
.resources-pane.collapsed .resource-edge-toggle {
  right: 0;
}
.resources-pane.collapsed .resource-edge-toggle svg {
  transform: rotate(180deg);
}

/* =========================================================
   MIDDLE PANE — CALENDAR
   ========================================================= */

.calendar-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;

  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);

  overflow-x: hidden; 
  overflow-y: auto;
  min-height: 0;
}

.right-body {
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

.calendar-wrapper {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  position: relative;
  background: var(--color-surface-alt);
}

/* =========================================================
   RIGHT PANE — BACKLOG (20%)
   ========================================================= */

.backlog-pane {
  position: relative;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;

  background: var(--color-surface);
  border-left: none;
  box-shadow: none;

  overflow: clip;
  overflow-x: visible;
  min-height: 0;

  transition: flex-basis 0.2s ease, min-width 0.2s ease, max-width 0.2s ease;
}

/* Collapsed state */
.backlog-pane.collapsed {
  flex: 0 0 40px;
  min-width: 40px;
  max-width: 40px;
}

.backlog-pane.collapsed #backlog {
  display: none;
}

.backlog-pane.collapsed .pane-header {
  display: none;
}
.backlog-pane.collapsed .pane-search-bar {
  display: none;
}

/* Edge toggle — vertically centered pill on the left edge */
.backlog-edge-toggle {
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 14px;
  height: 36px;
  padding: 0;

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: none;
  border-radius: 0 4px 4px 0;

  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.backlog-edge-toggle:hover {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}

.backlog-pane.collapsed .backlog-edge-toggle {
  left: 0;
}

.backlog-pane.collapsed .backlog-edge-toggle svg {
  transform: rotate(180deg);
}

#backlog {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: auto;

  min-height: 0;
  padding: 0;
}

.backlog-item {
  height: var(--row-height);
  display: flex;
  align-items: center;

  padding: 0 var(--space-md);
  margin: 0;

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: none;

  font-weight: 500;
  color: var(--color-text);

  transition: background 0.15s ease;
}

.backlog-item:hover {
  background: var(--color-accent-subtle);
}


#backlog .backlog-item:first-child {
  border-top: none;
}

/* =========================================================
   SPLITTER
   ========================================================= */
.splitter {
  width: 8px;
  flex-shrink: 0;
  position: relative;
  cursor: col-resize;
  background: transparent;
}

/* Visible indicator via pseudo-element — no layout reflow on hover */
.splitter::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--color-border);
  border-radius: 2px;
  transition: background 0.08s ease;
}

/* Right splitter: hide idle line (edge toggle provides the visual cue) */
#splitter-right::after {
  background: transparent;
}

.splitter:hover::after,
#splitter-right:hover::after {
  width: 2px;
  background: var(--color-accent);
}

.splitter.dragging::after,
#splitter-right.dragging::after {
  width: 2px;
  background: var(--color-accent);
}

/* =========================================================
   PANE HEADER — CATALYST SURFACE
   ========================================================= */

.pane-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;

  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);

  padding: var(--space-sm) var(--space-lg);

  font-size: var(--font-lg);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.25px;
  color: var(--color-text);

  height: 44px;
  min-height: 44px;
  max-height: 44px;

  overflow: hidden;
}

.pane-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.pane-header-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

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

.pane-header-title,
.pane-header h2 {
  font-size: var(--font-xs);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--color-text);
  margin: 0;
  white-space: nowrap;
}

.pane-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 14px;
  padding: 0 4px;
  margin-right: var(--space-sm);
  border-radius: 3px;
  background: var(--color-accent-subtle);
  color: var(--color-accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
  line-height: 1;
}

.pane-header .actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Compact labeled action buttons (Pull / Push / Export / Sort) */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: var(--font-xs);
  font-weight: 400;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  line-height: 1;
}
.action-label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}
.action-btn:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface-alt);
}

.pane-header-start {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pane-header .icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.pane-header .icon:hover {
  opacity: 1;
}

/* action-btn handles its own sizing; this fallback covers any remaining .btn in pane-headers */
.pane-header .btn:not(.action-btn) {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

/* =========================================================
   BLOCK 3 — CATALYST BUTTONS, TABS, HEADERS, LISTS, CARDS
   ========================================================= */

/* ------------------------------
   BUTTONS (Catalyst Geometry)
   ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);

  font-size: var(--font-sm);
  font-weight: 600;

  cursor: pointer;
  -webkit-user-select: none; user-select: none;

  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Primary button */
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* Secondary button */
.btn-secondary {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-surface-muted);
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--color-surface-muted);
}
.btn-ghost.is-active {
  color: var(--color-accent);
  background: var(--color-accent-subtle);
}

/* Outline button — visible border, no fill */
.btn-outline {
  background: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}
.btn-outline:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
}

/* Danger button */
.btn-danger {
  background: var(--color-danger);
  color: #fff;
  border-color: var(--color-danger);
}
.btn-danger:hover {
  background: #a61d24;
  border-color: #a61d24;
}

/* Small icon button */
.icon-button,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-sm);

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);

  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.icon-button:hover,
.btn-icon:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface-alt);
}

/* ------------------------------
   TABS (Catalyst Style)
   ------------------------------ */
.tab-link {
  padding: 5px var(--space-md);
  border-radius: var(--radius-md);

  background: transparent;
  border: none;

  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  cursor: pointer;

  transition: background 0.15s ease, color 0.15s ease;
}

.tab-link:hover {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

.tab-link.active {
  background: var(--color-surface);
  color: var(--color-accent);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  
}

/* ------------------------------
   PANE HEADERS (Catalyst Surface)
   ------------------------------ */
.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  background: var(--color-surface);
  padding: var(--space-sm) var(--space-lg);

  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);

  flex: 0 0 auto;
  min-height: 44px;
}

.pane-header h2 {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
  line-height: var(--lh-tight);
}

.pane-header .actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.pane-header .icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}
.pane-header .icon:hover {
  opacity: 1;
}



/* ------------------------------
   LIST ITEMS (Catalyst Neutral)
   ------------------------------ */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  height: var(--row-height);
  display: flex;
  align-items: center;

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: none;

  transition: background 0.15s ease, box-shadow 0.15s ease;
}

li:last-child {
  border-bottom: 1px solid var(--color-border);
}

li:hover {
  background: var(--color-accent-subtle);
  box-shadow: var(--shadow-sm);
}

/* Utility titles */
.left-title,
.task-title {
  font-weight: 600;
  margin: 0;
  font-size: var(--font-md);
  color: var(--color-text);
}

/* Sort icon */
.sort-button {
  cursor: pointer;
  width: 20px;
  height: 20px;
}

/* ------------------------------
   TASK CARD (Catalyst Card)
   ------------------------------ */
.task-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;

  padding: var(--space-sm) var(--space-md);

  cursor: grab;

  transition: background 0.15s ease;
}

.task-card:hover {
  background: var(--color-accent-subtle);
}

.task-card.drag-over {
  outline: 2px dashed var(--color-accent);
  background: rgba(9, 105, 218, 0.05);
}

.task-card-header {
  display: flex;
  align-items: center;
  gap: 4px;
}
.task-card-priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-card-assignee-inline {
  margin-left: auto;
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.task-card-assignee-inline.unassigned {
  font-style: italic;
  opacity: 0.6;
}
.task-card.select-mode {
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.task-card.select-mode:hover {
  border-color: var(--color-accent);
}
.task-card.select-mode.selected {
  border-color: var(--color-accent);
  background: var(--color-accent-subtle);
  box-shadow: inset 3px 0 0 var(--color-accent);
}
.backlog-sort-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--color-text-muted);
}
.backlog-sort-select {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.backlog-sort-select:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface-alt);
}
.backlog-sort-dir {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 11px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.backlog-sort-dir:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface-alt);
}
.backlog-bulk-actions {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background: var(--color-accent-subtle);
  border-bottom: 1px solid var(--color-border);
}
.bulk-btn {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 8px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.bulk-btn:disabled { opacity: 0.4; cursor: default; }
.bulk-btn-schedule { background: var(--color-accent); color: #fff; }
.bulk-btn-schedule:hover:not(:disabled) { opacity: 0.9; }
.bulk-btn-remove { background: var(--color-danger); color: #fff; }
.bulk-btn-remove:hover:not(:disabled) { opacity: 0.9; }
.bulk-btn-cancel { background: var(--color-surface); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.bulk-btn-cancel:hover { border-color: var(--color-accent); }

/* Searchable resource picker (bulk schedule dialog) */
.resource-picker {
  position: relative;
  margin-bottom: 12px;
}
.resource-picker-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  box-sizing: border-box;
}
.resource-picker-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-accent-subtle);
}
.resource-picker-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 180px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 10;
  margin-top: 2px;
}
.resource-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}
.resource-picker-option:hover {
  background: var(--color-accent-subtle);
}
.resource-picker-option.active {
  background: var(--color-accent-subtle);
  font-weight: 600;
}
.resource-picker-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.resource-picker-name {
  color: var(--color-text);
}

.task-card-header a {
  font-size: var(--font-sm);
  font-weight: 600;
}

.task-card-type-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.task-card-sprint {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.task-card-summary {
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-assignee {
  margin-top: 2px;
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   BLOCK 4 — CATALYST DAILY CALENDAR
   ========================================================= */

/* Calendar wrapper */
.calendar-wrapper {
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}


/* Calendar header */
.calendar-header {
  display: grid;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  grid-auto-columns: var(--day-width);

  background: var(--color-surface);
  box-shadow: inset 0 -2px 0 var(--color-border);

  position: sticky;
  top: 0;
  z-index: 10;
}

/* Month cells */
.month {
  font-size: var(--font-sm);
  font-weight: 600;

  background: var(--color-accent);
  color: #fff;

  padding: var(--space-xs) 0;

  /* allow inner label to sticky-scroll within this cell's bounds */
  overflow: visible;
  display: flex;
  align-items: center;
}

.month-text {
  position: sticky;
  left: 4px;
  padding: 0 4px;
  white-space: nowrap;
}

.month:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}

/* Month-start day — stronger left border to mark the boundary */
.day.is-month-start {
  border-left: 2px solid var(--color-border);
}

/* ── Calendar zoom toggle ────────────────────────────────────────────── */

.zoom-toggle {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-left: var(--space-sm);
}

.zoom-btn {
  padding: 2px 10px;
  font-size: var(--font-xs);
  font-weight: 400;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1.6;
  transition: background 0.15s ease, color 0.15s ease;
}

.zoom-btn.active {
  background: var(--color-accent);
  color: #fff;
  font-weight: 500;
}

.zoom-btn:hover:not(.active) {
  background: var(--color-accent-subtle);
}

/* ── Week-mode header ────────────────────────────────────────────────── */

.calendar-header.week-mode .week-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 2px 0;
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: var(--color-surface);
  white-space: nowrap;
  overflow: hidden;
}

/* Day cells */
.day {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--color-text-muted);

  padding: 2px 0;
  border: none;
  border-right: 1px solid rgba(0, 0, 0, 0.06);

  background: var(--color-surface);
  white-space: nowrap;
  overflow: hidden;
}

/* Weekend */
.day.weekend {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text-muted);
}
[data-theme="dark"] .day.weekend {
  background: rgba(255, 255, 255, 0.10);
}

/* Today highlight */
.day.today {
  background: var(--color-warning);
  border: 2px solid var(--color-danger);
  font-weight: 700;
}

/* Calendar body */
.calendar-body {
  display: grid;
  grid-auto-rows: minmax(var(--row-height), auto);
  position: relative;
}

/* Resource rows */
.resource-row {
  position: relative;
  min-height: var(--row-height);

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: none;

  overflow: hidden;
  transition: height 0.3s ease, min-height 0.3s ease;
}

.resource-row:last-child {
  border-bottom: 1px solid var(--color-border);
}

/* Drag-over */
.resource-row.drag-over {
  background-color: rgba(9, 105, 218, 0.08);
  outline: 2px dashed var(--color-accent);
}

/* Time-off stripes */
.timeoff-stripe {
  position: absolute;
  height: 2px;
  background: #94a3b8;  /* slate grey — settled, plan around it */
  opacity: 0.9;
  pointer-events: auto;
  z-index: 1;
  cursor: default;
}

.timeoff-stripe--pending {
  background: repeating-linear-gradient(
    90deg,
    #f59e0b 0px,
    #f59e0b 6px,
    transparent 6px,
    transparent 10px
  );
  opacity: 0.95;
}

[data-theme="dark"] .day,
[data-theme="dark"] .calendar-header.week-mode .week-label {
  border-right-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .timeoff-stripe {
  background: #64748b;  /* darker slate for dark mode */
  opacity: 0.7;
}

[data-theme="dark"] .timeoff-stripe--pending {
  background: repeating-linear-gradient(
    90deg,
    #f59e0b 0px,
    #f59e0b 6px,
    transparent 6px,
    transparent 10px
  );
  opacity: 0.6;
}

/* Public holiday stripes (stacked below time-off stripes) */
.holiday-stripe {
  position: absolute;
  height: 2px;
  background: #f87171;  /* coral red — hard constraint, plan around it */
  opacity: 0.85;
  pointer-events: auto;
  z-index: 1;
  cursor: default;
}

[data-theme="dark"] .holiday-stripe {
  background: rgba(248, 113, 113, 0.5);
  opacity: 1;
}

/* Cross-portfolio capacity stripe (below holiday) */
.cross-portfolio-stripe {
  position: absolute;
  height: 2px;
  background: #a78bfa;  /* purple — external claim on this resource */
  opacity: 0.85;
  pointer-events: auto;
  z-index: 1;
  cursor: default;
}

[data-theme="dark"] .cross-portfolio-stripe {
  background: rgba(167, 139, 250, 0.5);
  opacity: 1;
}

/* Cross-portfolio allocation bars (read-only, muted) */
.cross-portfolio-bar {
  position: absolute;
  top: 10px;
  height: calc(var(--bar-height) - 4px);
  background: var(--color-border);
  border: 1px dashed var(--color-border-strong);
  border-radius: 3px;
  opacity: 0.55;
  z-index: 1;
  pointer-events: auto;
  cursor: default;
  font-size: 9px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 4px;
  line-height: calc(var(--bar-height) - 8px);
}
[data-theme="dark"] .cross-portfolio-bar {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Overallocation indicators (below time-off 0–5px and holiday 5–10px stripes) */
.overalloc-day {
  display: none;
}

.overalloc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: var(--radius-full);
  background: var(--color-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
  cursor: default;
  line-height: 1;
}

/* Overallocation indicator stripe on individual bars */
.bar-overalloc-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-danger);
  border-radius: 2px 2px 0 0;
  z-index: 2;
  pointer-events: none;
}

/* Allocation bar */
.allocation-bar {
  position: absolute;
  top: calc((var(--row-height) - var(--bar-height)) / 2);

  height: var(--bar-height);

  display: flex;
  align-items: center;
  justify-content: center;

  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-accent-hover)
  );

  border-radius: 3px;
  color: #fff;

  font-size: calc(var(--bar-height) * 0.32);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;

  box-shadow: var(--shadow-md);
  cursor: pointer;

  transition: transform 0.15s ease, opacity 0.15s ease;
}

.allocation-bar:hover {
  transform: scale(1.02);
}

.allocation-bar.dragging {
  opacity: 0.6;
  border: 2px dashed var(--color-text);
}

.allocation-bar.resizing {
  transform: none;
  transition: none;
}

.allocation-bar.bar-filtered {
  opacity: 0.12;
  filter: grayscale(0.6);
  pointer-events: none;
}

/* Week-mode bars — smaller text, clipped, thinner resize handles */
#calendarBody.week-mode .allocation-bar {
  font-size: 7px;
  padding: 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#calendarBody.week-mode .resize-handle {
  width: 3px;
}

/* Delta poller "Reconnecting…" banner (ADR-039 Phase 5). Shown after 4+
   consecutive poll failures; hidden on the next successful poll. Sits
   fixed at the top of the viewport below any account-status banner. */
.delta-poller-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  padding: 8px 16px;
  background: var(--color-warning, #f59e0b);
  color: #111;
  font-size: var(--font-sm, 12px);
  font-weight: 500;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Delta pulse — 0.8s outline animation on tasks just patched from the
   mutation response or a delta poll (ADR-039 Phase 4). No layout cost
   (outline + box-shadow, no positioning). */
@keyframes delta-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(91, 115, 245, 0.80); }
  50%  { box-shadow: 0 0 0 4px rgba(91, 115, 245, 0.30); }
  100% { box-shadow: 0 0 0 8px rgba(91, 115, 245, 0.00); }
}
.delta-pulse {
  animation: delta-pulse 0.8s ease-out;
}

/* Progress fill — full-height white tint overlay visible on any bar colour */
.bar-progress {
  position: absolute;
  top: 30%;
  left: 0;

  height: 40%;
  background: rgba(255, 255, 255, 0.3);
  border-right: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px 0 0 2px;

  width: 0%;
  transition: width 0.3s ease;
}

/* Resize handles */
.resize-handle {
  position: absolute;
  top: 0;

  width: 6px;
  height: 100%;

  background: rgba(0,0,0,0.15);
  cursor: ew-resize;

  z-index: 10;
  transition: background 0.15s ease;
}

.resize-handle:hover {
  background: rgba(0,0,0,0.25);
}

.resize-handle.left {
  left: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.resize-handle.right {
  right: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Month boundary separator line through calendar rows */
.month-separator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed rgba(99, 143, 217, 0.45);
  z-index: 1;
  pointer-events: none;
}

/* Sprint boundary markers */
.sprint-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  margin-left: 0;
  border-left: 1.5px solid var(--color-accent); /* colour overridden per-sprint by JS */
  z-index: 2;
  pointer-events: auto;
  cursor: default;
}

.sprint-marker-label {
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--color-accent); /* overridden per-sprint by JS */
  opacity: 0.7;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1;
}

/* Today vertical line */
.today-line {
  position: absolute;
  top: 0;
  bottom: 0;

  border-left: 2px dashed var(--color-danger);
  z-index: 20;
}

/* Tooltip */
.tooltip {
  position: fixed;
  pointer-events: none;

  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-top: 2.5px solid var(--color-accent);
  border-radius: var(--radius-md);

  padding: 9px 12px 10px;
  white-space: normal;
  max-width: 260px;

  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13), 0 1px 4px rgba(0, 0, 0, 0.07);
  z-index: 9999;

  display: none;
}

.tooltip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 5px;
}

.tooltip-title img {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.tooltip-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 5px;
  margin-top: 1px;
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}
.tooltip-row:last-child { margin-bottom: 0; }
.tooltip-row img {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

.tooltip-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-top: 5px;
  margin-bottom: 2px;
}

/* Positioning context */
#calendarBody {
  position: relative;
}

/* =========================================================
   BLOCK 5 — CATALYST YEARLY RESOURCE CALENDAR (MODERNIZED)
   ========================================================= */

/* Resource Calendar tab — fill viewport */
#resource-calendar {
  height: 100%;
  overflow: hidden;
}
#resource-calendar .rc-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Header row inside Resource Calendar tab */
.rc-body .pane-header.resource-calendar-header {
  justify-content: space-between;
  min-height: 44px;
  flex-shrink: 0;
  gap: 0;
}

/* Inline legend in header */
.rc-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: center;
  padding: 0 16px;
}
.rc-legend .legend-item { font-size: 10px; color: var(--color-text-muted); gap: 4px; }
.rc-legend .legend-swatch { width: 10px; height: 10px; }

/* Import status */
.rc-import-status { font-size: var(--font-xs); color: var(--color-text-muted); white-space: nowrap; }
.rc-import-label { color: var(--color-text-muted); }

/* Compact dropdowns */
.resource-calendar-select,
.resource-calendar-year {
  padding: 3px 24px 3px 8px;
  font-size: var(--font-xs);
  font-weight: 400;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 8 10 12 14 8'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
}

.resource-calendar-select {
  min-width: 150px;
}

.resource-calendar-select:hover,
.resource-calendar-year:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background: var(--color-surface-alt);
}

.resource-calendar-select:focus,
.resource-calendar-year:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Selected resource label */
.resource-calendar-selected {
  margin-left: auto;

  font-size: var(--font-sm);
  color: var(--color-accent);
  font-weight: 500;

  padding: var(--space-xs) var(--space-sm);

  background: var(--color-accent-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-accent);

  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* Hidden until selection */
#resourceCalendarGrid {
  display: none;
}

/* 12‑month grid container */
.resource-calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-surface-alt);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* Month block */
.month-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);

  padding: 16px var(--space-sm) var(--space-sm);
  overflow: hidden;

  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;

  transition: background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.month-block:hover {
  background: var(--color-surface-alt);
  box-shadow: var(--shadow-md);
}

/* Month title */
.month-title {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.3px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

/* Days grid */
.month-days,
.month-block .days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 8px;
  align-content: start;
  align-items: start;
}

/* Day-of-week header labels */
.month-block .day-header {
  font-size: calc(var(--font-xs) - 1px);
  font-weight: 700;
  color: var(--color-text-muted);
  text-align: center;
  padding: 3px 0 8px;
}

/* Filler cells that offset the 1st to the correct weekday column */
.month-block .day-filler {
  background: transparent;
  border: none;
}

/* Resource calendar day cell */
.month-block .day-cell {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;

  padding: 4px 2px;
  font-size: var(--font-xs);
  color: var(--color-text);
  text-align: center;
  cursor: default;
  -webkit-user-select: none; user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Conflict dot — allocated day that also has vacation or public holiday */
.month-block .day-cell.conflict::after {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.month-block .day-cell:hover {
  background: var(--color-accent-subtle);
  border-color: var(--color-accent);
}

/* Weekend */
.day-cell.weekend,
.month-block .day-cell.weekend {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text-muted);
}
[data-theme="dark"] .day-cell.weekend,
[data-theme="dark"] .month-block .day-cell.weekend {
  background: rgba(255, 255, 255, 0.10);
}

/* Public holiday */
.public-holiday,
.month-block .day-cell.holiday {
  background: #ffecec;
  border-color: #ffb3b3;
  color: #b30000;
  font-weight: 600;
}

/* Vacation — approved (confirmed) */
.vacation-day,
.month-block .day-cell.vacation {
  background: #e0f7e9;
  border-color: #9ad7b3;
  color: #1b6b3a;
  font-weight: 600;
}

/* Vacation — pending (awaiting approval) */
.month-block .day-cell.vacation-pending {
  background: #fff8e1;
  border-color: #ffd54f;
  color: #b45309;
  font-weight: 600;
}

/* Calendar legend */
.calendar-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 7px 16px;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid;
  flex-shrink: 0;
}
.swatch-weekend  { background: var(--color-surface-alt); border-color: var(--color-border); }
.swatch-holiday  { background: #fecaca; border-color: #f87171; }
.swatch-vacation { background: #e2e8f0; border-color: #94a3b8; }
.swatch-pending  { background: #fef3c7; border-color: #f59e0b; }
.swatch-allocated{ background: var(--color-accent); border-color: var(--color-accent-hover); }
.swatch-conflict {
  background: var(--color-accent);
  border-color: var(--color-accent-hover);
  position: relative;
}
.swatch-conflict::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.legend-conflict-label { color: var(--color-danger); }
.swatch-overloaded { background: var(--color-danger); border-color: #dc2626; }

[data-theme="dark"] .swatch-holiday    { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.25); }
[data-theme="dark"] .swatch-vacation   { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.25); }
[data-theme="dark"] .swatch-overloaded { background: rgba(239,68,68,0.75);   border-color: rgba(239,68,68,1); }
[data-theme="dark"] .swatch-pending  { background: rgba(251,191,36,0.12);  border-color: rgba(251,191,36,0.25); }

/* Allocation highlight */
.allocation-day,
.month-block .day-cell.allocated {
  background-color: var(--color-accent);
  border-color: var(--color-accent-hover);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-md);
}

/* Conflict — task allocated during leave or public holiday */
.month-block .day-cell.conflict {
  color: #ffb3b3;
}

/* Overloaded — multiple allocations on the same day */
.month-block .day-cell.overloaded {
  background-color: var(--color-danger);
  border-color: #dc2626;
  color: #fff;
}

/* =========================================================
   BLOCK 6 — CATALYST BACKLOG (TASK LIST, CARDS, DRAG/DROP)
   ========================================================= */

/* Backlog scroll container */
#backlog {
  background: var(--color-surface-alt);
  padding: var(--space-md);

  overflow-y: auto;

  border-left: 1px solid var(--color-border);
}


/* ── Backlog project groups ─────────────────────────────────────────────────── */

.backlog-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-xs);
}

.backlog-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Pull header to full width, compensating for #backlog padding */
  margin: 0 calc(-1 * var(--space-md));
  padding: 4px var(--space-md);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  position: sticky;
  top: calc(-1 * var(--space-md));
  z-index: 1;
}

.backlog-group:first-child .backlog-group-header {
  border-top: none;
  margin-top: calc(-1 * var(--space-md));
}

.backlog-group-toggle {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-text-muted);
  line-height: 1;
}

.backlog-group-name {
  flex: 1;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-accent);
}

.backlog-group-count {
  font-size: 10px;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

/* Epic sub-groups within project groups */
.backlog-epic-header {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--space-sm) 3px calc(var(--space-sm) + 4px);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  color: var(--color-text-muted);
  font-size: 11px;
  border-top: 1px solid var(--color-border);
  margin-top: 2px;
}
.backlog-epic-header:first-child { border-top: none; margin-top: 0; }
.backlog-epic-header:hover { color: var(--color-text); }
.backlog-epic-name {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.backlog-epic-chevron {
  flex-shrink: 0;
  transition: transform 0.15s;
}
.backlog-epic-chevron.collapsed {
  transform: rotate(-90deg);
}

.backlog-group-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
}

.backlog-group-body[hidden] {
  display: none;
}

/* ------------------------------
   TASK CARD (Catalyst Card)
   ------------------------------ */
.task-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;

  padding: var(--space-sm) var(--space-md);

  cursor: grab;

  transition: background 0.15s ease;
}

.task-card:hover {
  background: var(--color-accent-subtle);
}

/* Drag-over state */
.task-card.drag-over {
  outline: 2px dashed var(--color-accent);
  background: rgba(9, 105, 218, 0.05);
}

/* Task title */
.task-card .task-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text);
}

/* Task metadata */
.task-card .task-meta {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

/* ------------------------------
   DROP INDICATOR (vertical line)
   ------------------------------ */
.drop-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  border-left: 2px dotted var(--color-accent);
  pointer-events: none;
  z-index: 1000;
}

/* =========================================================
   BLOCK 7 — CATALYST MODAL, FORMS, EFFORT BLOCKS, SLIDER
   ========================================================= */

/* ------------------------------
   MODAL BACKDROP
   ------------------------------ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 34, 60, 0.50);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  z-index: 1000;
  transition: opacity 0.25s ease;
}

/* ------------------------------
   MODAL CONTAINER
   ------------------------------ */
.modal-content {
  position: relative;
  background: var(--color-surface);
  margin: auto;
  margin-top: 8vh;

  padding: var(--space-xl);
  width: 800px;
  max-width: 90%;

  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);

  animation: fadeInUp 0.3s ease;
}

/* Modal title */
.modal-content h2 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);

  font-size: var(--font-xl);
  font-weight: 600;
  color: var(--color-text);

  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  padding-right: 40px;

  border-bottom: 1px solid var(--color-border);
}

.modal-content h2 img {
  flex-shrink: 0;
}

/* Close button */
.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.modal-close:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

/* ------------------------------
   FORM LAYOUT
   ------------------------------ */
#taskForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Form labels */
#taskForm label {
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

/* Text inputs */
#taskForm input[type="text"],
#taskForm input[type="date"],
#taskForm input[type="number"] {
  width: 100%;
  padding: var(--space-sm) var(--space-md);

  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);

  font-size: var(--font-md);
  background: var(--color-surface);

  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#taskForm input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent) 25%, transparent);
  outline: none;
}

/* Jira link */
.jira-link {
  font-size: var(--font-sm);
  color: var(--color-accent);
  font-weight: 500;
  white-space: nowrap;
}
.jira-link:hover {
  text-decoration: underline;
}

/* ------------------------------
   FORM ROWS
   ------------------------------ */
.form-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.form-row label {
  min-width: 140px;
}

.form-row input,
.form-row a,
.form-row span {
  flex: 1;
}

/* ------------------------------
   PROGRESS SLIDER
   ------------------------------ */
#modalProgress {
  width: 80%;
  accent-color: var(--color-accent);
}

#progressValue {
  font-weight: 600;
  margin-left: var(--space-sm);
}

/* ------------------------------
   EFFORT BLOCKS
   ------------------------------ */
.effort-blocks {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.effort-block {
  flex: 1;

  background: var(--color-surface-alt);
  padding: var(--space-md);

  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);

  box-shadow: var(--shadow-sm);
}

.effort-block h3 {
  font-size: var(--font-md);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

/* ------------------------------
   MODAL FOOTER
   ------------------------------ */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* ------------------------------
   READONLY POINTER-EVENTS
   ------------------------------ */
#modalActualEffort {
  pointer-events: none;
}

/* ------------------------------
   MODAL ANIMATION
   ------------------------------ */
@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   BLOCK 8 — CATALYST UTILITIES, SCROLLBARS, OVERRIDES
   ========================================================= */

/* ------------------------------
   GLOBAL SCROLLBAR — HIDDEN
   Scrolling still works; bars are just not rendered.
   ------------------------------ */
::-webkit-scrollbar {
  display: none;
}

/* scrollbar-width intentionally omitted — Chrome 121+ treats it as canonical and
   ignores all ::-webkit-scrollbar overrides when set on *, breaking the calendar exception. */

/* ------------------------------
   CALENDAR HORIZONTAL SCROLLBAR
   Vertical stays hidden; horizontal shown as a subtle pill.
   ------------------------------ */
.calendar-wrapper::-webkit-scrollbar:horizontal {
  display: block;
  height: 8px;
}

.calendar-wrapper::-webkit-scrollbar-track:horizontal {
  background: transparent;
}

.calendar-wrapper::-webkit-scrollbar-thumb:horizontal {
  background: transparent;
  border-radius: 10px;
  min-width: 40px;
}

.calendar-wrapper.scrollbar-visible::-webkit-scrollbar-thumb:horizontal {
  background: rgba(100, 100, 100, 0.35);
}

.calendar-wrapper.scrollbar-visible::-webkit-scrollbar-thumb:horizontal:hover {
  background: rgba(100, 100, 100, 0.65);
}

/* ------------------------------
   UTILITY CLASSES
   ------------------------------ */
.hidden { display: none !important; }
.no-select { -webkit-user-select: none; user-select: none; }

.text-ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-column { display: flex; flex-direction: column; }

/* ------------------------------
   FINAL OVERRIDES & FIXES
   ------------------------------ */
.calendar-header { z-index: 20; }
.today-line { z-index: 15; }
.allocation-bar { z-index: 5; }

.pane-header { overflow: visible; z-index: 100; }

.splitter {
  min-width: 8px;
  max-width: 8px;
}

.resources-pane,
.calendar-pane,
.backlog-pane,
.calendar-wrapper,
#backlog {
  min-height: 0;
}

.tooltip { z-index: 9999; }

/* =========================================================
   LOGIN SCREEN — CATALYST STYLE
   ========================================================= */
#loginScreen {
  display: none;
}

.login-screen {
  position: fixed;
  inset: 0;
  background: var(--color-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  background: var(--color-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  width: min(380px, 90vw);
  overflow: hidden;
}

/* Branding header — logo + tagline, vertically centred */
.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 200px;
  padding: var(--space-2xl) var(--space-xl);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.login-logo {
  display: block;
  width: 120px;
  height: auto;
}

.login-tagline {
  font-family: 'DM Serif Display', serif;
  font-size: var(--font-md);
  font-weight: 400;
  font-style: normal;
  background: linear-gradient(135deg, var(--color-accent) 0%, #818cf8 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  margin: 8px 0 0;
  letter-spacing: 0.03em;
}

/* "by Belesio SCS" — parent-company attribution under the login logo */
.login-company {
  text-align: center;
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Form body */
.login-body {
  padding: var(--space-lg) var(--space-xl) var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  text-align: left;
}

#loginFields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.login-card .form-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-xs);
}

.login-card label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-align: left;
}

.login-card input {
  width: 100%;
  padding: 9px var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: var(--font-md);
  color: var(--color-text);
  background: var(--color-surface);
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-card input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.login-btn {
  width: 100%;
  padding: 10px var(--space-sm);
  font-size: var(--font-md);
  font-weight: 600;
  margin-top: var(--space-xs);
}

.login-error {
  color: var(--color-danger);
  font-size: var(--font-sm);
  text-align: center;
  min-height: 20px;
}

/* =========================================================
   Effort Modal — Catalyst Enhanced + Motion + Shake
   ========================================================= */

.actual-effort-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modal-fade-in 0.18s ease-out;
}

.actual-effort-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 34, 60, 0.50);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.actual-effort-dialog {
  position: relative;
  background: var(--color-surface);
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  border-top: 3px solid var(--color-accent);
  width: 340px;

  box-shadow: var(--shadow-lg);

  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 16px;

  animation: modal-scale-in 0.18s ease-out;
}

.actual-effort-header {
  position: relative;
}

.actual-effort-dialog h3 {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text);
}

.actual-effort-desc {
  margin: 0;
  font-size: var(--font-sm);
  color: var(--color-text-muted);
}

#actual-effort-input {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: var(--font-md);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.15s ease;
}

#actual-effort-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(91, 115, 245, 0.2);
}

.actual-effort-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}


.hidden {
  display: none !important;
}

/* Animations */
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-scale-in {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Shake animation */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.3s ease;
}


/* ── Icon + label button variant ─────────────────────────────────────────── */
.btn-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-xs);
  white-space: nowrap;
}

/* ── Time-off import status ───────────────────────────────────────────────── */
.timeoff-sync-status {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ── Push to Jira — toolbar badge ───────────────────────────────────────── */
.push-btn-wrap {
  position: relative;
  display: inline-flex;
}

.push-dirty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  background: var(--color-warning);
  color: #fff;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-sizing: border-box;
}

/* ── Change Password Modal ───────────────────────────────────────────────── */
.cp-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-modal.hidden {
  display: none;
}

.cp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 34, 60, 0.50);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}

.cp-dialog {
  position: relative;
  z-index: 1;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 400px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-scale-in 0.15s ease;
  border-top: 3px solid var(--color-accent);
}

.cp-dialog.cp-first-time {
  width: 440px;
  border-top: none;
  box-shadow: 0 8px 40px rgba(91, 115, 245, 0.12), var(--shadow-lg);
}

.cp-header {
  position: relative;
  padding: var(--space-xl) var(--space-xl) 0;
}

.cp-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-title-group svg {
  flex-shrink: 0;
  color: var(--color-accent);
}

.cp-header h3 {
  margin: 0;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text);
}

.cp-body {
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Form rows stack label above input, matching the login card */
.cp-body .form-row {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-xs);
}

.cp-body .form-row label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text);
}

.cp-field-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cp-field-wrap input {
  width: 100%;
  padding: var(--space-sm);
  padding-right: 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-md);
  box-sizing: border-box;
}

.cp-field-wrap input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.cp-eye-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  line-height: 0;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}

.cp-eye-btn:hover {
  color: var(--color-accent);
}

/* Eye icon visibility — only one icon shown at a time */
.cp-eye-hide { display: none; }
.cp-eye-btn.is-visible .cp-eye-show { display: none; }
.cp-eye-btn.is-visible .cp-eye-hide { display: block; }

.cp-hint {
  display: block;
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.cp-error {
  margin-top: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--color-danger) 8%, transparent);
  color: var(--color-danger);
  border: 1px solid color-mix(in srgb, var(--color-danger) 25%, transparent);
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
}

.cp-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 0 var(--space-xl) var(--space-xl);
}

.cp-footer .btn-primary {
  width: 100%;
  padding: var(--space-sm);
  font-size: var(--font-md);
}

.cp-footer .btn-ghost {
  width: 100%;
  font-size: var(--font-md);
}

/* ── Welcome banner (first-time password setup) ────────────────────────── */

.cp-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
  margin-bottom: var(--space-sm);
  background: linear-gradient(180deg, var(--color-accent-subtle) 0%, transparent 100%);
  border-radius: var(--radius-md);
}

.cp-welcome-logo {
  display: block;
  height: 56px;
  margin-bottom: var(--space-lg);
}

.cp-welcome-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.cp-welcome-org {
  display: inline-block;
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-subtle);
  padding: 3px 14px;
  border-radius: var(--radius-full);
  margin: 0 0 16px;
}

.cp-welcome-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin: 0;
  max-width: 320px;
}

.cp-welcome-hint strong {
  color: var(--color-text);
  font-weight: 600;
}

.cp-next-hint {
  font-size: var(--font-xs);
  color: var(--color-accent);
  font-weight: 500;
  text-align: center;
  margin: 6px 0 0;
  opacity: 0.75;
}

/* ── Forgot password in login card ──────────────────────────────────────── */
.forgot-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--color-border-strong);
  font-size: var(--font-xs);
  cursor: pointer;
  text-align: center;
  padding: 2px 0;
}

.forgot-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.forgot-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.forgot-heading {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.forgot-msg {
  font-size: var(--font-xs);
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 8px 12px;
  margin-top: var(--space-xs);
}

.forgot-msg--error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.forgot-back {
  display: block;
  background: none;
  border: none;
  color: var(--color-border-strong);
  font-size: var(--font-xs);
  cursor: pointer;
  margin-top: var(--space-xs);
  padding: 0;
  text-align: left;
}

.forgot-back:hover {
  color: var(--color-accent);
}

/* ── Resource multi-select filter ────────────────────────────────────────── */
.resource-filter-bar {
  flex: 0 0 auto;
  padding: 4px var(--space-sm);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

/* Pane search bars (resource + backlog) */
.pane-search-bar {
  flex: 0 0 auto;
  padding: 4px var(--space-sm);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.pane-search {
  width: 100%;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s;
}
.pane-search:focus {
  border-color: var(--color-accent);
}
.pane-search::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}
.pane-search-sticky {
  position: sticky;
  top: 0;
  z-index: 1;
}

.resource-filter-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: left;
}

.resource-filter-btn:hover {
  border-color: var(--color-accent);
}

.resource-filter-panel {
  position: absolute;
  top: calc(100% - 4px);
  left: var(--space-sm);
  right: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px 0;
}

.resource-filter-sep {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

.resource-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: var(--font-xs);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
}

.resource-filter-option:hover {
  background: var(--color-accent-subtle);
}

.resource-filter-option input[type="checkbox"] {
  margin: 0;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.resource-filter-all {
  font-weight: 500;
}
.resource-filter-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 0;
}
.resource-filter-actions .resource-filter-all {
  flex: 1;
}
.rf-action-btn {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.rf-action-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.resource-filter-group-label {
  padding: 6px 10px 2px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-accent);
}

.resource-filter-search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 8px;
  background: var(--color-surface);
}

/* Issue type display in task modal */
/* Issue key + project on one row */
.modal-id-row {
  align-items: flex-start;
  gap: var(--space-md);
}

.modal-id-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.modal-id-group label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.modal-id-group input {
  width: 100%;
}

.modal-issue-type {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  font-size: var(--font-sm);
  min-height: 36px;
  flex: 1;
}

.modal-issue-type img {
  flex-shrink: 0;
}

/* Readonly inputs — visually muted, no interaction affordance */
input[readonly], textarea[readonly] {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  cursor: default;
  border-color: var(--color-border);
}

/* ── Dark theme ────────────────────────────────────────────────────────────── */

[data-theme="dark"] {
  /* Core surfaces */
  --color-surface:       #16192b;
  --color-surface-alt:   #1e2235;
  --color-surface-muted: #262b44;

  /* Borders */
  --color-border:        #30375a;
  --color-border-strong: #464f7a;

  /* Text */
  --color-text:          #e2e5f1;
  --color-text-muted:    #8892b8;
  --color-text-light:    #5c6490;
  --color-resource-text: #adb5d9;

  /* Accent — slightly lighter for readability on dark surfaces */
  --color-accent:        #7b8ff7;
  --color-accent-hover:  #6b7ef5;
  --color-accent-subtle: #1f2347;

  /* Shadows — deeper on dark backgrounds */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4),  0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.4);
}

/* Password modal error / success banners */
[data-theme="dark"] .forgot-msg {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
}
[data-theme="dark"] .forgot-msg--error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

/* Calendar day type cells */
[data-theme="dark"] .public-holiday,
[data-theme="dark"] .month-block .day-cell.holiday {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
[data-theme="dark"] .vacation-day,
[data-theme="dark"] .month-block .day-cell.vacation {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
[data-theme="dark"] .month-block .day-cell.vacation-pending {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
  color: #fcd34d;
}
[data-theme="dark"] .month-block .day-cell.overloaded {
  background-color: rgba(239, 68, 68, 0.75);
  border-color: rgba(239, 68, 68, 1);
  color: #fff;
}

/* ── Theme picker (settings General tab) ──────────────────────────────────── */

.theme-picker {
  display: flex;
  gap: 16px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.theme-card input[type="radio"] {
  display: none;
}

.theme-card-preview {
  width: 88px;
  height: 60px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.theme-card:hover .theme-card-preview {
  border-color: var(--color-border-strong);
}

.theme-card input[type="radio"]:checked + .theme-card-preview {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.theme-card-label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  font-weight: 500;
}

.theme-card input[type="radio"]:checked ~ .theme-card-label {
  color: var(--color-accent);
  font-weight: 600;
}

/* Light theme preview — hardcoded so it always shows light colours */
.theme-preview-light { background: #f4f5f9; }
.theme-preview-light .tp-header {
  height: 16px;
  background: #5B73F5;
  flex-shrink: 0;
}
.theme-preview-light .tp-body {
  flex: 1;
  background: #ffffff;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.theme-preview-light .tp-line {
  height: 3px;
  background: #dde1ee;
  border-radius: 2px;
}
.theme-preview-light .tp-bar {
  height: 7px;
  width: 58%;
  background: #5B73F5;
  border-radius: 3px;
}

/* Dark theme preview — hardcoded so it always shows dark colours */
.theme-preview-dark { background: #1e2235; }
.theme-preview-dark .tp-header {
  height: 16px;
  background: #16192b;
  border-bottom: 1px solid #30375a;
  flex-shrink: 0;
}
.theme-preview-dark .tp-body {
  flex: 1;
  background: #16192b;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.theme-preview-dark .tp-line {
  height: 3px;
  background: #30375a;
  border-radius: 2px;
}
.theme-preview-dark .tp-bar {
  height: 7px;
  width: 58%;
  background: #7b8ff7;
  border-radius: 3px;
}

/* ── Project filter ──────────────────────────────────────────────────────── */
.project-filter-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.project-filter-label {
  font-size: var(--font-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Icon-only filter button */
.project-filter-icon {
  position: relative;
  color: var(--color-text-muted);
  transition: color 0.12s;
}
.project-filter-icon:hover {
  color: var(--color-text);
}
.project-filter-icon.active {
  color: var(--color-accent);
}

/* Active-filter indicator dot */
.filter-active-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

.project-filter-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  min-width: 150px;
  padding: 4px 0;
}

.pfp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--font-sm);
  color: var(--color-text);
  text-align: left;
  border-radius: 0;
  white-space: nowrap;
}
.pfp-item:hover {
  background: var(--color-surface-alt);
}
.pfp-item.checked {
  color: var(--color-accent);
  font-weight: 500;
}

.pfp-check {
  width: 14px;
  flex-shrink: 0;
  color: var(--color-accent);
  display: flex;
  align-items: center;
}

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

.pfp-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

/* ── Board role — read-only overrides ────────────────────────────────────── */
body.board-role .allocation-bar { cursor: default; }
body.board-role .resize-handle  { display: none; }
body.board-role .task-card       { cursor: default; }

/* ── Responsive toolbar — progressive label hiding ───────────────────────── */
/* Step 1 (~1400px): drop "Last push: Xm ago" — least critical info */
@media (max-width: 1400px) {
  .last-push-label { display: none !important; }
}

/* Step 2 (~1250px): drop "All projects" / active-project text, keep filter icon */
@media (max-width: 1250px) {
  .project-filter-label { display: none; }
}

/* Step 3 (~1100px): icon-only action buttons — drop Pull / Push / Export text */
@media (max-width: 1100px) {
  .action-btn span { display: none; }
  .action-btn { padding: 3px 6px; gap: 0; }
}

/* ── F-097 (2026-05-07): keyboard focus visibility ─────────────────────────
   Several form/input/button selectors above use `outline: none` to drop the
   default browser ring, then provide a `:focus { border-color, box-shadow }`
   visual replacement. That works for sighted users but can be inconsistent
   and (for a few selectors like .backlog-sort-select) the replacement was
   missing entirely.

   This global `:focus-visible` rule guarantees a strong keyboard focus ring
   on every focusable element regardless of per-component `outline: none`.
   `:focus-visible` only matches keyboard navigation — mouse clicks don't
   trigger it — so it doesn't visually compete with `:focus` rules used by
   other components for hover-like styling.

   Per-component `:focus { border-color, box-shadow }` rules continue to
   work alongside; this just adds an outline on top for keyboard users.
─────────────────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
/* Inputs and buttons inside dense forms benefit from a tighter offset so the
   ring doesn't overlap adjacent elements. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline-offset: 1px;
}

/* ── Motion sensitivity (WCAG 2.3.3) ─────────────────────────────────────────
   The client carries 138 animation/transition declarations and five files with
   @keyframes — the copilot's marching ant, the splash fade, the push drawer's
   0.5s close, modal and drawer transitions — and until now NONE of them
   consulted the operating system's reduced-motion preference.

   For a user with a vestibular disorder that setting is not cosmetic; it is the
   difference between a usable interface and a nauseating one, and they have
   already expressed the preference at the OS level. Honouring it is one rule.

   Deliberately near-zero rather than zero: `0.01ms` keeps transitionend and
   animationend events firing, so JS that waits on them (the loader fade, the
   drawer close) still completes instead of hanging on a listener that never
   resolves. `!important` because it must beat per-component declarations, which
   is the whole point of a preference override.

   Scroll behaviour is included: scrollToToday() and the calendar's smooth
   scrolling are motion too. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
