/* ═══════════════════════════════════════════════
   INVOICE APP — Complete Stylesheet
   ═══════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #ede9fe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --success-dark: #15803d;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --danger-dark: #b91c1c;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --warning-dark: #b45309;
  --info: #0891b2;
  --info-light: #e0f2fe;
  --white: #fff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-w: 240px;
  --sidebar-collapsed-w: 64px;
  --navbar-h: 64px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #f1f5f9;
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── TOP NAVBAR ─────────────────────────────────────────────── */
.main-navbar {
  min-height: var(--navbar-h);
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: 0 !important;
}

.main-navbar .container-fluid {
  min-height: var(--navbar-h);
  padding: 0 24px !important;
  flex-wrap: wrap;
  align-items: center;
}

/* Brand */
.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

/* Nav links */
.main-navbar .nav-link {
  color: var(--gray-500) !important;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px !important;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.main-navbar .nav-link:hover {
  color: var(--primary) !important;
  background: var(--primary-light);
}

.main-navbar .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
  font-weight: 600;
}

/* Dropdown */
.main-navbar .dropdown-menu {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 210px;
  margin-top: 8px !important;
}

.main-navbar .dropdown-item {
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.12s;
}

.main-navbar .dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.main-navbar .dropdown-divider {
  margin: 4px 0;
  border-color: var(--gray-100);
}

/* ── Main App (Dashboard/Invoices/Estimates/etc) — indigo sidebar ─── */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  z-index: 1031;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease;
}
body.app-sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-w);
  /* The base rule's overflow-x:hidden clips the hover flyout label below
     (position:absolute, escapes to the right of the icon rail) — visible on
     both axes here since collapsed icon-only rows never need to scroll. */
  overflow: visible;
}

.app-sidebar-brand-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  flex-shrink: 0;
}
.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.app-sidebar-brand-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 8px 10px;
  border: none;
  background: var(--gray-50);
  color: var(--gray-500);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.app-sidebar-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.app-sidebar-toggle i {
  transition: transform 0.2s ease;
  font-size: 13px;
}
body.app-sidebar-collapsed .app-sidebar-toggle i {
  transform: rotate(180deg);
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 16px;
  flex: 1;
}

.app-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.app-sidebar-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.app-sidebar-link:hover,
.app-sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.app-sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed (icon-only): hide labels, reveal on hover as a flyout. */
body.app-sidebar-collapsed .app-sidebar-toggle .app-sidebar-label,
body.app-sidebar-collapsed .app-sidebar-brand-name {
  display: none;
}
body.app-sidebar-collapsed .app-sidebar-link .app-sidebar-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1032;
}
body.app-sidebar-collapsed .app-sidebar-link:hover .app-sidebar-label,
body.app-sidebar-collapsed .app-sidebar-link:focus-visible .app-sidebar-label {
  opacity: 1;
  visibility: visible;
}

.app-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 1030;
}

.app-topbar {
  margin-left: var(--sidebar-w);
  min-height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: margin-left 0.2s ease;
}
body.app-sidebar-collapsed .app-topbar {
  margin-left: var(--sidebar-collapsed-w);
}

.app-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: 22px;
  padding: 6px;
  margin-right: auto;
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.app-topbar-link {
  color: var(--gray-500);
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.app-topbar-link:hover,
.app-topbar-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* Content offset — scoped to body.app-shell only, distinct from
   body.pms-shell/portal-shell so each app's sidebar only offsets its
   own pages. */
body.app-shell .page-wrapper {
  margin: 0 0 0 var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.app-shell.app-sidebar-collapsed .page-wrapper {
  margin-left: var(--sidebar-collapsed-w);
}
body.app-shell .app-footer {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.app-shell.app-sidebar-collapsed .app-footer {
  margin-left: var(--sidebar-collapsed-w);
}

/* Home launcher page — no sidebar, so its topbar/content/footer never
   get the sidebar-width offset every other body.app-shell page uses. */
.home-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  text-decoration: none;
}
body.home-shell .app-topbar {
  margin-left: 0;
}
body.home-shell .app-footer {
  margin-left: 0;
}

/* Notification bell + dropdown, user menu — Main App topbar */
.app-notif-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--gray-600);
  font-size: 20px;
}
.app-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.app-notif-dropdown {
  width: 360px;
  border: none;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.app-notif-header {
  padding: 14px 18px;
  background: #1a1a2e;
  color: #fff;
}
.app-notif-header-title {
  font-size: 14px;
  font-weight: 700;
}
.app-notif-header-subtitle {
  font-size: 11px;
  opacity: 0.7;
}
.app-notif-mark-all {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
}
.app-notif-list {
  max-height: 380px;
  overflow-y: auto;
}
.app-notif-empty {
  padding: 32px;
  text-align: center;
  color: #888;
}
.app-notif-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.app-notif-empty div {
  font-size: 13px;
}
.app-notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
  background: #fff;
}
.app-notif-item.is-unread {
  background: #f8f9ff;
}
.app-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--notif-color) 13%, transparent);
}
.app-notif-icon i {
  color: var(--notif-color);
  font-size: 16px;
}
.app-notif-body {
  flex: 1;
  min-width: 0;
}
.app-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 3px;
}
.app-notif-item.is-unread .app-notif-item-title {
  font-weight: 700;
}
.app-notif-unread-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}
.app-notif-item-message {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-notif-item-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}
.app-notif-footer {
  padding: 10px 18px;
  text-align: center;
  border-top: 1px solid #f0f2f5;
  background: #f8f9fb;
}
.app-notif-footer a {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.app-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 4px 4px 8px;
  cursor: pointer;
}
.app-user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.app-user-chip-caret {
  font-size: 11px;
  color: var(--gray-400);
}

/* Home launcher topbar — no sidebar/hamburger to fall back on here, so on
   narrow screens every item (brand name, Settings label, user name) collapses
   to icon-only instead of wrapping the row. */
@media (max-width: 767.98px) {
  body.home-shell .app-topbar {
    padding: 0 12px;
  }
  body.home-shell .app-topbar-right {
    gap: 0;
  }
  body.home-shell .brand-name {
    display: none;
  }
  body.home-shell .app-topbar-link-label {
    display: none;
  }
  body.home-shell .app-topbar-link {
    padding: 6px 8px;
  }
  body.home-shell .app-user-chip-name,
  body.home-shell .app-user-chip-caret {
    display: none;
  }
  body.home-shell .app-user-chip {
    padding: 4px;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.app-sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  body.app-sidebar-open .app-sidebar-backdrop {
    display: block;
  }
  .app-sidebar-toggle {
    display: none;
  }
  .app-topbar,
  body.app-sidebar-collapsed .app-topbar {
    margin-left: 0;
  }
  body.app-shell .page-wrapper,
  body.app-shell.app-sidebar-collapsed .page-wrapper,
  body.app-shell .app-footer,
  body.app-shell.app-sidebar-collapsed .app-footer {
    margin-left: 0;
  }
  .app-mobile-toggle {
    display: block;
  }
}

/* User avatar */
.user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-avatar-img {
  object-fit: cover;
}
.user-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}
.user-avatar-xl {
  width: 72px;
  height: 72px;
  font-size: 26px;
}
.user-avatar-stack {
  display: inline-flex;
}
.user-avatar-stack .user-avatar {
  border: 2px solid #fff;
  margin-left: -10px;
}
.user-avatar-stack .user-avatar:first-child {
  margin-left: 0;
}

/* Client Portal avatar (clientChatAvatarHtml()) — initials-only circle,
   mirrors .user-avatar's look since Client Portal has no photo upload. */
.portal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.portal-avatar-initials {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
}

/* ── Admin Team Messages inbox (projects/team_messages.php) ──────── */
.pms-inbox-layout {
  display: flex;
  height: calc(100vh - 230px);
  min-height: 480px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pms-inbox-list-pane {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pms-inbox-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.pms-inbox-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px;
}
.pms-inbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}
.pms-inbox-row:last-child {
  border-bottom: none;
}
.pms-inbox-row:hover {
  background: var(--gray-50);
}
.pms-inbox-row.is-active {
  background: var(--primary-light);
}
.pms-inbox-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pms-inbox-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-900);
}
.pms-inbox-preview {
  font-size: 12px;
  color: var(--gray-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pms-inbox-time {
  font-size: 11px;
  color: var(--gray-400);
  flex-shrink: 0;
}
.pms-inbox-unread {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
}
.pms-inbox-pin-icon {
  font-size: 11px;
  color: var(--primary);
  margin-right: 4px;
  vertical-align: 1px;
}
.pms-inbox-row-menu {
  position: relative;
  flex-shrink: 0;
}
.pms-inbox-row-menu-toggle {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--gray-400);
  opacity: 0;
  transition:
    opacity 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}
.pms-inbox-row-menu-toggle:hover,
.pms-inbox-row-menu-toggle:focus-visible {
  background: var(--gray-100);
  color: var(--gray-700);
}
.pms-inbox-row:hover .pms-inbox-row-menu-toggle,
.pms-inbox-row-menu-toggle[aria-expanded="true"] {
  opacity: 1;
}
.pms-inbox-thread-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.pms-inbox-thread-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gray-400);
  font-size: 13px;
}
.pms-inbox-thread-empty i {
  font-size: 32px;
}
.pms-inbox-empty-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

/* ── Team Directory: multi-select for group chat ─────────────────── */
.team-card-checkbox {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}
.team-group-chat-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.team-checkbox-col {
  width: 36px;
}
.pms-inbox-thread-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pms-inbox-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.pms-inbox-thread-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pms-inbox-thread-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--gray-900);
}
.pms-inbox-thread-subtitle {
  font-size: 11.5px;
  color: var(--gray-400);
}
.pms-inbox-thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pms-chat-msg {
  display: flex;
}
.pms-chat-msg-mine {
  justify-content: flex-end;
}
.pms-chat-msg-col {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}
.pms-chat-msg-mine .pms-chat-msg-col {
  align-items: flex-end;
}
.pms-chat-msg-sender {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 2px;
}
.pms-chat-msg-bubble {
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.pms-chat-msg-theirs .pms-chat-msg-bubble {
  background: var(--gray-100);
  color: var(--gray-900);
}
.pms-chat-msg-mine .pms-chat-msg-bubble {
  background: var(--primary);
  color: #fff;
}
.pms-chat-msg-time {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--gray-400);
  margin-top: 2px;
  padding: 0 2px;
}
.pms-chat-msg-deleted {
  font-size: 12.5px;
  font-style: italic;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
}
.pms-chat-msg-delete {
  border: none;
  background: transparent;
  color: var(--gray-400);
  font-size: 12px;
  padding: 0 2px;
  margin-top: 2px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.pms-chat-msg:hover .pms-chat-msg-delete {
  opacity: 1;
}
.pms-chat-msg-delete:hover {
  color: var(--danger);
}
.pms-chat-panel-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}
.pms-chat-panel-input input[type="text"] {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.pms-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  transition: all 0.15s;
  flex-shrink: 0;
}
.pms-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.pms-chat-send-btn {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pms-new-group-btn {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
}
.pms-group-member-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 4px;
}
.pms-group-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.pms-group-member-row:hover {
  background: var(--gray-50);
}
.pms-group-member-name {
  font-size: 13px;
  color: var(--gray-700);
}
.pms-group-member-meta {
  font-size: 11px;
  color: var(--gray-400);
}
.pms-inbox-row-menu .dropdown-menu {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.pms-inbox-row-menu .dropdown-menu .dropdown-item {
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--gray-700);
}
.pms-inbox-row-menu .dropdown-menu .dropdown-item:hover,
.pms-inbox-row-menu .dropdown-menu .dropdown-item:focus {
  background: var(--primary-light);
  color: var(--primary);
}
.pms-inbox-row-menu .dropdown-menu .dropdown-item.text-danger:hover,
.pms-inbox-row-menu .dropdown-menu .dropdown-item.text-danger:focus {
  background: var(--danger-light);
  color: var(--danger);
}
.pms-inbox-row-menu .dropdown-menu .dropdown-divider {
  margin: 6px 4px;
  border-color: var(--gray-200);
}
@media (max-width: 767px) {
  .pms-inbox-layout {
    flex-direction: column;
    height: auto;
  }
  .pms-inbox-list-pane {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    max-height: 320px;
  }
  .pms-inbox-thread-pane {
    min-height: 480px;
  }
}

/* ── PAGE WRAPPER ───────────────────────────────────────────── */
.page-wrapper {
  padding: 28px 32px;
  min-height: calc(100vh - var(--navbar-h));
  max-width: 100%;
  margin: 0 auto;
}

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header p {
  font-size: 13px;
  color: var(--gray-400);
  margin: 3px 0 0;
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid var(--gray-200) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm);
}

.card-header {
  background: #ffffff !important;
  border-bottom: 1px solid var(--gray-100) !important;
  padding: 14px 20px !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
}

.card-body {
  padding: 20px;
}

/* ── STAT CARDS ─────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  height: 100%;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
  line-height: 1;
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 5px;
}

/* ── TABLE CARD ─────────────────────────────────────────────── */
.table-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── TABLES ─────────────────────────────────────────────────── */
.table {
  margin: 0 !important;
  font-size: 13.5px;
}

.table thead th {
  background: var(--gray-50) !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--gray-200) !important;
  border-top: none !important;
  white-space: nowrap;
  vertical-align: middle;
}

.table tbody td {
  padding: 13px 16px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--gray-100) !important;
  color: var(--gray-700);
}

.table tbody tr:last-child td {
  border-bottom: none !important;
}

.table tbody tr {
  transition: background 0.1s;
}

.table tbody tr:hover {
  background: var(--gray-50) !important;
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-draft {
  background: #ede9fe;
  color: #5b21b6;
}
.badge-sent {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-paid {
  background: #dcfce7;
  color: #15803d;
}
.badge-partial {
  background: #fef9c3;
  color: #854d0e;
}
.badge-unpaid {
  background: #fff7ed;
  color: #c2410c;
}
.badge-overdue {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-credited {
  background: #ccfbf1;
  color: #0f766e;
}
.badge-accepted {
  background: #dcfce7;
  color: #15803d;
}
.badge-declined {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-converted {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-tax {
  background: #ede9fe;
  color: #5b21b6;
}
.badge-cash {
  background: #dcfce7;
  color: #15803d;
}
.badge-proforma {
  background: #fff7ed;
  color: #c2410c;
}

/* ── Proposal status badges (draft/sent/converted reuse the existing
   .badge-draft/.badge-sent/.badge-converted classes above — these are
   the proposal-specific statuses without an existing match) ── */
.badge-viewed {
  background: #f3e8ff;
  color: #7e22ce;
}
.badge-revision_requested {
  background: #fef9c3;
  color: #854d0e;
}
.badge-approved {
  background: #dcfce7;
  color: #15803d;
}
.badge-rejected {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-expired {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-archived {
  background: #f3f4f6;
  color: #6b7280;
}
.proposal-status-card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 90px;
}
a.proposal-status-card .badge-all {
  background: var(--gray-100);
  color: var(--gray-700);
}
a.proposal-status-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
a.proposal-status-card:hover {
  border-color: var(--primary);
}
a.proposal-status-card.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
}
a.proposal-status-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.proposal-title-link {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.proposal-title-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.proposal-number-link {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--gray-500);
  text-decoration: none;
}
.proposal-number-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 8px;
  padding: 8px 16px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-primary:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

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

.btn-success:hover {
  background: #15803d !important;
  transform: translateY(-1px);
}

.btn-outline-primary {
  background: transparent !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.btn-outline-secondary {
  background: transparent !important;
  border-color: var(--gray-300) !important;
  color: var(--gray-600) !important;
}

.btn-outline-secondary:hover {
  background: var(--gray-100) !important;
  border-color: var(--gray-400) !important;
  color: var(--gray-700) !important;
}

.btn-sm {
  padding: 5px 12px !important;
  font-size: 12.5px !important;
}

/* Bootstrap sizes buttons inside a .btn-group via `.btn-group-sm > .btn`
   (a parent-context selector), not the `.btn-sm` class — so a toggle
   group like tasks.php's Board/List switcher was rendering at Bootstrap's
   own untouched default small size (.25rem .5rem padding, .875rem font)
   while a plain `.btn.btn-sm` button sitting right next to it (e.g.
   "Subtask Split: OFF") used this app's .btn-sm override above. Same
   values here so both sizing paths match. */
.btn-group-sm > .btn {
  padding: 5px 12px !important;
  font-size: 12.5px !important;
}

/* Filter-row submit/action buttons sit beside .form-control/.form-select/
   Select2 boxes, which are all one full height (no -sm variant, see
   .form-control-sm above). .btn-sm's normal small size is correct
   everywhere else (table rows, card headers, modal footers), so this is
   scoped to filter rows only rather than resizing every .btn-sm in the
   app.

   Two selector groups because filter bars in this app use two different
   layout conventions: most use Bootstrap's `.row.g-2.align-items-end`
   grid (tasks.php, timesheet.php, contracts/index.php — some put the
   class directly on the <form>, others nest it on an inner row div
   inside a <form class="card ...">, hence scoping to the class itself,
   not `form.align-items-end`); reports.php instead uses its own
   .report-filter-bar/.report-filter-actions flex layout (align-items:
   flex-end is set in that rule's CSS, not via this utility class), so
   it needs its own selector to be caught at all. */
.align-items-end .btn-sm,
.report-filter-actions .btn-sm {
  padding: 9px 16px !important;
  font-size: 13.5px !important;
}

.btn-lg {
  padding: 12px 24px !important;
  font-size: 15px !important;
}

/* Icon action buttons */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.btn-icon.btn-view:hover {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.btn-icon.btn-edit:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c4b5fd;
}
.btn-icon.btn-pdf:hover {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.btn-icon.btn-email:hover {
  background: var(--success-light);
  color: var(--success);
  border-color: #bbf7d0;
}
.btn-icon.btn-del:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fecaca;
}

/* Row-actions kebab menu — replaces a cluster of inline .btn-icon buttons
   with a single trigger + Bootstrap dropdown, used across every table (and
   div-based row list) with 2+ per-row actions app-wide. */
.row-actions-kebab {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-size: 15px;
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-500);
  cursor: pointer;
}
.row-actions-kebab:hover,
.row-actions-kebab:focus {
  background: var(--gray-100);
  color: var(--gray-700);
}
.row-actions-kebab::after {
  display: none;
}
.row-actions-dropdown {
  min-width: 180px;
  padding: 6px;
  font-size: 13.5px;
}
.row-actions-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  border-radius: 6px;
  padding: 7px 10px;
}
.row-actions-dropdown .dropdown-item i {
  width: 18px;
}
.row-actions-dropdown form {
  margin: 0;
}

/* ── FORMS ──────────────────────────────────────────────────── */
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
  display: block;
}

/* ── Filter bar "active" indicator — app-wide convention. Add
   <span class="filter-dot"></span> right after a filter field's <label>
   text when that field's current value differs from its default, so a
   filter bar with many fields (Global Task Board, Timesheet, Contracts,
   Reports, ...) shows at a glance which ones are actually filtering the
   list without having to read every value. Pair with .filter-clear-link,
   shown only when at least one field is active (PHP-side condition, not
   CSS), so "Clear" doesn't sit there permanently when nothing is
   filtered. ── */
.filter-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-left: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.filter-clear-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  white-space: nowrap;
}
.filter-clear-link:hover {
  color: var(--danger);
}

.form-control,
.form-select {
  border: 1.5px solid var(--gray-200) !important;
  border-radius: 8px !important;
  padding: 9px 12px !important;
  font-size: 13.5px !important;
  /* Explicit, not the browser default: a native <select>'s UA line-height
     ratio (~1.5x) and CSS's "normal" (~1.2x, what a Select2-generated
     span resolves to) are NOT the same number, which by itself produced a
     4px height gap between a plain .form-select and a Select2-enhanced
     one even with identical padding/font-size. Pinning both to the same
     explicit ratio (also applied to .select2-selection__rendered below)
     is what actually keeps them the same height. */
  line-height: 1.5 !important;
  color: var(--gray-800) !important;
  background-color: #fff !important;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  font-family: inherit;
  width: 100%;
}

/* The shorthand `background` above would otherwise reset the
   dropdown-arrow background-image Bootstrap sets on .form-select —
   re-declare it explicitly so every <select> across the app keeps
   its chevron. */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23555' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 16px 12px !important;
  padding-right: 2.25rem !important;
}

/* .form-control-sm/.form-select-sm intentionally get NO separate (smaller)
   override here: the base rule above already forces every .form-control/
   .form-select — "-sm" or not — to this one full size. A prior attempt at
   this fix instead shrank -sm controls down to match .btn-sm, but a
   Select2-enhanced -sm dropdown can't be shrunk reliably (its arrow's
   centering math breaks once the box gets small — see the Select2 block
   below), so the fix goes the other way: every filter-row control,
   including "-sm" ones, matches the Select2 dropdown's natural full size.
   See .align-items-end .btn-sm below for the button side of this. */

.form-control:focus,
.form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
  outline: none !important;
}

.form-control::placeholder {
  color: var(--gray-300) !important;
}

.input-group-text {
  background: var(--gray-50) !important;
  border: 1.5px solid var(--gray-200) !important;
  color: var(--gray-500) !important;
  font-size: 13.5px !important;
  padding: 9px 12px !important;
}

.input-group .form-control {
  border-left: none !important;
}

.input-group-text + .form-control {
  border-left: none !important;
}

.form-text {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 4px;
}

.form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius) !important;
  border: none !important;
  font-size: 13.5px;
  padding: 12px 16px !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: var(--success-light) !important;
  color: #14532d !important;
}

.alert-danger {
  background: var(--danger-light) !important;
  color: #7f1d1d !important;
}

.alert-warning {
  background: var(--warning-light) !important;
  color: #78350f !important;
}

/* ── INVOICE TYPE SELECTOR ──────────────────────────────────── */
.invoice-type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.invoice-type-btn {
  padding: 20px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: #fff;
  text-decoration: none;
  display: block;
}

.invoice-type-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.invoice-type-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.invoice-type-btn i {
  font-size: 28px;
  display: block;
  margin-bottom: 8px;
  color: var(--gray-300);
}

.invoice-type-btn.active i,
.invoice-type-btn:hover i {
  color: var(--primary);
}

.invoice-type-btn .type-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-700);
  display: block;
}

.invoice-type-btn .type-desc {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 3px;
  display: block;
}

/* ── LINE ITEMS TABLE ───────────────────────────────────────── */
.items-table {
  width: 100%;
  border-collapse: collapse;
}

.items-table thead th {
  background: var(--gray-50);
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  border-bottom: 2px solid var(--gray-200);
}

.items-table tbody td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.items-table tbody tr:last-child td {
  border-bottom: none;
}

.items-table input,
.items-table select {
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
  width: 100%;
  background: #fff;
  font-family: inherit;
  color: var(--gray-800);
  transition: border-color 0.15s;
}

.items-table input:focus,
.items-table select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.items-table input[readonly] {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
}

.btn-remove-row {
  background: none;
  border: none;
  color: var(--gray-300);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 15px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove-row:hover {
  background: var(--danger-light);
  color: var(--danger);
}

/* ── TOTALS BOX ─────────────────────────────────────────────── */
.totals-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--gray-600);
  border-bottom: 1px dashed var(--gray-200);
}

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

.totals-row.total-final {
  border-top: 2px solid var(--gray-800);
  border-bottom: none;
  margin-top: 8px;
  padding-top: 12px;
  font-size: 17px;
  font-weight: 800;
  color: var(--gray-900);
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-300);
}

.empty-state > i {
  display: block;
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 15px;
  color: var(--gray-400);
  margin: 0 0 16px;
}

/* ── UTILITIES ──────────────────────────────────────────────── */
.mono {
  font-family: "SF Mono", "Fira Code", monospace;
}
.text-purple {
  color: var(--primary) !important;
}
.fw-600 {
  font-weight: 600 !important;
}
.fw-700 {
  font-weight: 700 !important;
}
.fw-800 {
  font-weight: 800 !important;
}
.fs-11 {
  font-size: 11px !important;
}
.fs-12 {
  font-size: 12px !important;
}
.fs-13 {
  font-size: 13px !important;
}

/* ── SUMMARY FILTER PILLS ───────────────────────────────────── */
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  border: 1.5px solid transparent;
}

.filter-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* ─── Navbar collapse (lg breakpoint = 992px) ────────────────── */
@media (max-width: 991.98px) {
  /* Expand toggler area */
  .main-navbar .container-fluid {
    padding: 0 16px !important;
  }

  /* Collapsed panel */
  .main-navbar .navbar-collapse {
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--gray-100);
    padding: 10px 0 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.07);
  }

  /* Nav links: stack vertically */
  .main-navbar .navbar-nav-links {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    gap: 1px !important;
    margin-bottom: 8px;
  }

  .main-navbar .navbar-nav-links .nav-link,
  .main-navbar .navbar-nav-links .dropdown > .nav-link {
    width: 100%;
    padding: 10px 14px !important;
    border-radius: 8px;
  }

  /* Dropdowns: inline / no floating */
  .main-navbar .navbar-nav-links .dropdown-menu {
    position: static !important;
    float: none !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-left: 3px solid var(--gray-200) !important;
    border-radius: 0 !important;
    padding: 4px 0 !important;
    margin: 2px 0 4px 26px !important;
    min-width: auto !important;
    background: transparent !important;
  }

  .main-navbar .navbar-nav-links .dropdown-item {
    border-radius: 6px;
    font-size: 13px;
  }

  /* Right side (settings + user): separate row at bottom */
  .main-navbar .navbar-right {
    width: 100%;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--gray-100);
    justify-content: space-between !important;
    flex-wrap: wrap;
  }

  /* User dropdown: align to left on mobile */
  .main-navbar .navbar-right .dropdown-menu {
    right: 0;
    left: auto;
  }
}

/* ─── Tablet & mobile (≤768px) ───────────────────────────────── */
@media (max-width: 768px) {
  /* Page wrapper */
  .page-wrapper {
    padding: 14px 12px;
  }

  /* Page header: stack title + buttons */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .page-header > div:last-child .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 130px;
  }

  /* Tables: horizontal scroll inside cards */
  .table-card,
  .card-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-card .table,
  .card-body .table {
    min-width: 560px;
  }

  /* Items table on create/edit pages */
  .items-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1px;
  }

  .items-table {
    min-width: 680px;
  }

  /* Invoice type selector: 1 column */
  .invoice-type-selector {
    grid-template-columns: 1fr 1fr;
  }

  /* Stat values: smaller on mobile */
  .stat-value {
    font-size: 20px;
  }

  /* Report summary boxes: stack vertically */
  .report-summary-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .report-summary-box .summary-amount-wrap {
    text-align: left;
  }

  .report-summary-box .summary-amount {
    font-size: 22px;
  }

  /* Footer */
  .app-footer {
    padding: 12px 16px;
  }

  .app-footer-inner {
    justify-content: center;
    text-align: center;
  }
}

/* ─── Small phones (≤480px) ──────────────────────────────────── */
@media (max-width: 480px) {
  .page-wrapper {
    padding: 12px 10px;
  }

  .page-header h1 {
    font-size: 18px;
  }

  .stat-value {
    font-size: 18px;
  }

  .invoice-type-selector {
    grid-template-columns: 1fr;
  }

  /* Action icon buttons in table rows: tighten up */
  .btn-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
}

/* ── Report Summary Boxes ───────────────────────────────────── */
.report-summary-box {
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-summary-box.warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.report-summary-box.purple {
  background: #f0efff;
  border: 1px solid #c4b5fd;
}

.report-summary-box .summary-label {
  font-size: 15px;
  font-weight: 700;
}

.report-summary-box.warning .summary-label {
  color: #c2410c;
}
.report-summary-box.purple .summary-label {
  color: #4f46e5;
}

.report-summary-box .summary-sub {
  font-size: 13px;
  color: #888;
  margin-top: 3px;
}

.report-summary-box .summary-amount-wrap {
  text-align: right;
}

.report-summary-box .summary-amount-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.report-summary-box.warning .summary-amount-tag {
  color: #c2410c;
}
.report-summary-box.purple .summary-amount-tag {
  color: #4f46e5;
}

.report-summary-box .summary-amount {
  font-size: 28px;
  font-weight: 800;
  font-family: "SF Mono", "Fira Code", monospace;
  line-height: 1;
}

.report-summary-box.warning .summary-amount {
  color: #c2410c;
}
.report-summary-box.purple .summary-amount {
  color: #4f46e5;
}

/* ── Service Autocomplete ───────────────────────────────────── */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: fixed;
  background: white;
  border: 1.5px solid #4f46e5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.15);
  z-index: 99999;
  max-height: 280px;
  overflow-y: auto;
  min-width: 320px;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f4f6f9;
  transition: background 0.1s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #f5f3ff;
}

.autocomplete-item .item-left .item-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a2e;
}

.autocomplete-item .item-left .item-meta {
  font-size: 11.5px;
  color: #aaa;
  margin-top: 2px;
}

.autocomplete-item .item-right {
  text-align: right;
  flex-shrink: 0;
}

.autocomplete-item .item-right .item-price {
  font-size: 13.5px;
  font-weight: 700;
  color: #4f46e5;
  font-family: monospace;
}

.autocomplete-item .item-right .item-tax {
  font-size: 11px;
  color: #aaa;
}

.autocomplete-item .item-category {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: #e0e7ff;
  color: #4f46e5;
  margin-top: 3px;
  display: inline-block;
}

.autocomplete-empty {
  padding: 14px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
}

/* ── App Footer ─────────────────────────────────────────────── */
.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--gray-200);
  padding: 14px 32px;
  margin-top: auto;
}

.app-footer-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--gray-400);
  flex-wrap: wrap;
}

.app-footer-divider {
  color: var(--gray-300);
}

.app-footer-brand {
  color: var(--gray-400);
}

.app-footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}

.app-footer-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.app-footer-version {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: monospace;
}

/* ── Tooltips ───────────────────────────────────────────────── */
.tooltip {
  font-family: "Inter", sans-serif !important;
  font-size: 12px !important;
}

.tooltip-inner {
  background: #1a1a2e !important;
  color: white !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  max-width: 200px !important;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
  border-top-color: #1a1a2e !important;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
  border-bottom-color: #1a1a2e !important;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
  border-left-color: #1a1a2e !important;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
  border-right-color: #1a1a2e !important;
}

/* ── SweetAlert2 custom styles ────────────────────────────── */
.swal-rounded.swal2-popup {
  border-radius: 18px !important;
  padding: 32px 28px 24px !important;
  font-family: "Inter", sans-serif !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.swal-rounded .swal2-title {
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #1a1a2e !important;
  padding: 0 0 8px !important;
}

.swal-rounded .swal2-html-container {
  font-size: 14px !important;
  color: #6b7280 !important;
  margin-top: 4px !important;
}

.swal-rounded .swal2-icon {
  margin: 0 auto 16px !important;
  width: 56px !important;
  height: 56px !important;
}

.swal-rounded .swal2-icon .swal2-icon-content {
  font-size: 28px !important;
}

.swal-rounded .swal2-actions {
  gap: 10px !important;
  margin-top: 24px !important;
}

.swal-rounded .swal2-confirm,
.swal-rounded .swal2-cancel {
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  padding: 10px 22px !important;
  border: none !important;
}

.swal-rounded .swal2-cancel {
  background: #f3f4f6 !important;
  color: #374151 !important;
}

.swal-rounded .swal2-cancel:hover {
  background: #e5e7eb !important;
}

.swal-toast.swal2-popup {
  border-radius: 12px !important;
  font-family: "Inter", sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  padding: 12px 18px !important;
}

/* ── Projects module (PMS) — emerald accent, left sidebar ───────── */

/* Sidebar: fixed, full height, collapses to icon-only on desktop,
   slides off-canvas below the lg breakpoint. body.pms-sidebar-collapsed
   drives the collapsed width; body.pms-sidebar-open drives the mobile
   drawer — two independent states, see the media query below. */
.pms-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #d1fae5;
  box-shadow: 0 1px 8px rgba(5, 150, 105, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 1031;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease;
}
body.pms-sidebar-collapsed .pms-sidebar {
  width: var(--sidebar-collapsed-w);
  overflow: visible;
}

.pms-sidebar-brand-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  flex-shrink: 0;
}
.pms-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.pms-sidebar-app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
}

.pms-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 8px 10px;
  border: none;
  background: var(--gray-50);
  color: var(--gray-500);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.pms-sidebar-toggle:hover {
  background: #d1fae5;
  color: #059669;
}
.pms-sidebar-toggle i {
  transition: transform 0.2s ease;
  font-size: 13px;
}
body.pms-sidebar-collapsed .pms-sidebar-toggle i {
  transform: rotate(180deg);
}

.pms-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 16px;
  flex: 1;
}

.pms-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #047857;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.pms-sidebar-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.pms-sidebar-link:hover,
.pms-sidebar-link.active {
  background: #d1fae5;
  color: #059669;
}

.pms-sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collapsed (icon-only): hide labels, reveal on hover as a flyout —
   pure CSS, no JS involved in the hover itself. */
body.pms-sidebar-collapsed .pms-sidebar-app-badge,
body.pms-sidebar-collapsed .pms-sidebar-toggle .pms-sidebar-label,
body.pms-sidebar-collapsed .pms-sidebar-brand-name {
  display: none;
}
body.pms-sidebar-collapsed .pms-sidebar-link .pms-sidebar-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1032;
}
body.pms-sidebar-collapsed .pms-sidebar-link:hover .pms-sidebar-label,
body.pms-sidebar-collapsed .pms-sidebar-link:focus-visible .pms-sidebar-label {
  opacity: 1;
  visibility: visible;
}

.pms-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 1030;
}

/* Top bar: utility items only (settings, waffle, notifications, user
   menu) — primary nav lives in the sidebar. Not fixed; margin-left
   keeps it clear of the sidebar and both resize together. */
.pms-topbar {
  margin-left: var(--sidebar-w);
  min-height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid #d1fae5;
  box-shadow: 0 1px 8px rgba(5, 150, 105, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: margin-left 0.2s ease;
}
body.pms-sidebar-collapsed .pms-topbar {
  margin-left: var(--sidebar-collapsed-w);
}

.pms-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #047857;
  font-size: 22px;
  padding: 6px;
  margin-right: auto;
}

.pms-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pms-topbar-link {
  color: #047857;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.pms-topbar-link:hover,
.pms-topbar-link.active {
  background: #d1fae5;
  color: #059669;
}

.pms-waffle-btn {
  color: #047857 !important;
}

/* Notification bell + dropdown */
.pms-notif-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #047857;
  font-size: 20px;
}
.pms-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pms-notif-dropdown {
  width: 360px;
  border: none;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.pms-notif-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
}
.pms-notif-header-title {
  font-size: 14px;
  font-weight: 700;
}
.pms-notif-header-subtitle {
  font-size: 11px;
  opacity: 0.7;
}
.pms-notif-mark-all {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
}
.pms-notif-list {
  max-height: 380px;
  overflow-y: auto;
}
.pms-notif-empty {
  padding: 32px;
  text-align: center;
  color: #888;
}
.pms-notif-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.pms-notif-empty div {
  font-size: 13px;
}
.pms-notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
  background: #fff;
}
.pms-notif-item.is-unread {
  background: #ecfdf5;
}
.pms-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--notif-color) 13%, transparent);
}
.pms-notif-icon i {
  color: var(--notif-color);
  font-size: 16px;
}
.pms-notif-body {
  flex: 1;
  min-width: 0;
}
.pms-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 3px;
}
.pms-notif-item.is-unread .pms-notif-item-title {
  font-weight: 700;
}
.pms-notif-unread-dot {
  width: 6px;
  height: 6px;
  background: #059669;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}
.pms-notif-item-message {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pms-notif-item-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}
.pms-notif-footer {
  padding: 10px 18px;
  text-align: center;
  border-top: 1px solid #f0f2f5;
  background: #ecfdf5;
}
.pms-notif-footer a {
  font-size: 13px;
  color: #059669;
  font-weight: 600;
  text-decoration: none;
}

/* User menu */
.pms-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 4px 4px 8px;
  cursor: pointer;
}
.pms-user-avatar {
  background: linear-gradient(135deg, #10b981, #059669);
}
.pms-user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: #047857;
}
.pms-user-chip-caret {
  font-size: 11px;
  color: #6ee7b7;
}

/* Proposals repaints the shared .pms-* shell (built for/still used by
   Projects, hence the green above) in its own indigo identity — the same
   brand color already used by proposal badges/buttons/the PDF's default
   accent. Scoped to body.proposals-shell (set only in
   includes/header_proposals.php) so Projects' green is untouched. */
body.proposals-shell.pms-shell .pms-sidebar {
  border-right-color: #e0e7ff;
  box-shadow: 0 1px 8px rgba(79, 70, 229, 0.07);
}
body.proposals-shell.pms-shell .pms-sidebar-app-badge {
  color: #4338ca;
  background: #e0e7ff;
}
body.proposals-shell.pms-shell .pms-sidebar-toggle:hover {
  background: #e0e7ff;
  color: #4338ca;
}
body.proposals-shell.pms-shell .pms-sidebar-link {
  color: #4338ca;
}
body.proposals-shell.pms-shell .pms-sidebar-link:hover,
body.proposals-shell.pms-shell .pms-sidebar-link.active {
  background: #e0e7ff;
  color: #4338ca;
}
body.proposals-shell.pms-shell .pms-topbar {
  border-bottom-color: #e0e7ff;
  box-shadow: 0 1px 8px rgba(79, 70, 229, 0.07);
}
body.proposals-shell.pms-shell .pms-mobile-toggle,
body.proposals-shell.pms-shell .pms-topbar-link,
body.proposals-shell.pms-shell .pms-notif-bell {
  color: #4338ca;
}
body.proposals-shell.pms-shell .pms-topbar-link:hover,
body.proposals-shell.pms-shell .pms-topbar-link.active {
  background: #e0e7ff;
  color: #4338ca;
}
body.proposals-shell.pms-shell .pms-waffle-btn {
  color: #4338ca !important;
}
body.proposals-shell.pms-shell .pms-notif-header {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}
body.proposals-shell.pms-shell .pms-notif-item.is-unread {
  background: #eef2ff;
}
body.proposals-shell.pms-shell .pms-notif-unread-dot {
  background: #4f46e5;
}
body.proposals-shell.pms-shell .pms-notif-footer {
  background: #eef2ff;
}
body.proposals-shell.pms-shell .pms-notif-footer a {
  color: #4f46e5;
}
body.proposals-shell.pms-shell .pms-user-avatar {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
}
body.proposals-shell.pms-shell .pms-user-chip-name {
  color: #4338ca;
}
body.proposals-shell.pms-shell .pms-user-chip-caret {
  color: #a5b4fc;
}

/* Meetings repaints the shared .pms-* shell in its own blue identity,
   the same accent used by btn-meeting-accent / meetings.css. Scoped to
   body.meetings-shell (set only in includes/header_meetings.php) so no
   other module's shell colors change. */
body.meetings-shell.pms-shell .pms-sidebar {
  border-right-color: #dbeafe;
  box-shadow: 0 1px 8px rgba(37, 99, 235, 0.07);
}
body.meetings-shell.pms-shell .pms-sidebar-app-badge {
  color: #1d4ed8;
  background: #dbeafe;
}
body.meetings-shell.pms-shell .pms-sidebar-toggle:hover {
  background: #dbeafe;
  color: #1d4ed8;
}
body.meetings-shell.pms-shell .pms-sidebar-link {
  color: #1d4ed8;
}
body.meetings-shell.pms-shell .pms-sidebar-link:hover,
body.meetings-shell.pms-shell .pms-sidebar-link.active {
  background: #dbeafe;
  color: #1d4ed8;
}
body.meetings-shell.pms-shell .pms-topbar {
  border-bottom-color: #dbeafe;
  box-shadow: 0 1px 8px rgba(37, 99, 235, 0.07);
}
body.meetings-shell.pms-shell .pms-mobile-toggle,
body.meetings-shell.pms-shell .pms-topbar-link,
body.meetings-shell.pms-shell .pms-notif-bell {
  color: #1d4ed8;
}
body.meetings-shell.pms-shell .pms-topbar-link:hover,
body.meetings-shell.pms-shell .pms-topbar-link.active {
  background: #dbeafe;
  color: #1d4ed8;
}
body.meetings-shell.pms-shell .pms-waffle-btn {
  color: #1d4ed8 !important;
}
body.meetings-shell.pms-shell .pms-notif-header {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}
body.meetings-shell.pms-shell .pms-notif-item.is-unread {
  background: #eff6ff;
}
body.meetings-shell.pms-shell .pms-notif-unread-dot {
  background: #2563eb;
}
body.meetings-shell.pms-shell .pms-notif-footer {
  background: #eff6ff;
}
body.meetings-shell.pms-shell .pms-notif-footer a {
  color: #2563eb;
}
body.meetings-shell.pms-shell .pms-user-avatar {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Content offset: page-wrapper and footer sit beside the sidebar, not
   under it — scoped to body.pms-shell only so the main invoicing app's
   own .page-wrapper/.app-footer (no sidebar there) are untouched. */
body.pms-shell .page-wrapper {
  margin: 0 0 0 var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.pms-shell.pms-sidebar-collapsed .page-wrapper {
  margin-left: var(--sidebar-collapsed-w);
}
body.pms-shell .app-footer {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.pms-shell.pms-sidebar-collapsed .app-footer {
  margin-left: var(--sidebar-collapsed-w);
}

/* Mobile (< lg): sidebar becomes an off-canvas drawer at full label
   width regardless of the desktop collapsed state; top bar/content
   lose their sidebar offset since the sidebar no longer reserves
   permanent space. */
@media (max-width: 991.98px) {
  .pms-sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.pms-sidebar-open .pms-sidebar {
    transform: translateX(0);
  }
  body.pms-sidebar-open .pms-sidebar-backdrop {
    display: block;
  }
  .pms-sidebar-toggle {
    display: none;
  }
  .pms-topbar,
  body.pms-sidebar-collapsed .pms-topbar {
    margin-left: 0;
  }
  body.pms-shell .page-wrapper,
  body.pms-shell.pms-sidebar-collapsed .page-wrapper,
  body.pms-shell .app-footer,
  body.pms-shell.pms-sidebar-collapsed .app-footer {
    margin-left: 0;
  }
  .pms-mobile-toggle {
    display: block;
  }
}

/* ── Renewals module — sky-blue accent, left sidebar ─────────────── */
.renewal-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #e0f2fe;
  box-shadow: 0 1px 8px rgba(2, 132, 199, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 1031;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease;
}
body.renewal-sidebar-collapsed .renewal-sidebar {
  width: var(--sidebar-collapsed-w);
  overflow: visible;
}
.renewal-sidebar-brand-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  flex-shrink: 0;
}
.renewal-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.renewal-app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
}
.renewal-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 8px 10px;
  border: none;
  background: var(--gray-50);
  color: var(--gray-500);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.renewal-sidebar-toggle:hover {
  background: #e0f2fe;
  color: #0284c7;
}
.renewal-sidebar-toggle i {
  transition: transform 0.2s ease;
  font-size: 13px;
}
body.renewal-sidebar-collapsed .renewal-sidebar-toggle i {
  transform: rotate(180deg);
}
.renewal-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 16px;
  flex: 1;
}
.renewal-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #0369a1;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.renewal-sidebar-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.renewal-sidebar-link:hover,
.renewal-sidebar-link.active {
  background: #e0f2fe;
  color: #0284c7;
}
.renewal-sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
body.renewal-sidebar-collapsed .renewal-app-badge,
body.renewal-sidebar-collapsed .renewal-sidebar-toggle .renewal-sidebar-label,
body.renewal-sidebar-collapsed .renewal-sidebar-brand-name {
  display: none;
}
body.renewal-sidebar-collapsed .renewal-sidebar-link .renewal-sidebar-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1032;
}
body.renewal-sidebar-collapsed
  .renewal-sidebar-link:hover
  .renewal-sidebar-label,
body.renewal-sidebar-collapsed
  .renewal-sidebar-link:focus-visible
  .renewal-sidebar-label {
  opacity: 1;
  visibility: visible;
}
.renewal-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 1030;
}
.renewal-topbar {
  margin-left: var(--sidebar-w);
  min-height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid #e0f2fe;
  box-shadow: 0 1px 8px rgba(2, 132, 199, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: margin-left 0.2s ease;
}
body.renewal-sidebar-collapsed .renewal-topbar {
  margin-left: var(--sidebar-collapsed-w);
}
.renewal-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #0369a1;
  font-size: 22px;
  padding: 6px;
  margin-right: auto;
}
.renewal-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.renewal-topbar-link {
  color: #0369a1;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.renewal-topbar-link:hover,
.renewal-topbar-link.active {
  background: #e0f2fe;
  color: #0284c7;
}
.renewal-waffle-btn {
  color: #0369a1 !important;
}
.renewal-notif-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #0369a1;
  font-size: 20px;
}
.renewal-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.renewal-notif-dropdown {
  width: 360px;
  border: none;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.renewal-notif-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff;
}
.renewal-notif-header-title {
  font-size: 14px;
  font-weight: 700;
}
.renewal-notif-header-subtitle {
  font-size: 11px;
  opacity: 0.7;
}
.renewal-notif-mark-all {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
}
.renewal-notif-list {
  max-height: 380px;
  overflow-y: auto;
}
.renewal-notif-empty {
  padding: 32px;
  text-align: center;
  color: #888;
}
.renewal-notif-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.renewal-notif-empty div {
  font-size: 13px;
}
.renewal-notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
  background: #fff;
}
.renewal-notif-item.is-unread {
  background: #f0f9ff;
}
.renewal-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--notif-color) 13%, transparent);
}
.renewal-notif-icon i {
  color: var(--notif-color);
  font-size: 16px;
}
.renewal-notif-body {
  flex: 1;
  min-width: 0;
}
.renewal-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 3px;
}
.renewal-notif-item.is-unread .renewal-notif-item-title {
  font-weight: 700;
}
.renewal-notif-unread-dot {
  width: 6px;
  height: 6px;
  background: #0284c7;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}
.renewal-notif-item-message {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.renewal-notif-item-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}
.renewal-notif-footer {
  padding: 10px 18px;
  text-align: center;
  border-top: 1px solid #f0f2f5;
  background: #f0f9ff;
}
.renewal-notif-footer a {
  font-size: 13px;
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
}
.renewal-user-avatar {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}
.renewal-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 4px 4px 8px;
  cursor: pointer;
}
.renewal-user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: #0369a1;
}
.renewal-user-chip-caret {
  font-size: 11px;
  color: #7dd3fc;
}
body.renewal-shell .page-wrapper {
  margin: 0 0 0 var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.renewal-shell.renewal-sidebar-collapsed .page-wrapper {
  margin-left: var(--sidebar-collapsed-w);
}
body.renewal-shell .app-footer {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.renewal-shell.renewal-sidebar-collapsed .app-footer {
  margin-left: var(--sidebar-collapsed-w);
}
@media (max-width: 991.98px) {
  .renewal-sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.renewal-sidebar-open .renewal-sidebar {
    transform: translateX(0);
  }
  body.renewal-sidebar-open .renewal-sidebar-backdrop {
    display: block;
  }
  .renewal-sidebar-toggle {
    display: none;
  }
  .renewal-topbar,
  body.renewal-sidebar-collapsed .renewal-topbar {
    margin-left: 0;
  }
  body.renewal-shell .page-wrapper,
  body.renewal-shell.renewal-sidebar-collapsed .page-wrapper,
  body.renewal-shell .app-footer,
  body.renewal-shell.renewal-sidebar-collapsed .app-footer {
    margin-left: 0;
  }
  .renewal-mobile-toggle {
    display: block;
  }
}

/* ── Purchases module — teal accent, left sidebar ────────────────── */
.purchase-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #ccfbf1;
  box-shadow: 0 1px 8px rgba(15, 118, 110, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 1031;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease;
}
body.purchase-sidebar-collapsed .purchase-sidebar {
  width: var(--sidebar-collapsed-w);
  overflow: visible;
}
.purchase-sidebar-brand-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  flex-shrink: 0;
}
.purchase-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.purchase-app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #0d9488;
  background: #ccfbf1;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
}
.purchase-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 8px 10px;
  border: none;
  background: var(--gray-50);
  color: var(--gray-500);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.purchase-sidebar-toggle:hover {
  background: #ccfbf1;
  color: #0d9488;
}
.purchase-sidebar-toggle i {
  transition: transform 0.2s ease;
  font-size: 13px;
}
body.purchase-sidebar-collapsed .purchase-sidebar-toggle i {
  transform: rotate(180deg);
}
.purchase-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 16px;
  flex: 1;
}
.purchase-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #0f766e;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.purchase-sidebar-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.purchase-sidebar-link:hover,
.purchase-sidebar-link.active {
  background: #ccfbf1;
  color: #0d9488;
}
.purchase-sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
body.purchase-sidebar-collapsed .purchase-app-badge,
body.purchase-sidebar-collapsed
  .purchase-sidebar-toggle
  .purchase-sidebar-label,
body.purchase-sidebar-collapsed .purchase-sidebar-brand-name {
  display: none;
}
body.purchase-sidebar-collapsed .purchase-sidebar-link .purchase-sidebar-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1032;
}
body.purchase-sidebar-collapsed
  .purchase-sidebar-link:hover
  .purchase-sidebar-label,
body.purchase-sidebar-collapsed
  .purchase-sidebar-link:focus-visible
  .purchase-sidebar-label {
  opacity: 1;
  visibility: visible;
}
.purchase-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 1030;
}
.purchase-topbar {
  margin-left: var(--sidebar-w);
  min-height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid #ccfbf1;
  box-shadow: 0 1px 8px rgba(15, 118, 110, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: margin-left 0.2s ease;
}
body.purchase-sidebar-collapsed .purchase-topbar {
  margin-left: var(--sidebar-collapsed-w);
}
.purchase-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #0f766e;
  font-size: 22px;
  padding: 6px;
  margin-right: auto;
}
.purchase-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.purchase-topbar-link {
  color: #0f766e;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.purchase-topbar-link:hover,
.purchase-topbar-link.active {
  background: #ccfbf1;
  color: #0d9488;
}
.purchase-waffle-btn {
  color: #0f766e !important;
}
.purchase-notif-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #0f766e;
  font-size: 20px;
}
.purchase-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.purchase-notif-dropdown {
  width: 360px;
  border: none;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.purchase-notif-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #fff;
}
.purchase-notif-header-title {
  font-size: 14px;
  font-weight: 700;
}
.purchase-notif-header-subtitle {
  font-size: 11px;
  opacity: 0.7;
}
.purchase-notif-mark-all {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
}
.purchase-notif-list {
  max-height: 380px;
  overflow-y: auto;
}
.purchase-notif-empty {
  padding: 32px;
  text-align: center;
  color: #888;
}
.purchase-notif-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.purchase-notif-empty div {
  font-size: 13px;
}
.purchase-notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
  background: #fff;
}
.purchase-notif-item.is-unread {
  background: #f0fdfa;
}
.purchase-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--notif-color) 13%, transparent);
}
.purchase-notif-icon i {
  color: var(--notif-color);
  font-size: 16px;
}
.purchase-notif-body {
  flex: 1;
  min-width: 0;
}
.purchase-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 3px;
}
.purchase-notif-item.is-unread .purchase-notif-item-title {
  font-weight: 700;
}
.purchase-notif-unread-dot {
  width: 6px;
  height: 6px;
  background: #0f766e;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}
.purchase-notif-item-message {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.purchase-notif-item-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}
.purchase-notif-footer {
  padding: 10px 18px;
  text-align: center;
  border-top: 1px solid #f0f2f5;
  background: #f0fdfa;
}
.purchase-notif-footer a {
  font-size: 13px;
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}
.purchase-user-avatar {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}
.purchase-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 4px 4px 8px;
  cursor: pointer;
}
.purchase-user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
}
.purchase-user-chip-caret {
  font-size: 11px;
  color: #5eead4;
}
body.purchase-shell .page-wrapper {
  margin: 0 0 0 var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.purchase-shell.purchase-sidebar-collapsed .page-wrapper {
  margin-left: var(--sidebar-collapsed-w);
}
body.purchase-shell .app-footer {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.purchase-shell.purchase-sidebar-collapsed .app-footer {
  margin-left: var(--sidebar-collapsed-w);
}
@media (max-width: 991.98px) {
  .purchase-sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.purchase-sidebar-open .purchase-sidebar {
    transform: translateX(0);
  }
  body.purchase-sidebar-open .purchase-sidebar-backdrop {
    display: block;
  }
  .purchase-sidebar-toggle {
    display: none;
  }
  .purchase-topbar,
  body.purchase-sidebar-collapsed .purchase-topbar {
    margin-left: 0;
  }
  body.purchase-shell .page-wrapper,
  body.purchase-shell.purchase-sidebar-collapsed .page-wrapper,
  body.purchase-shell .app-footer,
  body.purchase-shell.purchase-sidebar-collapsed .app-footer {
    margin-left: 0;
  }
  .purchase-mobile-toggle {
    display: block;
  }
}

/* ── CKEditor ───────────────────────────────────────────────────── */
.ck-editor__editable {
  min-height: 160px;
  font-size: 14px;
  line-height: 1.7;
}
.ck-editor__editable_inline {
  min-height: 160px;
}

/* ── Project Form (.pf-*) ───────────────────────────────────────── */
.pf-section {
  margin-bottom: 24px;
}
.pf-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}
.pf-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.pf-section-head h6 {
  font-weight: 700;
  font-size: 14px;
  margin: 0;
  color: #1a1a2e;
}
.pf-section-head p {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.pf-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.pf-label .text-danger {
  font-size: 11px;
}

.pf-status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pf-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  transition: all 0.15s ease;
}
.pf-status-pill:hover {
  border-color: #d1d5db;
}
.pf-status-pill input {
  display: none;
}
.pf-status-pill .pf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.pf-status-pill.active-not_started {
  border-color: #9ca3af;
  background: #f3f4f6;
}
.pf-status-pill.active-in_progress {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #1d4ed8;
}
.pf-status-pill.active-in_review_client {
  border-color: #8b5cf6;
  background: #f5f3ff;
  color: #6d28d9;
}
.pf-status-pill.active-on_hold {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}
.pf-status-pill.active-completed {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}
.pf-status-pill.active-cancelled {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.pf-member-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.pf-member-card:hover {
  border-color: #d1fae5;
}
.pf-member-card .pf-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pf-member-card input {
  border: none;
  background: transparent;
  font-size: 13px;
  padding: 2px 0;
  outline: none;
  width: 100%;
}
.pf-member-card input:focus {
  border-bottom: 1.5px solid #10b981;
}
.pf-member-card input::placeholder {
  color: #9ca3af;
}

.pf-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafbfc;
}
.pf-drop-zone:hover,
.pf-drop-zone.dragover {
  border-color: #10b981;
  background: #ecfdf5;
}
.pf-drop-zone i {
  font-size: 28px;
  color: #9ca3af;
  display: block;
  margin-bottom: 6px;
}
.pf-drop-zone.dragover i {
  color: #10b981;
}

.pf-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #d1fae5;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #065f46;
}
.pf-file-chip .pf-file-remove {
  cursor: pointer;
  color: #ef4444;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.pf-file-chip .pf-file-remove:hover {
  opacity: 1;
}

.pf-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}
.pf-toggle-row:last-child {
  border-bottom: none;
}
.pf-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.pf-toggle-desc {
  font-size: 11.5px;
  color: #9ca3af;
  margin-top: 1px;
}

.pf-budget-input .input-group-text {
  background: #f0fdf4;
  border-color: #d1fae5;
  color: #059669;
  font-weight: 700;
  font-size: 13px;
}

.pf-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(241, 245, 249, 0.95);
  backdrop-filter: blur(8px);
  padding: 14px 0;
  margin-top: 8px;
  border-top: 1px solid #e5e7eb;
}

.pf-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ── DataTables — projects emerald theme ────────────────────────── */
.dataTables_wrapper {
  --dt-accent: #059669;
  --dt-accent-dark: #047857;
  --dt-accent-soft: #ecfdf5;
  --dt-border: #e5e7eb;
  --dt-muted: #6b7280;
  --dt-text: #374151;
  font-size: 13px;
}
.dataTables_wrapper .dt-toolbar,
.dataTables_wrapper .dt-footer {
  margin: 0;
  padding: 14px 16px;
  row-gap: 0.65rem;
}
.dataTables_wrapper .dt-toolbar {
  background: #f8fafb;
  border-bottom: 1px solid #f0f2f5;
  border-radius: 12px 12px 0 0;
}
.dataTables_wrapper .dt-footer {
  background: #f8fafb;
  border-top: 1px solid #f0f2f5;
  border-radius: 0 0 12px 12px;
}
.dataTables_wrapper .dt-toolbar-length,
.dataTables_wrapper .dt-footer-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.dataTables_wrapper .dt-toolbar-filter,
.dataTables_wrapper .dt-footer-paging {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin: 0;
  padding-top: 0;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dt-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid #d1d5db;
  border-radius: 9px;
  min-height: 36px;
  color: var(--dt-text);
  background: #fff;
  font-size: 13px;
  margin: 0;
}
.dataTables_wrapper .dataTables_length select {
  min-width: 78px;
  padding-right: 1.8rem;
}
.dataTables_wrapper .dataTables_filter input {
  min-width: 220px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 0.2rem rgba(16, 185, 129, 0.16);
  outline: 0;
}
.dataTables_wrapper .dt-table-wrap {
  border: none;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}
.dataTables_wrapper .dt-table-wrap .table {
  margin-bottom: 0 !important;
  min-width: 680px;
}
.dataTables_wrapper .dt-table-wrap .table thead th {
  background: #f0fdf4;
  color: #065f46;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #d1fae5;
  padding: 10px 14px;
  white-space: nowrap;
}
.dataTables_wrapper .dt-table-wrap .table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}
.dataTables_wrapper .dt-table-wrap .table tbody tr:hover {
  background: #f0fdf4;
}
.dataTables_wrapper .dataTables_info {
  color: var(--dt-muted);
  font-size: 12px;
  font-weight: 500;
}
.dataTables_wrapper .dataTables_paginate .pagination {
  margin: 0;
  gap: 4px;
}
.dataTables_wrapper .page-item .page-link {
  border: 1px solid #d1fae5;
  border-radius: 8px;
  min-width: 34px;
  height: 34px;
  padding: 0 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--dt-accent-dark);
  background: #fff;
  transition: all 0.15s ease;
}
.dataTables_wrapper .page-item .page-link:hover {
  color: #065f46;
  background: var(--dt-accent-soft);
  border-color: #86efac;
}
.dataTables_wrapper .page-item.active .page-link {
  color: #fff;
  border-color: var(--dt-accent);
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 10px rgba(5, 150, 105, 0.22);
}
.dataTables_wrapper .page-item.disabled .page-link {
  color: #9ca3af;
  border-color: #e5e7eb;
  background: #f9fafb;
  box-shadow: none;
}
.card .dataTables_wrapper {
  border-radius: 0 0 12px 12px;
}
.card .dataTables_wrapper .dt-toolbar {
  border-radius: 0;
}
.card .dataTables_wrapper .dt-footer {
  border-radius: 0 0 12px 12px;
}
@media (max-width: 991.98px) {
  .dataTables_wrapper .dt-toolbar-filter,
  .dataTables_wrapper .dt-footer-paging {
    justify-content: flex-start;
  }
  .dataTables_wrapper .dataTables_filter input {
    min-width: 180px;
  }
}
@media (max-width: 767.98px) {
  .dataTables_wrapper .dt-toolbar,
  .dataTables_wrapper .dt-footer {
    padding: 10px 12px;
  }
  .dataTables_wrapper .dt-toolbar-length,
  .dataTables_wrapper .dt-toolbar-filter,
  .dataTables_wrapper .dt-footer-info,
  .dataTables_wrapper .dt-footer-paging {
    justify-content: center;
    width: 100%;
    text-align: center;
  }
  .dataTables_wrapper .dataTables_filter label {
    width: 100%;
    justify-content: center;
  }
  .dataTables_wrapper .dataTables_filter input {
    min-width: 0;
    width: 100%;
    max-width: 320px;
  }
  .dataTables_wrapper .dataTables_paginate .pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
  .dataTables_wrapper .dt-table-wrap .table {
    min-width: 560px;
  }
}

/* ── CKEditor rendered content ──────────────────────────────────── */
.ck-content h1,
.ck-content h2,
.ck-content h3,
.ck-content h4 {
  font-weight: 700;
  margin: 1em 0 0.4em;
}
.ck-content h1 {
  font-size: 1.6em;
}
.ck-content h2 {
  font-size: 1.3em;
}
.ck-content h3 {
  font-size: 1.1em;
}
.ck-content ul,
.ck-content ol {
  padding-left: 1.8em;
  margin: 0.5em 0;
}
.ck-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.8em 0;
}
.ck-content table td,
.ck-content table th {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  vertical-align: top;
}
.ck-content table th {
  background: #f3f4f6;
  font-weight: 600;
}
.ck-content blockquote {
  border-left: 4px solid #d1d5db;
  margin: 0.8em 0;
  padding: 0.5em 1em;
  color: #6b7280;
}
.ck-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.ck-content figure.image {
  margin: 0.8em auto;
  text-align: center;
}
.ck-content figure.image figcaption {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}
.ck-content pre {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  font-size: 13px;
}

/* ── Project View (.pv-*) layout, priority badges, kanban ─────── */
.pv-layout {
  display: flex;
  flex-direction: column;
}
/* ── Project detail page's section nav — horizontal pill strip below the
   header card (reuses .gtb-quicktab from the Global Task Board so this
   app has one "chip nav" convention instead of two). Replaced the old
   220px-wide left sidebar (.pv-sidebar) so the content column gets full
   width. ── */
.pv-tabbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.pv-tabbar .gtb-quicktab {
  flex-shrink: 0;
}
.pv-tabbar-divider {
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  background: #e5e7eb;
  margin: 0 4px;
  flex-shrink: 0;
}
.pv-content {
  flex: 1;
  min-width: 0;
  padding: 24px;
  overflow-x: auto;
}
.priority-urgent {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
.priority-high {
  background: #fff7ed;
  color: #92400e;
  border: 1px solid #fed7aa;
}
.priority-medium {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.priority-low {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}
.kanban-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 12px;
}
.kanban-col {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  min-height: 200px;
  border-top: 3px solid #e5e7eb;
}
.kanban-col-planning_research {
  border-top-color: #0ea5e9;
}
.kanban-col-todo {
  border-top-color: #6b7280;
}
.kanban-col-in_progress {
  border-top-color: #3b82f6;
}
.kanban-col-hold {
  border-top-color: #ea580c;
}
.kanban-col-review {
  border-top-color: #f59e0b;
}
.kanban-col-done {
  border-top-color: #10b981;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 700;
}
.kanban-text-planning_research {
  color: #0ea5e9;
}
.kanban-text-todo {
  color: #6b7280;
}
.kanban-text-in_progress {
  color: #3b82f6;
}
.kanban-text-hold {
  color: #ea580c;
}
.kanban-text-review {
  color: #f59e0b;
}
.kanban-text-done {
  color: #10b981;
}
.kanban-col-count {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 2px 8px;
}
.kanban-empty {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 24px 0;
}
.kanban-empty i {
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
  color: #d1d5db;
}
.kanban-card {
  position: relative;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}
.kanban-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}
.kanban-card[draggable="true"] {
  cursor: grab;
}
.kanban-card .priority-strip {
  height: 3px;
  border-radius: 2px;
  margin: -12px -12px 10px;
}
.priority-strip.strip-low {
  background: #10b981;
}
.priority-strip.strip-medium {
  background: #3b82f6;
}
.priority-strip.strip-high {
  background: #f59e0b;
}
.priority-strip.strip-urgent {
  background: #ef4444;
}
.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  min-height: 16px;
}
.kanban-card-milestone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-drag-handle {
  color: #d1d5db;
  cursor: grab;
  flex-shrink: 0;
  padding: 2px;
}
.kanban-drag-handle:hover {
  color: #9ca3af;
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
  display: block;
  line-height: 1.4;
}
.kanban-card-title:hover {
  color: var(--primary-dark);
}
.kanban-card-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.kanban-card-label {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 6px;
}
.kanban-pill-warn {
  display: inline-block;
  margin-top: 8px;
  background: #fef3c7;
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  white-space: nowrap;
}
.kanban-card-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.kanban-card-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #f1f5f9;
  overflow: hidden;
}
.kanban-card-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
}
.kanban-card-progress span {
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
}
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}
.kanban-card-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kanban-card-avatar.is-unassigned {
  background: #f1f5f9;
  color: #9ca3af;
  font-size: 12px;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.kanban-card-priority,
.kanban-card-due,
.kanban-card-hours {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  color: #9ca3af;
  white-space: nowrap;
}
.kanban-card-priority {
  color: #d1d5db;
}
.kanban-card-due.is-overdue {
  color: var(--danger);
  font-weight: 600;
}
/* ── Project detail page's Task Board tab — reuses .kanban-col/
   .kanban-col-body/.kanban-card etc. as-is, but reflows them into a
   horizontally-scrolling row (.pv-board/.pv-board-col) instead of a
   wrapping Bootstrap grid, matching the Global Task Board's behavior. ── */
.pv-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.pv-board-col {
  flex: 0 0 280px;
  width: 280px;
}
/* Fixed bottom-right drag handle for scrolling .pv-board horizontally —
   same mechanism as .gtb-hscroll (Global Task Board), anchored to the
   right instead of centered. */
.pv-hscroll {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 1030;
  display: none;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 5px;
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.14),
    0 2px 6px rgba(15, 23, 42, 0.06);
}
.pv-hscroll.is-visible {
  display: block;
}
.pv-hscroll-track {
  position: relative;
  display: flex;
  gap: 3px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.pv-hscroll.is-dragging .pv-hscroll-track {
  cursor: grabbing;
}
.pv-hscroll-seg {
  width: 26px;
  height: 24px;
  border-radius: 6px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.pv-hscroll-thumb {
  position: absolute;
  top: -1px;
  left: 0;
  height: 26px;
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.1);
  border: 1.5px solid var(--primary);
  pointer-events: none;
  transition:
    left 0.08s linear,
    width 0.08s linear;
}

/* Drag & drop */
.kanban-card.is-dragging {
  opacity: 0.35;
  cursor: grabbing;
}
.kanban-col-body {
  transition:
    background 0.15s,
    outline 0.15s;
  outline: 2px dashed transparent;
  outline-offset: -4px;
  border-radius: 8px;
  min-height: 40px;
}
.kanban-col-body.is-drag-over {
  background: var(--primary-light);
  outline-color: var(--primary);
}
.kanban-card.is-moving {
  position: relative;
  opacity: 0.55;
  pointer-events: none;
}
.kanban-card-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
}
.kanban-card-spinner .spinner-border {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
}
.kanban-card.just-moved {
  animation: kanban-card-settle 0.5s ease;
}
@keyframes kanban-card-settle {
  0% {
    box-shadow: 0 0 0 2px var(--primary);
  }
  100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}
.kanban-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 2000;
}
.kanban-toast.show {
  opacity: 1;
  transform: translateY(0);
}
.kanban-toast.is-error {
  background: var(--danger);
}

/* ── Global Task Board (projects/tasks.php) — reuses .kanban-card/
   .kanban-col/.kanban-col-body/.kanban-col-head/.kanban-col-count/
   .kanban-empty for the shared box/drag-state visuals; these rules cover
   only what's actually new (stage count is admin-configurable, so the
   board scrolls horizontally rather than using a fixed Bootstrap grid
   like the per-project board does). ── */
.gtb-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.gtb-col {
  flex: 0 0 280px;
  width: 280px;
}
/* ── Fixed bottom drag handle for scrolling .gtb-board horizontally,
   so the user doesn't have to scroll the page down to reach the native
   scrollbar. One segment per column; a thumb overlay tracks the visible
   range and can be dragged (or a segment clicked) to jump — shown only
   when the board is actually wider than the viewport (gtb.js). ── */
.gtb-hscroll {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1030;
  display: none;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 5px;
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.14),
    0 2px 6px rgba(15, 23, 42, 0.06);
}
.gtb-hscroll.is-visible {
  display: block;
}
.gtb-hscroll-track {
  position: relative;
  display: flex;
  gap: 3px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.gtb-hscroll.is-dragging .gtb-hscroll-track {
  cursor: grabbing;
}
.gtb-hscroll-seg {
  width: 26px;
  height: 24px;
  border-radius: 6px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
.gtb-hscroll-thumb {
  position: absolute;
  top: -1px;
  left: 0;
  height: 26px;
  border-radius: 8px;
  background: rgba(79, 70, 229, 0.1);
  border: 1.5px solid var(--primary);
  pointer-events: none;
  transition:
    left 0.08s linear,
    width 0.08s linear;
}
.gtb-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
  display: block;
  line-height: 1.4;
}
.gtb-card-title:hover {
  color: var(--primary);
}
.gtb-card-sub-tag {
  font-size: 10.5px;
  font-weight: 700;
  color: #7c3aed;
  margin-bottom: 4px;
}
.gtb-card-client {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #64748b;
  margin: 4px 0;
}
.gtb-card-client a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}
.gtb-card-client a:hover {
  text-decoration: underline;
}
.gtb-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
}
.gtb-pill-neutral {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}
.gtb-pill-danger {
  background: #fef2f2;
  color: #dc2626;
}
.gtb-pill-warn {
  background: #fef3c7;
  color: #b45309;
}
.gtb-pill-info {
  background: #eff6ff;
  color: #2563eb;
}
.gtb-badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  color: #2563eb;
  background: #eff6ff;
}
.gtb-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.gtb-edit-btn {
  color: #94a3b8;
  text-decoration: none;
}
.gtb-edit-btn:hover {
  color: var(--primary);
}
.gtb-avatar-stack {
  display: flex;
  align-items: center;
}
.gtb-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid #fff;
  margin-left: -6px;
}
.gtb-avatar:first-child {
  margin-left: 0;
}
.gtb-avatar.is-empty {
  background: #e2e8f0;
  color: #94a3b8;
}
.gtb-avatar.gtb-avatar-more {
  background: #cbd5e1;
  color: #475569;
  font-size: 9px;
}
.gtb-quicktab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 5px 12px;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.gtb-quicktab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.gtb-quicktab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.gtb-quicktab-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0 6px;
}
.gtb-quicktab.is-active .gtb-quicktab-count {
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
  .pv-tabbar {
    padding: 8px 16px;
  }
  .pv-content {
    padding: 16px;
  }
}

/* ── Global Tasks page (.tasks.*) ───────────────────────────────── */
.priority-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  position: relative;
}
.status-pill i {
  font-size: 10px;
}
.status-planning_research {
  background: #e0f2fe;
  color: #0369a1;
}
.status-todo {
  background: #f1f5f9;
  color: #64748b;
}
.status-in_progress {
  background: #dbeafe;
  color: #2563eb;
}
.status-hold {
  background: #ffedd5;
  color: #c2410c;
}
.status-review {
  background: #fef3c7;
  color: #b45309;
}
.status-done {
  background: #dcfce7;
  color: #16a34a;
}
.status-dropdown {
  position: relative;
  display: inline-block;
}
.status-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 4px;
  min-width: 150px;
  margin-top: 4px;
}
.status-dropdown.open .status-dropdown-menu {
  display: block;
}
.status-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}
.status-dropdown-item:hover {
  background: #f1f5f9;
}
.status-dropdown-item .sd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dropdown-item.sd-active {
  font-weight: 700;
  background: #f8fafc;
}
.due-overdue {
  color: #dc2626;
  font-weight: 600;
}
.timer-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
}
.timer-banner .timer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  animation: pulse-dot 1.5s infinite;
  display: inline-block;
}
.timer-banner .timer-dot.is-paused {
  animation: none;
  opacity: 0.5;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
.task-table tbody tr {
  transition: background 0.1s;
}
.task-table tbody tr:hover {
  background: #f8fafc;
}
.task-table tbody tr.subtask-row-nested {
  background: #fbfcfe;
}
.task-table tbody tr.subtask-row-nested:hover {
  background: #f1f5f9;
}
.task-table tbody tr.subtask-row-nested .task-title-link {
  font-size: 12.5px;
  font-weight: 500;
}
.task-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  font-weight: 600;
  border-bottom: 2px solid #f1f5f9;
  padding: 10px 12px;
}
.task-table td {
  padding: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #f8fafc;
}
.task-title-link {
  color: #1e293b;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
}
.task-title-link:hover {
  color: #059669;
}

/* ── Task Detail page (.td-*) ───────────────────────────────────── */
.td-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
}
.td-main {
  flex: 1;
  min-width: 0;
  padding: 28px;
}
.td-side {
  width: 280px;
  min-width: 280px;
  padding: 28px 20px 28px 0;
  border-left: 1px solid #f3f4f6;
}
.comment-bubble {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.subtask-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  margin-bottom: 6px;
  background: #fff;
}
.subtask-row.done-task {
  opacity: 0.55;
}
.subtask-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  background: transparent;
}
form.subtask-toggle-form {
  margin: 0;
  padding: 0;
  display: inline;
}
.subtask-check:hover {
  border-color: #059669;
}
.done-task .subtask-check {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}
.subtask-input-wrap {
  position: relative;
}
.subtask-input-wrap .form-control {
  padding-right: 30px !important;
}
.subtask-input-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-300, #d1d5db);
  font-size: 13px;
  pointer-events: none;
}

/* Checklist — same row/check shell as .subtask-row/.subtask-check, blue
   accent instead of green so the two task-detail cards read as visually
   distinct at a glance (checklist = blue, sub-task = green/purple). */
.checklist-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  margin-bottom: 6px;
  background: #fff;
}
.checklist-check {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  background: transparent;
}
.checklist-check:hover {
  border-color: var(--primary);
}
.checklist-check.is-checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.checklist-item-title {
  font-size: 13px;
  cursor: text;
  outline: none;
  word-break: break-word;
}
.checklist-item-title:focus {
  background: #eff6ff;
  border-radius: 4px;
}
.comment-input-wrap {
  position: relative;
}
.comment-input-wrap .form-control {
  padding-right: 30px !important;
}
.comment-input-hint {
  position: absolute;
  right: 10px;
  top: 10px;
  color: var(--gray-300, #d1d5db);
  font-size: 13px;
  pointer-events: none;
}
/* Comment/reply composer: current-user avatar to the left + submit-shortcut hint */
.comment-compose-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.comment-compose-main {
  flex: 1;
  min-width: 0;
}
.comment-compose-hint {
  font-size: 11px;
  color: var(--gray-400, #9ca3af);
  margin-top: 4px;
}
.comment-compose-hint kbd {
  font-size: 10px;
}
.task-timer-card {
  transition: box-shadow 0.15s;
}
.task-timer-card.is-running {
  box-shadow: 0 0 0 1px var(--dt-accent, #059669) inset;
}
.task-timer-card.is-paused {
  box-shadow: 0 0 0 1px var(--warning) inset;
}
.task-timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-timer-clock {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-800);
}
.task-timer-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dt-accent, #059669);
  animation: task-timer-pulse 1.6s ease-in-out infinite;
}
.task-timer-dot.is-paused {
  background: var(--warning);
  animation: none;
}
@keyframes task-timer-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.task-timer-estimate {
  padding: 0 16px 16px;
}
@media (prefers-reduced-motion: reduce) {
  .task-timer-dot {
    animation: none;
  }
}

@media (max-width: 768px) {
  .td-layout {
    flex-direction: column;
  }
  .td-side {
    width: 100%;
    border-left: none;
    border-top: 1px solid #f3f4f6;
    padding: 16px;
  }
  .td-main {
    padding: 16px;
  }
}

/* ── Invoice / Estimate view — print overrides ──────────────────── */
@media print {
  .main-navbar,
  .page-header .btn,
  .col-xl-4,
  .page-header p,
  .alert {
    display: none !important;
  }
  .col-xl-8 {
    width: 100% !important;
    flex: 0 0 100% !important;
  }
  .page-wrapper {
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: none !important;
  }
}

/* ── Changelog ──────────────────────────────────────────────────── */
.changelog-version {
  background: white;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.changelog-version:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.changelog-version.latest {
  border-color: #c4b5fd;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}
.changelog-header {
  background: #f8f9fb;
  padding: 18px 24px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.changelog-version.latest .changelog-header {
  background: #f5f3ff;
}
.version-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.version-dot.latest {
  background: #4f46e5;
  color: white;
}
.version-number {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a2e;
  font-family: "SF Mono", monospace;
}
.version-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
}
.version-date {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}
.changelog-body {
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.changelog-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f4f6f9;
  font-size: 13.5px;
}
.changelog-item:last-child {
  border-bottom: none;
}
.change-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.change-text {
  color: #374151;
  line-height: 1.5;
  padding-top: 2px;
}
code {
  background: #f1f0fe;
  color: #4f46e5;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
}
.changelog-sidebar {
  position: sticky;
  top: 80px;
  background: white;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  overflow: hidden;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.changelog-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f2f5;
}
.changelog-sidebar-link {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #f4f6f9;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.changelog-sidebar-link:last-child {
  border-bottom: none;
}
.changelog-sidebar-link:hover {
  background: #f5f3ff;
  border-left-color: #c4b5fd;
}
.changelog-sidebar-link.active {
  background: #f0efff;
  border-left-color: #4f46e5;
}
.changelog-sidebar-ver {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  font-family: "SF Mono", monospace;
}
.changelog-sidebar-link.active .changelog-sidebar-ver {
  color: #4f46e5;
}
.changelog-sidebar-name {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.changelog-sidebar::-webkit-scrollbar {
  width: 4px;
}
.changelog-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.changelog-sidebar::-webkit-scrollbar-thumb {
  background: #e0e0e0;
  border-radius: 4px;
}

/* ── Services form (.item-type-option, .price-summary-row) ──────── */
.item-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid #e8ecf0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
  transition: all 0.15s;
  user-select: none;
  min-width: 120px;
  justify-content: center;
}
.item-type-option:hover {
  border-color: #4f46e5;
  color: #4f46e5;
  background: #f5f3ff;
}
.item-type-option.active {
  border-color: #4f46e5;
  background: #f0efff;
  color: #4f46e5;
}
.item-type-option i {
  font-size: 18px;
}
.price-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: #555;
  border-bottom: 1px dashed #e8ecf0;
}
.price-summary-row:last-child {
  border-bottom: none;
}

/* ── Credit Note type button (.cn-type-btn) ─────────────────────── */
.cn-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 24px;
  border: 2px solid #e8ecf0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
  transition: all 0.15s;
  min-width: 160px;
  text-align: center;
  user-select: none;
}
.cn-type-btn small {
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
}
.cn-type-btn:hover,
.cn-type-btn.active {
  border-color: #dc2626;
  background: #fef2f2;
  color: #dc2626;
}
.cn-type-btn.active small {
  color: #dc2626;
}

/* ── Bank — transaction type button (.txn-type-btn) ─────────────── */
.txn-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 32px;
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
  transition: all 0.15s;
  min-width: 160px;
  text-align: center;
  user-select: none;
  background: white;
}
.txn-type-btn small {
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
}
.txn-type-btn.active-in {
  border-color: #16a34a;
  background: #f0fdf4;
}
.txn-type-btn.active-out {
  border-color: #dc2626;
  background: #fef2f2;
}

/* ── Bank — account type button (.acc-type-btn) ─────────────────── */
.acc-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  border: 2px solid #e8ecf0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
  transition: all 0.15s;
  min-width: 140px;
  text-align: center;
  user-select: none;
  background: white;
}
.acc-type-btn small {
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
}
.acc-type-btn.active {
  background: #f5f3ff;
  color: #4f46e5;
}

/* ── Estimates / FY report — print overrides ────────────────────── */
@media print {
  .main-navbar,
  .page-header .btn,
  .col-xl-4,
  .alert,
  select,
  .btn {
    display: none !important;
  }
  .col-xl-8 {
    width: 100% !important;
    flex: 0 0 100% !important;
  }
  .page-wrapper {
    padding: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: none !important;
  }
}

/* ── PM Reports ──────────────────────────────────────────────────── */
.report-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}
.report-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.report-tab:hover {
  color: #059669;
}
.report-tab.active {
  color: #059669;
  border-bottom-color: #059669;
}
.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 16px;
}
/* Fields had no width rule at all, so each one shrank to fit its own
   content and left-bunched with a big empty gap before the Apply button
   (only .report-filter-actions had a width behavior, via margin-left:auto).
   flex-grow spreads them out to fill the row like the Bootstrap
   col-md-* grid other filter bars in the app use. */
.report-filter-field {
  flex: 1 1 180px;
  min-width: 160px;
}
.report-filter-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}
.report-filter-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.report-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
}
.report-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}
.report-kpi-label {
  font-size: 11.5px;
  color: #6b7280;
  margin-top: 4px;
}
.report-attention-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.report-attention-panel h6 {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
}
.report-attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.report-attention-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 12.5px;
}
.report-attention-item:last-child {
  border-bottom: none;
}
.report-attention-item a {
  color: #111827;
  text-decoration: none;
  font-weight: 600;
}
.report-attention-item a:hover {
  color: #059669;
}
.report-attention-empty {
  font-size: 12.5px;
  color: #9ca3af;
  padding: 8px 0;
}
.report-table-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.report-table-wrap table {
  margin-bottom: 0;
}
.report-drilldown-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #059669;
  text-decoration: none;
  margin-bottom: 12px;
}
.report-drilldown-back:hover {
  color: #047857;
}
@media print {
  .report-tabs,
  .report-filter-bar,
  .report-drilldown-back {
    display: none !important;
  }
}

/* ── Reports — stat sub label ───────────────────────────────────── */
.stat-sub {
  font-size: 11.5px;
  color: #888;
  margin-top: 3px;
}
#print-header {
  display: none;
}

/* ── Reports — print ────────────────────────────────────────────── */
@media print {
  @page {
    size: A4 landscape;
    margin: 15mm 12mm 12mm 12mm;
  }
  #print-header {
    display: block !important;
    margin-bottom: 12px;
  }
  .ph-company {
    font-size: 18px;
    font-weight: 800;
    color: #000;
    line-height: 1.2;
  }
  .ph-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-top: 2px;
  }
  .ph-meta {
    font-size: 10px;
    color: #555;
    margin-top: 3px;
  }
  .ph-rule {
    border: none;
    border-top: 2px solid #000;
    margin: 8px 0 14px;
  }
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    border-radius: 4px !important;
    margin-bottom: 12px !important;
    page-break-inside: avoid;
  }
  .card-header {
    background: #f2f2f2 !important;
    border-bottom: 1px solid #ccc !important;
    padding: 6px 10px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #000 !important;
  }
  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    padding: 8px 10px !important;
    page-break-inside: avoid;
    background: white !important;
  }
  .stat-label {
    font-size: 9px !important;
    color: #555 !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .stat-value {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #000 !important;
    line-height: 1.3;
  }
  .stat-sub {
    font-size: 9px !important;
    color: #666 !important;
  }
  .row {
    margin: 0 !important;
  }
  .col-6,
  .col-md-2,
  .col-md-3,
  .col-md-4,
  .col-xl-4,
  .col-xl-8,
  .col-xl-9 {
    padding: 3px !important;
  }
  .col-xl-4,
  .col-xl-8 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
  .table-responsive {
    overflow: visible !important;
  }
  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10px !important;
    page-break-inside: auto;
  }
  thead {
    display: table-header-group;
  }
  tfoot {
    display: table-footer-group;
  }
  th {
    background: #e8e8e8 !important;
    color: #000 !important;
    border: 1px solid #aaa !important;
    padding: 4px 6px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
  }
  td {
    border: 1px solid #ccc !important;
    padding: 3px 6px !important;
    color: #000 !important;
    font-size: 10px !important;
  }
  tfoot td {
    background: #f0f0f0 !important;
    font-weight: 700 !important;
    border-top: 2px solid #888 !important;
  }
  tr {
    page-break-inside: avoid;
  }
  tr[style*="opacity:.35"] {
    opacity: 0.5 !important;
  }
  .collection-bar {
    display: none !important;
  }
  .badge {
    border: 1px solid #888 !important;
    background: white !important;
    color: #000 !important;
    font-size: 9px !important;
    padding: 1px 4px !important;
  }
  .aging-badge {
    border: 1px solid #888 !important;
    padding: 1px 5px !important;
    border-radius: 3px !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    background: white !important;
    color: #000 !important;
  }
  .card[style*="border:2px solid #4f46e5"] {
    border: 2px solid #000 !important;
    background: #f8f8f8 !important;
  }
  a {
    color: #000 !important;
    text-decoration: none !important;
  }
  .mono {
    font-family: monospace !important;
  }
  .card-header a {
    display: none !important;
  }
  .card-body > div[style*="border-bottom"] {
    border-bottom: 1px solid #eee !important;
    padding: 4px 8px !important;
  }
}

/* ── Contracts — view page (.contract-body, .timeline-*) ────────── */
.contract-body {
  line-height: 1.8;
  font-size: 14px;
  background: #fff;
  padding: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}
.timeline-item {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}
.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Contract sidebar action card ─────────────────────────── */
.contract-action-card .card-body {
  padding: 24px;
}
.contract-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}
.contract-action-draft .contract-action-icon,
.contract-action-sent .contract-action-icon {
  background: #eff6ff;
  color: #2563eb;
}
.contract-action-signed .contract-action-icon {
  background: #f0fdf4;
  color: #059669;
}
.contract-action-declined .contract-action-icon {
  background: #fef2f2;
  color: #dc2626;
}
.contract-action-expired .contract-action-icon {
  background: #fffbeb;
  color: #d97706;
}
.contract-action-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 4px;
}
.contract-action-signed .contract-action-title {
  color: #059669;
}
.contract-action-declined .contract-action-title {
  color: #dc2626;
}
.contract-action-expired .contract-action-title {
  color: #d97706;
}
.contract-action-desc {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 16px;
}
.contract-action-link {
  border-top: 1px solid #f3f4f6;
  padding-top: 14px;
}
.contract-action-link-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin-bottom: 6px;
}
.contract-action-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
}
.contract-action-link-url {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contract-action-copy-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.contract-action-copy-btn:hover {
  border-color: #059669;
  color: #059669;
}
.contract-action-override {
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
  margin-top: 16px;
}
.contract-action-override summary {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
}
.contract-action-override summary:hover {
  color: #6b7280;
}
.contract-action-override form {
  margin-top: 10px;
}

/* ── Contracts list: Type multiselect filter ─────────────────── */
.contract-type-toggle {
  position: relative;
  display: flex !important;
  align-items: center;
  padding-right: 32px !important;
}
.contract-type-toggle.active {
  color: #059669 !important;
  border-color: #059669 !important;
  background: #f0fdf4 !important;
}
/* Bootstrap's dropdown-toggle caret is inline right after the text by
   default; every real <select>/Select2 box on this same row pins its
   arrow to the far right edge instead, so this button (standing in for a
   select) needs the same treatment to look like part of the row. */
.contract-type-toggle::after {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -2px;
}
.contract-type-menu {
  min-width: 220px;
}
.contract-type-menu .dropdown-item {
  border-radius: 6px;
  cursor: pointer;
}
.contract-type-menu .dropdown-item:hover {
  background: #f9fafb;
}
.contract-type-menu .form-check-input:checked {
  background-color: #059669;
  border-color: #059669;
}

/* ── Project Notes: sticky-note grid ───────────────────────────── */
.sticky-note {
  position: relative;
  border: 1px solid;
  border-radius: 3px;
  padding: 18px 16px 14px;
  min-height: 170px;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.sticky-note:hover,
.sticky-note:focus-visible {
  transform: rotate(0deg) scale(1.04) !important;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.16),
    0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 2;
  outline: none;
}
.sticky-note-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.25),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.sticky-note-title {
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 6px;
  word-break: break-word;
}
.sticky-note-body {
  font-size: 13px;
  color: #374151;
  line-height: 1.45;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.sticky-note-author {
  font-size: 10.5px;
  color: rgba(0, 0, 0, 0.5);
  font-weight: 600;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sticky-note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}
.sticky-note-date {
  font-size: 10.5px;
  color: rgba(0, 0, 0, 0.45);
  font-weight: 600;
}
.sticky-note-delete {
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.35);
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition:
    color 0.15s,
    background 0.15s;
}
.sticky-note-delete:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}
@media (prefers-reduced-motion: reduce) {
  .sticky-note {
    transition: none;
  }
}

/* ── Notes: per-note passcode lock ────────────────────────────── */
.notes-pin-input {
  width: 100%;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 10px;
  padding: 10px 12px 10px 22px;
}
.notes-lock-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
}
.notes-lock-link:hover {
  color: var(--primary-dark);
}
.sticky-note-locked {
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}
.sticky-note-locked-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 8px;
}
.sticky-note-locked-text {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 12px;
}
.sticky-note-lock-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.35);
}

/* ── Searchable select (Select2), sized to match .form-control/.form-select
   exactly (this app overrides Bootstrap's own padding/font-size/border with
   !important, so those values — not Bootstrap's defaults — are the ones a
   Select2 box must match to sit flush next to a normal input). No separate
   -sm variant: every filter-row control matches this one full size — see
   the note by .form-control-sm above.

   !important is required on every property here: select2.min.css (loaded
   from the CDN in every header, always AFTER this file) sets
   .select2-container--default .select2-selection--single
   .select2-selection__rendered { line-height: 28px } at the SAME selector
   specificity (3 classes) as the rule below — a specificity tie is decided
   by source order, and since select2.min.css loads later it was silently
   winning, forcing every Select2 box to a fixed 28px line-height regardless
   of what padding/font-size this file set.

   position: relative is also required on .select2-selection--single:
   select2.min.css never sets it there (only on the outer .select2-container,
   several levels up), so the arrow span's `height:100%; top:0` and the
   arrow icon's own `top:50%` were resolving against that outer container
   instead of the visible box — the arrow rendered up near the top instead
   of centered. ── */
.js-search-select + .select2-container .select2-selection--single {
  position: relative !important;
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  padding: 9px 12px !important;
  border: 1.5px solid var(--gray-200) !important;
  border-radius: 8px !important;
  background-color: #fff !important;
}
.js-search-select + .select2-container .select2-selection__rendered {
  padding: 0 !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  color: var(--gray-800) !important;
}
.js-search-select + .select2-container .select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
  right: 6px !important;
}
.js-search-select + .select2-container--focus .select2-selection--single,
.js-search-select + .select2-container--open .select2-selection--single {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.select2-dropdown {
  border-radius: 8px;
  border-color: var(--gray-200);
  font-size: 13.5px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13.5px;
}
.select2-container--default
  .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary);
}

/* ── AI INSIGHTS ────────────────────────────────────────────── */
.ai-usage-scroll {
  max-height: 320px;
  overflow-y: auto;
}

/* ── Lead Pipeline ────────────────────────────────────────────── */
.badge-lead-new {
  background: #ede9fe;
  color: #5b21b6;
}
.badge-lead-contacted {
  background: #e0f2fe;
  color: #0369a1;
}
.badge-lead-qualified {
  background: #e0f2fe;
  color: #0e7490;
}
.badge-lead-proposal_sent {
  background: #fef9c3;
  color: #854d0e;
}
.badge-lead-negotiation {
  background: #fff7ed;
  color: #c2410c;
}
.badge-lead-won {
  background: #dcfce7;
  color: #15803d;
}
.badge-lead-lost {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-stage-dynamic {
  background: var(--stage-bg, #f1f5f9);
  color: var(--stage-text, #334155);
}

.stage-settings-list {
  display: flex;
  flex-direction: column;
}
.stage-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid #f1f5f9;
  cursor: grab;
}
.stage-settings-row.is-dragging {
  opacity: 0.4;
}
.stage-settings-drag {
  color: #cbd5e1;
  font-size: 16px;
}
.stage-settings-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex: 0 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.stage-settings-label {
  font-weight: 600;
  font-size: 14px;
  color: #1e293b;
}
.stage-settings-lock {
  color: #94a3b8;
  font-size: 12px;
}
.stage-settings-count {
  color: #94a3b8;
  font-size: 12.5px;
  margin-left: auto;
}
.stage-settings-actions {
  display: flex;
  gap: 6px;
}
.stage-settings-edit {
  padding: 10px 4px 14px 38px;
  border-bottom: 1px solid #f1f5f9;
}
.stage-settings-blocked {
  padding: 10px 4px 14px 38px;
  font-size: 13px;
  color: #92400e;
  border-bottom: 1px solid #f1f5f9;
}

.leads-kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.leads-kanban-col {
  flex: 0 0 260px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px;
  min-height: 200px;
}
.leads-kanban-col.is-drag-over {
  background: var(--primary-light);
}
.leads-kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.leads-kanban-col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
}
.leads-kanban-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  text-decoration: none;
  color: inherit;
  display: block;
}
.leads-kanban-card:hover {
  border-color: var(--primary);
}
.leads-kanban-card.is-dragging {
  opacity: 0.4;
}
.leads-kanban-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}
.leads-kanban-card-company {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}
.leads-kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.leads-kanban-card-value {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.leads-kanban-card-age {
  font-size: 11px;
  color: #9ca3af;
}
.leads-kanban-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 20px 8px;
}
.leads-breadcrumb {
  font-size: 13px;
  padding: 6px 0;
  --bs-breadcrumb-divider: none;
}
.leads-breadcrumb .breadcrumb-item {
  display: flex;
  align-items: center;
}
.leads-breadcrumb .breadcrumb-item + .breadcrumb-item {
  padding-left: 8px;
}
.leads-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  content: "\203A";
  font-size: 14px;
  color: #cbd5e1;
  padding-right: 8px;
  float: none;
}
.leads-breadcrumb .breadcrumb-item a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.leads-breadcrumb .breadcrumb-item a:hover {
  color: #db2777;
}
.leads-breadcrumb .breadcrumb-item a i,
.leads-breadcrumb .breadcrumb-item.active i {
  font-size: 12.5px;
}
.leads-breadcrumb .breadcrumb-item.active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #db2777;
  font-weight: 700;
}
.leads-row-clickable {
  cursor: pointer;
}
.leads-sort-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.leads-sort-link:hover {
  color: var(--primary);
}
.leads-sort-link i {
  font-size: 11px;
  margin-left: 2px;
}
.leads-form-card {
  max-width: 640px;
}
.leads-sources-add-card {
  max-width: 480px;
}
.leads-cursor-pointer {
  cursor: pointer;
}

/* ── Leads module — pink/rose accent, left sidebar ───────────── */
.lead-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #fce7f3;
  box-shadow: 0 1px 8px rgba(219, 39, 119, 0.07);
  display: flex;
  flex-direction: column;
  z-index: 1031;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.2s ease;
}
body.lead-sidebar-collapsed .lead-sidebar {
  width: var(--sidebar-collapsed-w);
  overflow: visible;
}
.lead-sidebar-brand-row {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  flex-shrink: 0;
}
.lead-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.lead-app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 18px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #db2777;
  background: #fce7f3;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  width: fit-content;
  white-space: nowrap;
  overflow: hidden;
}
.lead-sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 8px 10px;
  border: none;
  background: var(--gray-50);
  color: var(--gray-500);
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  flex-shrink: 0;
}
.lead-sidebar-toggle:hover {
  background: #fce7f3;
  color: #db2777;
}
.lead-sidebar-toggle i {
  transition: transform 0.2s ease;
  font-size: 13px;
}
body.lead-sidebar-collapsed .lead-sidebar-toggle i {
  transform: rotate(180deg);
}
.lead-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 16px;
  flex: 1;
}
.lead-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #be185d;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}
.lead-sidebar-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.lead-sidebar-link:hover,
.lead-sidebar-link.active {
  background: #fce7f3;
  color: #db2777;
}
.lead-sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
}
body.lead-sidebar-collapsed .lead-app-badge,
body.lead-sidebar-collapsed .lead-sidebar-toggle .lead-sidebar-label,
body.lead-sidebar-collapsed .lead-sidebar-brand-name {
  display: none;
}
body.lead-sidebar-collapsed .lead-sidebar-link .lead-sidebar-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 1032;
}
body.lead-sidebar-collapsed .lead-sidebar-link:hover .lead-sidebar-label,
body.lead-sidebar-collapsed
  .lead-sidebar-link:focus-visible
  .lead-sidebar-label {
  opacity: 1;
  visibility: visible;
}
.lead-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  z-index: 1030;
}
.lead-topbar {
  margin-left: var(--sidebar-w);
  min-height: var(--navbar-h);
  background: #fff;
  border-bottom: 1px solid #fce7f3;
  box-shadow: 0 1px 8px rgba(219, 39, 119, 0.07);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
  transition: margin-left 0.2s ease;
}
body.lead-sidebar-collapsed .lead-topbar {
  margin-left: var(--sidebar-collapsed-w);
}
.lead-mobile-toggle {
  display: none;
  border: none;
  background: transparent;
  color: #be185d;
  font-size: 22px;
  padding: 6px;
  margin-right: auto;
}
.lead-topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lead-topbar-link {
  color: #be185d;
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}
.lead-topbar-link:hover,
.lead-topbar-link.active {
  background: #fce7f3;
  color: #db2777;
}
.lead-waffle-btn {
  color: #be185d !important;
}
.lead-notif-bell {
  position: relative;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #be185d;
  font-size: 20px;
}
.lead-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 4px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lead-notif-dropdown {
  width: 360px;
  border: none;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}
.lead-notif-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
}
.lead-notif-header-title {
  font-size: 14px;
  font-weight: 700;
}
.lead-notif-header-subtitle {
  font-size: 11px;
  opacity: 0.7;
}
.lead-notif-mark-all {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11px;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
}
.lead-notif-list {
  max-height: 380px;
  overflow-y: auto;
}
.lead-notif-empty {
  padding: 32px;
  text-align: center;
  color: #888;
}
.lead-notif-empty i {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}
.lead-notif-empty div {
  font-size: 13px;
}
.lead-notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
  background: #fff;
}
.lead-notif-item.is-unread {
  background: #fdf2f8;
}
.lead-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--notif-color) 13%, transparent);
}
.lead-notif-icon i {
  color: var(--notif-color);
  font-size: 16px;
}
.lead-notif-body {
  flex: 1;
  min-width: 0;
}
.lead-notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a2e;
  line-height: 1.3;
  margin-bottom: 3px;
}
.lead-notif-item.is-unread .lead-notif-item-title {
  font-weight: 700;
}
.lead-notif-unread-dot {
  width: 6px;
  height: 6px;
  background: #db2777;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}
.lead-notif-item-message {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-notif-item-time {
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}
.lead-notif-footer {
  padding: 10px 18px;
  text-align: center;
  border-top: 1px solid #f0f2f5;
  background: #fdf2f8;
}
.lead-notif-footer a {
  font-size: 13px;
  color: #db2777;
  font-weight: 600;
  text-decoration: none;
}
.lead-user-avatar {
  background: linear-gradient(135deg, #ec4899, #db2777);
}
.lead-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 4px 4px 4px 8px;
  cursor: pointer;
}
.lead-user-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: #be185d;
}
.lead-user-chip-caret {
  font-size: 11px;
  color: #f9a8d4;
}
body.lead-shell .page-wrapper {
  margin: 0 0 0 var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.lead-shell.lead-sidebar-collapsed .page-wrapper {
  margin-left: var(--sidebar-collapsed-w);
}
body.lead-shell .app-footer {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s ease;
}
body.lead-shell.lead-sidebar-collapsed .app-footer {
  margin-left: var(--sidebar-collapsed-w);
}
@media (max-width: 991.98px) {
  .lead-sidebar {
    width: var(--sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  body.lead-sidebar-open .lead-sidebar {
    transform: translateX(0);
  }
  body.lead-sidebar-open .lead-sidebar-backdrop {
    display: block;
  }
  .lead-sidebar-toggle {
    display: none;
  }
  .lead-topbar,
  body.lead-sidebar-collapsed .lead-topbar {
    margin-left: 0;
  }
  body.lead-shell .page-wrapper,
  body.lead-shell.lead-sidebar-collapsed .page-wrapper,
  body.lead-shell .app-footer,
  body.lead-shell.lead-sidebar-collapsed .app-footer {
    margin-left: 0;
  }
  .lead-mobile-toggle {
    display: block;
  }
}

/* ── Lead Detail Page (redesign) ─────────────────────────────── */
.lead-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}
.lead-detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lead-detail-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0;
}
.lead-detail-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  background: #fce7f3;
  color: #be185d;
}
.lead-detail-meta {
  font-size: 13.5px;
  color: #64748b;
  margin-top: 6px;
}

.lead-detail-origin {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border: 1px solid #fbcfe8;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.lead-detail-origin-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #db2777;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.lead-detail-origin-text {
  font-size: 13.5px;
  color: #831843;
  line-height: 1.5;
}
.lead-detail-origin-stale {
  margin-left: auto;
  font-size: 12px;
  color: #9d174d;
  background: #fff;
  border: 1px solid #fbcfe8;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.lead-detail-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
}

.lead-detail-avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.lead-detail-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ec4899, #db2777);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
}
.lead-detail-avatar-name {
  font-weight: 700;
  font-size: 14.5px;
  color: #1a1a2e;
}
.lead-detail-avatar-company {
  font-size: 12px;
  color: #94a3b8;
}
.lead-detail-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #334155;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.lead-detail-field:last-child {
  border-bottom: none;
}
.lead-detail-field i {
  color: #94a3b8;
  width: 16px;
}

.lead-detail-stepper {
  display: flex;
  gap: 4px;
  margin: 4px 0 2px;
}
.lead-detail-step-form {
  flex: 1;
  display: block;
}
.lead-detail-step {
  width: 100%;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #e5e7eb;
  cursor: pointer;
}
.lead-detail-step.done {
  background: #db2777;
}
.lead-detail-step.current {
  background: #db2777;
  box-shadow: 0 0 0 2px #fce7f3;
}
.lead-detail-step-label {
  font-size: 11px;
  color: #db2777;
  font-weight: 700;
  margin-top: 6px;
}
.lead-detail-closed-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.lead-detail-closed-banner.won {
  background: #dcfce7;
  color: #15803d;
}
.lead-detail-closed-banner.lost {
  background: #fee2e2;
  color: #b91c1c;
}

.lead-detail-bill-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.lead-detail-bill-title {
  color: #15803d;
}
.lead-detail-bill-copy {
  font-size: 12.5px;
  color: #166534;
  margin-bottom: 12px;
}

.lead-detail-quick-actions {
  display: flex;
  gap: 8px;
}
.btn-quick-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12.5px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s;
}
.btn-quick-action:hover {
  transform: translateY(-1px);
}
.btn-quick-whatsapp {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.btn-quick-email {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}
.btn-quick-sms {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.lead-quick-tabs .nav-link {
  font-size: 11.5px;
  padding: 5px 10px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 20px;
  margin-right: 4px;
}
.lead-quick-tabs .nav-link.active {
  background: #db2777;
  color: #fff;
}
.lead-quick-badge {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

.lead-detail-tabs .nav-link {
  color: #94a3b8;
  font-weight: 600;
  font-size: 13.5px;
}
.lead-detail-tabs .nav-link.active {
  color: #db2777;
  border-color: #f1f5f9 #f1f5f9 #db2777;
}
.lead-detail-tab-badge {
  display: inline-block;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  margin-left: 4px;
}
.lead-detail-tab-count {
  color: #cbd5e1;
  font-size: 11px;
  margin-left: 4px;
}

.lead-detail-timeline {
  position: relative;
  padding-left: 28px;
}
.lead-detail-timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #f1f5f9;
}
.lead-detail-tl-item {
  position: relative;
  margin-bottom: 18px;
}
.lead-detail-tl-dot {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fce7f3;
  color: #db2777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.lead-detail-tl-dot.system {
  background: #f1f5f9;
  color: #94a3b8;
}
.lead-detail-tl-meta {
  font-size: 11.5px;
  color: #94a3b8;
  margin-bottom: 3px;
}
.lead-detail-tl-body {
  font-size: 13px;
  color: #475569;
  margin-top: 2px;
}

.lead-detail-attach {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.lead-detail-attach i.bi-file-earmark-text {
  color: #db2777;
  font-size: 16px;
}
.lead-detail-attach .name {
  flex: 1;
}
.lead-detail-attach .name a {
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
}
.lead-detail-attach .name a:hover {
  color: #db2777;
}
.lead-detail-attach-meta {
  color: #94a3b8;
  font-size: 11.5px;
}

.lead-detail-overview-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px;
  height: 100%;
}
.lead-detail-overview-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  margin-bottom: 8px;
}
.lead-detail-overview-label i {
  margin-right: 4px;
}
.lead-detail-overview-value {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}
.lead-detail-overview-sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}
.lead-detail-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #475569;
  padding: 5px 0;
}
.lead-detail-summary-row i {
  color: #db2777;
  width: 16px;
}

.lead-detail-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.lead-detail-note-card {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
  padding: 12px;
}
.lead-detail-note-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.lead-detail-note-meta {
  font-size: 11px;
  color: #b45309;
}
.lead-detail-note-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}
.lead-detail-note-icon-btn {
  border: none;
  background: transparent;
  color: #b45309;
  opacity: 0.6;
  font-size: 12px;
  padding: 2px 4px;
  line-height: 1;
}
.lead-detail-note-icon-btn:hover {
  opacity: 1;
}
.lead-detail-note-body {
  font-size: 13px;
  color: #475569;
}

.lead-comment-composer {
  position: relative;
}
.lead-comment-mention-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 2px;
}
.lead-comment-mention-item {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.lead-comment-mention-item:hover {
  background: #fce7f3;
  color: #db2777;
}
.lead-comment-mention-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.lead-comment-mention-tag i {
  cursor: pointer;
  font-size: 10px;
}
.lead-comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lead-comment-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px 14px;
}
.lead-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.lead-comment-author {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.lead-comment-role {
  font-size: 11px;
  color: #7c3aed;
  background: #ede9fe;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 6px;
}
.lead-comment-time {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 8px;
}
.lead-comment-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.lead-comment-body {
  font-size: 13px;
  color: #334155;
}

/* ── Leads Dashboard ──────────────────────────────────────────── */
.lead-dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 991.98px) {
  .lead-dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.lead-dash-kpi-card {
  background: #fff;
  border: 1px solid #eef0f6;
  border-radius: 12px;
  padding: 16px 18px;
}
.lead-dash-kpi-card.won {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.lead-dash-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.lead-dash-kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
}
.lead-dash-kpi-sub {
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
}

.lead-dash-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lead-dash-trend {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
}
.lead-dash-trend-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  height: 100%;
  min-width: 3px;
}
.lead-dash-trend-bar {
  width: 100%;
  height: var(--h, 3%);
  background: linear-gradient(180deg, #ec4899, #db2777);
  border-radius: 3px 3px 0 0;
  transition: opacity 0.15s;
}
.lead-dash-trend-col:hover .lead-dash-trend-bar {
  opacity: 0.75;
}
.lead-dash-trend-labels {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
}

.lead-dash-funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.lead-dash-funnel-label {
  flex: 0 0 100px;
  font-size: 12.5px;
  color: #475569;
  font-weight: 600;
}
.lead-dash-funnel-track {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 6px;
  overflow: hidden;
}
.lead-dash-funnel-fill {
  height: 100%;
  width: var(--w, 2%);
  border-radius: 6px;
  background: var(--stage-fill, #64748b);
}
.lead-dash-funnel-fill-new {
  background: #5b21b6;
}
.lead-dash-funnel-fill-contacted {
  background: #0369a1;
}
.lead-dash-funnel-fill-qualified {
  background: #0e7490;
}
.lead-dash-funnel-fill-proposal_sent {
  background: #854d0e;
}
.lead-dash-funnel-fill-negotiation {
  background: #c2410c;
}
.lead-dash-funnel-count {
  flex: 0 0 24px;
  text-align: right;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.lead-dash-bar-row {
  margin-bottom: 14px;
}
.lead-dash-bar-row:last-child {
  margin-bottom: 0;
}
.lead-dash-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
.lead-dash-bar-label a {
  color: #334155;
  text-decoration: none;
}
.lead-dash-bar-label a:hover {
  color: #db2777;
}
.lead-dash-bar-stat {
  font-size: 11.5px;
  color: #94a3b8;
  white-space: nowrap;
}
.lead-dash-bar-track {
  height: 7px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}
.lead-dash-bar-fill {
  height: 100%;
  width: var(--w, 2%);
  background: #db2777;
  border-radius: 4px;
}
.lead-dash-bar-fill.campaign {
  background: #4f46e5;
}

.lead-dash-attention-count {
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  margin-left: 4px;
}
.lead-dash-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
}
.lead-dash-attention-item:last-of-type {
  border-bottom: none;
}
.lead-dash-attention-item:hover strong {
  color: #db2777;
}

/* ── Campaign channel honesty (not-connected/offline states) ────── */
.leads-channel-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 6px;
}
.lead-campaign-not-connected {
  background: #fffbeb;
  border-color: #fde68a;
}
.lead-campaign-not-connected.offline {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* ── Fixed bottom action bar (long forms — Proposal edit, etc.) ──── */
.form-actions-fixed-spacer {
  height: 76px;
}
.form-actions-fixed {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: #fff;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  transition: left 0.2s ease;
}
body.app-sidebar-collapsed .form-actions-fixed {
  left: var(--sidebar-collapsed-w);
}
/* proposals/form.php (and any other page under the shared .pms-shell, e.g.
   Projects) collapses its sidebar via a different body class than the main
   admin shell — without this, the bar stayed anchored at the full
   var(--sidebar-w) offset after collapsing, leaving a blank gap on the left
   the width of the difference. */
body.pms-sidebar-collapsed .form-actions-fixed {
  left: var(--sidebar-collapsed-w);
}
@media (max-width: 991.98px) {
  .form-actions-fixed,
  body.app-sidebar-collapsed .form-actions-fixed,
  body.pms-sidebar-collapsed .form-actions-fixed {
    left: 0;
  }
}

/* ── Proposal PDF template picker (Proposal Settings) ────────────── */
.tpl-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.tpl-card {
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  display: block;
}
.tpl-card:hover {
  border-color: var(--gray-300);
}
.tpl-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.tpl-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tpl-preview {
  width: 100%;
  aspect-ratio: 210 / 297;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: #fff;
  margin-bottom: 8px;
}
.tpl-preview-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-800);
  text-align: center;
}
/* Minimal */
.tpl-preview.tpl-minimal .tpl-p-logo {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 22%;
  height: 8%;
  border-radius: 50%;
  background: var(--gray-200);
}
.tpl-preview.tpl-minimal .tpl-p-title {
  position: absolute;
  top: 26%;
  left: 10%;
  width: 60%;
  height: 12%;
  background: var(--gray-800);
}
.tpl-preview.tpl-minimal .tpl-p-rule {
  position: absolute;
  top: 42%;
  left: 10%;
  width: 15%;
  height: 2%;
  background: var(--tpl-accent, #4f46e5);
}
.tpl-preview.tpl-minimal .tpl-p-lines {
  position: absolute;
  top: 48%;
  left: 10%;
  width: 55%;
  height: 25%;
  background: repeating-linear-gradient(
    to bottom,
    var(--gray-200),
    var(--gray-200) 8%,
    transparent 8%,
    transparent 16%
  );
}
.tpl-preview.tpl-minimal .tpl-p-band {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6%;
  background: var(--tpl-accent, #4f46e5);
}
/* Modern */
.tpl-preview.tpl-modern {
  background: var(--tpl-accent, #4f46e5);
}
.tpl-preview.tpl-modern .tpl-p-logo {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 22%;
  height: 8%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.tpl-preview.tpl-modern .tpl-p-title {
  position: absolute;
  top: 26%;
  left: 10%;
  width: 60%;
  height: 12%;
  background: #fff;
}
.tpl-preview.tpl-modern .tpl-p-lines {
  position: absolute;
  top: 45%;
  left: 10%;
  width: 55%;
  height: 25%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.55) 8%,
    transparent 8%,
    transparent 16%
  );
}
/* Classic */
.tpl-preview.tpl-classic {
  background: #faf8f3;
}
.tpl-preview.tpl-classic .tpl-p-logo {
  position: absolute;
  top: 8%;
  left: 42%;
  width: 16%;
  height: 6%;
  border-radius: 50%;
  background: var(--gray-300);
}
.tpl-preview.tpl-classic .tpl-p-box {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 80%;
  height: 45%;
  border: 1.5px solid #b8ab8e;
}
.tpl-preview.tpl-classic .tpl-p-title {
  position: absolute;
  top: 32%;
  left: 20%;
  width: 60%;
  height: 10%;
  background: #2d2a24;
}
.tpl-preview.tpl-classic .tpl-p-lines {
  position: absolute;
  top: 48%;
  left: 20%;
  width: 60%;
  height: 10%;
  background: repeating-linear-gradient(
    to bottom,
    var(--gray-200),
    var(--gray-200) 30%,
    transparent 30%,
    transparent 60%
  );
}
/* Sidebar */
.tpl-preview.tpl-sidebar .tpl-p-side {
  position: absolute;
  top: 0;
  left: 0;
  width: 32%;
  height: 100%;
  background: var(--tpl-accent, #4f46e5);
}
.tpl-preview.tpl-sidebar .tpl-p-logo {
  position: absolute;
  top: 8%;
  left: 6%;
  width: 18%;
  height: 7%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.tpl-preview.tpl-sidebar .tpl-p-lines {
  position: absolute;
  top: 25%;
  left: 5%;
  width: 22%;
  height: 30%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.5),
    rgba(255, 255, 255, 0.5) 10%,
    transparent 10%,
    transparent 20%
  );
}
.tpl-preview.tpl-sidebar .tpl-p-title {
  position: absolute;
  top: 12%;
  left: 40%;
  width: 50%;
  height: 14%;
  background: var(--gray-800);
}
/* Letterhead */
.tpl-preview.tpl-letterhead .tpl-p-topband {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 12%;
  background: var(--tpl-accent, #4f46e5);
}
.tpl-preview.tpl-letterhead .tpl-p-logo {
  position: absolute;
  top: 3%;
  left: 6%;
  width: 14%;
  height: 6%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}
.tpl-preview.tpl-letterhead .tpl-p-title {
  position: absolute;
  top: 20%;
  left: 8%;
  width: 65%;
  height: 10%;
  background: var(--gray-800);
}
.tpl-preview.tpl-letterhead .tpl-p-lines {
  position: absolute;
  top: 34%;
  left: 8%;
  width: 84%;
  height: 3%;
  background: var(--gray-200);
}

.sig-block-label {
  font-size: 10.5px;
  letter-spacing: 0.4px;
}

/* ── Proposal analytics dashboard ─────────────────────────────────── */
.proposal-kpi-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  height: 100%;
}
.proposal-kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  margin-bottom: 6px;
}
.proposal-kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}
.proposal-kpi-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ── Proposal version diff viewer ─────────────────────────────────── */
.proposal-diff-body {
  font-size: 13.5px;
  line-height: 1.9;
}
.diff-added {
  background: #dcfce7;
  color: #166534;
  border-radius: 3px;
  padding: 1px 3px;
}
.diff-removed {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  border-radius: 3px;
  padding: 1px 3px;
}

/* ── Proposal section engagement heatmap ──────────────────────────── */
.proposal-heatmap-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}
.proposal-heatmap-row:hover {
  background: var(--gray-50);
}
.proposal-heatmap-label {
  width: 170px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proposal-heatmap-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
}
.proposal-heatmap-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a5b4fc, #4338ca);
}
.proposal-heatmap-time {
  width: 64px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

/* ── Proposal unified activity timeline ───────────────────────────── */
.proposal-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--activity-color) 15%, transparent);
}
.proposal-activity-icon i {
  color: var(--activity-color);
  font-size: 13px;
}

/* ── Bank transaction reference attachment link (transactions.php) ─── */
.txn-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--info);
  background: var(--info-light);
  border-radius: 6px;
  padding: 2px 7px;
  text-decoration: none;
  margin-top: 2px;
}

/* ── Proposal creation chooser + template marking ─────────────────── */
.proposal-template-toggle {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
}
.proposal-template-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.proposal-create-option {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 28px 24px;
  height: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.proposal-create-option:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
  color: inherit;
}
.proposal-create-option.disabled {
  opacity: 0.55;
  pointer-events: none;
}
.proposal-create-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
  background: #eef2ff;
  color: var(--primary);
}
.proposal-create-option h5 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}
.proposal-create-option p {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 0;
  line-height: 1.6;
}
.proposal-template-pick {
  display: block;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  height: 100%;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.proposal-template-pick:hover {
  border-color: var(--gray-300);
}
.proposal-template-pick.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.proposal-template-pick input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ── Button loading state (assets/js/button-loading.js) ──────────
   .btn-loading: the button shows a spinner while a save/fetch runs.
   The JS keeps the button's width so the label swap doesn't shift layout. */
.btn-loading {
  cursor: progress;
  pointer-events: none;
}
.btn-loading .btn-spinner {
  --bs-spinner-width: 0.9em;
  --bs-spinner-height: 0.9em;
  --bs-spinner-border-width: 0.15em;
  margin-right: 0.4em;
  color: currentColor;
}
.btn-loading .btn-spinner:last-child {
  margin-right: 0;
}
@media (prefers-reduced-motion: reduce) {
  /* No spin: a static, dimmed ring still reads as "busy". */
  .btn-loading .btn-spinner {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.6;
  }
}

/* ── Back-to-top button (changelog) — ring shows scroll progress ── */
.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1030;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--primary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.15);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, background 0.15s ease, color 0.15s ease;
}
.scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { background: var(--primary); color: var(--white); }
.scroll-top:hover .scroll-top-progress { stroke: var(--white); }
.scroll-top:focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; }
.scroll-top i { position: relative; transition: transform 0.15s ease; }
.scroll-top:hover i { transform: translateY(-2px); }
.scroll-top-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.scroll-top-track,
.scroll-top-progress { fill: none; stroke-width: 3; }
.scroll-top-track { stroke: var(--gray-200); }
.scroll-top-progress {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}
.scroll-top:hover .scroll-top-track { stroke: transparent; }
@media (max-width: 575.98px) {
  .scroll-top { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-top, .scroll-top i, .scroll-top-progress { transition: none; }
}
