/* FuelDirect2 desktop palette: navy page, slate panels, blue controls. */
:root {
    color-scheme: light;
    --fd2-page: #e4ebf4;
    --fd2-panel: #f3f6fb;
    --fd2-raised: #e9f0f8;
    --fd2-table-head: #d9e3f0;
    --fd2-row-alt: #eaf0f7;
    --fd2-hover: #dce8f7;
    --fd2-border: #bfccdd;
    --fd2-input: #f8faff;
    --fd2-text: #17263d;
    --fd2-secondary: #344963;
    --fd2-muted: #526780;
    --fd2-link: #1d4ed8;
    --fd2-shadow: 0 5px 18px #2330470c;
}

html.dark {
    color-scheme: dark;
    --fd2-page: #0f172a;
    --fd2-panel: #111827;
    --fd2-raised: #162137;
    --fd2-table-head: #1b2940;
    --fd2-row-alt: #141f32;
    --fd2-hover: #1d2d47;
    --fd2-border: #293a54;
    --fd2-input: #0d1626;
    --fd2-text: #e8eef8;
    --fd2-secondary: #c5d1e2;
    --fd2-muted: #9aacc5;
    --fd2-link: #7eafff;
    --fd2-shadow: 0 6px 22px #02061726;
}

html .fd2-portal { background: var(--fd2-page); color: var(--fd2-text); }
html .fd2-portal .fd2-shell,
html .fd2-portal .fd2-workspace { background: var(--fd2-page) !important; }
html .fd2-portal .bg-white { background-color: var(--fd2-panel) !important; }
html .fd2-portal .bg-gray-50 { background-color: var(--fd2-raised) !important; }
html .fd2-portal .bg-gray-100 { background-color: var(--fd2-hover) !important; }
html .fd2-portal .text-gray-900,
html .fd2-portal .text-gray-800 { color: var(--fd2-text) !important; }
html .fd2-portal .text-gray-700,
html .fd2-portal .text-gray-600 { color: var(--fd2-secondary) !important; }
html .fd2-portal .text-gray-500,
html .fd2-portal .text-gray-400 { color: var(--fd2-muted) !important; }
html .fd2-portal .text-artisoft-main-600,
html .fd2-portal .text-artisoft-main-700 { color: var(--fd2-link) !important; }
html .fd2-portal .border-gray-200,
html .fd2-portal .border-gray-300 { border-color: var(--fd2-border) !important; }
html .fd2-portal .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--fd2-border) !important; }
html .fd2-portal .shadow-sm { box-shadow: var(--fd2-shadow); }
html .fd2-portal .hover\:bg-gray-50:hover,
html .fd2-portal .hover\:bg-gray-100:hover { background-color: var(--fd2-hover) !important; }

html .fd2-portal input,
html .fd2-portal select,
html .fd2-portal textarea {
    background-color: var(--fd2-input) !important;
    border-color: var(--fd2-border) !important;
    color: var(--fd2-text) !important;
    border-radius: 7px;
}
html .fd2-portal input::placeholder,
html .fd2-portal textarea::placeholder { color: var(--fd2-muted) !important; opacity: 1; }
.fd2-portal :is(input, select, textarea):focus { outline: 2px solid #6094fa; outline-offset: 2px; }
.fd2-portal h1:focus { outline: none; }
.fd2-portal h1 { letter-spacing: -.025em; }
.fd2-portal h2 { letter-spacing: -.015em; }
.fd2-portal button { transition: background-color .15s ease, border-color .15s ease; }
.fd2-portal .bg-artisoft-main-600 { background-color: #2563eb; }
.fd2-portal .bg-artisoft-main-600:hover { background-color: #1d4ed8; }

html .fd2-portal .fd2-sidebar {
    background: #111827 !important;
    color: #c5d1e2;
    border-color: #233047 !important;
}
html .fd2-portal .fd2-sidebar :is(.text-gray-700, .text-gray-900) { color: #d7e2f2 !important; }
html .fd2-portal .fd2-sidebar :is(.text-gray-400, .text-gray-500) { color: #8fa3c0 !important; }
html .fd2-portal .fd2-sidebar :is(.text-artisoft-main-600, .text-artisoft-main-700) { color: #8ab7ff !important; }
html .fd2-portal .fd2-sidebar :is(.border-gray-200, .border-gray-300) { border-color: #233047 !important; }
.fd2-sidebar nav { padding-top: 22px; }
.fd2-sidebar nav a { margin: 3px 0; border: 1px solid transparent; border-radius: 7px; }
html .fd2-portal .fd2-sidebar nav a:hover { background: #1c2940 !important; color: #eff5ff !important; }
html .fd2-portal .fd2-sidebar .bg-artisoft-main-100 { background: #1a3159 !important; border-color: #31578b; }
html .fd2-portal .fd2-sidebar nav .bg-artisoft-main-100 { box-shadow: inset 3px 0 #6094fa; }
html.dark .fd2-portal .bg-artisoft-main-100 { background-color: #1a3159 !important; }

.fd2-portal table { background: var(--fd2-panel); }
.fd2-portal thead,
.fd2-portal thead.bg-gray-50 { background: var(--fd2-table-head) !important; }
.fd2-portal th { color: var(--fd2-muted); font-size: .7rem; letter-spacing: .045em; text-transform: uppercase; }
.fd2-portal tbody tr:nth-child(even) { background-color: var(--fd2-row-alt); }
.fd2-portal tbody tr:hover { background-color: var(--fd2-hover); }
.fd2-portal td { border-color: var(--fd2-border); }
.fd2-portal details summary { cursor: pointer; color: var(--fd2-link); }
.fd2-portal details[open] { line-height: 1.65; }
.fd2-status { display: inline-flex; align-items: center; gap: 6px; border: 1px solid; border-radius: 6px; padding: 3px 8px; font-size: .75rem; font-weight: 600; text-transform: capitalize; }
.fd2-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fd2-status-good { background: #dcf2e8; border-color: #9fd4bd; color: #176247; }
.fd2-status-warning { background: #fff0d2; border-color: #dec08a; color: #855707; }
.fd2-status-danger { background: #f9e2e6; border-color: #e8acb5; color: #9a3146; }
.fd2-status-neutral { background: #e0e8f3; border-color: #bdcce1; color: #455b78; }
html.dark .fd2-status-good { background: #12372e; border-color: #245d49; color: #7fdeb3; }
html.dark .fd2-status-warning { background: #3a301c; border-color: #66522a; color: #e9c375; }
html.dark .fd2-status-danger { background: #3d2530; border-color: #6d3949; color: #f2a2b3; }
html.dark .fd2-status-neutral { background: #202e44; border-color: #3b506e; color: #b5c6de; }
html.dark .fd2-portal .bg-green-100 { background-color: #12372e; }
html.dark .fd2-portal .text-green-800 { color: #7fdeb3; }
html.dark .fd2-portal .bg-red-50 { background-color: #3d2530; }
html.dark .fd2-portal .text-red-800 { color: #f2a2b3; }

.fd2-portal #instancesMap { border-color: var(--fd2-border); background: var(--fd2-raised); border-radius: 9px; }
.fd2-portal .fd2-map-popup { color: #17263d; font-size: .8rem; line-height: 1.55; min-width: 170px; }
.fd2-map-popup strong { display: block; margin-bottom: 4px; }
.fd2-map-popup dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; }
.fd2-map-popup dt { color: #526780; }
.fd2-map-popup dd { overflow-wrap: anywhere; }
html.dark .fd2-portal .leaflet-tile-pane { filter: brightness(.72) saturate(.65); }
html.dark .fd2-portal .leaflet-control-zoom a,
html.dark .fd2-portal .leaflet-popup-content-wrapper,
html.dark .fd2-portal .leaflet-popup-tip { background: #162137; color: #e8eef8; }
html.dark .fd2-portal .leaflet-control-attribution { background: #111827dc; color: #9aacc5; }
html.dark .fd2-portal .leaflet-control-attribution a { color: #8ab7ff; }
.fd2-portal { scrollbar-color: #536981 var(--fd2-page); }
.fd2-installation-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.fd2-map-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.fd2-map-options article { min-width: 0; overflow: hidden; border: 1px solid var(--fd2-border); border-radius: 10px; background: var(--fd2-panel); }
.fd2-map-options header { display: flex; gap: 12px; min-height: 116px; padding: 18px; }
.fd2-map-options h2 { font-size: 1rem; font-weight: 600; color: var(--fd2-text); }
.fd2-map-options header p { margin-top: 5px; color: var(--fd2-muted); font-size: .8rem; line-height: 1.5; }
.fd2-map-option-number { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; background: #1a3159; color: #9ac2ff; border-radius: 7px; font-size: .85rem; }
.fd2-map-option-canvas { height: 440px; background: var(--fd2-raised); color: var(--fd2-text); }
.fd2-map-options footer { padding: 12px 18px; color: var(--fd2-muted); font-size: .75rem; }
.fd2-map-options .maplibregl-popup-content { color: #17263d; font-size: .8rem; }
@media (max-width: 1100px) { .fd2-map-options { grid-template-columns: minmax(0, 1fr); } .fd2-map-option-canvas { height: 360px; } .fd2-map-options header { min-height: auto; } }
.fd2-installation-toolbar input { width: min(100%, 340px); }
.fd2-installation-toolbar > span { margin-left: auto; }
.fd2-view-tabs { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--fd2-border); background: var(--fd2-input); border-radius: 8px; }
.fd2-view-tabs button { padding: 6px 16px; border-radius: 5px; color: var(--fd2-muted); font-size: .85rem; }
.fd2-view-tabs button.selected { background: var(--fd2-hover); color: var(--fd2-text); box-shadow: inset 0 -2px #6094fa; }
.fd2-installation-table th { padding: 13px 16px; }
.fd2-installation-table td { padding: 13px 16px; vertical-align: middle; }
.fd2-installation-name { max-width: 310px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd2-installation-table .fd2-installation-details { background: var(--fd2-raised); }
.fd2-installation-table .fd2-installation-details:hover { background: var(--fd2-raised); }
.fd2-installation-table .fd2-installation-details > td { padding: 24px; }
.fd2-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
.fd2-detail-grid h2 { font-size: .8rem; font-weight: 600; color: var(--fd2-text); margin-bottom: 12px; }
.fd2-detail-grid dl { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 7px 12px; font-size: .78rem; }
.fd2-detail-grid dt { color: var(--fd2-muted); }
.fd2-detail-grid dd { color: var(--fd2-secondary); overflow-wrap: anywhere; }
@media (max-width: 900px) { .fd2-detail-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .fd2-portal button { transition: none; } }
