/* KTG CONSTRUCTION MANAGEMENT — DARK VIP PRO FINAL POLISH
 * Final visual hierarchy pass for executive dark mode.
 * Presentation only; no business logic, routes or Livewire behavior changed.
 */

html.dark {
    --ktg-final-canvas: #07111f;
    --ktg-final-surface: #0f1b2c;
    --ktg-final-surface-raised: #132238;
    --ktg-final-surface-strong: #172940;
    --ktg-final-border: #30465f;
    --ktg-final-border-soft: #24374e;
    --ktg-final-title: #f7f9fc;
    --ktg-final-body: #d5e0eb;
    --ktg-final-muted: #a8b9cc;
    --ktg-final-subtle: #91a6bd;
    --ktg-final-blue: #92c2f4;
    --ktg-final-gold: #f2b84b;
}

/* --------------------------------------------------------------------------
   1. Executive page headers: never white in dark mode
   -------------------------------------------------------------------------- */
html.dark body .triton-page > section:first-child {
    background:
        linear-gradient(135deg, rgba(49, 93, 145, .18), transparent 42%),
        linear-gradient(180deg, #132238 0%, #0f1c2e 100%) !important;
    border-color: #34506e !important;
    color: var(--ktg-final-body) !important;
    box-shadow:
        inset 0 3px 0 rgba(242, 184, 75, .72),
        0 14px 34px rgba(0, 0, 0, .12) !important;
}

html.dark body .triton-page > section:first-child h1,
html.dark body .triton-page > section:first-child h2,
html.dark body .triton-page > section:first-child h3 {
    color: var(--ktg-final-title) !important;
    text-shadow: none !important;
}

html.dark body .triton-page > section:first-child p,
html.dark body .triton-page > section:first-child [class~="text-slate-500"],
html.dark body .triton-page > section:first-child [class~="text-slate-400"] {
    color: #b4c5d8 !important;
}

html.dark body .triton-page > section:first-child [class~="bg-white"],
html.dark body .triton-page > section:first-child [class*="bg-white/"] {
    background-color: #15263c !important;
    border-color: #38516d !important;
}

/* Some legacy pages render an extra marketing-style header wrapper. */
html.dark body .triton-page > div:first-child[class*="rounded"],
html.dark body .triton-page > header:first-child {
    background:
        linear-gradient(135deg, rgba(49, 93, 145, .16), transparent 45%),
        #101d30 !important;
    border-color: #34506e !important;
    color: var(--ktg-final-body) !important;
}

/* --------------------------------------------------------------------------
   2. Typography contrast: eliminate remaining navy-on-dark text
   -------------------------------------------------------------------------- */
html.dark body .triton-page .text-kt-navy,
html.dark body .triton-page [class*="text-[#1D3C6A]"],
html.dark body .triton-page [class*="text-[#1d3c6a]"],
html.dark body .triton-page [class*="text-[#173A66]"],
html.dark body .triton-page [class*="text-[#244D82]"],
html.dark body .triton-page [class*="text-[#315D91]"],
html.dark body .triton-page [class*="text-[#315d91]"] {
    color: #ddecfb !important;
}

html.dark body .triton-page a.text-kt-navy,
html.dark body .triton-page a[class*="text-[#1D3C6A]"],
html.dark body .triton-page a[class*="text-[#315D91]"] {
    color: var(--ktg-final-blue) !important;
}

html.dark body .triton-page a.text-kt-navy:hover,
html.dark body .triton-page a[class*="text-[#1D3C6A]"]:hover,
html.dark body .triton-page a[class*="text-[#315D91]"]:hover {
    color: #cbe5ff !important;
}

html.dark body .triton-page [class~="text-slate-700"] { color: #dde6ef !important; }
html.dark body .triton-page [class~="text-slate-600"] { color: #c8d4e1 !important; }
html.dark body .triton-page [class~="text-slate-500"] { color: var(--ktg-final-muted) !important; }
html.dark body .triton-page [class~="text-slate-400"] { color: var(--ktg-final-subtle) !important; }

/* KPI values and dashboard links need more visual authority. */
html.dark body .triton-page [class*="text-2xl"].text-kt-navy,
html.dark body .triton-page [class*="text-3xl"].text-kt-navy,
html.dark body .triton-page [class*="font-black"][class*="text-[#1D3C6A]"] {
    color: #f1f6fc !important;
}

/* --------------------------------------------------------------------------
   3. Navigation hierarchy
   -------------------------------------------------------------------------- */
html.dark body .triton-page nav[class*="rounded"] {
    background-color: #0f1d30 !important;
    border-color: #314a66 !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
}

html.dark body .triton-page nav[class*="rounded"] a,
html.dark body .triton-page nav[class*="rounded"] button {
    color: #bfd0e1 !important;
}

html.dark body .triton-page nav[class*="rounded"] a[class*="bg-[#1D3C6A]"],
html.dark body .triton-page nav[class*="rounded"] a[class*="bg-kt-navy"],
html.dark body .triton-page nav[class*="rounded"] button[class*="bg-[#1D3C6A]"],
html.dark body .triton-page nav[class*="rounded"] button[class*="bg-kt-navy"] {
    background-color: #244f82 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(21, 61, 105, .22) !important;
}

/* --------------------------------------------------------------------------
   4. KPI cards and surfaces: controlled separation, never flat black
   -------------------------------------------------------------------------- */
html.dark body .triton-page .triton-card {
    border-color: var(--ktg-final-border) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.018) !important;
}

html.dark body .triton-page .triton-card:hover {
    border-color: #3b5877;
}

html.dark body .triton-page section.grid .triton-card {
    background-color: #122137 !important;
}

html.dark body .triton-page section.grid .triton-card:nth-child(even) {
    background-color: #13243a !important;
}

/* Keep large corporate KPI strips intentionally stronger than normal cards. */
html.dark body .triton-page section[class*="bg-[#1D3C6A]"] {
    background: linear-gradient(135deg, #244b7c 0%, #1e416d 100%) !important;
    border-color: #315a8f !important;
}

/* --------------------------------------------------------------------------
   5. Status chips: executive dark pills rather than white stickers
   -------------------------------------------------------------------------- */
html.dark body .triton-page [class*="rounded-full"][class*="bg-slate-100"],
html.dark body .triton-page [class*="rounded-full"][class*="bg-slate-50"] {
    background-color: #17283e !important;
    color: #dce7f2 !important;
    border-color: #526b86 !important;
    --tw-ring-color: #526b86 !important;
    box-shadow: inset 0 0 0 1px rgba(140, 163, 189, .10) !important;
}

html.dark body .triton-page [class*="rounded-full"][class*="text-slate-600"],
html.dark body .triton-page [class*="rounded-full"][class*="text-slate-500"] {
    color: #e3ebf4 !important;
}

html.dark body .triton-page [class*="rounded-full"] [class*="bg-slate-400"] {
    background-color: #9bb0c7 !important;
}

/* Semantic chips retain meaning with restrained saturation. */
html.dark body .triton-page [class*="rounded-full"][class*="bg-red-50"] {
    background-color: rgba(190,30,45,.18) !important;
    color: #ff9da7 !important;
    --tw-ring-color: rgba(239,68,68,.36) !important;
}
html.dark body .triton-page [class*="rounded-full"][class*="bg-amber-50"] {
    background-color: rgba(217,119,6,.18) !important;
    color: #ffd078 !important;
    --tw-ring-color: rgba(245,158,11,.36) !important;
}
html.dark body .triton-page [class*="rounded-full"][class*="bg-emerald-50"] {
    background-color: rgba(5,150,105,.16) !important;
    color: #75e8bd !important;
    --tw-ring-color: rgba(16,185,129,.34) !important;
}
html.dark body .triton-page [class*="rounded-full"][class*="bg-blue-50"] {
    background-color: rgba(37,99,235,.17) !important;
    color: #9fcbff !important;
    --tw-ring-color: rgba(59,130,246,.34) !important;
}

/* --------------------------------------------------------------------------
   6. Structure master data — cleaner executive hierarchy
   -------------------------------------------------------------------------- */
html.dark body .triton-page .structure-item {
    background: linear-gradient(180deg, #122137 0%, #101d30 100%) !important;
    border-color: #304860 !important;
}

html.dark body .triton-page .structure-item:hover {
    background: linear-gradient(180deg, #172b43 0%, #14263b 100%) !important;
    border-color: #4c6d91 !important;
    box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;
}

html.dark body .triton-page table thead,
html.dark body .triton-page table thead tr,
html.dark body .triton-page table thead th {
    background-color: #172940 !important;
    color: #c3d0df !important;
}

/* --------------------------------------------------------------------------
   7. Dashboard fine contrast
   -------------------------------------------------------------------------- */
html.dark body .triton-page #resource-summary,
html.dark body .triton-page #quality-summary {
    background-color: #0f1c2e !important;
}

html.dark body .triton-page #resource-summary > div:first-child,
html.dark body .triton-page #quality-summary > div:first-child {
    background-color: #101f32 !important;
}

html.dark body .triton-page #resource-summary [class*="bg-slate-50"],
html.dark body .triton-page #quality-summary [class*="bg-slate-50"] {
    background-color: #15263b !important;
}

/* --------------------------------------------------------------------------
   8. Forms and filters: premium glass feel with clear focus
   -------------------------------------------------------------------------- */
html.dark body .triton-page input:not([type="checkbox"]):not([type="radio"]),
html.dark body .triton-page textarea,
html.dark body .triton-page select,
html.dark body .triton-page .triton-field {
    background-color: #0c192a !important;
    border-color: #3a536f !important;
}

html.dark body .triton-page input:hover,
html.dark body .triton-page textarea:hover,
html.dark body .triton-page select:hover,
html.dark body .triton-page .triton-field:hover {
    border-color: #506f92 !important;
}

html.dark body .triton-page input:focus,
html.dark body .triton-page textarea:focus,
html.dark body .triton-page select:focus,
html.dark body .triton-page .triton-field:focus {
    border-color: #79a6d7 !important;
    box-shadow: 0 0 0 3px rgba(87,139,199,.17) !important;
}

/* --------------------------------------------------------------------------
   9. Reduce visual noise from bright utility backgrounds
   -------------------------------------------------------------------------- */
html.dark body .triton-page [class~="bg-white"]:not([class*="text-white"]),
html.dark body .triton-page [class*="bg-white/"]:not([class*="text-white"]) {
    background-color: #111f33 !important;
}

html.dark body .triton-page [class*="shadow-"] {
    --tw-shadow-color: rgba(0,0,0,.18) !important;
}

/* Scrollbars remain discreet on dense QS registers. */
html.dark body .triton-page {
    scrollbar-color: #49637f #0b1625;
}

html.dark body .triton-page ::-webkit-scrollbar-track { background: #0b1625; }
html.dark body .triton-page ::-webkit-scrollbar-thumb {
    background: #49637f;
    border-radius: 999px;
}
