/* ============================================================================
   Dark mode — data-bs-theme="dark" στο <html> (toggle στο header, localStorage).
   Το Metronic bundle δίνει τα Bootstrap dark βασικά (body #0A1B44, text #E7ECF5,
   border #1A3068)· εδώ οι dark εκδοχές των ΔΙΚΩΝ μας custom στοιχείων που το
   metronic-app/dx.css καρφώνουν light. Το /admin μένει πάντα light (skip στο JS).

   Παλέτα: βάση #0A1B44 · βαθύ φόντο #04102B · soft #0F2454 ·
   borders #1A3068 / #142853 · text #E7ECF5 · muted #A6B4D0 · faint #6B7A9B
   ============================================================================ */

[data-bs-theme=dark] body {
    background-color: #04102B;
    color: #E7ECF5;
}

/* ── Header (top-row) ── */
[data-bs-theme=dark] main .top-row {
    background-color: #0A1B44 !important;
    border-bottom-color: #142853 !important;
    box-shadow: none;
}
[data-bs-theme=dark] .top-row strong[style*="#052767"] { color: #E7ECF5 !important; }
[data-bs-theme=dark] .top-row strong[style*="#0a7d34"] { color: #4CD07D !important; }
[data-bs-theme=dark] .top-row .text-muted,
[data-bs-theme=dark] .top-row .text-secondary { color: #A6B4D0 !important; }

/* ── Tabs (be-tabs σε όλες τις tabbed φόρμες) ── */
[data-bs-theme=dark] .be-tabs {
    background-color: #0A1B44 !important;
    border-color: #1A3068 !important;
    border-bottom-color: #1A3068 !important;
}
[data-bs-theme=dark] .be-tabs .nav-link { color: #A6B4D0 !important; }
[data-bs-theme=dark] .be-tabs .nav-link:hover { color: #E7ECF5 !important; border-bottom-color: #1A3068 !important; }
[data-bs-theme=dark] .be-tabs .nav-link.active { color: #1B84FF !important; border-bottom-color: #1B84FF !important; }
[data-bs-theme=dark] .be-tabs .nav-link:disabled,
[data-bs-theme=dark] .be-tabs .nav-link.disabled { color: #6B7A9B !important; }

/* ── Κάρτες φορμών (tab-content / brand-body / be-toolbar / sticky) ── */
[data-bs-theme=dark] .tab-content,
[data-bs-theme=dark] .brand-body,
[data-bs-theme=dark] .mtx .tab-content,
[data-bs-theme=dark] .mtx .brand-body {
    background-color: #0A1B44 !important;
    border-color: #1A3068 !important;
}
[data-bs-theme=dark] .be-toolbar,
[data-bs-theme=dark] .mtx .be-toolbar {
    background-color: #0A1B44 !important;
    border-color: #1A3068 !important;
}
[data-bs-theme=dark] .be-sticky-top,
[data-bs-theme=dark] .mtx .be-sticky-top { background-color: #04102B !important; }

/* ── .mtx tokens (Είδη/Παραστατικά σελίδες) ── */
[data-bs-theme=dark] .mtx {
    --mtx-fg: #C9D4E8;
    --mtx-fg-strong: #E7ECF5;
    --mtx-muted: #A6B4D0;
    --mtx-muted-2: #6B7A9B;
    --mtx-border: #1A3068;
    --mtx-border-soft: #142853;
    --mtx-bg-soft: #0F2454;
}
[data-bs-theme=dark] .mtx .btn-outline-primary,
[data-bs-theme=dark] .mtx .btn-outline-secondary,
[data-bs-theme=dark] .mtx .btn-outline-success,
[data-bs-theme=dark] .mtx .btn-outline-dark,
[data-bs-theme=dark] .mtx .btn-outline-info {
    background: #0F2454;
    border-color: #1A3068;
    color: #C9D4E8;
}
[data-bs-theme=dark] .mtx .btn-outline-primary { color: #1B84FF; }

/* ── ParEdit: Γραμμές Παραστατικού / αναζήτηση είδους ── */
[data-bs-theme=dark] .par-page.mtx .items-section {
    background-color: #0A1B44;
    border-color: #1A3068;
    color: #C9D4E8;
}
[data-bs-theme=dark] .par-page.mtx .lines-grid > thead > tr > th {
    background-color: #0A1B44;
    color: #A6B4D0;
    border-color: #1A3068;
}
[data-bs-theme=dark] .par-page.mtx .lines-grid > tbody > tr > td {
    background-color: #0A1B44;
    color: #C9D4E8;
    border-color: #142853;
}
[data-bs-theme=dark] .par-page.mtx .lines-grid > tbody > tr:hover > td { background-color: #0F2454; }
[data-bs-theme=dark] .par-page.mtx .lines-grid input,
[data-bs-theme=dark] .par-page.mtx .lines-grid select {
    background-color: #0F2454;
    border-color: #24417F;
    color: #E7ECF5;
}
[data-bs-theme=dark] .par-page.mtx .lines-grid input:focus,
[data-bs-theme=dark] .par-page.mtx .lines-grid select:focus { background-color: #0F2454; }
[data-bs-theme=dark] .par-page.mtx .brand-search-list { background-color: #0A1B44; border-color: #1A3068 !important; }
[data-bs-theme=dark] .par-page.mtx .brand-search-list .btn-link { color: #C9D4E8; }
[data-bs-theme=dark] .par-page.mtx .brand-search-list .btn-link:hover { background-color: #0F2454; }
[data-bs-theme=dark] .par-page.mtx .lines-grid > tbody > tr.brand-search-dropdown > td { background-color: #0A1B44; }

/* ── Πλέγματα (.be-dxgrid) ── */
[data-bs-theme=dark] .be-dxgrid {
    color-scheme: dark;
    background: #0A1B44;
    border-color: #1A3068 !important;
    /* DevExpress vars → dark */
    --dxbl-grid-hover-bg: #0F2454;
    --dxbl-grid-hover-color: #E7ECF5;
    --dxbl-grid-selection-color: #E7ECF5;
    --dxbl-grid-selection-focus-color: #E7ECF5;
}
[data-bs-theme=dark] .be-dxgrid .dxbl-grid-header-content,
[data-bs-theme=dark] .be-dxgrid thead tr:first-child th {
    background: #0A1B44 !important;
    color: #A6B4D0 !important;
    border-bottom-color: #1A3068 !important;
}
[data-bs-theme=dark] .be-dxgrid thead tr:not(:first-child) th,
[data-bs-theme=dark] .be-dxgrid .dxbl-grid-filter-row td {
    background: #0F2454 !important;
}
[data-bs-theme=dark] .be-dxgrid tbody td {
    background: #0A1B44;
    color: #C9D4E8;
    border-top-color: #142853;
}
[data-bs-theme=dark] .be-dxgrid tbody tr:hover { background: #0F2454 !important; }
[data-bs-theme=dark] .be-dxgrid tbody tr:hover td { background: transparent; }
[data-bs-theme=dark] .be-dxgrid tbody tr.dxbl-grid-selected-row td,
[data-bs-theme=dark] .be-dxgrid tbody tr[aria-selected="true"] td {
    background: rgba(27, 132, 255, .16) !important;
    color: #E7ECF5;
}
[data-bs-theme=dark] .be-dxgrid .dxbl-grid-footer-content,
[data-bs-theme=dark] .be-dxgrid tfoot td {
    background: #0F2454 !important;
    color: #E7ECF5 !important;
    border-top-color: #1A3068;
}

/* ── DevExpress editors / dropdowns σε dark ── */
[data-bs-theme=dark] {
    --dxbl-text-edit-bg: #0F2454;
    --dxbl-text-edit-border-color: #24417F;
    --dxbl-list-box-item-active-bg: rgba(27, 132, 255, .2);
    --dxbl-list-box-item-active-color: #E7ECF5;
}
[data-bs-theme=dark] .dxbl-text-edit,
[data-bs-theme=dark] .dxbl-text-edit input { color: #E7ECF5; }
[data-bs-theme=dark] .dxbl-dropdown-dialog,
[data-bs-theme=dark] .dxbl-popup {
    background-color: #0A1B44;
    border-color: #1A3068;
    color: #C9D4E8;
}

/* ── Bootstrap utilities που μένουν «φωτεινά» σε dark ── */
[data-bs-theme=dark] .bg-light { background-color: #0F2454 !important; }
[data-bs-theme=dark] .text-dark { color: #E7ECF5 !important; }
[data-bs-theme=dark] .table { --bs-table-bg: transparent; }

/* Alerts: σκούρα βάση, κρατούν το χρώμα-ένδειξη στο κείμενο/περίγραμμα */
[data-bs-theme=dark] .alert-info {
    background-color: rgba(27, 132, 255, .12);
    border-color: rgba(27, 132, 255, .3);
    color: #7AB5FF;
}
[data-bs-theme=dark] .alert-success {
    background-color: rgba(23, 198, 83, .12);
    border-color: rgba(23, 198, 83, .3);
    color: #5BDD8B;
}
[data-bs-theme=dark] .alert-warning {
    background-color: rgba(246, 192, 0, .12);
    border-color: rgba(246, 192, 0, .3);
    color: #F6C000;
}
[data-bs-theme=dark] .alert-danger {
    background-color: rgba(248, 40, 90, .12);
    border-color: rgba(248, 40, 90, .3);
    color: #FF7A9A;
}

/* Toggle κουμπί στο dark: σκούρο «light» κουμπί */
[data-bs-theme=dark] .btn-light {
    --bs-btn-color: #C9D4E8; --bs-btn-bg: #0F2454; --bs-btn-border-color: #1A3068;
    --bs-btn-hover-color: #E7ECF5; --bs-btn-hover-bg: #1A3068; --bs-btn-hover-border-color: #1A3068;
    --bs-btn-active-color: #E7ECF5; --bs-btn-active-bg: #1A3068; --bs-btn-active-border-color: #1A3068;
}
[data-bs-theme=dark] .btn-secondary {
    --bs-btn-color: #C9D4E8; --bs-btn-bg: #0F2454; --bs-btn-border-color: #1A3068;
    --bs-btn-hover-color: #E7ECF5; --bs-btn-hover-bg: #1A3068; --bs-btn-hover-border-color: #1A3068;
}
[data-bs-theme=dark] .btn-outline-secondary, [data-bs-theme=dark] .btn-outline-dark {
    --bs-btn-color: #A6B4D0; --bs-btn-border-color: #24417F;
    --bs-btn-hover-color: #E7ECF5; --bs-btn-hover-bg: #0F2454; --bs-btn-hover-border-color: #24417F;
    --bs-btn-active-color: #E7ECF5; --bs-btn-active-bg: #1A3068; --bs-btn-active-border-color: #24417F;
}

/* ── Sidebar σε dark: ένα σκαλί βαθύτερο από τις επιφάνειες, ίδια navy οικογένεια ── */
[data-bs-theme=dark] .page .sidebar { background-color: #2d3237 !important; }
[data-bs-theme=dark] .sidebar .top-row.navbar { background-color: #2d3237 !important; border-bottom-color: rgba(255, 255, 255, .1); }
[data-bs-theme=dark] .nav-toolbar { background-color: #2d3237; border-bottom-color: rgba(255, 255, 255, .1); }
[data-bs-theme=dark] .nav-search .form-control { background-color: #2d3237; border-color: rgba(255, 255, 255, .15); }
[data-bs-theme=dark] .nav-scrollable { scrollbar-color: #5a6270 #2d3237; }

/* Τίτλος φόρμας: πλέον απλό κείμενο (χωρίς πλαίσιο) → μόνο χρώμα γραμματοσειράς */
[data-bs-theme=dark] .be-form-title { color: #E7ECF5; box-shadow: none; }
