.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
}
.site-body {
    padding-top: 62px;
}

.email-body-viewer {
    color: #1f2937;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: normal;
}

.email-body-viewer > :first-child {
    margin-top: 0;
}

.email-body-viewer :where(p, div, blockquote, pre, table, ul, ol) {
    margin-bottom: 0.75rem;
}

.email-body-viewer :where(p, div, blockquote, pre, table, ul, ol):last-child {
    margin-bottom: 0;
}

.email-body-viewer :where(h1, h2, h3, h4) {
    color: #111827;
    font-weight: 600;
    line-height: 1.3;
    margin: 0.9rem 0 0.45rem;
}

.email-body-viewer h1 {
    font-size: 1.25rem;
}

.email-body-viewer h2 {
    font-size: 1.125rem;
}

.email-body-viewer h3,
.email-body-viewer h4 {
    font-size: 1rem;
}

.email-body-viewer a {
    color: #2563eb;
    text-decoration: underline;
}

.email-body-viewer blockquote {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #9ca3af;
    border-radius: 0.375rem;
    color: #4b5563;
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
}

.email-body-viewer blockquote blockquote {
    background: #fff;
    border-left-color: #cbd5e1;
}

.email-body-viewer blockquote::before {
    color: #6b7280;
    content: "Previous message";
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
}

.email-body-viewer .email-reply-header {
    align-items: center;
    color: #6b7280;
    display: flex;
    font-size: 0.78rem;
    font-weight: 600;
    gap: 0.75rem;
    margin: 1rem 0 0.65rem;
    text-transform: none;
}

.email-body-viewer .email-reply-header::after {
    background: #e5e7eb;
    content: "";
    flex: 1 1 auto;
    height: 1px;
}

.email-body-viewer :where(ul, ol) {
    padding-left: 1.25rem;
}

.email-body-viewer ul {
    list-style: disc;
}

.email-body-viewer ol {
    list-style: decimal;
}

.email-body-viewer pre {
    background: transparent;
    border: 0;
    color: #4b5563;
    font-family: inherit;
    font-size: 0.92em;
    padding: 0;
    white-space: pre-wrap;
}

.email-body-viewer table {
    border-collapse: collapse;
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.email-body-viewer :where(td, th) {
    border: 1px solid #e5e7eb;
    padding: 0.4rem 0.55rem;
    vertical-align: top;
}

.email-body-viewer th {
    background: #f9fafb;
    font-weight: 600;
}

.email-body-viewer hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 1rem 0;
}

.reporting-overview-shell {
    overflow: visible;
}

.reporting-overview-table {
    border-collapse: separate;
    border-spacing: 0;
}

.reporting-overview-table thead th {
    background: #f9fafb;
    position: sticky;
    top: 62px;
    z-index: 30;
}

.reporting-overview-header {
    background: #f9fafb;
    box-shadow: inset 0 -1px 0 #e5e7eb;
}

.reporting-overview-corner {
    top: 62px;
    z-index: 40;
    box-shadow: inset 0 -1px 0 #e5e7eb, 1px 0 0 #e5e7eb;
}

.reporting-overview-customer {
    z-index: 20;
    box-shadow: 1px 0 0 #f3f4f6;
    background: #fff;
}

.reporting-overview-requirements {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.reporting-overview-table tbody tr:hover > td,
.reporting-overview-table tbody tr:hover > .reporting-overview-customer,
.reporting-overview-table tbody tr > .reporting-overview-customer:hover {
    background: #f9fafb !important;
}

/* ── Dark-mode colour scheme ─────────────────────────────────────────── */

html.dark { color-scheme: dark; }

/* Backgrounds */
html.dark .bg-white      { background-color: #1e293b !important; }
html.dark .bg-gray-50    { background-color: #0f172a !important; }
html.dark .bg-gray-100   { background-color: #1e293b !important; }
html.dark .bg-gray-200   { background-color: #334155 !important; }

/* Text */
html.dark .text-gray-900 { color: #f1f5f9 !important; }
html.dark .text-gray-800 { color: #e2e8f0 !important; }
html.dark .text-gray-700 { color: #cbd5e1 !important; }
html.dark .text-gray-600 { color: #94a3b8 !important; }
html.dark .text-gray-500 { color: #94a3b8 !important; }
html.dark .text-gray-400 { color: #64748b !important; }
html.dark .text-gray-300 { color: #64748b !important; }

/* Borders */
html.dark .border-gray-100 { border-color: #1e293b !important; }
html.dark .border-gray-200 { border-color: #334155 !important; }
html.dark .border-gray-300 { border-color: #475569 !important; }
html.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #1e293b !important; }
html.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #334155 !important; }

/* Hover states */
html.dark .hover\:bg-gray-50:hover  { background-color: #334155 !important; }
html.dark .hover\:bg-gray-200:hover { background-color: #475569 !important; }
html.dark .hover\:text-gray-600:hover { color: #e2e8f0 !important; }
html.dark .hover\:text-gray-700:hover { color: #e2e8f0 !important; }
html.dark .hover\:text-gray-800:hover { color: #f1f5f9 !important; }
html.dark .hover\:text-gray-900:hover { color: #f8fafc !important; }

/* Status/alert backgrounds — keep readable in dark mode */
html.dark .bg-red-50     { background-color: rgba(127, 29, 29, 0.3) !important; }
html.dark .bg-red-100    { background-color: rgba(127, 29, 29, 0.4) !important; }
html.dark .bg-green-50   { background-color: rgba(20, 83, 45, 0.3) !important; }
html.dark .bg-green-100  { background-color: rgba(20, 83, 45, 0.4) !important; }
html.dark .bg-yellow-100 { background-color: rgba(113, 63, 18, 0.3) !important; }
html.dark .bg-amber-50   { background-color: rgba(113, 63, 18, 0.25) !important; }
html.dark .bg-blue-50    { background-color: rgba(30, 58, 138, 0.3) !important; }
html.dark .bg-blue-100   { background-color: rgba(30, 58, 138, 0.4) !important; }
html.dark .border-red-200    { border-color: rgba(153, 27, 27, 0.5) !important; }
html.dark .border-green-200  { border-color: rgba(22, 101, 52, 0.5) !important; }
html.dark .border-amber-200  { border-color: rgba(146, 64, 14, 0.5) !important; }

/* Shadow softening */
html.dark .shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important; }
html.dark .shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3) !important; }

/* Form inputs */
html.dark input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
html.dark textarea,
html.dark select {
    background-color: #0f172a !important;
    border-color: #475569 !important;
    color: #e2e8f0 !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #64748b !important;
}

/* Navbar */
html.dark .site-nav {
    background-color: #1e293b !important;
    border-color: #702082 !important;
}
html.dark .site-logo { filter: brightness(0) invert(1); }

/* Custom reporting table */
html.dark .reporting-overview-table thead th { background: #1e293b; }
html.dark .reporting-overview-header         { background: #1e293b; box-shadow: inset 0 -1px 0 #334155; }
html.dark .reporting-overview-corner         { box-shadow: inset 0 -1px 0 #334155, 1px 0 0 #334155; }
html.dark .reporting-overview-customer       { background: #1e293b; box-shadow: 1px 0 0 #1e293b; }
html.dark .reporting-overview-table tbody tr:hover > td,
html.dark .reporting-overview-table tbody tr:hover > .reporting-overview-customer,
html.dark .reporting-overview-table tbody tr > .reporting-overview-customer:hover {
    background: #334155 !important;
}

/* Email viewer */
html.dark .email-body-viewer              { color: #e2e8f0; }
html.dark .email-body-viewer :where(h1, h2, h3, h4) { color: #f1f5f9; }
html.dark .email-body-viewer a            { color: #60a5fa; }
html.dark .email-body-viewer blockquote   { background: #1e293b; border-color: #475569; border-left-color: #64748b; color: #94a3b8; }
html.dark .email-body-viewer blockquote blockquote { background: #0f172a; border-left-color: #475569; }
html.dark .email-body-viewer blockquote::before    { color: #94a3b8; }
html.dark .email-body-viewer .email-reply-header   { color: #94a3b8; }
html.dark .email-body-viewer .email-reply-header::after { background: #475569; }
html.dark .email-body-viewer pre          { color: #94a3b8; }
html.dark .email-body-viewer :where(td, th) { border-color: #475569; }
html.dark .email-body-viewer th           { background: #1e293b; }
html.dark .email-body-viewer hr           { border-top-color: #475569; }

/* Theme toggle transition */
html.dark-transition,
html.dark-transition *,
html.dark-transition *::before,
html.dark-transition *::after {
    transition: background-color 0.2s ease, color 0.15s ease, border-color 0.2s ease !important;
}
