/* iTech Modern — client portal dark mode.
   Light mode is left exactly as the client portal already looks (Client Portal Pro).
   html[data-itheme="dark"] swaps the portal's own colour tokens and covers the parts
   that carry fixed light colours. Cosmetic only. */

html[data-itheme="dark"] { color-scheme: dark; background: #0d0f1a; }
html[data-itheme="dark"] body.customers {
    --cpp-bg: #0d0f1a;
    --cpp-surface: #151827;
    --cpp-ink: #f3f4f9;
    --cpp-text: #c9cde0;
    --cpp-muted: #9095b0;
    --cpp-line: #262b42;
    --cpp-soft: #1a1e30;
    --cpp-accent: #a07bff;
    --cpp-accent-hover: #bba0ff;
    --cpp-accent-soft: rgba(117, 55, 242, .2);
    --cpp-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --cpp-shadow-hover: 0 12px 32px rgba(0, 0, 0, .45);
    --it-surface: #151827; --it-surface-2: #1a1e30; --it-surface-3: #21263b; --it-input: #121523;
    --it-line: #262b42; --it-line-strong: #323853; --it-ink: #f3f4f9; --it-text: #c9cde0; --it-muted: #9095b0; --it-faint: #6c7190;
    background: #0d0f1a;
    color: #c9cde0;
}

/* Text */
html[data-itheme="dark"] body.customers h1, html[data-itheme="dark"] body.customers h2, html[data-itheme="dark"] body.customers h3,
html[data-itheme="dark"] body.customers h4, html[data-itheme="dark"] body.customers h5, html[data-itheme="dark"] body.customers h6 { color: var(--it-ink); }
html[data-itheme="dark"] body.customers .text-muted { color: var(--it-muted) !important; }
html[data-itheme="dark"] body.customers hr { border-top-color: var(--it-line); }
html[data-itheme="dark"] body.customers code,
html[data-itheme="dark"] body.customers pre { background: var(--it-surface-3); color: var(--it-ink); border-color: var(--it-line); }

/* Top bar */
html[data-itheme="dark"] body.customers .navbar.header {
    background: rgba(21, 24, 39, .92);
    border-bottom-color: var(--it-line);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .3);
}
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > li > a { color: var(--it-text); }
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > li > a:hover,
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > li > a:focus,
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > .open > a { background: var(--it-surface-3); color: var(--it-ink); }
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > li.active > a { background: var(--cpp-accent-soft); color: var(--cpp-accent); }
html[data-itheme="dark"] body.customers .navbar-toggle .icon-bar { background: var(--it-text); }
html[data-itheme="dark"] body.customers .navbar-collapse { border-color: var(--it-line); }

/* Panels, cards, wells */
html[data-itheme="dark"] body.customers .panel_s,
html[data-itheme="dark"] body.customers .panel,
html[data-itheme="dark"] body.customers .panel-body,
html[data-itheme="dark"] body.customers .well,
html[data-itheme="dark"] body.customers .list-group-item { background: var(--it-surface); border-color: var(--it-line); color: var(--it-text); }
html[data-itheme="dark"] body.customers .panel-heading,
html[data-itheme="dark"] body.customers .panel-footer { background: var(--it-surface-2); border-color: var(--it-line); color: var(--it-ink); }

/* Tables */
html[data-itheme="dark"] body.customers .table { color: var(--it-text); background: transparent; }
html[data-itheme="dark"] body.customers .table > thead > tr > th,
html[data-itheme="dark"] body.customers .table > tbody > tr > td,
html[data-itheme="dark"] body.customers .table > tbody > tr > th,
html[data-itheme="dark"] body.customers .table > tfoot > tr > td { border-color: var(--it-line); }
html[data-itheme="dark"] body.customers .table > thead > tr > th,
html[data-itheme="dark"] body.customers table.dataTable thead th { background: var(--it-surface-2); color: var(--it-muted); }
html[data-itheme="dark"] body.customers table.dataTable tbody tr,
html[data-itheme="dark"] body.customers table.dataTable tbody td { background: transparent; }
html[data-itheme="dark"] body.customers .table > tbody > tr:hover > td { background: rgba(148, 163, 184, .06); }
html[data-itheme="dark"] body.customers .table-striped > tbody > tr:nth-of-type(odd) { background: rgba(148, 163, 184, .04); }
html[data-itheme="dark"] body.customers .dataTables_info,
html[data-itheme="dark"] body.customers .dataTables_length label,
html[data-itheme="dark"] body.customers .dataTables_filter label { color: var(--it-muted); }
html[data-itheme="dark"] body.customers .pagination > li > a,
html[data-itheme="dark"] body.customers .pagination > li > span { background: var(--it-surface); border-color: var(--it-line); color: var(--it-text); }
html[data-itheme="dark"] body.customers .pagination > .active > a,
html[data-itheme="dark"] body.customers .pagination > .active > span { background: #7537f2; border-color: #7537f2; color: #fff; }

/* Forms */
html[data-itheme="dark"] body.customers .form-control,
html[data-itheme="dark"] body.customers .bootstrap-select > .dropdown-toggle,
html[data-itheme="dark"] body.customers input[type="text"],
html[data-itheme="dark"] body.customers input[type="email"],
html[data-itheme="dark"] body.customers input[type="password"],
html[data-itheme="dark"] body.customers input[type="number"],
html[data-itheme="dark"] body.customers input[type="url"],
html[data-itheme="dark"] body.customers input[type="tel"],
html[data-itheme="dark"] body.customers input[type="search"],
html[data-itheme="dark"] body.customers select,
html[data-itheme="dark"] body.customers textarea { background-color: var(--it-input); border-color: var(--it-line-strong); color: var(--it-ink); }
html[data-itheme="dark"] body.customers .form-control::placeholder,
html[data-itheme="dark"] body.customers input::placeholder,
html[data-itheme="dark"] body.customers textarea::placeholder { color: var(--it-faint); }
html[data-itheme="dark"] body.customers .form-control[disabled],
html[data-itheme="dark"] body.customers .form-control[readonly] { background-color: var(--it-surface-3); color: var(--it-muted); }
html[data-itheme="dark"] body.customers .input-group-addon { background: var(--it-surface-3); border-color: var(--it-line-strong); color: var(--it-muted); }
html[data-itheme="dark"] body.customers label,
html[data-itheme="dark"] body.customers .control-label { color: var(--it-text); }
html[data-itheme="dark"] body.customers select option { background: var(--it-input); color: var(--it-ink); }
html[data-itheme="dark"] body.customers .checkbox label::before,
html[data-itheme="dark"] body.customers .radio label::before { background-color: var(--it-input); border-color: var(--it-line-strong); }

/* Buttons */
html[data-itheme="dark"] body.customers .btn-default { background: var(--it-surface-2); border-color: var(--it-line-strong); color: var(--it-text); }
html[data-itheme="dark"] body.customers .btn-default:hover,
html[data-itheme="dark"] body.customers .btn-default:focus { background: var(--it-surface-3); color: var(--it-ink); }
html[data-itheme="dark"] body.customers .close { color: var(--it-text); text-shadow: none; }

/* Dropdowns, modals, popovers, tabs */
html[data-itheme="dark"] body.customers .dropdown-menu { background: var(--it-surface); border-color: var(--it-line); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
html[data-itheme="dark"] body.customers .dropdown-menu > li > a { color: var(--it-text); }
html[data-itheme="dark"] body.customers .dropdown-menu > li > a:hover,
html[data-itheme="dark"] body.customers .dropdown-menu > li > a:focus { background: var(--it-surface-3); color: var(--it-ink); }
html[data-itheme="dark"] body.customers .dropdown-menu .divider { background: var(--it-line); }
html[data-itheme="dark"] body.customers .modal-content { background: var(--it-surface); border-color: var(--it-line); color: var(--it-text); }
html[data-itheme="dark"] body.customers .modal-header,
html[data-itheme="dark"] body.customers .modal-footer { border-color: var(--it-line); }
html[data-itheme="dark"] body.customers .popover { background: var(--it-surface); border-color: var(--it-line); color: var(--it-text); }
html[data-itheme="dark"] body.customers .nav-tabs { border-bottom-color: var(--it-line); }
html[data-itheme="dark"] body.customers .nav-tabs > li > a { color: var(--it-muted); }
html[data-itheme="dark"] body.customers .nav-tabs > li.active > a,
html[data-itheme="dark"] body.customers .nav-tabs > li.active > a:hover,
html[data-itheme="dark"] body.customers .nav-tabs > li.active > a:focus { background: var(--it-surface); border-color: var(--it-line) var(--it-line) transparent; color: var(--cpp-accent); }

/* Labels and alerts */
html[data-itheme="dark"] body.customers .label-default { background: rgba(148, 163, 184, .16); color: #cbd5e1; }
html[data-itheme="dark"] body.customers .alert-info { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .35); color: #bfdbfe; }
html[data-itheme="dark"] body.customers .alert-success { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .35); color: #a7f3d0; }
html[data-itheme="dark"] body.customers .alert-warning { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .35); color: #fde68a; }
html[data-itheme="dark"] body.customers .alert-danger { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); color: #fecaca; }

/* Footer */
html[data-itheme="dark"] body.customers footer,
html[data-itheme="dark"] body.customers .footer { background: transparent; color: var(--it-muted); border-color: var(--it-line); }

/* Tailwind colour utilities used across the portal views */
html[data-itheme="dark"] body.customers .tw-bg-white { background-color: var(--it-surface) !important; }
html[data-itheme="dark"] body.customers .tw-bg-neutral-50 { background-color: var(--it-surface-2) !important; }
html[data-itheme="dark"] body.customers .tw-bg-neutral-100 { background-color: var(--it-surface-3) !important; }
html[data-itheme="dark"] body.customers .tw-text-neutral-900,
html[data-itheme="dark"] body.customers .tw-text-neutral-800 { color: var(--it-ink) !important; }
html[data-itheme="dark"] body.customers .tw-text-neutral-700,
html[data-itheme="dark"] body.customers .tw-text-neutral-600 { color: var(--it-text) !important; }
html[data-itheme="dark"] body.customers .tw-text-neutral-500,
html[data-itheme="dark"] body.customers .tw-text-neutral-400 { color: var(--it-muted) !important; }
html[data-itheme="dark"] body.customers .tw-border-neutral-200,
html[data-itheme="dark"] body.customers .tw-border-neutral-300 { border-color: var(--it-line) !important; }

/* Light / dark switch in the portal menu */
.itheme-toggle .itheme-sun { display: none; }
html[data-itheme="dark"] .itheme-toggle .itheme-sun { display: inline; }
html[data-itheme="dark"] .itheme-toggle .itheme-moon { display: none; }
html[data-itheme="dark"] body.customers .itheme-toggle { color: #fbbf24 !important; }

/* Two logos */
html[data-itheme] .navbar-brand .itheme-logo-dark { display: none !important; }
html[data-itheme="dark"] .navbar-brand .itheme-logo-dark { display: inline-block !important; }
html[data-itheme="dark"] .navbar-brand .itheme-logo-light { display: none !important; }

/* Links that carry the base text colour (invoice numbers etc.) */
html[data-itheme="dark"] body.customers a.invoice-number,
html[data-itheme="dark"] body.customers a.estimate-number,
html[data-itheme="dark"] body.customers a.proposal-number,
html[data-itheme="dark"] body.customers table a:not(.btn):not(.label):not([class*="text-"]) { color: var(--cpp-accent); }
/* Progress bars */
html[data-itheme="dark"] body.customers .progress { background: var(--it-surface-3); box-shadow: none; }
/* Status badges: tinted from their own colour */
html[data-itheme="dark"] body.customers .label-success { background-color: rgba(16, 185, 129, .16) !important; color: #6ee7b7 !important; }
html[data-itheme="dark"] body.customers .label-danger { background-color: rgba(239, 68, 68, .16) !important; color: #fca5a5 !important; }
html[data-itheme="dark"] body.customers .label-warning { background-color: rgba(245, 158, 11, .16) !important; color: #fcd34d !important; }
html[data-itheme="dark"] body.customers .label-info { background-color: rgba(14, 165, 233, .16) !important; color: #7dd3fc !important; }
html[data-itheme="dark"] body.customers .label-primary { background-color: rgba(117, 55, 242, .2) !important; color: #c4b5fd !important; }
html[data-itheme="dark"] body.customers .label[style] { background-color: color-mix(in srgb, currentColor 16%, transparent) !important; }

/* ── My Instances (intake_info) ── */
html[data-itheme="dark"] body.customers .pi {
    --pi-ink: #f3f4f9; --pi-muted: #9095b0; --pi-line: #262b42; --pi-soft: #1a1e30;
    --pi-accent: #a07bff; --pi-accent-soft: rgba(117, 55, 242, .2);
    --pi-warn: #fcd34d; --pi-warn-soft: rgba(245, 158, 11, .12);
    --pi-ok: #6ee7b7; --pi-ok-soft: rgba(16, 185, 129, .14);
}
html[data-itheme="dark"] body.customers .pi .pi-inst,
html[data-itheme="dark"] body.customers .pi .pi-stat,
html[data-itheme="dark"] body.customers .pi .pi-list { background: var(--it-surface); }
html[data-itheme="dark"] body.customers .pi .pi-pending { border-color: rgba(245, 158, 11, .35); }
html[data-itheme="dark"] body.customers .pi .pi-icon[style] { background: color-mix(in srgb, var(--pi-state, #a07bff) 18%, transparent) !important; }
html[data-itheme="dark"] body.customers .pi .pi-chip-rec { border-color: rgba(16, 185, 129, .35); }
html[data-itheme="dark"] body.customers .pi .pi-btn:not(.pi-btn-soft) { background: #7537f2; }
html[data-itheme="dark"] body.customers .pi strong,
html[data-itheme="dark"] body.customers .pi b { color: var(--pi-ink); }

/* ── iTech Partners: partner card, documents, agreement, forms, notice ── */
html[data-itheme="dark"] body.customers .xpc { --xpc-ink: #f3f4f9; --xpc-muted: #9095b0; --xpc-line: #262b42; }
html[data-itheme="dark"] body.customers .xpc-card { background: var(--it-surface); }
html[data-itheme="dark"] body.customers .xpc-b { background: var(--it-surface-2); }
html[data-itheme="dark"] body.customers .xpc-b i { background: rgba(117, 55, 242, .2); color: #c4b5fd; }
html[data-itheme="dark"] body.customers .xpc-tag { background: var(--it-surface-3); color: var(--it-text); }
html[data-itheme="dark"] body.customers .xpc-tag.is-ok { background: rgba(16, 185, 129, .14); color: #6ee7b7; }
html[data-itheme="dark"] body.customers .xpc-reg.is-off { background: var(--it-surface-3); color: var(--it-muted) !important; }

html[data-itheme="dark"] body.customers .xdd h4,
html[data-itheme="dark"] body.customers .xdd-main b { color: var(--it-ink); }
html[data-itheme="dark"] body.customers .xdd-list { background: var(--it-surface); border-color: var(--it-line); }
html[data-itheme="dark"] body.customers .xdd-row { border-top-color: var(--it-line); }
html[data-itheme="dark"] body.customers .xdd-ico { background: rgba(117, 55, 242, .2); color: #c4b5fd; }
html[data-itheme="dark"] body.customers .xdd-ico.is-ok { background: rgba(16, 185, 129, .14); color: #6ee7b7; }
html[data-itheme="dark"] body.customers .xdd-ico.is-due { background: rgba(245, 158, 11, .14); color: #fcd34d; }
html[data-itheme="dark"] body.customers .xdd-btn:not(.is-primary) { background: var(--it-surface-2); border-color: var(--it-line-strong); color: var(--it-text) !important; }

html[data-itheme="dark"] body.customers .xag,
html[data-itheme="dark"] body.customers .xfm { --ink: #f3f4f9; --muted: #9095b0; --line: #262b42; }
html[data-itheme="dark"] body.customers .xag-card,
html[data-itheme="dark"] body.customers .xfm-card { background: var(--it-surface); }
html[data-itheme="dark"] body.customers .xag-party,
html[data-itheme="dark"] body.customers .xfm-row { background: var(--it-surface-2); }
html[data-itheme="dark"] body.customers .xag-steps { background: var(--it-surface-2); }
html[data-itheme="dark"] body.customers .xag-dot,
html[data-itheme="dark"] body.customers .xag-steps li span { background: var(--it-surface-3); }
html[data-itheme="dark"] body.customers .xag-doc { background: var(--it-surface-2); color: var(--it-text); }
html[data-itheme="dark"] body.customers .xag-doc h2,
html[data-itheme="dark"] body.customers .xag-doc h3 { color: #ddd6fe; }
html[data-itheme="dark"] body.customers .xag-pad { background: #fff; } /* signature pad stays white: ink is dark */
html[data-itheme="dark"] body.customers .xag-done { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .35); color: #a7f3d0; }
html[data-itheme="dark"] body.customers .xag-draft { background: rgba(245, 158, 11, .14); color: #fcd34d; }
html[data-itheme="dark"] body.customers .xfm-add { background: rgba(117, 55, 242, .14); border-color: rgba(167, 139, 250, .45); color: #c4b5fd; }
html[data-itheme="dark"] body.customers .xfm-steps li.is-now { background: var(--it-surface); color: #c4b5fd; }

html[data-itheme="dark"] body.customers .xab { background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .35); color: #fecaca; }
html[data-itheme="dark"] body.customers .xab a { color: #fca5a5 !important; }
html[data-itheme="dark"] body.customers .pi .pi-inst .pi-icon { background: color-mix(in srgb, var(--pi-state, #a07bff) 18%, transparent) !important; }
html[data-itheme="dark"] body.customers .cpp-tier.is-none { background: var(--it-surface-3); color: var(--it-text); }

/* The portal hides menu icons; keep the light / dark switch visible */
body.customers .navbar.header .navbar-nav > li.customers-nav-item-theme > a > svg.itheme-moon { display: inline !important; }
body.customers .navbar.header .navbar-nav > li.customers-nav-item-theme > a > svg.itheme-sun { display: none !important; }
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > li.customers-nav-item-theme > a > svg.itheme-moon { display: none !important; }
html[data-itheme="dark"] body.customers .navbar.header .navbar-nav > li.customers-nav-item-theme > a > svg.itheme-sun { display: inline !important; }
body.customers .navbar.header .navbar-nav > li.customers-nav-item-theme > a { padding-left: 10px; padding-right: 10px; }
