/*
 * SC-specific dark-mode fixes, loaded after the generic skin (css/hmd-dark.css, tools/app-shell).
 * Covers the page <style> blocks and third-party widgets the generic Tailwind remap cannot see.
 * Colours follow the generic skin tokens: page #0e131c, surface #151b27, raised #1c2331,
 * lines #273041 / #343e52, text #e2e8f0 / #cbd5e1 / #8b95a7.
 */

/* Cards and table rows (inventory/local_reconciliation, sales) */
html.dark .panel { background: #151b27; border-top-color: #273041; border-right-color: #273041; border-bottom-color: #273041; }
html.dark .panel:not([class*="border-l-"]) { border-left-color: #273041; }
html.dark .table-row:hover { background: #1c2331; }

/* Legacy sales page widgets */
html.dark .muted { color: #8b95a7; }
html.dark .chip { background: #151b27; border-color: #343e52; }
html.dark .chip.tab-active, html.dark .tab-active { background: #e2e8f0; color: #0e131c; border-color: #e2e8f0; }
html.dark .nav-tab { color: #8b95a7; }
html.dark .nav-tab.active { border-color: #f87171; color: #f87171; }
html.dark .progress { background: #273041; }
html.dark .shadow-\[1px_0_0_\#e5e7eb\] { box-shadow: 1px 0 0 #273041; }

/* Home page (welcome) */
html.dark .mono-grid {
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
}
html.dark .pill { background: rgba(21, 27, 39, .85); border-color: #273041; }
html.dark .capability-box:hover { box-shadow: 0 14px 30px rgba(0, 0, 0, .45); }

/* Shipments help (rendered Markdown) */
html.dark .doc { color: #cbd5e1; }
html.dark .doc h1, html.dark .doc h2, html.dark .doc h3, html.dark .doc strong { color: #f1f5f9; }
html.dark .doc hr { border-top-color: #273041; }
html.dark .doc code { background: #1c2331; border-color: #343e52; }
html.dark .doc th { background: #1c2331; color: #e2e8f0; }
html.dark .doc th, html.dark .doc td { border-color: #343e52; }
/* Mermaid diagrams use the light "neutral" theme: keep them on a light card so they stay legible. */
html.dark .doc pre.mermaid { background: #f8fafc; border-color: #343e52; }

/* Flatpickr date picker (3PL logs, order substitutions); the pages force a light border with !important */
html.dark .flatpickr-calendar { background: #151b27; border-color: #343e52 !important; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, .6) !important; }
html.dark .flatpickr-calendar.arrowTop:before, html.dark .flatpickr-calendar.arrowTop:after { border-bottom-color: #151b27; }
html.dark .flatpickr-calendar.arrowBottom:before, html.dark .flatpickr-calendar.arrowBottom:after { border-top-color: #151b27; }
html.dark .flatpickr-months .flatpickr-month,
html.dark .flatpickr-months .flatpickr-prev-month,
html.dark .flatpickr-months .flatpickr-next-month { color: #e2e8f0; fill: #e2e8f0; }
html.dark .flatpickr-months .flatpickr-prev-month:hover svg,
html.dark .flatpickr-months .flatpickr-next-month:hover svg { fill: #f87171; }
html.dark .flatpickr-current-month .flatpickr-monthDropdown-months,
html.dark .flatpickr-current-month input.cur-year { background: transparent; color: #e2e8f0; }
html.dark span.flatpickr-weekday { color: #8b95a7; }
html.dark .flatpickr-day { color: #e2e8f0; }
html.dark .flatpickr-day:hover, html.dark .flatpickr-day:focus,
html.dark .flatpickr-day.inRange { background: #252d3d; border-color: #252d3d; box-shadow: -5px 0 0 #252d3d, 5px 0 0 #252d3d; }
html.dark .flatpickr-day.prevMonthDay, html.dark .flatpickr-day.nextMonthDay,
html.dark .flatpickr-day.flatpickr-disabled { color: #4b5466; }
html.dark .flatpickr-day.today { border-color: #6b7588; }
html.dark .flatpickr-day.selected, html.dark .flatpickr-day.startRange, html.dark .flatpickr-day.endRange { color: #fff; box-shadow: none; }
html.dark .flatpickr-time { border-top-color: #273041 !important; }
html.dark .flatpickr-time input, html.dark .flatpickr-time .flatpickr-am-pm, html.dark .flatpickr-time .flatpickr-time-separator { color: #e2e8f0; background: transparent; }
html.dark .flatpickr-time input:hover, html.dark .flatpickr-time input:focus { background: #1c2331; }
