/* Κοινές καρτέλες εφαρμογής (slate, ίδιο look με Οφειλές) — χρήση: <nav class="ins-nav"><a class="ins-tab active">…</a></nav> */
/* Insights navigation & περιεχόμενο — πιστό nav-tabs look του
   dashboard οφειλών (slate palette): κάτω-περίγραμμα, top-rounded tabs,
   active γεμάτο slate. */
.ins-toolbar {
    display: flex; flex-wrap: wrap; align-items: flex-end;
    gap: .6rem; row-gap: .5rem;
    margin-bottom: 1.25rem;
}
/* Μικρότερο κενό ανάμεσα στον τίτλο-σελίδας και το tab bar, ίδιο παντού */
body[data-page-name^="insights-"] .container-fluid > .d-flex:first-of-type,
body[data-page-name^="insights-"] .container > .d-flex:first-of-type {
    margin-bottom: .6rem !important;
}
.ins-nav {
    display: flex; flex-wrap: wrap; gap: .25rem; align-items: flex-end;
    border-bottom: 2px solid #475569;
    min-width: 0;
}
.ins-tab {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .7rem 1rem;
    border-radius: 8px 8px 0 0; border: none;
    font-size: .9rem; font-weight: 600; line-height: 1;
    color: #374151; background: transparent;
    text-decoration: none; white-space: nowrap; flex-shrink: 0;
    transition: background .18s ease, color .18s ease;
}
.ins-tab i { font-size: 1rem; }
.ins-tab:hover { color: #475569; background: rgba(71, 85, 105, .1); }
.ins-tab.active { color: #fff; background: #475569; }
.ins-more.show, .ins-tab.ins-more[aria-expanded="true"] {
    color: #fff; background: #475569;
}
/* Chip επιλεγμένης οντότητας — slate, ταιριαστό με τα tabs.
   ΧΩΡΙΣ overflow:hidden στο container ώστε το dropdown να μη «κόβεται». */
.ins-entity {
    display: inline-flex; align-items: stretch; flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
    border-radius: 10px; align-self: center;
}
.ins-entity-main {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .5rem .8rem; font-size: .875rem; font-weight: 600;
    color: #fff; background: linear-gradient(135deg, #475569, #334155);
    text-decoration: none; white-space: nowrap; max-width: 15rem;
    border-radius: 10px 0 0 10px;
}
.ins-entity-main .ins-entity-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ins-entity-caret {
    display: inline-flex; align-items: center; padding: 0 .6rem;
    color: #fff; background: #334155; border: none; cursor: pointer;
    border-radius: 0 10px 10px 0;
}
.ins-entity-caret:hover { background: #1e293b; }
.ins-entity-caret::after { margin-left: 0; }
.ins-dd .dropdown-item { font-size: .875rem; }
.ins-dd .dropdown-item.active,
.ins-dd .dropdown-item:active { background: #475569; }
@media (max-width: 575.98px) {
    .ins-tab { padding: .6rem .7rem; font-size: .84rem; }
    .ins-tab .ins-tab-text { display: none; }
    .ins-tab.ins-keep-text .ins-tab-text { display: inline; }
}

/* ============================================================= *
 * Insights περιεχόμενο — εναρμονισμένο με το dashboard οφειλών.
 * Στοχεύει ΜΟΝΟ τις σελίδες Insights μέσω data-page-name.
 * ============================================================= */
body[data-page-name^="insights-"] {
    background: #f6f8fa;
}
body[data-page-name^="insights-"] .container-fluid,
body[data-page-name^="insights-"] .container {
    max-width: 1320px;
}
/* Τίτλος σελίδας */
body[data-page-name^="insights-"] h4 {
    color: #1e293b; font-weight: 700; letter-spacing: -.01em;
}
body[data-page-name^="insights-"] h4 > .bi:first-child,
body[data-page-name^="insights-"] h4 > i.bi:first-child {
    color: #475569;
}
/* Κάρτες — απαλή σκιά, στρογγυλά, χωρίς σκληρό border */
body[data-page-name^="insights-"] .card {
    border: 1px solid #e8edf2;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
    transition: box-shadow .18s ease, transform .18s ease;
}
body[data-page-name^="insights-"] .card-header {
    background: #fbfcfd;
    border-bottom: 1px solid #eef2f6;
    font-weight: 600; color: #334155;
    border-radius: 12px 12px 0 0 !important;
}
/* Κάρτες μετρικών (row g-3 → κάρτες με μικρό label + μεγάλο νούμερο):
   ανασήκωμα στο hover, χρωματικό αριστερό λεπτό border */
body[data-page-name^="insights-"] .row > [class*="col-"] > .card.h-100 {
    border-left: 3px solid #475569;
}
body[data-page-name^="insights-"] .row > [class*="col-"] > .card.h-100:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, .10);
    transform: translateY(-2px);
}
body[data-page-name^="insights-"] .card-body .text-muted.small {
    text-transform: uppercase; letter-spacing: .04em;
    font-size: .7rem !important; font-weight: 600;
}
body[data-page-name^="insights-"] .card-body .fs-5.fw-semibold {
    font-size: 1.5rem !important; font-weight: 700 !important;
    letter-spacing: -.02em;
}
/* Πίνακες — καθαρές επικεφαλίδες, ήπιες γραμμές */
body[data-page-name^="insights-"] .table > thead th {
    text-transform: uppercase; letter-spacing: .03em;
    font-size: .72rem; color: #64748b; font-weight: 700;
    border-bottom: 2px solid #e8edf2;
}
body[data-page-name^="insights-"] .table > tbody td {
    border-color: #f1f4f8; vertical-align: middle;
}
body[data-page-name^="insights-"] .table-hover > tbody > tr:hover > * {
    background: #f1f5f9;
}
/* Σύνδεσμοι σε πίνακες — slate */
body[data-page-name^="insights-"] .table a {
    color: #475569; text-decoration: none; font-weight: 500;
}
body[data-page-name^="insights-"] .table a:hover {
    color: #334155; text-decoration: underline;
}
/* Ενημερωτικά alert-secondary → πιο ήπια «notice» εμφάνιση */
body[data-page-name^="insights-"] .alert-secondary {
    background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569;
    border-radius: 10px;
}

/* Κεφαλίδα σελίδας (ίδιο ύφος με debt-hero, συμπαγής) */
.app-hero {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    color: #fff; padding: 1.25rem 1.5rem; margin-bottom: 1rem;
    border-radius: 16px; box-shadow: 0 10px 30px rgba(71, 85, 105, .25);
}
.app-hero h1, .app-hero h4, .app-hero a { color: #fff !important; }
.app-hero .text-muted, .app-hero small { color: rgba(255,255,255,.8) !important; }
.app-hero .badge.bg-light { color: #334155 !important; }
.app-hero .btn-outline-light:hover { color: #334155 !important; }
.app-hero a.btn-light, .app-hero a.btn-light:hover, .app-hero a.btn-light:focus {
    color: #334155 !important; background: #fff; border-color: #fff; font-weight: 600;
}
.app-hero a.btn-danger, .app-hero a.btn-danger:hover { color: #fff !important; }


/* Επιλογέας χώρων εργασίας (sidebar, κάτω από το όνομα χρήστη) — μόνο λογιστές/admin */
.ws-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.ws-switch .ws-item:nth-child(odd):last-child { grid-column: 1 / -1; }
.ws-item { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .45rem .3rem; border-radius: 10px; font-size: .68rem; line-height: 1.15; text-align: center; color: rgba(255,255,255,.75) !important; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); text-decoration: none; transition: background .15s ease; }
.ws-item i { font-size: 1.05rem; }
.ws-item:hover { background: rgba(255,255,255,.14); color: #fff !important; }
.glass-sidebar .ws-item.active, .glass-sidebar .ws-item.active i, .glass-sidebar .ws-item.active span { background: #fff; color: #334155 !important; border-color: #fff; font-weight: 600; }
.glass-sidebar .ws-item:focus, .glass-sidebar .ws-item:active { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.ws-search input { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.15); color: #fff !important; }
.ws-search input::placeholder { color: rgba(255,255,255,.6); }
.ws-search input:focus { background: #fff; color: #334155 !important; }

/* Δυναμικοί πίνακες: ταξινόμηση με κλικ στην επικεφαλίδα */
th.ts-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.ts-th:hover { color: #1e293b; text-decoration: underline; }
th.ts-active { color: #1e293b; }
th .ts-ind { font-size: .7rem; color: #475569; }

/* Δέντρο BI στο sidebar (χώρος «Συγκεντρωτικό Πελατών», 02/10/2026): BI → καρτέλες, ανοιχτό μόνο το ενεργό */
.report-tree, .report-tree-tabs { list-style: none; padding-left: 0; margin: 0; }
.report-tree-tabs { padding-left: 1.1rem; }
.report-tree-tabs .nav-link { font-size: .9rem; }
.report-tree-label { cursor: pointer; }

.report-tree-label { display: flex; align-items: center; }
.report-tree-label > span { flex: 1 1 auto; }
.report-tree-caret { font-size: .8rem; transition: transform .18s ease; }
.report-tree-label[aria-expanded="false"] .report-tree-caret { transform: rotate(-90deg); }
