/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
    --ch-reg: #2a78d6;
    --ch-ret: #e34948;
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 64px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #fff;
    --topbar-height: 60px;
    --primary: #2563eb;
    --primary-light: #eff6ff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #c8d4e8;
    --card-bg: #ffffff;
    --text: #64748b;
    --text-muted: #64748b;
    --border: #d1daea;
    --radius: 12px;
    --shadow: 0 1px 4px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1), 0 2px 4px rgba(0,0,0,.06);
}

/* ── Override Bootstrap text utilities ─────────────────────────────────────── */
.text-muted { color: var(--text-muted) !important; }
:root {
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--text-muted);
    --bs-secondary-color-rgb: 100, 116, 139;
}
[data-theme="dark"] {
    --bs-body-color: #f1f5f9;
    --bs-secondary-color: #94a3b8;
    --bs-secondary-color-rgb: 148, 163, 184;
    --bs-border-color: rgba(255,255,255,.06);
}

/* ── Dark theme ────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
    --ch-reg: #3987e5;
    --ch-ret: #e66767;
    --bg: #162032;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 4px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
}
[data-theme="dark"] .topbar { background: #1e293b; }
[data-theme="dark"] .topbar-avatar { background: #334155; color: #94a3b8; }
[data-theme="dark"] .avatar-dropdown { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .avatar-dropdown-item { color: #f1f5f9; }
[data-theme="dark"] .avatar-dropdown-item:hover { background: #334155; }
[data-theme="dark"] .notif-dropdown { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .notif-tabs { border-color: #334155; }
[data-theme="dark"] .notif-row { border-color: #334155; }
[data-theme="dark"] .notif-row:hover { background: #334155; }
[data-theme="dark"] .notif-row.unread { background: rgba(37,99,235,.14); }
[data-theme="dark"] .notif-footer { border-color: #334155; }
[data-theme="dark"] .dropdown-menu {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: #f1f5f9;
}
[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-theme="dark"] .dropdown-menu .dropdown-item:focus {
    background: #334155;
    color: #fff;
}
[data-theme="dark"] .dropdown-menu .dropdown-divider {
    border-color: #334155;
}
[data-theme="dark"] .stat-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .table { --bs-table-bg: #1e293b; --bs-table-striped-bg: #1e293b; --bs-table-hover-bg: #1e40af; --bs-table-border-color: #334155; --bs-border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .table th { background: #172033 !important; color: #94a3b8 !important; border-color: #334155 !important; }
[data-theme="dark"] .table td { background: #1e293b !important; border-color: #334155 !important; color: #f1f5f9; }
[data-theme="dark"] .table tbody tr:hover > td {
    background-color: #2d3f55 !important;
    box-shadow: none !important;
}
#glosesTableBody tr:hover > td { background-color: rgba(59,130,246,.12) !important; }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: #0f172a; border-color: #334155; color: #f1f5f9; }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus { background: #0f172a; border-color: #2563eb; color: #f1f5f9; }
[data-theme="dark"] .form-label { color: #94a3b8; }
[data-theme="dark"] .section-legend { color: #64748b; }
[data-theme="dark"] .nav-tabs { border-color: #334155; }
[data-theme="dark"] .nav-tabs .nav-link { color: #94a3b8; }
[data-theme="dark"] .nav-tabs .nav-link.active { background: #1e293b; border-color: #334155 #334155 #1e293b; color: #f1f5f9; }
.card-footer { background: #f3f5fa; border-color: var(--border); }
[data-theme="dark"] .card-footer { background: #182033; border-color: #334155; }
[data-theme="dark"] .member-header { background: #172554; border-color: #1e3a8a; }
[data-theme="dark"] .filter-bar { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .badge.bg-light { background: #334155 !important; color: #f1f5f9 !important; }
.lic-list-panel { background: #eaeff7; border: 1px solid #c8d4e8; border-radius: 6px; padding: 4px 8px; box-shadow: inset 0 2px 5px rgba(0,0,0,.08); }
[data-theme="dark"] .lic-list-panel { background: #141e30; border-color: #1e2d45; box-shadow: inset 0 2px 5px rgba(0,0,0,.25); }

/* ── Base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body {
    height: 100%;
    overflow: hidden;
}
body {
    font-family: 'Open Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    --bs-body-color: var(--text);
    margin: 0;
}
.card, .card-body, .card-header, .modal-content, .modal-body, .modal-header {
    color: var(--text);
}
[data-theme="dark"] .modal-content {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .modal-header {
    background: #172033;
    border-color: #334155;
}
[data-theme="dark"] .modal-footer {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .modal-body {
    color: var(--text);
}
[data-theme="dark"] .btn-close {
    filter: invert(1);
}
#app {
    height: 100%;
}
#main-layout {
    position: fixed;
    inset: 0;
    display: flex;
}

/* ── Loading screen ───────────────────────────────────────────────────────── */
.loading-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
    z-index: 9999;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1100;
    transition: width .25s ease, transform .3s ease;
    overflow: hidden;
}

.sidebar-header {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
    width: 100%;
    display: block;
    flex-shrink: 0;
    margin: 0;
}
.sidebar-logo-img {
    width: 100%;
    height: 116px;
    object-fit: contain;
    object-position: left center;
    display: block;
    margin: 0;
    transition: opacity .25s ease;
}
.sidebar-title { flex: 1; }
.org-name  { display: block; color: #fff; font-weight: 700; font-size: 15px; }
.org-sub   { display: block; color: var(--sidebar-text); font-size: 11px; margin-top: 1px; }

.btn-sidebar-close {
    background: none; border: none; color: var(--sidebar-text);
    font-size: 18px; cursor: pointer; padding: 4px;
}
.btn-sidebar-collapse {
    position: absolute;
    top: 10px;
    left: calc(100% - 38px);
    transform: translateX(0);
    background: none; border: none; color: rgba(255,255,255,.5);
    font-size: 18px; cursor: pointer; padding: 6px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s, left .25s ease, transform .25s ease;
}
.btn-sidebar-collapse:hover { background: var(--sidebar-hover); color: #fff; }

/* ── Collapsed sidebar ────────────────────────────────────────────────────── */
.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed-width); }

.sidebar.collapsed .sidebar-logo-img { opacity: 0; }
.sidebar.collapsed .sidebar-header   { padding: 12px 8px; }
.sidebar.collapsed .btn-sidebar-collapse { left: 50%; transform: translateX(-50%); }

.sidebar.collapsed .nav-label  { opacity: 0; max-height: 0; padding: 0; overflow: hidden; transition: opacity .15s, max-height .25s, padding .25s; }
.sidebar.collapsed .nav-divider { margin: 6px 8px; }

.sidebar.collapsed .sidebar-link {
    justify-content: center;
    padding: 10px 0;
    margin: 2px 8px;
}
.sidebar.collapsed .sidebar-link span { display: none; }
.sidebar.collapsed .sidebar-link i   { width: auto; font-size: 18px; margin: 0 auto; }

.sidebar.collapsed .user-info       { opacity: 0; max-height: 0; margin: 0; }

.sidebar-nav {
    flex: 1;
    list-style: none;
    padding: 8px 0;
    margin: 0;
    overflow-y: auto;
}
.sidebar-nav .nav-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    padding: 6px 16px 2px;
}
.sidebar-nav .nav-divider {
    height: 1px;
    background: rgba(255,255,255,.05);
    margin: 4px 16px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 8px;
    margin: 1px 8px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    transition: background .15s, color .15s, padding .25s ease, margin .25s ease;
}
.sidebar-link span {
    opacity: 1;
    transition: opacity .15s ease;
    overflow: hidden;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; transition: transform .2s ease, font-size .25s ease; }
.sidebar-link:hover   { background: var(--sidebar-hover); color: #cbd5e1; }
.sidebar-link:hover i { transform: scale(1.25) translateX(2px); }
.sidebar-link.active  {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    transition: padding .25s ease;
}
.sidebar-footer-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
    transition: width .25s, height .25s;
}
.sidebar-footer-label {
    font-size: 17px;
    font-weight: 600;
    color: rgba(255,255,255,.7);
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity .15s ease;
}
.sidebar.collapsed .sidebar-footer-label { opacity: 0; width: 0; }
.sidebar.collapsed .sidebar-footer { padding: 8px; justify-content: center; }

.sidebar-version {
    padding: 8px 16px 10px;
    text-align: center;
    font-size: 10px;
    color: rgba(255,255,255,.25);
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .15s ease;
}
.sidebar.collapsed .sidebar-version { opacity: 0; }

/* Global custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
@media (prefers-color-scheme: dark) {
    * { scrollbar-color: #334155 transparent; }
    *::-webkit-scrollbar-thumb { background: #334155; }
    *::-webkit-scrollbar-thumb:hover { background: #475569; }
}
[data-theme="dark"] * { scrollbar-color: #334155 transparent; }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] *::-webkit-scrollbar-thumb:hover { background: #475569; }
[data-theme="light"] * { scrollbar-color: #cbd5e1 transparent; }
[data-theme="light"] *::-webkit-scrollbar-thumb { background: #cbd5e1; }
[data-theme="light"] *::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.cl-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.cl-scroll::-webkit-scrollbar { width: 5px; }
.cl-scroll::-webkit-scrollbar-track { background: transparent; }
.cl-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.cl-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .cl-scroll { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .cl-scroll::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .cl-scroll::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Sidebar overlay (mobile) ─────────────────────────────────────────────── */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1099;
    display: none;
}
.sidebar-overlay.show { display: block; }

/* ── Main content ─────────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left .25s ease;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}


.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    /* Πάνω από τα εσωτερικά controls του Leaflet (π.χ. zoom buttons στον
       χάρτη αδειών του dashboard, που συχνά έχουν z-index:1000) — το
       topbar είναι ξεχωριστό stacking context από το #pageContent, οπότε
       το z-index εδώ πρέπει να νικάει το ΥΨΗΛΟΤΕΡΟ πιθανό z-index οπουδήποτε
       αλλού στη σελίδα, όχι μόνο τα δικά του παιδιά (avatar/notif dropdown). */
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.btn-sidebar-toggle {
    background: none; border: none;
    color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px;
}
.topbar-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    flex: 1;
    display: flex;
    align-items: center;
}
/* fa-table-columns σχεδιάζεται πιο "λεπτό" από τα υπόλοιπα εικονίδια τίτλου
   (π.χ. fa-id-card) στο ίδιο font-size — μεγαλώνεται στοχευμένα ώστε να
   ταιριάζει οπτικά. */
.topbar-title .fa-table-columns { font-size: 22px; }
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-user {
    font-size: 13px;
    color: var(--text-muted);
}
.topbar-bell {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 16px;
    transition: background .15s, color .15s;
}
.topbar-bell:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.topbar-bell:hover i {
    animation: ring 1.4s ease infinite;
    transform-origin: top center;
}
@keyframes ring {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(18deg); }
    30%  { transform: rotate(-16deg); }
    45%  { transform: rotate(12deg); }
    60%  { transform: rotate(-10deg); }
    75%  { transform: rotate(6deg); }
    90%  { transform: rotate(-3deg); }
    100% { transform: rotate(0deg); }
}
.topbar-avatar-wrap {
    position: relative;
}
.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8d5e8;
    font-size: 22px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background .15s, transform .2s ease, box-shadow .2s ease;
}
.topbar-avatar:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    background: #e2e8f0;
    color: #94a3b8;
}
.topbar-avatar-wrap.open .topbar-avatar {
    background: #e2e8f0;
    color: #94a3b8;
}
.avatar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 200px;
    z-index: 1000;
    padding: 6px 0;
    animation: fadeDown .15s ease;
}
.topbar-avatar-wrap.open .avatar-dropdown {
    display: block;
}
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.avatar-dropdown-user {
    padding: 8px 14px;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.avatar-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.avatar-dropdown-item:hover {
    background: rgba(0,0,0,.06);
}
.avatar-dropdown-item.text-danger { color: #dc2626; }

.topbar-bell-wrap { position: relative; }
.notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    width: 360px;
    max-width: 90vw;
    height: 400px;
    z-index: 1000;
    animation: fadeDown .15s ease;
    flex-direction: column;
}
.topbar-bell-wrap.open .notif-dropdown { display: flex; }
.notif-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .12s, border-color .12s;
}
.notif-tab.active { color: var(--bs-primary, #2563eb); border-bottom-color: var(--bs-primary, #2563eb); }
.notif-list {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.notif-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
}
.notif-row:hover { background: #f8faff; }
.notif-row.unread { background: rgba(37,99,235,.06); }
.notif-row-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(37,99,235,.12);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 1px;
}
.notif-row-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.35; }
.notif-row-body { font-size: 12px; color: var(--text-muted, #64748b); margin-top: 1px; }
.notif-row-time { font-size: 10.5px; color: var(--text-muted, #64748b); margin-top: 3px; }
.notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 36px 20px;
    color: var(--text-muted, #64748b);
    font-size: 12.5px;
    text-align: center;
}
.notif-empty i { font-size: 26px; opacity: .35; }
.notif-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.notif-footer button {
    background: none;
    border: none;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--bs-primary, #2563eb);
    cursor: pointer;
    padding: 4px 6px;
}
.notif-footer button:disabled { color: var(--text-muted, #64748b); cursor: default; opacity: .5; }

.page-content {
    height: calc(100vh - var(--topbar-height));
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    overflow: hidden;
    box-sizing: border-box;
}
.pr-svg { transform-origin: 50% 50%; }
.pr-svg.pr-spinning { animation: pr-spin .8s linear infinite; }
@keyframes pr-spin { to { transform: rotate(360deg); } }
.pr-arc { transition: stroke-dashoffset .1s linear; }
.page-content.page-loading {
    align-items: center !important;
    justify-content: center !important;
}
/* Κάρτες με πίνακα: φυσικό ύψος, scroll εσωτερικά όταν ξεχειλίζουν */
.page-content > .card:has(.table-wrapper) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - var(--topbar-height) - 48px);
}
.page-content > .card:has(.table-wrapper) .table-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
/* Καρτέλα μέλους: γεμίζει το viewport, scroll μόνο στο περιεχόμενο tabs */
.page-content > .member-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.member-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.member-card #memberForm {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.member-card #memberForm > .p-4 {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.member-card #memberForm > .p-4 > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}
.member-card #memberForm > .p-4 > div > .section-fieldset {
    margin-bottom: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.member-card .section-fieldset > .d-flex {
    flex: 1;
}
.member-card .section-fieldset > .row,
.member-card .section-fieldset > .d-flex > .flex-grow-1,
.member-card #memberForm > .p-4 > div > .row {
    flex: 1;
    align-content: space-between;
}
.member-card .card-footer {
    flex-shrink: 0;
}
.member-card .nav-tabs {
    flex-shrink: 0;
}
.member-card .member-header {
    flex-shrink: 0;
}

/* Dashboard */
#statsRow { flex-shrink: 0; }
#recentCard .table-wrapper, #recentRetiredCard .table-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ── Toast animations ─────────────────────────────────────────────────────── */
@keyframes toast-in  { from { opacity: 0; transform: translateX(110%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0);    } to { opacity: 0; transform: translateX(110%); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
.input-shake { animation: shake .35s ease; }
.toast-slide         { display: block !important; opacity: 0; }
.toast-slide-in      { animation: toast-in  .35s cubic-bezier(.22,1,.36,1) forwards; }
.toast-slide-out     { animation: toast-out .3s ease-in forwards; }

/* ── BSNotify theme override ──────────────────────────────────────────────── */

/* Shared: font sizes, text alignment, title spacing */
.notify-primary .notify-title,
.notify-success .notify-title,
.notify-info    .notify-title,
.notify-warning .notify-title,
.notify-danger  .notify-title  { font-weight: 600 !important; font-size: 13px !important; display: block !important; margin-bottom: 6px !important; padding-top: 10px !important; }

.notify-primary .notify-text,
.notify-success .notify-text,
.notify-info    .notify-text,
.notify-warning .notify-text,
.notify-danger  .notify-text { font-size: 12px !important; text-align: center !important; padding-bottom: 10px !important; }

/* ── Light mode: original colorful gradients ── */
@media (prefers-color-scheme: light) {
    .notify-success { background: linear-gradient(to right, rgba(40,167,69,0.85), rgba(60,220,120,0.85)) !important; }
    .notify-danger  { background: linear-gradient(to right, rgba(220,53,69,0.85), rgba(255,99,110,0.85)) !important; }
    .notify-warning { background: linear-gradient(to right, rgba(255,193,7,0.85), rgba(255,213,79,0.85)) !important; }
    .notify-info    { background: linear-gradient(to right, rgba(23,162,184,0.85), rgba(40,200,220,0.85)) !important; }
    .notify-primary { background: linear-gradient(to right, rgba(0,123,255,0.85), rgba(37,99,235,0.85)) !important; }

    .notify-primary .notify-title,
    .notify-success .notify-title,
    .notify-info    .notify-title,
    .notify-warning .notify-title,
    .notify-danger  .notify-title { color: #fff !important; }

    .notify-primary .notify-text,
    .notify-success .notify-text,
    .notify-info    .notify-text,
    .notify-warning .notify-text,
    .notify-danger  .notify-text { color: rgba(255,255,255,0.92) !important; }

    .notify-primary .notify-close,
    .notify-success .notify-close,
    .notify-info    .notify-close,
    .notify-warning .notify-close,
    .notify-danger  .notify-close { color: rgba(255,255,255,0.7) !important; }
}
:root[data-theme="light"] .notify-success { background: linear-gradient(to right, rgba(40,167,69,0.85), rgba(60,220,120,0.85)) !important; }
:root[data-theme="light"] .notify-danger  { background: linear-gradient(to right, rgba(220,53,69,0.85), rgba(255,99,110,0.85)) !important; }
:root[data-theme="light"] .notify-warning { background: linear-gradient(to right, rgba(255,193,7,0.85), rgba(255,213,79,0.85)) !important; }
:root[data-theme="light"] .notify-info    { background: linear-gradient(to right, rgba(23,162,184,0.85), rgba(40,200,220,0.85)) !important; }
:root[data-theme="light"] .notify-primary { background: linear-gradient(to right, rgba(0,123,255,0.85), rgba(37,99,235,0.85)) !important; }
:root[data-theme="light"] .notify-primary .notify-title,
:root[data-theme="light"] .notify-success .notify-title,
:root[data-theme="light"] .notify-info    .notify-title,
:root[data-theme="light"] .notify-warning .notify-title,
:root[data-theme="light"] .notify-danger  .notify-title { color: #fff !important; }
:root[data-theme="light"] .notify-primary .notify-text,
:root[data-theme="light"] .notify-success .notify-text,
:root[data-theme="light"] .notify-info    .notify-text,
:root[data-theme="light"] .notify-warning .notify-text,
:root[data-theme="light"] .notify-danger  .notify-text { color: rgba(255,255,255,0.92) !important; }

/* ── Dark mode: dark navy with colored left border ── */
@media (prefers-color-scheme: dark) {
    .notify-primary,
    .notify-success,
    .notify-info,
    .notify-warning,
    .notify-danger {
        background: linear-gradient(to right, rgba(15,23,42,0.97), rgba(30,41,59,0.92)) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.06) inset !important;
        border-radius: 10px !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        border-left-width: 4px !important;
    }
    .notify-success { border-left-color: #22c55e !important; }
    .notify-danger  { border-left-color: #f87171 !important; }
    .notify-warning { border-left-color: #fbbf24 !important; }
    .notify-info    { border-left-color: #38bdf8 !important; }
    .notify-primary { border-left-color: #2563eb !important; }

    .notify-success .icon-card { color: #22c55e !important; }
    .notify-danger  .icon-card { color: #f87171 !important; }
    .notify-warning .icon-card { color: #fbbf24 !important; }
    .notify-info    .icon-card { color: #38bdf8 !important; }
    .notify-primary .icon-card { color: #60a5fa !important; }

    .notify-success .notify-icon-strip { background-color: #22c55e !important; }
    .notify-danger  .notify-icon-strip { background-color: #f87171 !important; }
    .notify-warning .notify-icon-strip { background-color: #fbbf24 !important; }
    .notify-info    .notify-icon-strip { background-color: #38bdf8 !important; }
    .notify-primary .notify-icon-strip { background-color: #60a5fa !important; }

    .notify-success .notify-progress { background: #22c55e !important; }
    .notify-danger  .notify-progress { background: #f87171 !important; }
    .notify-warning .notify-progress { background: #fbbf24 !important; }
    .notify-info    .notify-progress { background: #38bdf8 !important; }
    .notify-primary .notify-progress { background: #60a5fa !important; }

    .notify-primary .notify-title,
    .notify-success .notify-title,
    .notify-info    .notify-title,
    .notify-warning .notify-title,
    .notify-danger  .notify-title { color: #f1f5f9 !important; }

    .notify-primary .notify-text,
    .notify-success .notify-text,
    .notify-info    .notify-text,
    .notify-warning .notify-text,
    .notify-danger  .notify-text { color: #cbd5e1 !important; }

    .notify-primary .notify-close,
    .notify-success .notify-close,
    .notify-info    .notify-close,
    .notify-warning .notify-close,
    .notify-danger  .notify-close { color: rgba(148,163,184,0.6) !important; }
    .notify-primary .notify-close:hover,
    .notify-success .notify-close:hover,
    .notify-info    .notify-close:hover,
    .notify-warning .notify-close:hover,
    .notify-danger  .notify-close:hover { color: #f1f5f9 !important; }
}
:root[data-theme="dark"] .notify-primary,
:root[data-theme="dark"] .notify-success,
:root[data-theme="dark"] .notify-info,
:root[data-theme="dark"] .notify-warning,
:root[data-theme="dark"] .notify-danger {
    background: linear-gradient(to right, rgba(15,23,42,0.97), rgba(30,41,59,0.92)) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.06) inset !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-left-width: 4px !important;
}
:root[data-theme="dark"] .notify-success { border-left-color: #22c55e !important; }
:root[data-theme="dark"] .notify-danger  { border-left-color: #f87171 !important; }
:root[data-theme="dark"] .notify-warning { border-left-color: #fbbf24 !important; }
:root[data-theme="dark"] .notify-info    { border-left-color: #38bdf8 !important; }
:root[data-theme="dark"] .notify-primary { border-left-color: #2563eb !important; }
:root[data-theme="dark"] .notify-primary .notify-title,
:root[data-theme="dark"] .notify-success .notify-title,
:root[data-theme="dark"] .notify-info    .notify-title,
:root[data-theme="dark"] .notify-warning .notify-title,
:root[data-theme="dark"] .notify-danger  .notify-title { color: #f1f5f9 !important; }
:root[data-theme="dark"] .notify-primary .notify-text,
:root[data-theme="dark"] .notify-success .notify-text,
:root[data-theme="dark"] .notify-info    .notify-text,
:root[data-theme="dark"] .notify-warning .notify-text,
:root[data-theme="dark"] .notify-danger  .notify-text { color: #cbd5e1 !important; }

/* ── Hide number input spinners ───────────────────────────────────────────── */
.no-spin::-webkit-inner-spin-button,
.no-spin::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.no-spin { -moz-appearance: textfield; }

/* ── AM Warning Alert ─────────────────────────────────────────────────────── */
.am-warning-alert {
    background: #fef9c3;
    border: 1px solid #fde047;
    color: #713f12;
    border-radius: 6px;
    padding: 12px 16px;
    text-align: justify;
}
[data-theme="dark"] .am-warning-alert {
    background: #1c1a07;
    border-color: #854d0e;
    color: #fde68a;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-lift { transition: box-shadow .25s; }
.card-lift:hover { box-shadow: 0 0 0 2px rgba(37,99,235,.25), 0 0 24px rgba(37,99,235,.18); }
[data-theme="dark"] .card-lift:hover { box-shadow: 0 0 0 2px rgba(37,99,235,.4), 0 0 28px rgba(37,99,235,.28); }
.card-header {
    background: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Stat cards (dashboard) ───────────────────────────────────────────────── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .2s, transform .2s;
}
.stat-card[style*="cursor:pointer"]:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    transition: transform .25s ease, border-radius .25s ease;
}
.stat-card:hover .stat-icon {
    transform: scale(1.18) rotate(-8deg);
    border-radius: 50%;
}
.stat-icon.blue   { background: linear-gradient(135deg, #2563eb, #3b82f6); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.3); }
.stat-icon.green  { background: linear-gradient(135deg, #059669, #10b981); color: #fff; box-shadow: 0 4px 12px rgba(16,185,129,.3); }
.stat-icon.red    { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.stat-icon.yellow { background: linear-gradient(135deg, #d97706, #f59e0b); color: #fff; box-shadow: 0 4px 12px rgba(245,158,11,.3); }
.stat-icon.teal   { background: linear-gradient(135deg, #0d9488, #14b8a6); color: #fff; box-shadow: 0 4px 12px rgba(20,184,166,.3); }
.stat-icon.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.3); }

/* ── Chart context menu ───────────────────────────────────────────────────── */
.ch-menu-item {
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background .12s;
}
.ch-menu-item i { color: var(--text-muted); width: 16px; }
.ch-menu-item:hover { background: var(--border); }
[data-theme="dark"] .ch-menu-item:hover { background: #334155; }

.stat-value { font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}
.table-wrapper::-webkit-scrollbar { width: 6px; height: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: transparent; }
.table-wrapper::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .table-wrapper::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .table-wrapper::-webkit-scrollbar-thumb:hover { background: #475569; }
/* Fieldset with scrollable inner table — mirrors members list style */
.section-fieldset-scroll {
    display: flex;
    flex-direction: column;
    padding-bottom: 16px;
    min-height: 0;
}
.gloses-scroll {
    overflow-y: auto;
    min-height: 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.section-fieldset-scroll > .gloses-scroll {
    flex: 1;
    min-height: 0;
}
/* tab-ades: two fieldsets share height equally */
#tab-ades { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#tab-ades > .d-flex { flex: 1; min-height: 0; }
#tab-ades .section-fieldset { padding: 8px; }
#tab-ades .section-fieldset-scroll { padding-bottom: 8px; }
#tab-ades .table td, #tab-ades .table th { padding: 8px 1% !important; line-height: 1.2 !important; }
#tab-ades .gloses-scroll { flex: 1; min-height: 0; }
#tab-ades .btn-action { width: 16px; height: 16px; font-size: 9px; border-radius: 4px; }
/* tab-prof: big fieldset shrinks to content; Ξένες Γλώσσες fills remaining space */
#tab-prof > .section-fieldset.mb-3 {
    flex: 0 0 auto !important;
}
#tab-prof > .section-fieldset.mb-3 > .row {
    flex: 0 0 auto;
    align-content: initial;
}
/* tab-epag: first fieldsets shrink to content; Συνεργάτες fills remaining space */
#tab-epag { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#tab-epag > .section-fieldset {
    flex: 0 0 auto !important;
    margin-bottom: 0.75rem !important;
}
#tab-epag > .d-flex {
    flex: 1;
    min-height: 0;
    margin-bottom: 0 !important;
}
#tab-epag > .d-flex > .section-fieldset {
    flex: 1;
    min-height: 0;
}
/* tab-fakelos */
#tab-fakelos { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#tab-fakelos .section-fieldset { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#tab-fakelos .gloses-scroll { flex: 1; min-height: 0; }

/* tab-financial */
#tab-financial { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#tab-financial > * { flex-shrink: 0; }
#tab-financial > .d-flex { flex: 1; min-height: 0; }
.fin-summary {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}
.fin-tile {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    min-width: 160px;
}
.fin-tile-balance { flex: 0 0 auto; }
.fin-tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted, #64748b); font-weight: 600; }
.fin-tile-value { font-size: 18px; font-weight: 700; line-height: 1.2; }
.fin-year-sep td { border-top: none !important; border-bottom: none !important; padding: 3px 10px !important; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
#tab-financial .gloses-scroll { border-radius: var(--radius) var(--radius) 0 0; border-bottom: none; }
.fin-cell-trunc { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-tfoot-bar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 5px 10px; background: linear-gradient(to bottom, #f8faff, #f1f5fd); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); font-size: 16px; font-weight: 700; flex-shrink: 0; }
[data-theme="dark"] .fin-tfoot-bar { background: #172033; border-color: #334155; }
#ofilesPrevBody  tr.fin-year-sep > td { background: rgba(220,53,69,0.15)  !important; color: #9b1c1c; }
#pliromesPrevBody tr.fin-year-sep > td { background: rgba(25,135,84,0.15) !important; color: #065f46; }
[data-theme="dark"] #ofilesPrevBody  tr.fin-year-sep > td { background: rgba(220,53,69,0.30)  !important; color: #fca5a5; }
[data-theme="dark"] #pliromesPrevBody tr.fin-year-sep > td { background: rgba(25,135,84,0.28) !important; color: #6ee7b7; }
.table {
    margin: 0;
    font-size: 14px;
}
.table-fixed {
    table-layout: fixed;
    width: 100%;
}
.table-fixed td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.table th {
    background: linear-gradient(to bottom, #f8faff, #f1f5fd);
    color: #1e293b;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 2px solid var(--border);
    padding: 11px 16px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.table td {
    padding: 6px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table tbody tr { cursor: pointer; transition: background .12s; }
.table:not(.pt-table) tbody tr:hover > td {
    background-color: #bfdbfe !important;
    box-shadow: none !important;
}
.table tbody tr:last-child td { border-bottom: none; }
/* Το background hover στο τελευταίο td έχει τετράγωνες γωνίες που προεξέχουν
   από τη στρογγυλεμένη κάτω γωνία της .card γύρω από τον πίνακα. */
.card .table tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.card .table tbody tr:last-child td:last-child  { border-bottom-right-radius: 10px; }

/* ── Search bar ───────────────────────────────────────────────────────────── */
.search-bar {
    position: relative;
}
.search-bar .fa-magnifying-glass {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}
.search-bar input {
    padding-left: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    height: 38px;
    background: #fff;
}
.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}

/* ── Badges (member status) ───────────────────────────────────────────────── */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    background: #e2e8f0;
    color: #475569;
}
.badge-status.active      i { color: #10b981; }
.badge-status.inactive    i { color: #ef4444; }
.badge-status.transferred i { color: #3b82f6; }
.badge-status.retired     i { color: #f59e0b; }
.badge-status.other       i { color: #a8b5c8; }
[data-theme="dark"] .badge-status { background: #334155; color: #f1f5f9; }

/* ── Action buttons ───────────────────────────────────────────────────────── */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    flex-shrink: 0;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all .15s;
    text-decoration: none;
}
.btn-action.view,
.btn-action.edit,
.btn-action.pdf,
.btn-action.debt,
.btn-action.delete,
.btn-action.print,
.btn-action.email,
.btn-action.sms,
.btn-action.fakelos,
.btn-action.link { background: #e2e8f0; color: #475569; }
.btn-action:hover  { background: #cbd5e1; color: #1e293b; transform: scale(1.08); }
[data-theme="dark"] .btn-action.view,
[data-theme="dark"] .btn-action.edit,
[data-theme="dark"] .btn-action.pdf,
[data-theme="dark"] .btn-action.debt,
[data-theme="dark"] .btn-action.delete,
[data-theme="dark"] .btn-action.print,
[data-theme="dark"] .btn-action.email,
[data-theme="dark"] .btn-action.sms,
[data-theme="dark"] .btn-action.fakelos,
[data-theme="dark"] .btn-action.link { background: #334155; color: #94a3b8; }
[data-theme="dark"] .btn-action:hover  { background: #475569; color: #f1f5f9; }

/* ── Autocomplete dropdown ────────────────────────────────────────────────── */
.ac-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border: 1px solid #c7d2e0;
    border-top: none; border-radius: 0 0 8px 8px;
    z-index: 1050; box-shadow: 0 8px 20px rgba(0,0,0,.12);
    max-height: 240px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent;
}
.ac-dropdown::-webkit-scrollbar { width: 6px; }
.ac-dropdown::-webkit-scrollbar-track { background: transparent; }
.ac-dropdown::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.ac-dropdown::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .ac-dropdown { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .ac-dropdown::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .ac-dropdown::-webkit-scrollbar-thumb:hover { background: #475569; }
.ac-item {
    padding: 8px 12px; cursor: pointer;
    font-size: 13px; color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.ac-active { background: #eff6ff; color: #2563eb; }
[data-theme="dark"] .ac-dropdown {
    background: #1e293b; border-color: #334155;
    box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
[data-theme="dark"] .ac-item { color: #f1f5f9; border-bottom-color: #334155; }
[data-theme="dark"] .ac-item:hover,
[data-theme="dark"] .ac-item.ac-active { background: #1e40af; color: #fff; }

/* ── Sortable table headers ──────────────────────────────────────────────── */
.th-sort:hover { background: #e8effa; cursor: pointer; }
.table th.th-sort-active { color: #5a85c8; }
.table td.td-sort-active { color: #5a85c8; font-weight: 600; }
.sort-idle { opacity: .3; font-size: 11px; }

/* ── Section fieldset ────────────────────────────────────────────────────── */
.section-fieldset {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    background: var(--card-bg);
}
.section-legend {
    float: none;
    width: auto;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--card-bg);
    border-radius: 4px;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.form-control, .form-select,
.form-control-sm, .form-select-sm {
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    background-color: var(--card-bg);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-control[readonly] {
    background-color: #e8edf5;
    color: #64748b;
    border-color: var(--border);
    opacity: 1;
}
[data-theme="dark"] .form-control[readonly] {
    background-color: #0f1929;
    color: #94a3b8;
    border-color: #2d3f55;
}
.form-control:disabled,
.form-select:disabled {
    background-color: #e8edf5;
    color: #64748b;
    border-color: var(--border);
    opacity: 1;
}
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled {
    background-color: #0f1929;
    color: #94a3b8;
    border-color: #2d3f55;
}
.form-control:disabled, .form-select:disabled {
    background-color: #f4f7fc;
    color: var(--text);
    opacity: 1;
    cursor: default;
    border-color: #d1daea;
}

/* ── cs-wrapper inside input-group ──────────────────────────────────────── */
.input-group > .cs-wrapper { flex: 1; min-width: 0; position: relative; margin-left: calc(var(--bs-border-width, 1px) * -1); }
.input-group > .cs-wrapper:first-child { margin-left: 0; }
.input-group > .cs-wrapper .cs-trigger { border-radius: 0; }
.input-group > .cs-wrapper:last-child .cs-trigger { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.input-group > .cs-wrapper:first-child .cs-trigger { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }

/* ── Date input calendar follows app theme ───────────────────────────────── */
input[type="date"],
input[type="time"],
input[type="datetime-local"] { color-scheme: light; accent-color: var(--primary); }
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] { color-scheme: dark; accent-color: var(--primary); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.nav-tabs {
    border-bottom: 2px solid var(--border);
    gap: 4px;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    margin-bottom: -2px;
    transition: all .15s;
}
.nav-tabs .nav-link:hover  { color: var(--text) !important; background: var(--border) !important; border-radius: 6px 6px 0 0; }
.nav-tabs .nav-link.active {
    color: var(--text) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 3px solid #1e40af !important;
    background: none !important;
}
#portalTabs {
    flex-wrap: nowrap;
}
#portalTabs .nav-item {
    flex: 1 1 0;
    min-width: 0;
}
#portalTabs .nav-link {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    gap: 4px;
}
.page-link {
    border-radius: 8px !important;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    min-width: 34px;
    text-align: center;
    font-weight: 500;
}
.page-item.active .page-link {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,99,235,.3);
}
.page-link:hover { background: #eff6ff; color: var(--primary); }

/* ── Login page ───────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a6e 50%, #2563eb 100%);
    padding: 20px;
}
.login-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
}
.login-logo {
    width: 225px; height: 225px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
[data-theme="dark"] .login-logo img {
}
.input-group-text {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--text-muted);
}
[data-theme="dark"] .input-group-text {
    background: #0f1929;
    border-color: #2d3f55;
}
.login-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.login-sub {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ── Member detail ────────────────────────────────────────────────────────── */
.member-header {
    background: linear-gradient(135deg, #0f172a, #1e3a6e);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px;
    color: #fff;
    border-bottom: 1px solid var(--card-bg);
}
.member-avatar {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.18);
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
}
.member-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}
.member-meta {
    font-size: 13px;
    opacity: .75;
    margin-top: 4px;
}
.am-change-btn {
    background: rgba(220,38,38,.5);
    border: 1px solid rgba(220,38,38,.6);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 11px;
    cursor: pointer;
    margin-top: 2px;
    color: #fff;
    line-height: 1.3;
    display: inline-block;
    transition: background .15s, color .15s, border-color .15s;
}
.am-change-btn:hover {
    opacity: 1;
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* ── Field view (readonly display) ───────────────────────────────────────── */
.field-view {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.field-view:last-child { border-bottom: none; }
.field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.field-value {
    font-size: 14px;
    color: var(--text);
}
.field-value.empty { color: #cbd5e1; font-style: italic; font-size: 13px; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; opacity: .2; margin-bottom: 16px; }
.empty-state p { font-size: 14px; margin: 0; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .sidebar {
        top: var(--topbar-height);
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    /* Χωρίς αυτό, ένα .collapsed που έμεινε στο localStorage από desktop
       χρήση σπρώχνει μόνιμα όλη τη σελίδα κατά sidebar-collapsed-width σε
       κινητό, ενώ το ίδιο το sidebar είναι ήδη εκτός οθόνης (off-canvas) —
       ο συνδυασμός δύο κλάσεων στο αρχικό selector έχει μεγαλύτερο
       specificity από ένα απλό .main-content, οπότε χρειάζεται να
       παρακαμφθεί ρητά, όχι απλά να επαναδηλωθεί το margin-left. */
    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    .dw-grid { grid-template-columns: 3fr 2fr; gap: 10px; }
}

@media (max-width: 767px) {
    .page-content  { padding: 8px; gap: 0; }
    .topbar        { padding: 12px 12px; gap: 8px; }
    .topbar-user   { display: none; }
    .dw-grid       { grid-template-columns: 3fr 2fr; gap: 8px; }
    .dw-col-left, .dw-col-right { gap: 8px; }
    .dw-lic-grid   { grid-template-columns: 1fr !important; }
    .dw-lic-map    { height: 200px !important; }
    .dw-header     { font-size: 10px; margin-bottom: 6px; }
    .dw-kv-label   { font-size: 9px; }
    .dw-kv-val     { font-size: 11px; }
    .member-header { padding: 16px; }
    .member-name   { font-size: 18px; }
    .member-card .p-4.thin-scroll { padding: 12px !important; }
}

@media (max-width: 600px) {
    .dw-grid { grid-template-columns: 1fr !important; }
    .dw-mitroo-row { flex-direction: column; gap: 14px !important; }
}

@media (max-width: 576px) {
    .stat-card  { padding: 14px; }
    .stat-value { font-size: 24px; }
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.text-primary  { color: var(--primary) !important; }
.bg-primary    { background: var(--primary) !important; }
.fw-600        { font-weight: 600; }
.fs-13         { font-size: 13px; }
.fs-12         { font-size: 12px; }
.cursor-pointer { cursor: pointer; }

/* ── Print Columns drag list ──────────────────────────────────────────────── */
.print-col-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 6px; border-radius: 6px;
    user-select: none; cursor: default;
    transition: background .15s;
}
.print-col-item:hover { background: rgba(99,102,241,.08); }
.print-col-item.drag-over { background: rgba(99,102,241,.15); outline: 2px dashed rgba(99,102,241,.4); }
.print-col-item.dragging  { opacity: .35; }
.print-col-handle {
    color: #94a3b8; cursor: grab; padding: 2px 4px; flex-shrink: 0; font-size: 13px;
}
.print-col-handle:active { cursor: grabbing; }
[data-theme="dark"] .print-col-item:hover   { background: rgba(99,102,241,.12); }
[data-theme="dark"] .print-col-item.drag-over { background: rgba(99,102,241,.2); }

#tplAvailCols, #tplDropZone { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
#tplAvailCols::-webkit-scrollbar, #tplDropZone::-webkit-scrollbar { width: 5px; }
#tplAvailCols::-webkit-scrollbar-track, #tplDropZone::-webkit-scrollbar-track { background: transparent; }
#tplAvailCols::-webkit-scrollbar-thumb, #tplDropZone::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
#tplAvailCols::-webkit-scrollbar-thumb:hover, #tplDropZone::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] #tplAvailCols, [data-theme="dark"] #tplDropZone { scrollbar-color: #334155 transparent; }
[data-theme="dark"] #tplAvailCols::-webkit-scrollbar-thumb, [data-theme="dark"] #tplDropZone::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] #tplAvailCols::-webkit-scrollbar-thumb:hover, [data-theme="dark"] #tplDropZone::-webkit-scrollbar-thumb:hover { background: #475569; }

#eventLogModal .border-bottom { border-bottom-color: #94a3b8 !important; }
[data-theme="dark"] #eventLogModal .border-bottom { border-bottom-color: #475569 !important; }
#eventLogModal .table > :not(caption) > * > * { border-bottom-color: #94a3b8; }
#eventLogModal .table thead tr { border-bottom: 2px solid #64748b; }
[data-theme="dark"] #eventLogModal .table > :not(caption) > * > * { border-bottom-color: #475569; }
[data-theme="dark"] #eventLogModal .table thead tr { border-bottom-color: #64748b; }

.print-col-list { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.print-col-list::-webkit-scrollbar { width: 5px; }
.print-col-list::-webkit-scrollbar-track { background: transparent; }
.print-col-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.print-col-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .print-col-list { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .print-col-list::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .print-col-list::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── SMS view ──────────────────────────────────────────────────────────────── */
.sms-list-item {
    padding: 7px 8px;
    border-radius: 6px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    transition: background .15s;
}
.sms-list-item:hover { background: var(--hover, rgba(0,0,0,.04)); }
.sms-list-item.active {
    background: rgba(59,130,246,.1);
    border-color: rgba(59,130,246,.3);
}
[data-theme="dark"] .sms-list-item:hover   { background: rgba(255,255,255,.05); }
[data-theme="dark"] .sms-list-item.active  { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.4); }

/* ── Print Templates ──────────────────────────────────────────────────────── */
.pt-list-item { transition: background .15s; }
.pt-list-item:hover  { background: var(--hover, rgba(0,0,0,.04)); }
.pt-list-item.active { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3) !important; }
[data-theme="dark"] .pt-list-item:hover  { background: rgba(255,255,255,.05); }
[data-theme="dark"] .pt-list-item.active { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.4) !important; }
[data-theme="dark"] #ptEditor > div,
[data-theme="dark"] #ptColList > div { border-bottom-color: rgba(255,255,255,.06); }
[data-theme="dark"] #ptColsWrap { border-color: rgba(255,255,255,.06); }
[data-theme="dark"] .pt-resize-handle { background: rgba(255,255,255,.06); }
.pt-sep-v { width: 1px; background: var(--border); }
[data-theme="dark"] .pt-sep-v { background: rgba(255,255,255,.06); }
.pt-ph {
    background: #dbeafe; color: #1d4ed8; border-radius: 3px;
    padding: 0 4px; font-size: 11px; font-family: monospace;
    white-space: nowrap;
}

/* Print templates column resize handles */
.pt-resize-handle {
    width:5px; flex-shrink:0; cursor:col-resize;
    background: var(--border);
    transition: background .15s;
}
.pt-resize-handle:hover, .pt-resize-handle.dragging { background:#93c5fd; }
#ptBody table.pt-table.pt-no-border td,
#ptBody table.pt-table.pt-no-border th { outline: 1px dashed rgba(128,128,128,.35); }
#ptPreviewPage table td,
#ptPreviewPage table th { word-break: break-word; overflow-wrap: break-word; }
#ptBody table.pt-table td[data-bg],
#ptBody table.pt-table th[data-bg],
#ptPreviewPage table.pt-table td[data-bg],
#ptPreviewPage table.pt-table th[data-bg] { background-color: var(--pt-cell-bg) !important; }

/* Print template guide lines */
.pt-guide { position:absolute; z-index:20; }
.pt-guide-h {
    left:0; right:0; height:13px;
    cursor:ns-resize;
    background: linear-gradient(to bottom, transparent 6px, rgba(37,99,235,.45) 6px, rgba(37,99,235,.45) 7px, transparent 7px);
}
.pt-guide-v {
    top:0; bottom:0; width:13px;
    cursor:ew-resize;
    background: linear-gradient(to right, transparent 6px, rgba(37,99,235,.45) 6px, rgba(37,99,235,.45) 7px, transparent 7px);
}
.pt-guide:hover .pt-guide-label,
.pt-guide.dragging .pt-guide-label { opacity:1; }
.pt-guide-label {
    position:absolute; font-size:9px; color:#2563eb;
    background:rgba(255,255,255,.92); border:1px solid #bfdbfe;
    padding:1px 4px; border-radius:3px; white-space:nowrap;
    opacity:0; transition:opacity .15s; pointer-events:none;
    font-family: sans-serif;
}
.pt-guide-h .pt-guide-label { top:0; right:8px; }
.pt-guide-v .pt-guide-label { left:0; top:8px; }
@media print {
    .pt-guide { display:none !important; }
    #ptPreviewPage { font-family:'Open Sans','Segoe UI',sans-serif !important; }
}

/* Phone mockup */
/* Container — sets size for cqi resolution; dimensions set by JS */
.sms-phone-ctr {
    container-type: size;
    flex-shrink: 0;
}
.sms-phone {
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    border-radius: 14.5cqi;
    padding: 4.5cqi;
    box-shadow: 0 8px 32px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.08);
    position: relative;
    display: flex;
    flex-direction: column;
}
.sms-phone-notch {
    width: 27cqi;
    height: 2.7cqi;
    background: #2d2d4e;
    border-radius: 1.8cqi;
    margin: 0 auto 3.6cqi;
    flex-shrink: 0;
}
.sms-phone-screen {
    background: #f2f2f7;
    border-radius: 10cqi;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.sms-phone-bar {
    background: #f2f2f7;
    padding: 3.6cqi 5.5cqi 2.7cqi;
    display: flex;
    align-items: center;
    gap: 3.6cqi;
    border-bottom: 1px solid #e0e0e8;
    font-size: 4cqi;
}
.sms-phone-body {
    flex: 1;
    padding: 4.5cqi 4.5cqi 2.7cqi;
    display: flex;
    flex-direction: column;
    gap: 2.7cqi;
    background: #f2f2f7;
    font-size: 4cqi;
    overflow-y: auto;
    scrollbar-width: none;
}
.sms-phone-body::-webkit-scrollbar { display: none; }
.sms-bubble-row { display: flex; justify-content: flex-start; }
.sms-bubble {
    background: #e5e5ea;
    border-radius: 7.3cqi 7.3cqi 7.3cqi 1.8cqi;
    padding: 3.6cqi 5.5cqi;
    font-size: 5.5cqi;
    line-height: 1.5;
    max-width: 85%;
    word-break: break-word;
    color: #1a1a1a;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}

/* ── Thin scrollbar (reusable) ─────────────────────────────────────────────── */
.thin-scroll { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.thin-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.thin-scroll::-webkit-scrollbar-track { background: transparent; }
.thin-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.thin-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .thin-scroll { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .thin-scroll::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .thin-scroll::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Modal list footer (select-all bar) ────────────────────────────────────── */
.modal-list-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: var(--card-bg);
    color: var(--text);
}
[data-theme="dark"] .modal-list-footer {
    background: #172033;
    border-color: #334155;
}

/* ── Rich Text Editor ──────────────────────────────────────────────────────── */
.rte-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    min-height: 0;
}
.rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 5px 7px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
[data-theme="dark"] .rte-toolbar { background: #172033; }

.rte-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
    padding: 0;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
.rte-btn:hover { background: rgba(99,102,241,.12); color: var(--text); }
.rte-btn:active { background: rgba(99,102,241,.22); }
[data-theme="dark"] .rte-btn:hover { background: rgba(99,102,241,.2); }

.rte-color-btn { flex-direction: column; gap: 1px; width: 26px; height: 26px; }
.rte-color-bar { display: block; width: 16px; height: 3px; border-radius: 2px; }

.rte-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 3px;
    flex-shrink: 0;
}

.rte-select {
    height: 24px;
    font-size: 11px;
    padding: 0 4px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    max-width: 110px;
}
[data-theme="dark"] .rte-select { background: #1e293b; border-color: #334155; }

.rte-body {
    flex: 1;
    min-height: 160px;
    padding: 10px 12px;
    outline: none;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    overflow-y: auto;
    word-break: break-word;
}
[data-theme="dark"] .rte-body { background: #1e293b; }
.rte-body:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    opacity: .6;
    pointer-events: none;
}
.rte-body img   { max-width: 100%; height: auto; border-radius: 4px; }
.rte-body a     { color: #3b82f6; }
.rte-body hr    { border-color: var(--border); margin: 8px 0; }
.rte-body *,
.rte-body *:hover,
.rte-body *:focus       { outline: none !important; box-shadow: none !important; }
.rte-body table         { border-collapse: collapse; }
.rte-body table,
.rte-body td,
.rte-body th,
.rte-body tr            { outline: none !important; }

/* ── Email preview ─────────────────────────────────────────────────────────── */
.email-preview-wrap {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    background: #fff;
    width: 280px;
}
.email-browser-bar {
    background: #e5e7eb;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #d1d5db;
}
.email-browser-dots { display: flex; gap: 5px; }
.email-browser-dots span {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: block;
}
.email-browser-url {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    font-size: 10px;
    color: #6b7280;
    padding: 2px 8px;
    text-align: center;
}
.email-preview-header {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.email-preview-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.email-preview-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.email-preview-body {
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.6;
    color: #374151;
    min-height: 120px;
    max-height: 260px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
}



/* ── Custom select dropdown ──────────────────────────────────────────────── */
.cs-wrapper { position: relative; }
.cs-trigger {
    cursor: pointer;
    user-select: none;
    display: flex !important;
    align-items: center;
    gap: 4px;
}
.cs-trigger .cs-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cs-panel {
    position: fixed;
    z-index: 2000;
    max-height: 220px;
    overflow-y: auto;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border, #dee2e6);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.cs-panel::-webkit-scrollbar { width: 5px; }
.cs-panel::-webkit-scrollbar-track { background: transparent; }
.cs-panel::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.cs-panel::-webkit-scrollbar-thumb:hover { background: #475569; }
.cs-option { padding: 5px 10px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.cs-option:hover { background: rgba(0,0,0,.06); }
.cs-option.cs-sel { background: var(--bs-primary, #0d6efd); color: #fff; }
@media (prefers-color-scheme: dark) {
    .cs-panel { background: #1e293b; border-color: #334155; }
    .cs-option:hover { background: rgba(255,255,255,.08); }
}
[data-theme="light"] .cs-panel { background: #ffffff; border-color: #d1daea; }
[data-theme="light"] .cs-option:hover { background: rgba(0,0,0,.06); }
/* Map marker tooltip */
.lic-map-tooltip { background:#fff; color:#333; border:1px solid #bbb; border-radius:4px; font-size:12px; font-weight:400; padding:4px 10px; box-shadow:0 1px 4px rgba(0,0,0,.15); }
.lic-map-tooltip::before { border-top-color:#bbb !important; }
/* Geocoding results dropdown */
.geo-results { background: var(--card-bg,#fff); color: var(--text-primary,#0f172a); border: 1px solid var(--border,#dee2e6); border-top: none; border-radius: 0 0 4px 4px; max-height: 160px; overflow-y: auto; }
.geo-result-item { padding: 7px 10px; font-size: 12px; cursor: pointer; color: var(--text-primary,#0f172a); border-bottom: 1px solid var(--border,#dee2e6); }
.geo-result-item:hover { background: rgba(0,0,0,.06); }
.geo-result-item:last-child { border-bottom: none; }
@media (prefers-color-scheme: dark) {
    .geo-results { background: #1e293b; border-color: #334155; }
    .geo-result-item { color: #e2e8f0; border-bottom-color: #334155; }
    .geo-result-item:hover { background: rgba(255,255,255,.08); }
}
[data-theme="light"] .geo-results { background: #ffffff; border-color: #d1daea; }
[data-theme="light"] .geo-result-item { color: #0f172a; border-bottom-color: #d1daea; }
[data-theme="light"] .geo-result-item:hover { background: rgba(0,0,0,.06); }
[data-theme="dark"] .geo-results { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .geo-result-item { color: #e2e8f0; border-bottom-color: #334155; }
[data-theme="dark"] .geo-result-item:hover { background: rgba(255,255,255,.08); }
[data-theme="light"] .dp-cal-title { color: #0f172a; }
[data-theme="light"] .dp-cal-day { color: #334155; }
[data-theme="light"] .dp-cal-footer { border-color: #d1daea; }

/* ── Dark scrollbars ─────────────────────────────────────────────────────── */
.sidebar-nav,
.gloses-scroll,
.member-card #memberForm > .p-4 {
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
.sidebar-nav::-webkit-scrollbar,
.gloses-scroll::-webkit-scrollbar,
.member-card #memberForm > .p-4::-webkit-scrollbar { width: 5px; height: 5px; }
.sidebar-nav::-webkit-scrollbar-track,
.gloses-scroll::-webkit-scrollbar-track,
.member-card #memberForm > .p-4::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb,
.gloses-scroll::-webkit-scrollbar-thumb,
.member-card #memberForm > .p-4::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.gloses-scroll::-webkit-scrollbar-thumb:hover,
.member-card #memberForm > .p-4::-webkit-scrollbar-thumb:hover { background: #475569; }

/* Delivery Status popover */
.popover {
    background: #1e293b;
    border: 1px solid #334155;
}
.popover .popover-arrow::after,
.popover .popover-arrow::before { border-left-color: #334155; }
.popover-body { padding: 10px 14px; }

.table tr.cert-debt > td     { background-color: rgba(220,38,38,.07)   !important; box-shadow: none !important; }
.table tr.cert-ok > td       { background-color: rgba(34,197,94,.07)   !important; box-shadow: none !important; }
.table tr.cert-selected > td { background-color: rgba(37,99,235,.12)   !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.cert-debt > td     { background-color: rgba(220,38,38,.14)   !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.cert-ok > td       { background-color: rgba(34,197,94,.1)    !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.cert-selected > td { background-color: rgba(37,99,235,.22)   !important; box-shadow: none !important; }
tr.row-anaklisi > td { background-color: rgba(220,53,69,0.35) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.row-anaklisi > td { background-color: rgba(220,53,69,0.35) !important; box-shadow: none !important; }

.lib-book-card {
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.lib-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    border-color: var(--primary);
}
.table tr.lib-my-book > td { background-color: rgba(37,99,235,.12) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.lib-my-book > td { background-color: rgba(37,99,235,.22) !important; box-shadow: none !important; }
.lib-my-book.card { background-color: rgba(37,99,235,.12); border-color: rgba(37,99,235,.35); }
[data-theme="dark"] .lib-my-book.card { background-color: rgba(37,99,235,.22); border-color: rgba(37,99,235,.45); }

.lib-list-title  { white-space: nowrap; }
.lib-list-avail  { width: 170px; }
.lib-list-action { width: 120px; }
@media (max-width: 575.98px) {
    .lib-list-title  { max-width: 1px; width: 100%; overflow: hidden; text-overflow: ellipsis; }
    .lib-list-avail  { width: 56px; }
    .lib-list-action { width: 90px; }
    .lib-list-table td, .lib-list-table th { padding-left: 8px; padding-right: 8px; }
}
tr.row-expiry > td { background-color: rgba(245,158,11,0.22) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.row-expiry > td { background-color: rgba(245,158,11,0.22) !important; box-shadow: none !important; }
tr.row-syntaxiodotimenos > td { background-color: rgba(251,146,60,0.13) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.row-syntaxiodotimenos > td { background-color: rgba(251,146,60,0.13) !important; box-shadow: none !important; }
tr.row-apoxorisi > td { background-color: rgba(220,53,69,0.18) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.row-apoxorisi > td { background-color: rgba(220,53,69,0.18) !important; box-shadow: none !important; }
tr.row-elegxos > td { background-color: rgba(251,191,36,0.18) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.row-elegxos > td { background-color: rgba(251,191,36,0.18) !important; box-shadow: none !important; }
tr.row-allos-sillogos > td { background-color: rgba(59,130,246,0.13) !important; box-shadow: none !important; }
[data-theme="dark"] .table tr.row-allos-sillogos > td { background-color: rgba(59,130,246,0.13) !important; box-shadow: none !important; }


/* Hide Ενέργειες column in secondary modal section */
.al-hide-energies .td-energies,
.al-hide-energies th#adiesEnergiesTh,
.al-hide-energies th#anakliseisEnergiesTh { display: none !important; }

/* Fixed width for # column in tab-ades tables and modals */
#tab-ades .table th:first-child,
#tab-ades .table td:first-child,
#adiesLitourgiastModal .table th:first-child,
#adiesLitourgiastModal .table td:first-child,
#adiesAkModal .table th:first-child,
#adiesAkModal .table td:first-child { width: 28px !important; min-width: 28px !important; max-width: 28px !important; }

/* Licenses view scroll */
.lic-scroll { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.lic-scroll::-webkit-scrollbar { width: 6px; }
.lic-scroll::-webkit-scrollbar-track { background: transparent; }
.lic-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
.lic-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] .lic-scroll { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .lic-scroll::-webkit-scrollbar-thumb { background: #334155; }
[data-theme="dark"] .lic-scroll::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Inline date picker ──────────────────────────────────────────────────── */
.dp-wrapper { position: relative; }
.dp-panel { max-height: none !important; overflow: hidden !important; }
.dp-cal { padding: 6px 8px 8px; min-width: 230px; user-select: none; }
.dp-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-cal-title { font-size: 12px; font-weight: 600; color: var(--text-primary, #0f172a); }
.dp-cal-nav { background: none; border: none; cursor: pointer; color: var(--text-muted, #64748b); padding: 2px 7px; border-radius: 4px; line-height: 1.4; }
.dp-cal-nav:hover { background: var(--border, #e2e8f0); }
.dp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.dp-cal-dow { font-size: 10px; font-weight: 600; text-align: center; color: var(--text-muted, #64748b); padding: 3px 0; }
.dp-cal-day { font-size: 12px; text-align: center; padding: 4px 2px; border-radius: 4px; cursor: pointer; color: var(--text-secondary, #334155); }
.dp-cal-day:hover:not(.dp-empty) { background: var(--border, #e2e8f0); }
.dp-cal-day.dp-today { font-weight: 700; color: var(--bs-primary, #0d6efd); }
.dp-cal-day.dp-sel { background: var(--bs-primary, #0d6efd); color: #fff !important; font-weight: 600; border-radius: 4px; }
.dp-cal-day.dp-sel:hover { background: var(--bs-primary, #0d6efd); }
.dp-cal-day.dp-empty { cursor: default; pointer-events: none; }
.dp-cal-day.dp-disabled { opacity: 0.25; cursor: not-allowed; }
[data-theme="dark"] .dp-cal-title { color: var(--text-primary, #f1f5f9); }
[data-theme="dark"] .dp-cal-day { color: var(--text-secondary, #cbd5e1); }
.dp-cal-footer { border-top: 1px solid var(--border, #e2e8f0); margin-top: 4px; padding-top: 6px; display: flex; justify-content: center; }
.dp-today-btn { background: var(--bs-primary, #0d6efd); border: none; color: #fff; border-radius: 4px; font-size: 11px; padding: 2px 12px; cursor: pointer; }
.dp-today-btn:hover { background: #0b5ed7; }
.dp-time-row { display: flex; align-items: center; gap: 5px; width: 100%; }
.dp-today-sm { padding: 2px 8px; flex-shrink: 0; }
.dp-time-h, .dp-time-m { width: 54px !important; flex-shrink: 0; padding: 2px 4px; font-size: 12px; }
.dp-ok-btn { background: var(--bs-primary, #0d6efd); border: none; color: #fff; border-radius: 4px; font-size: 11px; padding: 2px 10px; cursor: pointer; flex-shrink: 0; }
.dp-ok-btn:hover { background: #0b5ed7; }
.lic-list-item:hover { background: rgba(0,0,0,.05); }
[data-theme="dark"] .lic-list-item:hover { background: rgba(255,255,255,.07); }
.lic-list-cur { background: rgba(0,0,0,.04); border-left: 2px solid var(--border, #d1daea); padding-left: 4px; }
[data-theme="dark"] .lic-list-cur { background: rgba(255,255,255,.04); border-left-color: #475569; }

/* ── License detail locked / edit mode ──────────────────────────────────── */
#licRevokeEditSection [data-lic-edit]    { display: none; }
#licRevokeEditSection [data-lic-actions] { display: flex; }
#licRevokeEditSection.lic-locked [data-lic-edit]    { display: inline-flex !important; }
#licRevokeEditSection.lic-locked [data-lic-actions] { display: none !important; }
#licRevokeEditSection.lic-locked .form-control:not(.cs-trigger):not(.dp-trigger) { pointer-events: none; }
#licRevokeEditSection.lic-locked .cs-trigger,
#licRevokeEditSection.lic-locked .dp-trigger { pointer-events: none; }
#licRevokeEditSection.lic-locked .input-group > .btn { display: none !important; }
#licRevokeEditSection.lic-locked .input-group .cs-trigger { border-radius: var(--bs-border-radius-sm, 0.25rem) !important; }
#licRevokeEditSection:not(.lic-locked) #licSisteLink { display: none !important; }

/* ── AK fieldset locked / edit mode ─────────────────────────────────────── */
#akFieldset [data-lic-edit]    { display: none; }
#akFieldset [data-lic-actions] { display: flex; }
#akFieldset.lic-locked [data-lic-edit]    { display: inline-flex !important; }
#akFieldset.lic-locked [data-lic-actions] { display: none !important; }
#akFieldset.lic-locked .form-control:not(.cs-trigger):not(.dp-trigger) { pointer-events: none; }
#akFieldset.lic-locked .cs-trigger,
#akFieldset.lic-locked .dp-trigger { pointer-events: none; }
#akFieldset.lic-locked .input-group > .btn { display: none !important; }
#akFieldset.lic-locked .input-group .cs-trigger { border-radius: var(--bs-border-radius-sm, 0.25rem) !important; }

/* ── Calendar Widget ─────────────────────────────────────────────────────── */
.cal-header { display:flex; align-items:center; justify-content:space-between; padding:14px 18px 12px; border-bottom:1px solid var(--border); }
.cal-month-label { font-size:17px; font-weight:700; color:var(--bs-primary); min-width:180px; text-align:center; }
.cal-nav-btn { background:none; border:1px solid var(--border); border-radius:8px; width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-muted); transition:background .12s, color .12s; }
.cal-nav-btn:hover { background:var(--border); color:var(--text); }
.cal-today-btn { background:none; border:1px solid var(--border); border-radius:8px; padding:0 10px; height:30px; font-size:11px; font-weight:600; cursor:pointer; color:var(--text-muted); transition:background .12s; }
.cal-today-btn:hover { background:var(--border); color:var(--text); }
.cal-body { display:flex; flex:1; min-height:0; }
.cal-grid-wrap { flex:1; padding:12px 14px; display:flex; flex-direction:column; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; flex:1; }
.cal-dow  { text-align:center; font-size:12px; font-weight:700; color:var(--bs-primary); padding:2px 0 8px; text-transform:uppercase; letter-spacing:.06em; opacity:.7; }
.cal-day  { display:flex; flex-direction:column; align-items:center; padding:5px 2px 4px; border-radius:8px; cursor:pointer; transition:background .12s; user-select:none; }
.cal-day:not(.cal-empty):hover { background:rgba(99,102,241,.1); }
.cal-empty { cursor:default; }
.cal-num  { font-size:16px; font-weight:500; color:var(--text); display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:50%; transition:background .12s; flex-shrink:0; }
.cal-today .cal-num { background:var(--bs-primary); color:#fff !important; font-weight:700; box-shadow:0 2px 8px rgba(99,102,241,.4); }
.cal-sel:not(.cal-today) { background:rgba(99,102,241,.1); }
.cal-sel:not(.cal-today) .cal-num { color:var(--bs-primary); font-weight:700; }
.cal-weekend .cal-num { color:#f59e0b; }
.cal-dots { display:flex; gap:3px; justify-content:center; margin-top:3px; flex-wrap:wrap; max-width:30px; }
.cal-dot  { width:5px; height:5px; border-radius:50%; flex-shrink:0; }
.cal-panel { width:230px; flex-shrink:0; border-left:1px solid var(--border); padding:14px 12px; overflow-y:auto; display:flex; flex-direction:column; gap:6px; }
.cal-panel-date { font-size:13px; font-weight:700; color:var(--bs-primary); text-transform:uppercase; letter-spacing:.06em; padding:10px 14px; border-radius:10px; background:linear-gradient(135deg, rgba(99,102,241,.16) 0%, rgba(99,102,241,.04) 100%); border-left:3px solid var(--bs-primary); margin-bottom:4px; }
.cal-event-item { padding:9px 10px; border-radius:8px; background:var(--hover-bg,rgba(0,0,0,.03)); border-left:3px solid transparent; cursor:pointer; transition:background .12s, box-shadow .12s, transform .1s; }
[data-theme="dark"] .cal-event-item { background:rgba(255,255,255,.05); }
.cal-event-item:hover { background:rgba(99,102,241,.1); box-shadow:0 2px 8px rgba(99,102,241,.15); transform:translateX(2px); }
[data-theme="dark"] .cal-event-item:hover { background:rgba(99,102,241,.18); }
.cal-event-title { font-size:13px; font-weight:600; color:var(--text); line-height:1.3; }
.cal-event-meta  { font-size:11px; color:var(--text-muted); margin-top:3px; display:flex; align-items:center; gap:4px; }
.cal-type-pill { display:inline-flex; align-items:center; gap:3px; font-size:10px; font-weight:600; padding:1px 6px; border-radius:99px; }
.cal-panel-empty { text-align:center; padding:24px 8px; color:var(--text-muted); font-size:12px; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; opacity:.6; }

/* ── Calendar view toggle ────────────────────────────────────────────────── */
.cal-view-btns { display:flex; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.cal-view-btns button { background:none; border:none; padding:4px 10px; font-size:12px; font-weight:500; color:var(--text-muted); cursor:pointer; transition:background .12s, color .12s; white-space:nowrap; }
.cal-view-btns button:not(:last-child) { border-right:1px solid var(--border); }
.cal-view-btns button:hover { background:var(--hover-bg,rgba(0,0,0,.05)); color:var(--text); }
.cal-view-btns button.active { background:var(--bs-primary); color:#fff; }

/* ── Calendar week view ──────────────────────────────────────────────────── */
.cal-week-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }

.cal-week-col {
    display:flex; flex-direction:column; border-radius:12px; overflow:hidden;
    border:1px solid var(--border); border-top:3px solid rgba(99,102,241,.35);
    cursor:pointer; min-height:140px;
    transition:transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s ease, border-color .18s;
}
.cal-week-col:hover {
    transform:translateY(-4px);
    box-shadow:0 8px 24px rgba(99,102,241,.18);
    border-color:rgba(99,102,241,.5);
    border-top-color:var(--bs-primary);
}
.cal-week-col-hd {
    display:flex; flex-direction:column; align-items:center; gap:4px;
    padding:10px 4px 8px;
    border-bottom:1px solid var(--border);
    background:linear-gradient(160deg, rgba(99,102,241,.13) 0%, rgba(99,102,241,.03) 100%);
}
[data-theme="dark"] .cal-week-col-hd { background:linear-gradient(160deg, rgba(99,102,241,.2) 0%, rgba(99,102,241,.06) 100%); }

.cal-week-dow { font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; color:var(--bs-primary); }
.cal-week-num {
    font-size:18px; font-weight:600; color:var(--text);
    display:inline-flex; align-items:center; justify-content:center;
    width:34px; height:34px; border-radius:50%;
    transition:background .18s, color .18s;
}
.cal-today-num {
    background:var(--bs-primary); color:#fff !important; font-weight:700;
    box-shadow:0 3px 10px rgba(99,102,241,.5);
}

/* Selected day */
.cal-week-sel {
    border-color:var(--bs-primary);
    border-top-color:var(--bs-primary);
    box-shadow:0 0 0 2px rgba(99,102,241,.3);
    transform:translateY(-2px);
}
.cal-week-sel .cal-week-col-hd {
    background:linear-gradient(160deg, rgba(99,102,241,.22) 0%, rgba(99,102,241,.06) 100%);
}
.cal-week-sel .cal-week-num:not(.cal-today-num) {
    background:rgba(99,102,241,.15); color:var(--bs-primary); font-weight:700;
}

/* Weekend columns */
.cal-week-wknd { border-top-color:rgba(217,119,6,.45); }
.cal-week-wknd:hover { box-shadow:0 8px 24px rgba(217,119,6,.18); border-color:rgba(217,119,6,.55); border-top-color:#d97706; }
.cal-week-wknd .cal-week-col-hd {
    background:linear-gradient(160deg, rgba(245,158,11,.13) 0%, rgba(245,158,11,.03) 100%);
}
[data-theme="dark"] .cal-week-wknd .cal-week-col-hd { background:linear-gradient(160deg, rgba(245,158,11,.2) 0%, rgba(245,158,11,.06) 100%); }
.cal-week-wknd .cal-week-dow { color:#d97706; }
.cal-week-wknd .cal-week-num:not(.cal-today-num) { color:#d97706; }
.cal-week-wknd.cal-week-sel { border-color:#d97706; border-top-color:#d97706; box-shadow:0 0 0 2px rgba(217,119,6,.3); }
.cal-week-wknd.cal-week-sel .cal-week-num:not(.cal-today-num) { background:rgba(245,158,11,.15); }

/* Today column accent */
.cal-week-col:has(.cal-today-num) { border-top-color:var(--bs-primary); }
.cal-week-col:has(.cal-today-num) .cal-week-col-hd {
    background:linear-gradient(160deg, rgba(99,102,241,.22) 0%, rgba(99,102,241,.05) 100%);
}

/* Events */
.cal-week-events { padding:7px 6px; display:flex; flex-direction:column; gap:4px; flex:1; }
.cal-week-ev {
    border-radius:6px; padding:4px 7px; line-height:1.3;
    display:flex; flex-direction:column; gap:1px;
    cursor:pointer; transition:filter .12s, box-shadow .12s, transform .1s;
}
.cal-week-ev:hover { filter:brightness(1.08); box-shadow:0 2px 8px rgba(0,0,0,.12); transform:translateY(-1px); }
.cal-week-ev-time { font-size:9px; opacity:.8; font-weight:700; letter-spacing:.04em; }
.cal-week-ev-title { font-size:11px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }

/* ── Epitropi button & list badges ──────────────────────────────────────── */
.btn-ep-orange {
    --bs-btn-disabled-bg: #f97316;
    --bs-btn-disabled-border-color: #f97316;
    --bs-btn-disabled-color: #fff;
    background-color:#f97316; border-color:#f97316; color:#fff;
}
.btn-ep-orange:hover { background-color:#ea6c0a; border-color:#ea6c0a; color:#fff; }
.btn-ep-green {
    --bs-btn-disabled-bg: #16a34a;
    --bs-btn-disabled-border-color: #16a34a;
    --bs-btn-disabled-color: #fff;
    background-color:#16a34a; border-color:#16a34a; color:#fff;
}
.btn-ep-green:hover { background-color:#15803d; border-color:#15803d; color:#fff; }
.ep-badge-check  { background-color:#dc2626; font-size:9px; letter-spacing:.4px; vertical-align:middle; }
.ep-badge-active { background-color:#16a34a; font-size:9px; letter-spacing:.4px; vertical-align:middle; }

/* ── Cert modal list-group dark theme ──────────────────────────────────────── */
[data-theme="dark"] .list-group-item {
    background-color: transparent;
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .list-group-item-action:hover,
[data-theme="dark"] .list-group-item-action:focus {
    background-color: rgba(99,102,241,.08);
    color: var(--text);
}
[data-theme="dark"] .list-group-item.active {
    background-color: rgba(99,102,241,.18);
    border-color: rgba(99,102,241,.35);
    color: var(--text);
}

/* ── Print template placeholder submenus ──────────────────────────────────── */
.pt-ph-submenu { position: relative; }
#ptPlaceholderMenu,
#ptPhSubEl {
    background-color: var(--card-bg);
    border-color: var(--border);
    color: var(--text);
}
#ptPhSubEl .dropdown-item,
#ptPlaceholderMenu .pt-ph-group-label { color: var(--text); }
#ptPhSubEl .dropdown-item:hover,
#ptPhSubEl .dropdown-item:focus { background-color: rgba(99,102,241,.1); color: var(--text); }
.pt-ph-group-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    cursor: default;
    white-space: nowrap;
    color: var(--bs-body-color);
    font-size: 12px;
}
.pt-ph-group-label:hover { background-color: rgba(99,102,241,.12); }

/* ── Dashboard grid ───────────────────────────────────────────────────────── */
.page-content:has(.dw-grid) { height: auto; overflow-y: auto; overflow-x: hidden; }
.page-content:has(.sec-grid) { height: auto; overflow-y: auto; overflow-x: hidden; }
.sec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}
@media (max-width: 767px) {
    .sec-grid { grid-template-columns: 1fr; }
}
.highlight-pulse {
    animation: highlight-pulse 1.5s ease-out infinite;
    border-color: var(--primary) !important;
}
@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,99,235,.5); }
    50%      { box-shadow: 0 0 0 10px rgba(37,99,235,0); }
}
.fin-update-anim {
    animation: fin-update-in .5s cubic-bezier(.22,1,.36,1);
}
@keyframes fin-update-in {
    0%   { opacity: 0; transform: translateY(-8px) scale(.97); }
    55%  { opacity: 1; transform: translateY(0) scale(1.015); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .fin-update-anim { animation: none; }
}
.dw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.dw-col-left, .dw-col-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}
.dw-grow {
    min-height: 200px;
}
.dw-grow > .card {
    height: 100%;
}
.dw-lic-grid { display: grid; gap: 10px; align-items: start; }

/* ── Dashboard widgets ─────────────────────────────────────────────────────── */
.dw-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.dw-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}
.dw-kv-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.dw-kv-val   { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* Αιτήσεις Βεβαιώσεων — accordion εγγράφου κάτω από κάθε αίτηση. Η <tr> μένει
   πάντα στη ροή του πίνακα (τα <tr> δεν κάνουν smooth transition σε height),
   το εσωτερικό div είναι αυτό που "ανοιγοκλείνει" μέσω max-height/opacity. */
.req-doc-collapse {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .25s ease, opacity .2s ease;
}
.req-doc-collapse.open {
    max-height: 600px;
    opacity: 1;
}
