﻿    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
    .dark ::-webkit-scrollbar-thumb { background: #475569; }
    .custom-scrollbar::-webkit-scrollbar { display: none; }
    .custom-scrollbar:hover::-webkit-scrollbar { display: block; }
  /* ACTION MENU FIX */
.dropdown-menu {
    position: absolute;
    min-width: 240px;          /* you liked it wider 👍 */
    max-height: 260px;         /* 👈 THIS is the key fix */
    overflow-y: auto;          /* 👈 enables scrolling */
    z-index: 9999;
}

/* Keep items tidy */
.dropdown-menu li {
    padding: 10px 12px;
    white-space: nowrap;
}


/* Mobile sidebar footer visibility */
@media (max-width: 767px) {
  aside {
    overscroll-behavior: contain;
  }
}

/* Edit details polish */
.edit-details-soft-card {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}


/* Round 5 polish */
.custom-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.55);
  border-radius: 9999px;
}

@media (max-width: 767px) {
  .sidebar {
    padding-bottom: 6rem;
  }
}


/* Invoice preview safeguards */
@media (max-width: 900px) {
  .invoice-preview-toolbar {
    flex-wrap: wrap;
  }
}


/* Edit Details alignment polish */
@media (min-width: 768px) {
  .edit-details-form-grid-top {
    align-items: start;
  }
}


/* Targeted client email row alignment */
.edit-details-client-email-row,
.client-email-row {
  align-items: start;
}


/* Client tab email + button alignment fix only */
@media (min-width: 768px) {
  .client-email-row,
  .edit-details-client-email-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 52px !important;
    column-gap: 12px !important;
    align-items: start !important;
  }

  .client-email-row > .email-fields-wrap,
  .edit-details-client-email-row > .email-fields-wrap {
    min-width: 0;
  }

  .client-email-row .email-add-btn,
  .edit-details-client-email-row .email-add-btn {
    width: 52px !important;
    height: 52px !important;
    margin-top: 22px !important;
    align-self: start !important;
    justify-self: start !important;
  }
}

/* Phase 5 history timeline */
.history-timeline-item {
  position: relative;
}
.history-timeline-dot {
  position: absolute;
  left: 0;
  top: 1rem;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgb(59 130 246);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}
.history-timeline-line {
  position: absolute;
  left: 5px;
  top: 1.75rem;
  bottom: -1.5rem;
  width: 2px;
  background: rgba(148, 163, 184, 0.35);
}
.dark .history-timeline-line {
  background: rgba(71, 85, 105, 0.6);
}


/* UI polish: softer colour and consistent box shadows */
body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.05), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #f1f5fb 100%);
}

.dark body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 24%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.07), transparent 18%),
    linear-gradient(180deg, #020617 0%, #0b1120 100%);
}

#root .rounded-xl:not(.rounded-full),
#root .rounded-2xl:not(.rounded-full),
#root .rounded-3xl:not(.rounded-full),
#root .dropdown-menu,
#root aside {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07), 0 2px 10px rgba(59, 130, 246, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

#root .bg-white,
#root .bg-slate-50,
#root .dropdown-menu {
  border-color: rgba(148, 163, 184, 0.22);
}

#root .bg-white.rounded-xl,
#root .bg-white.rounded-2xl,
#root .bg-white.rounded-3xl,
#root .bg-slate-50.rounded-xl,
#root .bg-slate-50.rounded-2xl,
#root .bg-slate-50.rounded-3xl,
#root .dropdown-menu {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
  backdrop-filter: blur(8px);
}

.dark #root .dark\:bg-slate-900.rounded-xl,
.dark #root .dark\:bg-slate-900.rounded-2xl,
.dark #root .dark\:bg-slate-900.rounded-3xl,
.dark #root .dark\:bg-slate-800.rounded-xl,
.dark #root .dark\:bg-slate-800.rounded-2xl,
.dark #root .dark\:bg-slate-800.rounded-3xl,
.dark #root .dropdown-menu {
  background-image: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.98));
  border-color: rgba(96, 165, 250, 0.18);
}

#root .dropdown-menu {
  background-color: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12), 0 6px 18px rgba(59, 130, 246, 0.10);
  border-radius: 18px;
}

.dark #root .dropdown-menu {
  background-color: rgba(15, 23, 42, 0.98);
}

.dropdown-menu li:hover {
  background: rgba(59, 130, 246, 0.08);
}

.dark .dropdown-menu li:hover {
  background: rgba(59, 130, 246, 0.16);
}

.edit-details-soft-card {
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09), 0 6px 18px rgba(59, 130, 246, 0.06);
}

#root .text-blue-600,
#root .dark\:text-blue-400 {
  color: #2563eb;
}

#root .bg-blue-50 {
  background-color: rgba(59, 130, 246, 0.10);
}

#root .border-slate-200,
#root .border-slate-200\/80,
#root .border-slate-100 {
  border-color: rgba(148, 163, 184, 0.20);
}


/* === UI colour polish === */
:root {
  --ui-page-bg: linear-gradient(180deg, #f7fbff 0%, #fdfcff 45%, #f7fafc 100%);
  --ui-line: #bfd4f6;
  --ui-text-strong: #1e3a8a;
  --ui-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --ui-shadow-strong: 0 14px 34px rgba(37, 99, 235, 0.14);
}

body {
  background: var(--ui-page-bg);
}

#root {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(233, 213, 255, 0.20), transparent 24%),
    radial-gradient(circle at bottom right, rgba(204, 251, 241, 0.16), transparent 22%);
}

.bg-white,
[class*="bg-white"],
.rounded-2xl,
.rounded-3xl,
.rounded-xl {
  box-shadow: var(--ui-shadow);
}

.border,
[class*="border-slate-"],
[class*="border-gray-"] {
  border-color: var(--ui-line) !important;
}

table thead,
thead tr,
.table thead {
  background: linear-gradient(180deg, #edf4ff 0%, #f8fbff 100%);
}

th {
  color: var(--ui-text-strong) !important;
  font-weight: 700;
}

/* Google Doc preview formatting */
.job-notes-preview-text {
  line-height: 1.28;
  white-space: pre-wrap;
}

.job-notes-preview-html p,
.job-notes-preview-html h1,
.job-notes-preview-html h2,
.job-notes-preview-html h3,
.job-notes-preview-html h4,
.job-notes-preview-html h5,
.job-notes-preview-html h6 {
  margin: 0;
  line-height: 1.28;
}

.job-notes-preview-html .job-note-title {
  margin-bottom: 1.05rem;
}

.job-notes-preview-html .job-note-section-heading {
  margin-top: 1.05rem;
}

.job-notes-preview-html .job-note-section-heading + .job-note-body-line {
  margin-top: 0;
}

.job-notes-preview-html .job-note-spacer {
  min-height: 1.05rem;
}

.job-notes-preview-html ul,
.job-notes-preview-html ol {
  margin: 0 0 0.3rem 1.2rem;
  padding: 0;
}

.job-notes-preview-html li {
  margin: 0.08rem 0;
}

.job-notes-preview-html h4 {
  font-weight: 400;
}

.job-notes-preview-html a {
  color: #2563eb;
  text-decoration: underline;
}

hr,
.divide-y > :not([hidden]) ~ :not([hidden]) {
  border-color: #d7e6fb !important;
}

input,
select,
textarea {
  background: #ffffff !important;
  border-color: #a9c5ef !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4f7ddc !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18) !important;
}

button,
.btn,
[role="button"] {
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.10);
}

button[class*="bg-blue"],
button[class*="bg-indigo"],
.bg-blue-600,
.bg-blue-700,
.bg-indigo-600,
.bg-indigo-700 {
  background: linear-gradient(180deg, #4f87ff 0%, #2f66e8 100%) !important;
  border-color: #2f66e8 !important;
  color: #ffffff !important;
}

button[class*="bg-slate"],
button[class*="bg-gray"],
.bg-slate-100,
.bg-slate-50,
.bg-gray-100 {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%) !important;
}

.text-slate-900,
.text-gray-900,
.text-slate-800,
.text-gray-800 {
  color: #20324f !important;
}

.text-slate-700,
.text-gray-700,
.text-slate-600,
.text-gray-600 {
  color: #49607f !important;
}

.text-slate-500,
.text-gray-500,
.text-slate-400,
.text-gray-400 {
  color: #6b85a6 !important;
}

.text-blue-600,
.text-blue-700,
.text-indigo-600,
.text-indigo-700 {
  color: #255fda !important;
}

.text-emerald-600,
.text-green-600,
.text-teal-600 {
  color: #0f766e !important;
}

.text-rose-600,
.text-red-600 {
  color: #c2416c !important;
}

.bg-slate-50,
.bg-gray-50 {
  background: #f8fbff !important;
}

.bg-slate-100,
.bg-gray-100 {
  background: #eef5ff !important;
}

[class*="bg-amber-"],
[class*="bg-yellow-"] {
  background-color: #fff7d6 !important;
}

[class*="bg-emerald-"],
[class*="bg-green-"] {
  background-color: #ecfdf5 !important;
}

[class*="bg-rose-"],
[class*="bg-red-"] {
  background-color: #fff1f2 !important;
}

[class*="bg-violet-"],
[class*="bg-purple-"] {
  background-color: #f5f0ff !important;
}

nav, aside, header {
  background-image: linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(255, 255, 255, 0.96));
}

aside .rounded-2xl,
nav .rounded-2xl,
header .rounded-2xl,
[data-open="true"],
[aria-expanded="true"] {
  box-shadow: var(--ui-shadow-strong);
}

.modal,
[role="dialog"],
.fixed.inset-0 .rounded-2xl,
.fixed.inset-0 .rounded-3xl {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
}

section > .rounded-2xl:nth-of-type(3n+1),
.grid > .rounded-2xl:nth-of-type(3n+1),
.grid > div[class*="rounded"]:nth-of-type(3n+1) {
  background-image: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

section > .rounded-2xl:nth-of-type(3n+2),
.grid > .rounded-2xl:nth-of-type(3n+2),
.grid > div[class*="rounded"]:nth-of-type(3n+2) {
  background-image: linear-gradient(180deg, #ffffff 0%, #fff9fc 100%);
}

section > .rounded-2xl:nth-of-type(3n),
.grid > .rounded-2xl:nth-of-type(3n),
.grid > div[class*="rounded"]:nth-of-type(3n) {
  background-image: linear-gradient(180deg, #ffffff 0%, #f7fffb 100%);
}

table tbody tr:hover {
  background: rgba(191, 219, 254, 0.18) !important;
}

a, .link {
  color: #255fda;
}


/* targeted stat-card polish */
.bg-emerald-50\/80,
.bg-rose-50\/80,
.bg-sky-50\/90,
.bg-violet-50\/75,
.bg-amber-50\/90 {
  backdrop-filter: blur(2px);
}

.metric-card {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09) !important;
}

.metric-card-blue {
  background: linear-gradient(180deg, #eef4ff 0%, #dfe9ff 100%) !important;
  border-color: #adc6ff !important;
}

.metric-card-indigo {
  background: linear-gradient(180deg, #eff3ff 0%, #dfe6ff 100%) !important;
  border-color: #b3c3ff !important;
}

.metric-card-mint {
  background: linear-gradient(180deg, #edfff7 0%, #d8f8e8 100%) !important;
  border-color: #9be6c6 !important;
}

.metric-card-violet {
  background: linear-gradient(180deg, #fff0ff 0%, #f7d8fb 100%) !important;
  border-color: #e4a8ef !important;
}

.metric-card-rose {
  background: linear-gradient(180deg, #fff0f6 0%, #ffd6e5 100%) !important;
  border-color: #f4a6c3 !important;
}

.metric-card-amber {
  background: linear-gradient(180deg, #fff7dc 0%, #ffe4ae 100%) !important;
  border-color: #f4c871 !important;
}

/* Colour-guide text for summary cards */
.metric-card-blue * {
  color: #0b45c7 !important;
}

.metric-card-indigo * {
  color: #16245f !important;
}

.metric-card-mint * {
  color: #0d776a !important;
}

.metric-card-violet * {
  color: #8e2de2 !important;
}

.metric-card-rose * {
  color: #bf4777 !important;
}

.metric-card-amber * {
  color: #c26f00 !important;
}

/* Strong action button color fixes */
button.bg-slate-800,
button.bg-slate-900,
button.hover\:bg-slate-900,
button.hover\:bg-slate-800 {
  background: linear-gradient(180deg, #334155 0%, #1e293b 100%) !important;
  border-color: #1e293b !important;
  color: #ffffff !important;
}

button.bg-rose-500,
button.bg-rose-600,
button.bg-rose-700,
button.hover\:bg-rose-600,
button.hover\:bg-rose-700 {
  background: linear-gradient(180deg, #ef5a84 0%, #d94672 100%) !important;
  border-color: #d94672 !important;
  color: #ffffff !important;
}

button.bg-rose-500 i,
button.bg-rose-600 i,
button.bg-rose-700 i,
button.bg-slate-800 i,
button.bg-slate-900 i {
  color: inherit !important;
}


/* Mobile viewport + safe area helpers */
.mobile-vh {
  min-height: 100dvh;
  height: 100dvh;
}
.mobile-safe-bottom {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
}
@media (max-width: 767px) {
  .mobile-content-safe {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6rem) !important;
  }
}


/* Dark mode consistency fix */
html.dark body {
  background: linear-gradient(180deg, #020617 0%, #0b1120 100%) !important;
  color: #e2e8f0;
}
html.dark #root {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.10), transparent 22%),
    linear-gradient(180deg, #020617 0%, #0b1120 100%) !important;
}
html.dark .edit-details-page-shell {
  background: #020617 !important;
}
html.dark .edit-details-page-shell .bg-white,
html.dark .edit-details-page-shell .from-white,
html.dark .edit-details-page-shell .to-slate-50\/70 {
  background: #020617 !important;
}
html.dark .edit-details-page-shell .from-white,
html.dark .edit-details-page-shell .to-slate-50\/70 {
  background-image: none !important;
}
html.dark .edit-details-page-shell .border-slate-200,
html.dark .edit-details-page-shell .border-slate-200\/80,
html.dark .edit-details-page-shell .border-slate-100 {
  border-color: rgba(51, 65, 85, 0.75) !important;
}
html.dark .edit-details-page-shell .text-slate-800,
html.dark .edit-details-page-shell .text-slate-700 {
  color: #e5e7eb !important;
}
html.dark .edit-details-page-shell .text-slate-500,
html.dark .edit-details-page-shell .text-slate-400 {
  color: #94a3b8 !important;
}

/* === Dark mode real pass === */
html.dark,
html.dark body,
html.dark #root {
  background: #020617 !important;
  color: #e5e7eb;
}
html.dark header,
html.dark aside,
html.dark .bg-white,
html.dark .bg-slate-50,
html.dark .from-white,
html.dark .to-slate-50\/70,
html.dark .from-slate-50,
html.dark .to-white,
html.dark .edit-details-page-shell,
html.dark .edit-details-page-shell > div,
html.dark .edit-details-page-shell .rounded-3xl,
html.dark .edit-details-page-shell .rounded-2xl,
html.dark .edit-details-page-shell .rounded-xl {
  background-image: none !important;
}
html.dark header,
html.dark aside {
  background-color: #020617 !important;
}
html.dark .bg-white,
html.dark .bg-slate-50,
html.dark .edit-details-page-shell,
html.dark .edit-details-page-shell > div {
  background-color: #0f172a !important;
}
html.dark .edit-details-page-shell .bg-slate-50,
html.dark .edit-details-page-shell .bg-white,
html.dark .edit-details-page-shell .from-white,
html.dark .edit-details-page-shell .to-slate-50\/70 {
  background-color: #0f172a !important;
}
html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-200\/80,
html.dark .border-slate-300 {
  border-color: rgba(51, 65, 85, 0.9) !important;
}
html.dark .text-slate-800,
html.dark .text-slate-700,
html.dark .text-slate-600 {
  color: #e5e7eb !important;
}
html.dark .text-slate-500,
html.dark .text-slate-400 {
  color: #94a3b8 !important;
}
html.dark input,
html.dark select,
html.dark textarea {
  background-color: #111827 !important;
  color: #e5e7eb !important;
  border-color: rgba(71,85,105,0.9) !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #94a3b8 !important;
}
html.dark table thead,
html.dark thead tr,
html.dark .table thead {
  background: #0b1220 !important;
}
html.dark .shadow-sm,
html.dark .shadow-xl,
html.dark .shadow-2xl {
  box-shadow: 0 12px 28px rgba(0,0,0,0.45) !important;
}
html.dark .status-pill,
html.dark [class*='bg-emerald-50'],
html.dark [class*='bg-rose-50'],
html.dark [class*='bg-amber-50'],
html.dark [class*='bg-blue-50'] {
  filter: saturate(0.9);
}


/* === Focused dark mode repair === */
html.dark body {
  background: linear-gradient(180deg, #020617 0%, #0b1120 100%) !important;
  color: #e5e7eb !important;
}

html.dark #root {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.08), transparent 20%),
    linear-gradient(180deg, #020617 0%, #0b1120 100%) !important;
}

html.dark .bg-white,
html.dark [class*="bg-white"],
html.dark .bg-slate-50,
html.dark [class*="bg-slate-50"],
html.dark .bg-slate-100,
html.dark [class*="bg-slate-100"] {
  background: #0f172a !important;
  color: #e5e7eb !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700 {
  color: #e5e7eb !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #94a3b8 !important;
}

html.dark .border,
html.dark [class*="border-slate-"],
html.dark [class*="border-gray-"] {
  border-color: rgba(71, 85, 105, 0.9) !important;
}

html.dark input,
html.dark textarea,
html.dark select {
  background: #0b1220 !important;
  color: #e5e7eb !important;
  border-color: rgba(71, 85, 105, 0.9) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}

html.dark thead,
html.dark thead tr,
html.dark table thead,
html.dark .table thead {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
}

html.dark aside {
  background: #020617 !important;
  border-color: rgba(71, 85, 105, 0.9) !important;
}

html.dark .dropdown-menu {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border-color: rgba(71, 85, 105, 0.9) !important;
}

html.dark .shadow-sm,
html.dark .shadow,
html.dark .shadow-xl,
html.dark .shadow-2xl {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35) !important;
}


/* Focused dark-mode cleanup */
html.dark, .dark body {
  color-scheme: dark;
}

.dark body {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 26%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.10), transparent 22%),
    linear-gradient(180deg, #020617 0%, #071226 55%, #0b1730 100%) !important;
}

.dark #root {
  background: transparent !important;
}

.dark #root .bg-white,
.dark #root .bg-slate-50,
.dark #root .bg-slate-100,
.dark #root .bg-blue-50,
.dark #root .bg-green-50,
.dark #root .bg-rose-50,
.dark #root .bg-amber-50,
.dark #root .bg-purple-50,
.dark #root [class*='bg-white'],
.dark #root [class*='bg-slate-50'],
.dark #root [class*='bg-slate-100'] {
  background: linear-gradient(180deg, rgba(8, 18, 40, 0.96), rgba(10, 24, 52, 0.98)) !important;
  color: #e5eefc !important;
  border-color: rgba(96, 165, 250, 0.20) !important;
}

.dark #root input,
.dark #root textarea,
.dark #root select,
.dark #root option {
  background-color: rgba(5, 15, 35, 0.92) !important;
  color: #e5eefc !important;
  border-color: rgba(96, 165, 250, 0.22) !important;
}

.dark #root input::placeholder,
.dark #root textarea::placeholder {
  color: #93a9c9 !important;
}

.dark #root .text-slate-900,
.dark #root .text-slate-800,
.dark #root .text-slate-700,
.dark #root .text-slate-600,
.dark #root .text-slate-500,
.dark #root .text-slate-400,
.dark #root [class*='text-slate-9'],
.dark #root [class*='text-slate-8'],
.dark #root [class*='text-slate-7'],
.dark #root [class*='text-slate-6'],
.dark #root [class*='text-slate-5'],
.dark #root [class*='text-slate-4'] {
  color: #d9e7fb !important;
}

.dark #root .text-blue-600,
.dark #root .text-blue-500,
.dark #root .text-emerald-600,
.dark #root .text-green-600,
.dark #root .text-rose-600,
.dark #root .text-amber-600,
.dark #root .text-purple-600 {
  filter: saturate(1.05) brightness(1.1);
}

.dark #root table,
.dark #root thead,
.dark #root tbody,
.dark #root tr,
.dark #root td,
.dark #root th {
  border-color: rgba(96, 165, 250, 0.16) !important;
}

.dark #root .shadow-xl,
.dark #root .shadow-2xl,
.dark #root .shadow-lg,
.dark #root .shadow-md {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38), 0 8px 20px rgba(15, 23, 42, 0.28) !important;
}

.dark #root .ring-slate-200,
.dark #root .ring-slate-100,
.dark #root .ring-1 {
  --tw-ring-color: rgba(96, 165, 250, 0.16) !important;
}


/* === Dark mode final polish === */
html.dark aside,
.dark aside {
  background: linear-gradient(180deg, #091327 0%, #081120 100%) !important;
  border-right-color: rgba(96, 165, 250, 0.18) !important;
}

html.dark aside button,
.dark aside button {
  color: #c8d8f0 !important;
}

html.dark aside button:hover,
.dark aside button:hover {
  color: #ffffff !important;
}

html.dark aside .text-slate-400,
html.dark aside .text-slate-500,
html.dark aside .text-slate-600,
.dark aside .text-slate-400,
.dark aside .text-slate-500,
.dark aside .text-slate-600 {
  color: #c8d8f0 !important;
}

html.dark aside .border-slate-200,
html.dark aside .border-slate-800\/50,
.dark aside .border-slate-200,
.dark aside .border-slate-800\/50 {
  border-color: rgba(96, 165, 250, 0.18) !important;
}

html.dark aside .hover\:bg-slate-100:hover,
.dark aside .hover\:bg-slate-100:hover {
  background: rgba(59, 130, 246, 0.10) !important;
}

html.dark aside .bg-slate-50,
.dark aside .bg-slate-50 {
  background: transparent !important;
}

html.dark aside img,
.dark aside img {
  filter: none !important;
}

html.dark .bg-emerald-50,
html.dark .bg-rose-50,
html.dark .bg-amber-50,
html.dark .bg-blue-50,
html.dark .bg-cyan-50,
html.dark .bg-purple-50,
html.dark .bg-violet-50,
html.dark .bg-indigo-50,
html.dark .bg-green-50,
html.dark .bg-red-50,
html.dark .bg-yellow-50,
html.dark [class*="bg-emerald-50"],
html.dark [class*="bg-rose-50"],
html.dark [class*="bg-amber-50"],
html.dark [class*="bg-blue-50"],
html.dark [class*="bg-cyan-50"],
html.dark [class*="bg-purple-50"],
html.dark [class*="bg-violet-50"],
html.dark [class*="bg-indigo-50"],
html.dark [class*="bg-green-50"],
html.dark [class*="bg-red-50"],
html.dark [class*="bg-yellow-50"] {
  background: linear-gradient(180deg, rgba(8, 22, 46, 0.96), rgba(10, 28, 56, 0.98)) !important;
  border-color: rgba(96, 165, 250, 0.20) !important;
}

html.dark .bg-emerald-50 *,
html.dark .bg-rose-50 *,
html.dark .bg-amber-50 *,
html.dark .bg-blue-50 *,
html.dark .bg-cyan-50 *,
html.dark .bg-purple-50 *,
html.dark .bg-violet-50 *,
html.dark .bg-indigo-50 *,
html.dark .bg-green-50 *,
html.dark .bg-red-50 *,
html.dark .bg-yellow-50 * {
  text-shadow: none !important;
}

html.dark .status-pill,
html.dark [class*="rounded-full"] {
  border-color: rgba(96, 165, 250, 0.18);
}

html.dark .status-pill.bg-white,
html.dark .status-pill[class*="bg-white"] {
  background: rgba(8, 22, 46, 0.96) !important;
}

/* === Dark mode targeted repair: sidebar + summary cards === */
html.dark aside,
html.dark aside nav,
html.dark aside .custom-scrollbar,
html.dark aside .sticky,
.dark aside,
.dark aside nav,
.dark aside .custom-scrollbar,
.dark aside .sticky {
  background: linear-gradient(180deg, #030b18 0%, #061226 100%) !important;
}

html.dark aside,
.dark aside {
  color: #dbe8ff !important;
  border-right-color: rgba(96, 165, 250, 0.16) !important;
}

html.dark aside button,
.dark aside button {
  color: #dbe8ff !important;
  background: transparent !important;
  box-shadow: none !important;
}

html.dark aside button span,
html.dark aside button i,
.dark aside button span,
.dark aside button i {
  color: inherit !important;
  opacity: 1 !important;
}

html.dark aside nav button,
.dark aside nav button {
  border-radius: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding: 0.9rem 0.5rem !important;
}

html.dark aside nav button:hover,
.dark aside nav button:hover {
  background: rgba(59, 130, 246, 0.08) !important;
  color: #ffffff !important;
}

html.dark aside nav button.border-slate-300,
.dark aside nav button.border-slate-300 {
  border-left-color: transparent !important;
  border-bottom-color: transparent !important;
  background: rgba(59, 130, 246, 0.10) !important;
  color: #ffffff !important;
}

html.dark aside .text-slate-500,
html.dark aside .text-slate-400,
html.dark aside .text-slate-600,
.dark aside .text-slate-500,
.dark aside .text-slate-400,
.dark aside .text-slate-600 {
  color: #dbe8ff !important;
}

html.dark aside .text-rose-500,
.dark aside .text-rose-500 {
  color: #fb7185 !important;
}

html.dark aside .mobile-safe-bottom,
.dark aside .mobile-safe-bottom {
  background: linear-gradient(180deg, #05101f 0%, #020a16 100%) !important;
}

/* dashboard / invoices / expenses / clients summary surfaces */
html.dark [style*="#eefbf5"],
.dark [style*="#eefbf5"] {
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.50), rgba(6, 95, 70, 0.36)) !important;
  border-color: rgba(16, 185, 129, 0.32) !important;
}

html.dark [style*="#fff1f6"],
.dark [style*="#fff1f6"] {
  background: linear-gradient(180deg, rgba(136, 19, 55, 0.44), rgba(159, 18, 57, 0.30)) !important;
  border-color: rgba(244, 114, 182, 0.26) !important;
}

html.dark [style*="#eef6ff"],
.dark [style*="#eef6ff"] {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.34), rgba(37, 99, 235, 0.22)) !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
}

html.dark [style*="#f5f1ff"],
.dark [style*="#f5f1ff"] {
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.32), rgba(109, 40, 217, 0.20)) !important;
  border-color: rgba(167, 139, 250, 0.26) !important;
}

html.dark [style*="#fff8e8"],
.dark [style*="#fff8e8"] {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.34), rgba(146, 64, 14, 0.22)) !important;
  border-color: rgba(251, 191, 36, 0.24) !important;
}

html.dark .bg-emerald-50,
html.dark .dark\:bg-emerald-900\/20,
.dark .bg-emerald-50,
.dark .dark\:bg-emerald-900\/20 {
  background: rgba(6, 78, 59, 0.42) !important;
  border-color: rgba(16, 185, 129, 0.24) !important;
}

html.dark .bg-purple-50,
html.dark .dark\:bg-purple-900\/20,
.dark .bg-purple-50,
.dark .dark\:bg-purple-900\/20 {
  background: rgba(88, 28, 135, 0.28) !important;
  border-color: rgba(168, 85, 247, 0.24) !important;
}

html.dark .bg-indigo-50,
html.dark .dark\:bg-indigo-900\/20,
.dark .bg-indigo-50,
.dark .dark\:bg-indigo-900\/20 {
  background: rgba(49, 46, 129, 0.30) !important;
  border-color: rgba(99, 102, 241, 0.24) !important;
}

html.dark .bg-rose-50,
html.dark .dark\:bg-rose-900\/20,
.dark .bg-rose-50,
.dark .dark\:bg-rose-900\/20 {
  background: rgba(136, 19, 55, 0.28) !important;
  border-color: rgba(244, 63, 94, 0.22) !important;
}

html.dark .bg-blue-50,
html.dark .dark\:bg-blue-900\/20,
html.dark .dark\:bg-blue-900\/30,
.dark .bg-blue-50,
.dark .dark\:bg-blue-900\/20,
.dark .dark\:bg-blue-900\/30 {
  background: rgba(30, 64, 175, 0.24) !important;
  border-color: rgba(96, 165, 250, 0.24) !important;
}

html.dark .bg-amber-50,
html.dark .dark\:bg-amber-900\/20,
.dark .bg-amber-50,
.dark .dark\:bg-amber-900\/20 {
  background: rgba(120, 53, 15, 0.26) !important;
  border-color: rgba(251, 191, 36, 0.22) !important;
}

html.dark .text-blue-900,
.dark .text-blue-900 {
  color: #dbeafe !important;
}

html.dark .text-violet-900,
.dark .text-violet-900 {
  color: #f5f3ff !important;
}

/* Colour-guide dark summary cards */
html.dark #root .metric-card,
.dark #root .metric-card {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34) !important;
}

html.dark #root .metric-card-blue,
.dark #root .metric-card-blue {
  background: linear-gradient(180deg, #0b45c7 0%, #0a3cae 100%) !important;
  border-color: #2f6ff2 !important;
}

html.dark #root .metric-card-indigo,
.dark #root .metric-card-indigo {
  background: linear-gradient(180deg, #16245f 0%, #121d4f 100%) !important;
  border-color: #4059d6 !important;
}

html.dark #root .metric-card-mint,
.dark #root .metric-card-mint {
  background: linear-gradient(180deg, #0d776a 0%, #0a6257 100%) !important;
  border-color: #1aa997 !important;
}

html.dark #root .metric-card-violet,
.dark #root .metric-card-violet {
  background: linear-gradient(180deg, #8e2de2 0%, #7a22cc 100%) !important;
  border-color: #b65cff !important;
}

html.dark #root .metric-card-rose,
.dark #root .metric-card-rose {
  background: linear-gradient(180deg, #bf4777 0%, #a93b68 100%) !important;
  border-color: #e56b9a !important;
}

html.dark #root .metric-card-amber,
.dark #root .metric-card-amber {
  background: linear-gradient(180deg, #db8100 0%, #bd6d00 100%) !important;
  border-color: #ffae35 !important;
}

html.dark #root .metric-card *,
.dark #root .metric-card * {
  color: var(--metric-dark-text, rgba(255, 255, 255, 0.86)) !important;
}

html.dark #root .metric-card .text-2xl,
html.dark #root .metric-card .text-3xl,
html.dark #root .metric-card .text-4xl,
html.dark #root .metric-card .font-black,
html.dark #root .metric-card .font-extrabold,
.dark #root .metric-card .text-2xl,
.dark #root .metric-card .text-3xl,
.dark #root .metric-card .text-4xl,
.dark #root .metric-card .font-black,
.dark #root .metric-card .font-extrabold {
  color: var(--metric-dark-strong-text, var(--metric-dark-text, #ffffff)) !important;
}

html.dark #root .metric-card-blue *,
.dark #root .metric-card-blue * {
  --metric-dark-text: #b7c0ff;
  --metric-dark-strong-text: #b7c0ff;
  color: var(--metric-dark-text) !important;
}

html.dark #root .metric-card-indigo *,
.dark #root .metric-card-indigo * {
  --metric-dark-text: #aebfff;
  --metric-dark-strong-text: #aebfff;
  color: var(--metric-dark-text) !important;
}

html.dark #root .metric-card-mint *,
.dark #root .metric-card-mint * {
  --metric-dark-text: #d9f7e4;
  --metric-dark-strong-text: #d9f7e4;
  color: var(--metric-dark-text) !important;
}

html.dark #root .metric-card-violet *,
.dark #root .metric-card-violet * {
  --metric-dark-text: #fbd5f7;
  --metric-dark-strong-text: #fbd5f7;
  color: var(--metric-dark-text) !important;
}

html.dark #root .metric-card-rose *,
.dark #root .metric-card-rose * {
  --metric-dark-text: #ffc7da;
  --metric-dark-strong-text: #ffc7da;
  color: var(--metric-dark-text) !important;
}

html.dark #root .metric-card-amber *,
.dark #root .metric-card-amber * {
  --metric-dark-text: #ffe0a8;
  --metric-dark-strong-text: #ffe0a8;
  color: var(--metric-dark-text) !important;
}

#root button.invoice-type-inactive-invoice,
#root button.invoice-type-inactive-invoice:focus,
#root button.invoice-type-inactive-invoice:active {
  background: #ffffff !important;
  border: 1px solid #bfdbfe !important;
  color: #1d4ed8 !important;
}

#root button.invoice-type-inactive-invoice:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

#root button.invoice-type-inactive-quote,
#root button.invoice-type-inactive-quote:focus,
#root button.invoice-type-inactive-quote:active {
  background: #ffffff !important;
  border: 1px solid #f5d0fe !important;
  color: #a21caf !important;
}

#root button.invoice-type-inactive-quote:hover {
  background: #fdf4ff !important;
  border-color: #f0abfc !important;
  color: #a21caf !important;
}

html.dark #root button.invoice-type-inactive-invoice,
.dark #root button.invoice-type-inactive-invoice {
  background: #020617 !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
  color: #bfdbfe !important;
}

html.dark #root button.invoice-type-inactive-invoice:hover,
.dark #root button.invoice-type-inactive-invoice:hover {
  background: rgba(30, 64, 175, 0.3) !important;
  color: #dbeafe !important;
}

html.dark #root button.invoice-type-inactive-quote,
.dark #root button.invoice-type-inactive-quote {
  background: #020617 !important;
  border-color: rgba(217, 70, 239, 0.5) !important;
  color: #f5d0fe !important;
}

html.dark #root button.invoice-type-inactive-quote:hover,
.dark #root button.invoice-type-inactive-quote:hover {
  background: rgba(112, 26, 117, 0.35) !important;
  color: #fae8ff !important;
}

#root .invoice-billing-panel {
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.86) 0%, rgba(255, 255, 255, 0.94) 42%, rgba(240, 253, 250, 0.72) 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#root .invoice-billing-panel input,
#root .invoice-billing-panel textarea {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(147, 197, 253, 0.66) !important;
}

#root .invoice-billing-panel input:focus,
#root .invoice-billing-panel textarea:focus {
  background: #ffffff !important;
  border-color: #60a5fa !important;
}

#root .invoice-billing-panel textarea {
  line-height: 1.45;
  overflow-y: hidden;
}

html.dark #root .invoice-billing-panel,
.dark #root .invoice-billing-panel {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.86) 48%, rgba(8, 47, 73, 0.72) 100%) !important;
}

html.dark #root .invoice-billing-panel input,
html.dark #root .invoice-billing-panel textarea,
.dark #root .invoice-billing-panel input,
.dark #root .invoice-billing-panel textarea {
  background: rgba(2, 6, 23, 0.72) !important;
  border-color: rgba(96, 165, 250, 0.28) !important;
}

#root button.workspace-tab-button {
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

#root button.workspace-tab-active {
  background: #2563eb !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

#root button.workspace-tab-active:hover {
  background: #1d4ed8 !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
}

#root button.workspace-tab-idle {
  background: #ffffff !important;
  border-color: #93c5fd !important;
  color: #1d4ed8 !important;
}

#root .settings-shadow-checkbox {
  width: 1.25rem !important;
  height: 1.25rem !important;
  min-width: 1.25rem !important;
  padding: 0 !important;
  border-radius: 0.35rem !important;
  box-shadow: none !important;
  accent-color: #2563eb;
}

#root .shadows-disabled {
  --ui-shadow: none;
  --ui-shadow-strong: none;
}

#root .shadows-disabled *,
#root .shadows-disabled *::before,
#root .shadows-disabled *::after {
  --tw-shadow: 0 0 #0000 !important;
  --tw-shadow-colored: 0 0 #0000 !important;
}

#root .shadows-disabled :is(
  .rounded-xl,
  .rounded-2xl,
  .rounded-3xl,
  .shadow,
  .shadow-sm,
  .shadow-md,
  .shadow-lg,
  .shadow-xl,
  .shadow-2xl,
  .shadow-inner,
  .edit-details-soft-card,
  .invoice-billing-panel,
  .metric-card,
  .dropdown-menu,
  .modal,
  button,
  .btn,
  [role="button"],
  input,
  select,
  textarea,
  [data-open="true"],
  [aria-expanded="true"]
) {
  box-shadow: none !important;
}

#root button.workspace-tab-idle:hover {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1e40af !important;
}

html.dark #root button.workspace-tab-active,
.dark #root button.workspace-tab-active {
  background: #1e40af !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
}

html.dark #root button.workspace-tab-active:hover,
.dark #root button.workspace-tab-active:hover {
  background: #2563eb !important;
  border-color: #93c5fd !important;
  color: #ffffff !important;
}

html.dark #root button.workspace-tab-idle,
.dark #root button.workspace-tab-idle {
  background: #ffffff !important;
  border-color: #60a5fa !important;
  color: #1e40af !important;
}

html.dark #root button.workspace-tab-idle:hover,
.dark #root button.workspace-tab-idle:hover {
  background: #dbeafe !important;
  border-color: #60a5fa !important;
  color: #075985 !important;
}

#root button.workspace-action-button {
  border: 1px solid transparent !important;
}

#root button.workspace-action-secondary {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

#root button.workspace-action-secondary:hover {
  background: #eff6ff !important;
  border-color: #60a5fa !important;
  color: #1d4ed8 !important;
}

#root button.workspace-action-primary {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

#root button.workspace-action-primary:hover {
  background: #ffffff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

html.dark #root button.workspace-action-secondary,
.dark #root button.workspace-action-secondary {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html.dark #root button.workspace-action-secondary:hover,
.dark #root button.workspace-action-secondary:hover {
  background: #020617 !important;
  border-color: #60a5fa !important;
  color: #bfdbfe !important;
}

html.dark #root button.workspace-action-primary,
.dark #root button.workspace-action-primary {
  background: #1e40af !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
}

html.dark #root button.workspace-action-primary:hover,
.dark #root button.workspace-action-primary:hover {
  background: #020617 !important;
  border-color: #60a5fa !important;
  color: #bfdbfe !important;
}

/* Keep Cards tab card tones visible over global background normalizers */
#root .selected-cards-shell {
  background: #f8fbff !important;
  background-image: none !important;
}

#root .selected-cards-tone {
  background-image: none !important;
}

#root .selected-cards-tone.selected-cards-tone-client {
  background-color: #fff1d6 !important;
  border-color: #f0a64f !important;
}
#root .selected-cards-tone.selected-cards-tone-job {
  background-color: #dcecff !important;
  border-color: #60a5fa !important;
}
#root .selected-cards-tone.selected-cards-tone-invoice {
  background-color: #dcfce7 !important;
  border-color: #34d399 !important;
}
#root .selected-cards-tone.selected-cards-tone-expense {
  background-color: #fde4ef !important;
  border-color: #f472b6 !important;
}

/* Compact selected-record summaries; scoped away from editing forms. */
#root .selected-cards-shell {
  width: 100%;
  max-width: none;
  padding: 16px !important;
  border-radius: 18px !important;
  box-shadow: none !important;
}
#root .selected-cards-shell > .grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}
#root .selected-cards-shell .selected-cards-tone {
  min-width: 0;
  padding: 16px !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}
#root .selected-cards-shell .selected-cards-tone > div:first-child {
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: .12em;
}
#root .selected-cards-shell .selected-cards-tone > .grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
#root .selected-cards-shell .selected-cards-tone > .grid > div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: baseline;
  column-gap: 12px;
  padding: 8px 0;
}
#root .selected-cards-shell .selected-cards-tone > .grid > div + div {
  border-top: 1px solid rgba(71, 85, 105, .12);
}
#root .selected-cards-shell .selected-cards-tone > .grid > div > div:first-child {
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .06em;
}
#root .selected-cards-shell .selected-cards-tone > .grid > div > div:last-child {
  min-width: 0;
  margin-top: 0;
  font-size: 14px;
  line-height: 1.45;
  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  #root .selected-cards-shell { padding: 12px !important; }
  #root .selected-cards-shell > .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

@media (min-width: 601px) {
  #root .selected-cards-shell .selected-cards-tone > .grid > div {
    grid-template-columns: 150px minmax(0, 1fr);
    column-gap: 24px;
  }
  #root .selected-cards-shell .selected-cards-tone > .grid > div > div:last-child {
    text-align: left;
  }
}

/* ------------------------------------------------------------------
   List pages (Jobs, Invoices, Expenses, Financial Overview):
   column chooser, mobile card view and selection actions.
   ------------------------------------------------------------------ */
.abh-column-controls { margin-top: .2rem; display: grid; gap: .75rem; }
.abh-column-button-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.abh-column-button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid #cbd5e1; background: #f1f5f9; color: #64748b; border-radius: 999px; padding: .42rem .75rem; font-size: .75rem; font-weight: 800; line-height: 1.1; }
.abh-column-button.is-active { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.abh-view-switch { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding-top: .65rem; border-top: 1px solid rgba(148,163,184,.28); }
.abh-view-switch > span { margin-right: .1rem; color: #64748b; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.abh-columns-title { margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; color: #94a3b8; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.abh-invoice-columns-panel { margin-top: 1rem; padding: .8rem; border: 1px solid #cbd5e1; border-radius: 1rem; background: rgba(255,255,255,.72); }
.abh-column-warning { min-height: 0; opacity: 0; color: #b45309; font-size: .72rem; font-weight: 800; transition: opacity .15s ease; }
.abh-column-warning.show { opacity: 1; }
.abh-mobile-cards { display: none; }
.abh-selection-actions { display: flex; flex-wrap: wrap; gap: .5rem; width: 100%; }
.abh-selection-actions button { flex: 1 1 130px; border: 1px solid #93c5fd; background: #fff; color: #1d4ed8; border-radius: .75rem; padding: .62rem .8rem; font-size: .78rem; font-weight: 800; }
.dark .abh-column-button { border-color: #475569; background: #1e293b; color: #94a3b8; }
.dark .abh-column-button.is-active { border-color: #1d4ed8; background: rgba(30,64,175,.28); color: #bfdbfe; }
.dark .abh-invoice-columns-panel { border-color: #334155; background: rgba(2,6,23,.45); }
.dark .abh-selection-actions button { border-color: #1d4ed8; background: #0f172a; color: #bfdbfe; }

@media (min-width: 768px) {
  .abh-mobile-cards { display: none !important; }
  .abh-selection-actions { width: auto; margin-left: auto; }
}

@media (max-width: 767px) {
  .abh-mobile-page.abh-mobile-view-cards .abh-mobile-source-table { display: none !important; }
  .abh-mobile-page.abh-mobile-view-cards .abh-mobile-cards { display: grid !important; gap: .8rem; }
  .abh-mobile-page.abh-mobile-view-table .abh-mobile-source-table { display: block !important; }
  .abh-mobile-page.abh-mobile-view-table .abh-mobile-cards { display: none !important; }
  .abh-mobile-card-help { display: flex; align-items: center; gap: .55rem; padding: 0 .2rem; color: #64748b; font-size: .76rem; font-weight: 700; }
  .abh-mobile-card-help i { font-size: 1rem; color: #2563eb; }
  .abh-mobile-card { touch-action: pan-y; user-select: none; -webkit-user-select: none; padding: .95rem; border: 1px solid #bfd4f6; border-radius: 1.25rem; background: linear-gradient(180deg,#fff 0%,#f8fbff 100%); box-shadow: 0 9px 24px rgba(15,23,42,.075); transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease; }
  .abh-mobile-card:active { transform: scale(.995); }
  .abh-mobile-card.is-selected { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12), 0 10px 28px rgba(37,99,235,.13); }
  .abh-card-header { display: flex; align-items: flex-start; gap: .7rem; min-width: 0; }
  .abh-card-title-wrap { flex: 1 1 auto; min-width: 0; }
  .abh-card-title { color: #20324f; font-size: 1rem; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
  .abh-card-subtitle { margin-top: .22rem; color: #6b85a6; font-size: .78rem; font-weight: 700; overflow-wrap: anywhere; }
  .abh-card-badge { flex: 0 0 auto; border-radius: 999px; padding: .28rem .55rem; font-size: .65rem; font-weight: 900; line-height: 1; white-space: nowrap; background: #dbeafe; color: #1d4ed8; }
  .abh-card-badge.good { background: #d1fae5; color: #047857; }
  .abh-card-badge.warn { background: #fef3c7; color: #b45309; }
  .abh-card-badge.bad { background: #ffe4e6; color: #be123c; }
  .abh-card-badge.quote { background: #f3e8ff; color: #7e22ce; }
  .abh-card-check { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; margin: -.25rem 0 0 -.2rem; }
  .abh-card-check input { width: 1.15rem; height: 1.15rem; }
  .abh-card-status-line { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-top: .75rem; }
  .abh-card-payment { color: #64748b; font-size: .72rem; font-weight: 800; }
  .abh-card-meta-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem .75rem; margin-top: .8rem; padding-top: .78rem; border-top: 1px solid rgba(148,163,184,.22); }
  .abh-card-meta { min-width: 0; }
  .abh-card-meta span { display: block; margin-bottom: .15rem; color: #94a3b8; font-size: .62rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
  .abh-card-meta strong { display: block; color: #49607f; font-size: .82rem; font-weight: 850; overflow-wrap: anywhere; }
  .abh-card-meta.good-text strong { color: #059669; }
  .abh-card-meta.bad-text strong { color: #e11d48; }
  .abh-card-footer { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .8rem; padding-top: .7rem; border-top: 1px solid rgba(148,163,184,.18); }
  .abh-card-footer > span { flex: 1 1 auto; min-width: 0; color: #94a3b8; font-size: .68rem; font-weight: 700; }
  .abh-card-actions { flex: 0 0 auto; }
  .abh-card-open { display: inline-flex; align-items: center; gap: .25rem; color: #2563eb; font-size: .76rem; font-weight: 900; background: transparent; border: 0; box-shadow: none !important; padding: .3rem .1rem; }
  .abh-mobile-empty { padding: 1.2rem; border: 1px dashed #cbd5e1; border-radius: 1rem; text-align: center; color: #64748b; font-size: .82rem; font-weight: 700; }
  .abh-invoice-columns-panel { padding: .75rem; }
  .abh-column-button { padding: .45rem .65rem; font-size: .7rem; }
  .abh-view-switch { margin-top: .1rem; }
  .abh-selection-actions { order: 3; }
  .abh-selection-actions button { min-height: 42px; }
  .dark .abh-mobile-card { border-color: rgba(96,165,250,.2); background: linear-gradient(180deg,rgba(8,18,40,.98),rgba(10,24,52,.98)); }
  .dark .abh-card-title { color: #e5eefc; }
  .dark .abh-card-subtitle, .dark .abh-card-payment, .dark .abh-card-meta strong { color: #b7c9e5; }
  .dark .abh-card-meta-grid, .dark .abh-card-footer { border-color: rgba(96,165,250,.14); }
  .dark .abh-card-badge.info { background: rgba(30,64,175,.42); color: #bfdbfe; }
  .dark .abh-card-badge.good { background: rgba(6,78,59,.52); color: #a7f3d0; }
  .dark .abh-card-badge.warn { background: rgba(120,53,15,.5); color: #fde68a; }
  .dark .abh-card-badge.bad { background: rgba(136,19,55,.46); color: #fecdd3; }
  .dark .abh-card-badge.quote { background: rgba(88,28,135,.46); color: #e9d5ff; }
}
    

/* Larger, easier hit areas for the invoice column buttons on desktop. */
@media (min-width: 768px) {
  #root .abh-invoice-columns-panel .abh-column-button {
    min-height: 44px;
    padding: .6rem .9rem;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }
}

/* ------------------------------------------------------------------
   Invoice form: billing detail rows
   Date | Description | Hours | Minutes | Net Amount | wand | menu
   ------------------------------------------------------------------ */
#root .invoice-billing-panel .abh-billing-source-row {
  display: grid;
  grid-template-columns:
    minmax(96px, 1fr)
    minmax(140px, 1.8fr)
    minmax(60px, .58fr)
    minmax(60px, .58fr)
    minmax(88px, .85fr)
    52px
    52px;
  gap: 6px;
  align-items: start;
  min-width: 584px;
  width: 100%;
}

#root .invoice-billing-panel .abh-billing-source-row > * { min-width: 0; }

/* Give every column the same label line so every control starts together. */
#root .invoice-billing-panel .abh-billing-source-row label,
#root .invoice-billing-panel .abh-billing-source-row [aria-hidden="true"] {
  line-height: 15px;
}

#root .invoice-billing-panel .abh-billing-source-row input:not([type='checkbox']) {
  height: 52px;
  min-height: 52px;
  box-sizing: border-box;
}

/* Same starting size as the other fields; still resizable. */
#root .invoice-billing-panel .abh-billing-description-wrap textarea {
  height: 52px;
  min-height: 52px;
  box-sizing: border-box;
  overflow-y: auto;
}

#root .invoice-billing-panel .abh-billing-generate-mount,
#root .invoice-billing-panel .abh-billing-action-wrap {
  width: 52px;
}

#root .abh-billing-generate-button {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  color: #2563eb;
}
#root .abh-billing-generate-button i { font-size: 19px; line-height: 1; }
#root .abh-billing-generate-button:hover { background: #dbeafe; }
.dark #root .abh-billing-generate-button { border-color: #1d4ed8; background: rgba(30, 64, 175, .22); color: #93c5fd; }
.dark #root .abh-billing-generate-button:hover { background: rgba(30, 64, 175, .35); }

/* Scroll intermediate-width layouts when necessary. Phones override this below. */
#root .invoice-billing-panel .abh-billing-row-scroll-shell {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 900px) {
  #root .invoice-billing-panel .abh-billing-source-row {
    grid-template-columns:
      minmax(120px, 1fr)
      minmax(220px, 1.9fr)
      minmax(72px, .6fr)
      minmax(72px, .6fr)
      minmax(105px, .85fr)
      52px
      52px;
    gap: 10px;
    min-width: 0;
  }
}

/* Phones stack the fields: date, description, hours | minutes, amount, wand | menu. */
@media (max-width: 767px) {
  #root .invoice-billing-panel .abh-billing-row-scroll-shell {
    min-width: 0;
    max-width: 100%;
    overflow-x: visible;
  }
  #root .invoice-billing-panel .abh-billing-source-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
    max-width: 100%;
  }
  #root .invoice-billing-panel .abh-billing-date-wrap,
  #root .invoice-billing-panel .abh-billing-description-wrap,
  #root .invoice-billing-panel .abh-billing-amount-mount {
    grid-column: 1 / -1;
  }
  #root .invoice-billing-panel .abh-billing-generate-mount { justify-self: end; }
  #root .invoice-billing-panel .abh-billing-action-wrap { justify-self: start; }
  #root .invoice-billing-panel .abh-billing-description-wrap textarea {
    height: 110px;
    min-height: 110px;
    resize: vertical;
  }
  #root .invoice-billing-panel .abh-billing-source-row label {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Billing row menu: undo/redo and VAT toggle above the tag options. */
.abh-billing-history-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.abh-billing-history-actions button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.abh-billing-history-actions button:disabled { opacity: .4; cursor: not-allowed; }
.abh-billing-menu-actions {
  display: grid;
  gap: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.abh-billing-menu-actions button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}
.abh-billing-menu-actions button:hover { background: #f1f5f9; }
.abh-billing-menu-actions button i { flex: 0 0 auto; font-size: 16px; color: #2563eb; }
.abh-billing-menu-actions button[data-enabled="true"] i { color: #059669; }
.dark .abh-billing-history-actions { border-bottom-color: #334155; background: #0f172a; }
.dark .abh-billing-history-actions button { border-color: #475569; background: #020617; color: #cbd5e1; }
.dark .abh-billing-menu-actions { border-bottom-color: #334155; background: #0f172a; }
.dark .abh-billing-menu-actions button { color: #e2e8f0; }
.dark .abh-billing-menu-actions button:hover { background: #1e293b; }

/* Invoice builder heading and billing details label */
#root .abh-invoice-builder-billing {
  border-radius: 1rem 1rem 0 0 !important;
  border-bottom: 0 !important;
}

#root .abh-billing-details-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .9rem;
  font-size: .68rem;
  line-height: 1rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #315fae;
}
#root .abh-billing-details-label i { font-size: .95rem; letter-spacing: 0; }
.dark #root .abh-billing-details-label { color: #93c5fd; }

/* Job schedule rows: calendar title, description, dates and times share one aligned grid. */
#root .abh-schedule-description-row > div { min-width: 0; }
#root .abh-schedule-description-row > .space-y-1 > label {
  line-height: 15px;
  min-height: 15px;
  margin-bottom: 4px;
}
#root .abh-schedule-description-row > .space-y-1 > input,
#root .abh-schedule-description-row > .space-y-1 > div {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 52px !important;
  min-height: 52px !important;
  padding: 14px !important;
  margin-top: 0 !important;
}

@media (min-width: 768px) {
  #root .abh-schedule-description-row { grid-template-columns: repeat(6, minmax(0, 1fr)) auto !important; }
  #root .abh-schedule-description-row > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
  #root .abh-schedule-description-row { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Floating editor opened from ExpandableTextField */
.abh-expandable-editor {
  position: fixed;
  z-index: 10055;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 22px 55px rgba(15,23,42,.22);
  backdrop-filter: blur(10px);
}
.abh-expandable-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.abh-expandable-editor-kicker {
  font-size: 10px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #2563eb;
}
.abh-expandable-editor-title {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 800;
  color: #334155;
}
.abh-expandable-editor-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #475569;
  background: #fff;
}
.abh-expandable-editor-textarea {
  display: block;
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  outline: none;
}
.abh-expandable-editor-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.abh-expandable-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}
.abh-expandable-editor-done {
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  padding: 8px 14px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}
.dark .abh-expandable-editor { border-color: #334155; background: rgba(15,23,42,.98); }
.dark .abh-expandable-editor-title,
.dark .abh-expandable-editor-textarea { color: #e2e8f0; }
.dark .abh-expandable-editor-close,
.dark .abh-expandable-editor-textarea { border-color: #475569; background: #020617; }
.dark .abh-expandable-editor-foot { color: #94a3b8; }
.abh-job-proofread-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid #bfdbfe; border-radius: 12px; color: #2563eb; background: #eff6ff; cursor: pointer; }
#root input.abh-proofread-input,
#root .abh-schedule-description-row > .space-y-1 > input.abh-proofread-input { padding-right: 48px !important; }
#root .abh-job-proofread-inline { position: absolute; right: 8px; bottom: 8px; padding: 0 !important; box-shadow: none !important; }
.dark .abh-job-proofread-button { background: #172554; color: #bfdbfe; border-color: #1e40af; }

@media (max-width: 767px) {
  .abh-expandable-editor { left: 12px !important; right: 12px !important; width: auto !important; }
  .abh-expandable-editor-foot { align-items: flex-start; flex-direction: column; }
}

/* Add/edit window: autosave status, More actions menu and version history */
.abh-workspace-save-status { margin-top: .18rem; font-size: .7rem; font-weight: 800; color: #64748b; }
.abh-workspace-save-status[data-state="saving"] { color: #2563eb; }
.abh-workspace-save-status[data-state="saved"] { color: #059669; }
.abh-workspace-save-status[data-state="dirty"] { color: #b45309; }
.abh-workspace-menu-button { width: 46px; min-width: 46px; padding-left: .7rem !important; padding-right: .7rem !important; justify-content: center; }
.abh-workspace-menu { position: fixed; z-index: 99999; width: 220px; padding: .45rem; border: 1px solid #cbd5e1; border-radius: 1rem; background: #fff; box-shadow: 0 18px 44px rgba(15,23,42,.22); }
.abh-workspace-menu > button, .abh-workspace-version-item { width: 100%; display: flex; align-items: center; gap: .65rem; padding: .7rem .8rem; border-radius: .7rem; color: #334155; font-size: .82rem; font-weight: 800; text-align: left; }
.abh-workspace-menu > button:hover, .abh-workspace-version-item:hover { background: #f1f5f9; }
.abh-workspace-menu > button:disabled { opacity: .38; cursor: not-allowed; }
.abh-workspace-menu-divider { height: 1px; margin: .35rem .2rem; background: #e2e8f0; }
.abh-workspace-versions { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid #e2e8f0; max-height: 280px; overflow-y: auto; }
.abh-workspace-menu-title { padding: .45rem .75rem .25rem; color: #94a3b8; font-size: .65rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.abh-workspace-version-empty { padding: .65rem .75rem; color: #94a3b8; font-size: .76rem; font-weight: 700; }
.abh-workspace-version-item span { display: flex; flex-direction: column; gap: .08rem; }
.abh-workspace-version-item small { color: #94a3b8; font-size: .66rem; font-weight: 700; }
.dark .abh-workspace-menu { border-color: #334155; background: #0f172a; }
.dark .abh-workspace-menu > button, .dark .abh-workspace-version-item { color: #e2e8f0; }
.dark .abh-workspace-menu > button:hover, .dark .abh-workspace-version-item:hover { background: #1e293b; }
.dark .abh-workspace-menu-divider, .dark .abh-workspace-versions { border-color: #334155; }

@media (max-width: 767px) {
  #root .edit-details-page-shell .sticky:has(.workspace-action-button) > div:last-child { align-items: stretch; }
  #root .edit-details-page-shell .workspace-action-button:not(.abh-workspace-menu-button) { flex: 1 1 0; }
  #root .edit-details-page-shell .abh-workspace-menu-button { flex: 0 0 48px !important; min-height: 54px; font-size: 1.1rem !important; }
  .abh-workspace-menu { width: min(230px, calc(100vw - 20px)); }
}


/* Overview ledger and Expenses: column picker panels and mobile cards. */
.abh-expenses-columns-panel,
.abh-overview-columns-panel {
  padding: .85rem;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  background: rgba(255,255,255,.72);
}
.abh-overview-columns-panel { margin-bottom: 1rem; }
.abh-expense-cards,
.abh-overview-cards { display: none; }
.dark .abh-expenses-columns-panel,
.dark .abh-overview-columns-panel {
  border-color: #334155;
  background: rgba(2,6,23,.45);
}

@media (max-width: 767px) {
  .abh-expenses-mobile-page.abh-expenses-view-cards .abh-expense-source-table { display: none !important; }
  .abh-expenses-mobile-page.abh-expenses-view-cards .abh-expense-cards { display: grid !important; gap: .8rem; }
  .abh-expenses-mobile-page.abh-expenses-view-table .abh-expense-source-table { display: block !important; }
  .abh-expenses-mobile-page.abh-expenses-view-table .abh-expense-cards { display: none !important; }

  .abh-overview-mobile-page.abh-overview-view-cards .abh-overview-source-table { display: none !important; }
  .abh-overview-mobile-page.abh-overview-view-cards .abh-overview-cards { display: grid !important; gap: .72rem; padding: .75rem; }
  .abh-overview-mobile-page.abh-overview-view-table .abh-overview-source-table { display: block !important; }
  .abh-overview-mobile-page.abh-overview-view-table .abh-overview-cards { display: none !important; }

  .abh-expense-cards { margin-top: .75rem; }
  .abh-overview-card .abh-card-title { font-size: .92rem; }
  .abh-overview-card .abh-card-meta-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .abh-expense-card .abh-card-meta-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .abh-overview-columns-panel,
  .abh-expenses-columns-panel { padding: .72rem; }
}

/* Financial Overview Monthly/Daily toggle: keep it readable in dark mode */
html.dark #root .abh-view-toggle {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(96, 165, 250, 0.35) !important;
}

html.dark #root .abh-view-toggle .abh-view-toggle-btn {
  background: transparent !important;
  border: 0 !important;
  color: #94a3b8 !important;
  filter: none !important;
}

html.dark #root .abh-view-toggle .abh-view-toggle-btn:hover {
  color: #e2e8f0 !important;
}

html.dark #root .abh-view-toggle .abh-view-toggle-btn.is-active {
  background: linear-gradient(180deg, #4f87ff 0%, #2f66e8 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35) !important;
}
