:root {
    --mb-sidebar-width: 260px;
    --mb-sidebar-bg: #16293f;
    --mb-sidebar-hover: rgba(255,255,255,0.06);
    --mb-sidebar-active-bg: rgba(79,142,247,0.15);
    --mb-sidebar-active-color: #4f8ef7;
    --mb-sidebar-active-border: #4f8ef7;
    --mb-topbar-height: 50px;
    --mb-primary: #4f8ef7;
    --mb-body-bg: #f0f2f7;
    /* Override Bootstrap rounded corners */
    --bs-border-radius: 3px;
    --bs-border-radius-sm: 2px;
    --bs-border-radius-lg: 4px;
    --bs-border-radius-xl: 4px;
    --bs-border-radius-pill: 3px;
}

/* ── Base ── */
body { background: var(--mb-body-bg); font-size: 16px; color: #333; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
a:hover { text-decoration: none; }
* { box-sizing: border-box; }
.mb-wrapper { display: flex; min-height: 100vh; overflow-x: hidden; }

/* ── Sidebar ── */
.mb-sidebar {
    width: var(--mb-sidebar-width);
    background: var(--mb-sidebar-bg);
    min-height: 100vh;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 1040;
    transition: transform 0.25s ease;
}
.mb-sidebar-logo {
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 9px;
    text-decoration: none;
}
.mb-logo-icon {
    width: 28px; height: 28px;
    background: linear-gradient(135deg, #4f8ef7, #a855f7);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 11px; flex-shrink: 0;
}
.mb-logo-text { color: #fff; font-size: 15px; font-weight: 500; }
.mb-logo-ver  { color: rgba(255,255,255,0.35); font-size: 15px; }
.mb-sidebar-logo { min-width: 0; overflow: hidden; }
.mb-sidebar-logo-tile { display: inline-flex; min-width: 0; max-width: 100%; background: rgba(255,255,255,0.07); padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.10); }
.mb-sidebar-logo-img { max-width: 100%; max-height: 58px; width: auto; height: auto; object-fit: contain; display: block; }
.mb-sidebar-online { display: flex; align-items: center; gap: 8px; padding: 10px 16px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mb-sidebar-online:hover { background: rgba(255,255,255,0.05); }
.mb-online-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.18); flex-shrink: 0; animation: mbOnlinePulse 2s ease-in-out infinite; }
.mb-online-count { color: #fff; font-weight: 700; font-size: 16px; }
.mb-online-label { color: rgba(255,255,255,0.55); font-size: 16px; }
.mb-online-names { color: rgba(255,255,255,0.5); font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
@keyframes mbOnlinePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.mb-sidebar-nav { flex: 1; padding: 6px 0; overflow-y: auto; }
.mb-nav-section {
    color: rgba(255,255,255,0.3); font-size: 17px;
    letter-spacing: 0.04em;
    padding: 10px 16px 3px;
}
.mb-nav-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    color: rgba(255,255,255,0.6); font-size: 16px;
    text-decoration: none;
    transition: all 0.15s;
    border-right: 2px solid transparent;
}
.mb-nav-item:hover { background: var(--mb-sidebar-hover); color: #fff; }
.mb-nav-item.active {
    background: var(--mb-sidebar-active-bg);
    color: var(--mb-sidebar-active-color);
    border-right-color: var(--mb-sidebar-active-border);
}
.mb-nav-item i { font-size: 22px; width: 26px; flex-shrink: 0; }
/* Αναπτυσσόμενη λίστα addons στο sidebar */
.mb-nav-sub { padding-left: 38px; font-size: 15px; }
.mb-nav-sub i { font-size: 18px; width: 18px; }
.mb-nav-caret { margin-left: auto; font-size: 12px !important; width: auto !important; transition: transform .2s; }
.mb-nav-item[aria-expanded="true"] .mb-nav-caret { transform: rotate(180deg); }
.mb-nav-badge {
    margin-left: auto; font-size: 11px;
    padding: 1px 6px; border-radius: 10px;
    background: #e24b4a; color: #fff; line-height: 1.6;
}
.mb-nav-badge.amber { background: #BA7517; }
.mb-nav-badge.blue  { background: #4f8ef7; }
.mb-nav-badge.green { background: #1D9E75; }

/* ── Main ── */
.mb-main {
    margin-left: var(--mb-sidebar-width);
    flex: 1; display: flex; flex-direction: column; min-height: 100vh; min-width: 0; overflow-x: hidden;
}

/* ── Topbar ── */
.mb-topbar {
    height: var(--mb-topbar-height);
    background: #1e3a5f; border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center;
    padding: 0 20px; gap: 16px;
    position: sticky; top: 0; z-index: 1030;
}
.mb-topbar-title { font-size: 16px; font-weight: 500; flex: 1; color: rgba(255,255,255,0.85); }
.mb-topbar-search {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); color: #fff;
    border-radius: 7px; padding: 6px 12px;
    font-size: 16px; width: 320px; outline: none;
    transition: border 0.15s;
}
.mb-topbar-search:focus { border-color: var(--mb-primary); background: rgba(255,255,255,0.15); }
.mb-topbar-search::placeholder { color: rgba(255,255,255,0.4); }
.mb-topbar-btn {
    width: 30px; height: 30px; border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #666; transition: all 0.15s;
}
.mb-topbar-btn:hover { background: rgba(255,255,255,0.15); }
.mb-lang-toggle {
    font-size: 15px; font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2); padding: 4px 5px;
    border-radius: 5px; cursor: pointer; color: rgba(255,255,255,0.8);
    text-decoration: none; transition: all 0.15s;
}
.mb-lang-toggle.dropdown-toggle::after { display: none; } /* χωρίς caret — μόνο η σημαία */
.mb-lang-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }
.mb-lang-toggle.dropdown-toggle::after { display: none; }
.mb-admin-avatar {
    width: 30px; height: 30px; background: var(--mb-primary);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 11px;
    font-weight: 500; cursor: pointer;
}

/* ── Page content ── */
.mb-content { padding: 18px; flex: 1; min-width: 0; overflow-x: hidden; }
.mb-page-header {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 14px;
}
.mb-page-title { font-size: 18px; font-weight: 600; }

/* ── Stat cards ── */
.mb-stat-card {
    background: #fff; border-radius: 12px;
    padding: 18px 20px; border: 1px solid #e8eaf0;
    display: flex; align-items: center; gap: 16px;
    text-decoration: none; color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    overflow: hidden;
}
.mb-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-2px); color: inherit; }
.mb-stat-icon {
    width: 54px; height: 54px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.mb-stat-body { flex: 1; }
.mb-stat-label { font-size: 16px; color: #888; margin-bottom: 4px; letter-spacing: 0.02em; font-weight: 600; }
.mb-stat-value { font-size: 28px; font-weight: 800; line-height: 1; }
.mb-stat-sub   { font-size: 15px; color: #999; margin-top: 5px; }

.mb-stat-card.blue  .mb-stat-icon { background: rgba(79,142,247,0.12); color: #4f8ef7; }
.mb-stat-card.blue  .mb-stat-value { color: #4f8ef7; }
.mb-stat-card.green .mb-stat-icon { background: rgba(29,158,117,0.12); color: #1D9E75; }
.mb-stat-card.green .mb-stat-value { color: #1D9E75; }
.mb-stat-card.amber .mb-stat-icon { background: rgba(186,117,23,0.12); color: #BA7517; }
.mb-stat-card.amber .mb-stat-value { color: #BA7517; }
.mb-stat-card.red   .mb-stat-icon { background: rgba(226,75,74,0.12); color: #e24b4a; }
.mb-stat-card.red   .mb-stat-value { color: #e24b4a; }
.mb-stat-card.pink  .mb-stat-icon { background: rgba(233,30,140,0.12); color: #e91e8c; }
.mb-stat-card.pink  .mb-stat-value { color: #e91e8c; }
.mb-stat-card.teal  .mb-stat-icon { background: rgba(0,188,212,0.12); color: #00bcd4; }
.mb-stat-card.teal  .mb-stat-value { color: #00bcd4; }

/* ── Cards ── */
.mb-card { background: #fff; border-radius: 10px; border: 1px solid #e8eaf0; }
.mb-card-header {
    padding: 14px 18px; border-bottom: 1px solid #e8eaf0;
    display: flex; align-items: center; justify-content: space-between;
}
.mb-card-title { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0; }
.mb-card-body  { padding: 18px; }
/* Tables inside cards scroll on mobile */
.mb-card [style*="overflow-x:auto"], .mb-card > div > .mb-table { overflow-x: auto; }

/* ── Tables ── */
.mb-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.mb-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mb-table th {
    padding: 11px 15px; font-weight: 700; font-size: 12.5px;
    color: #3d4f6f; text-align: left;
    border-bottom: 2px solid #d0d7e3; white-space: nowrap;
    letter-spacing: 0.02em;
    background: #edf1f7; font-size: 16px;
}
.mb-table td { padding: 13px 15px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
.mb-table tbody tr:nth-child(even) td { background: #f8fafe; }
.mb-table tbody tr:hover td { background: #eef3fb; }
.mb-table tr:last-child td { border-bottom: none; }
.mb-table tr:hover td { background: #fafbff; }

/* ── Badges ── */
.mb-badge {
    display: inline-block; font-size: 15px; font-weight: 500;
    padding: 3px 8px; border-radius: 10px; white-space: nowrap;
}
.mb-badge-success  { background: #e6f4ea; color: #276a3a; }
.mb-badge-warning  { background: #fff3e0; color: #8a5700; }
.mb-badge-danger   { background: #fde8e8; color: #9b2020; }
.mb-badge-info     { background: #e3f0fd; color: #1558a0; }
.mb-badge-secondary{ background: #f0f2f7; color: #666; }
.mb-badge-completed{ background: #e0f5f2; color: #0d6e63; }

/* ── Forms ── */
.mb-form-control {
    width: 100%; padding: 7px 11px;
    border: 1px solid #dde0e8; border-radius: 4px;
    font-size: 16px; transition: border 0.15s;
    outline: none; background: #fff; color: #333;
}
.mb-form-control:focus { border-color: var(--mb-primary); box-shadow: 0 0 0 3px rgba(79,142,247,0.1); }
select.mb-form-control { cursor: pointer; }
input[type="date"].mb-form-control, input[type="text"].mb-form-control, input[type="number"].mb-form-control, input[type="email"].mb-form-control { cursor: text; }
textarea.mb-form-control { resize: vertical; }
.mb-form-label { font-size: 16px; font-weight: 600; color: #555; margin-bottom: 4px; display: block; }

/* ── Buttons ── */
.mb-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 18px; border-radius: 5px !important;
    font-size: 16px; font-weight: 500;
    border: none; cursor: pointer;
    text-decoration: none; transition: all 0.15s;
    white-space: nowrap;
}
.mb-btn-primary   { background: var(--mb-primary); color: #fff; }
.mb-btn-primary:hover   { background: #3a7de8; color: #fff; }
.mb-btn-secondary { background: #f0f2f7; color: #444; border: 1px solid #e0e3ea; }
.mb-btn-secondary:hover { background: #e4e7ef; }
.mb-btn-danger    { background: #e24b4a; color: #fff; }
.mb-btn-danger:hover    { background: #c93b3a; color: #fff; }
.mb-btn-success   { background: #1D9E75; color: #fff; }
.mb-btn-success:hover   { background: #178a64; color: #fff; }
.mb-btn-warning   { background: #BA7517; color: #fff; }
.mb-btn-warning:hover   { background: #a36613; color: #fff; }
.mb-btn-sm { padding: 6px 13px; font-size: 16px; border-radius: 5px !important; }
.mb-btn-metal {
    background: linear-gradient(180deg, #f8f9fb 0%, #e4e7ed 100%);
    color: #3a3f4b; border: 1px solid #c0c5cf;
    box-shadow: 0 1px 3px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.85);
    text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}
.mb-btn-metal:hover {
    background: linear-gradient(180deg, #eef0f5 0%, #d8dce4 100%);
    border-color: #a8aeb9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.5);
}

/* ── Login ── */
.mb-login {
    min-height: 100vh; background: #0f1b2d;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.mb-login-shell {
    width: 100%; max-width: 940px; min-height: 560px;
    display: flex; background: #fff; border-radius: 18px; overflow: hidden;
    box-shadow: 0 24px 70px rgba(0,0,0,.45);
    animation: mbLoginIn .5s ease;
}
@keyframes mbLoginIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.mb-login-brand {
    flex: 1 1 46%; position: relative; overflow: hidden;
    background: linear-gradient(150deg, #1e3a5f 0%, #16293f 100%);
    color: #fff; padding: 48px 44px; display: flex; flex-direction: column;
}
.mb-login-brand-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mb-login-brand-top { position: relative; z-index: 1; }
.mb-login-brand-logo { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.mb-login-brand-logo .mb-logo-icon { width: 46px; height: 46px; font-size: 17px; border-radius: 12px; }
.mb-login-brand-logo .wm { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.mb-login-brand-logo-tile { display: inline-flex; max-width: 100%; background: rgba(255,255,255,0.07); padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.10); }
.mb-login-brand-logo-img { max-width: 100%; max-height: 64px; width: auto; height: auto; object-fit: contain; display: block; }
.mb-login-form-foot { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-size: 15px; color: #94a3b8; }
.mb-login-brand h1 { font-size: 30px; font-weight: 800; line-height: 1.2; margin: 0 0 12px; position: relative; z-index: 1; }
.mb-login-brand p { font-size: 16px; color: #cbd5e1; line-height: 1.6; margin: 0; max-width: 320px; position: relative; z-index: 1; }
.mb-login-brand-feats { margin-top: auto; display: flex; flex-direction: column; gap: 13px; position: relative; z-index: 1; padding-top: 30px; }
.mb-login-brand-feat { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #dbe4f0; }
.mb-login-brand-feat i { color: #93c5fd; font-size: 18px; }

.mb-login-form {
    flex: 1 1 54%; background: #fff; padding: 46px 48px;
    display: flex; flex-direction: column; position: relative;
}
.mb-login-lang { position: absolute; top: 20px; right: 22px; }
.mb-login-form-inner { margin: auto 0; width: 100%; max-width: 360px; }
.mb-login-form h2 { font-size: 22px; font-weight: 700; color: #1e293b; margin: 0 0 4px; white-space: nowrap; }
.mb-login-form .sub { font-size: 15px; color: #94a3b8; margin: 0 0 26px; }
.mb-login-field { margin-bottom: 18px; }
.mb-login-field label { display: block; font-size: 15px; font-weight: 500; color: #475569; margin-bottom: 6px; }
.mb-login-inwrap { position: relative; }
.mb-login-inwrap > i.fic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 16px; pointer-events: none; }
.mb-login-inwrap input { width: 100%; padding: 12px 44px 12px 42px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 16px; color: #1e293b; background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.mb-login-inwrap input::placeholder { color: #cbd5e1; }
.mb-login-inwrap input:focus { border-color: #4f8ef7; box-shadow: 0 0 0 3px rgba(79,142,247,.12); }
.mb-login-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #94a3b8; cursor: pointer; padding: 6px; border-radius: 7px; font-size: 17px; display: inline-flex; }
.mb-login-eye:hover { color: #475569; background: #f1f5f9; }
.mb-login-submit { width: 100%; margin-top: 8px; padding: 12px; background: #1e3a5f; color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background .2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.mb-login-submit:hover { background: #16293f; }
.mb-login-alert { padding: 11px 14px; border-radius: 10px; font-size: 15px; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.mb-login-alert.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; animation: mbShake .35s; }
.mb-login-alert.warn { background: #fffbeb; color: #854d0e; border: 1px solid #fde68a; }
@keyframes mbShake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} }

@media (max-width: 860px) {
    .mb-login-shell { flex-direction: column; max-width: 440px; min-height: 0; }
    .mb-login-brand { padding: 32px 30px; }
    .mb-login-brand-feats { display: none; }
    .mb-login-brand h1 { font-size: 24px; }
    .mb-login-form { padding: 64px 26px 32px; }
    .mb-login-form-inner { max-width: 100%; margin: 0; }
    .mb-login-form h2 { font-size: 17px; }
    .mb-login-form-foot { position: static; margin-top: 22px; }
}

/* ── Avatar ── */
.mb-avatar { position: relative; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: inline-block; }
.mb-avatar img { display: block; border-radius: 50%; object-fit: cover; }

/* ── Hamburger ── */
.mb-hamburger {
    display: none; background: none; border: none;
    font-size: 26px; cursor: pointer; color: rgba(255,255,255,0.85); padding: 0; margin-right: 6px;
}

/* ── Settings Tabs ── */
.mb-settings-tabs {
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 0;
}
.mb-settings-tab {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; border-radius: 3px;
    border: 1.5px solid #e2e8f0; font-size: 16px; font-weight: 500;
    text-decoration: none; background: #fff;
    transition: all 0.15s ease; white-space: nowrap;
}
.mb-settings-tab:hover:not(.active) {
    background: #f8faff; border-color: currentColor;
    transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}
.mb-settings-tab.active { box-shadow: 0 2px 8px rgba(0,0,0,0.15); font-weight: 600; }
.mb-settings-tab i { font-size: 13px; }

/* ── Field desc & checkbox ── */
.mb-field-desc { font-size: 15px; color: #6b7280; margin-top: 4px; line-height: 1.4; }
.mb-chk-label {
    display: flex; align-items: center; gap: 7px;
    cursor: pointer; font-size: 16px; font-weight: 500; color: #374151;
}
.mb-chk-input {
    width: 15px; height: 15px; flex-shrink: 0;
    cursor: pointer; accent-color: var(--mb-primary);
}

/* ── Pagination ── */
.mb-pagination { display: flex; gap: 4px; }
.mb-pagination a, .mb-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 6px;
    border-radius: 4px; font-size: 16px; font-weight: 500;
    text-decoration: none; border: 1px solid #e8eaf0;
    background: #fff; color: #555; transition: all 0.15s;
}
.mb-pagination a:hover { background: #f0f2f7; }
.mb-pagination span.current { background: var(--mb-primary); color: #fff; border-color: var(--mb-primary); }
.mb-pagination span.disabled { color: #ccc; pointer-events: none; }

/* ── Responsive ── */
@media (max-width: 991px) {
    .mb-sidebar { transform: translateX(-100%); }
    .mb-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
    .mb-main { margin-left: 0; }
    .mb-hamburger { display: flex; align-items: center; }
    .mb-setting-label { width: 180px; min-width: 180px; font-size: 16px; }
    .mb-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,0.4); z-index: 1039;
    }
    .mb-overlay.show { display: block; }
    .mb-topbar-search { width: 140px; }
}
@media (max-width: 650px) {
    /* Settings: stack label above field on small screens */
    .mb-setting-row {
        flex-direction: column;
        border-bottom: 1px solid #e0e3ea;
        padding: 0;
    }
    .mb-setting-row:nth-child(even) { background: #f5f7fa; }
    .mb-setting-row:nth-child(even) .mb-setting-label { background: transparent; }
    .mb-setting-label {
        width: 100%; min-width: 0;
        text-align: left !important;
        padding: 8px 12px 3px 12px;
        font-size: 16px;
        font-weight: 700;
        color: #333;
        border-right: none !important;
        background: transparent !important;
    }
    .mb-setting-field,
    .mb-setting-field-wide {
        width: 100% !important;
        max-width: 100% !important;
        padding: 2px 12px 10px 12px;
    }
    .mb-setting-section {
        padding: 6px 12px;
        font-size: 16px;
    }
    /* Settings tabs: hide overflow, show dropdown */
    .mb-settings-tabs { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
    .mb-settings-tab { font-size: 16px; padding: 5px 10px; flex-shrink: 0; }
    /* Make form inputs full width on mobile - exclude checkboxes/radios */
    .mb-setting-field,
    .mb-setting-field-wide {
        width: 100% !important;
        max-width: 100% !important;
    }
    .mb-setting-field > .mb-form-control,
    .mb-setting-field textarea.mb-form-control,
    .mb-setting-field-wide > .mb-form-control,
    .mb-setting-field-wide textarea.mb-form-control {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}
@media (max-width: 575px) {
    .mb-content { padding: 10px; }
    /* Stat cards (col-6 col-md-3 etc.) — 1 per row on phones */
    .mb-content .row > [class*="col-"] { flex:0 0 100% !important; max-width:100% !important; width:100% !important; }
    .mb-content [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .mb-content img { max-width: 100%; height: auto; }
    /* Inline flex form rows (label + field with fixed px widths): stack & go full width */
    .mb-content [style*="display:flex"][style*="border-bottom"] { flex-wrap: wrap; }
    .mb-content [style*="display:flex"][style*="border-bottom"] > [style*="width:180px"],
    .mb-content [style*="display:flex"][style*="border-bottom"] > [style*="width:200px"],
    .mb-content [style*="display:flex"][style*="border-bottom"] > [style*="width:220px"],
    .mb-content [style*="display:flex"][style*="border-bottom"] > [style*="width:300px"] {
        width: 100% !important; text-align: left !important; flex-shrink: 1 !important;
    }
    .mb-content [style*="width:300px"] > input,
    .mb-content [style*="width:300px"] > select { width: 100% !important; }
    .mb-topbar { padding: 0 8px; gap: 3px; }
    .mb-topbar-title { display: none; }
    .mb-topbar-quick { gap: 0; margin-left: auto; }
    .mb-topbar-quick-btn { width: 28px; height: 28px; font-size: 16px; margin: 0; }
    .mb-topbar-btn { width: 28px; height: 28px; }
    .mb-hamburger { flex-shrink: 0; margin-right: 0; }
    .mb-lang-toggle { padding: 3px; }
    .mb-lang-toggle img { width: 24px; height: 17px; }
    .mb-admin-avatar { flex-shrink: 0; }
    .mb-admin-avatar img { width: 32px !important; height: 32px !important; }
    .mb-admin-avatar.dropdown-toggle::after { display: none; } /* το caret έσπρωχνε/έκοβε το avatar */
    .mb-search-wrap { display: none; }
    .mb-search-wrap.mobile-open {
        display: block;
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 1035;
        padding: 8px 12px;
        background: #fff;
        border-bottom: 1px solid #e8eaf0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    .mb-search-wrap.mobile-open .mb-topbar-search {
        display: block;
        width: 100%;
        background: #fff;
        border-color: #e8eaf0;
        color: #333;
    }
    .mb-search-wrap.mobile-open .mb-topbar-search::placeholder { color: #aaa; }
    .mb-search-wrap.mobile-open .mb-search-dropdown {
        position: fixed;
        top: 56px; left: 0; right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    .mb-mobile-search-btn { display: flex !important; }
}

/* ── Settings WHMCS-style form layout ── */
.mb-settings-body { padding: 0; }
.mb-settings-form { }

.mb-setting-row {
    display: flex;
    align-items: flex-start;
    border-bottom: 1px solid #e2e5ec;
    min-height: 42px;
    background: #fff;
}
.mb-setting-row:nth-child(even) { background: #f5f7fa; }
.mb-setting-row:last-child { border-bottom: none; }

.mb-setting-label {
    width: 240px;
    min-width: 240px;
    padding: 10px 16px 10px 20px;
    font-size: 16px;
    font-weight: 500;
    color: #444;
    text-align: right;
    line-height: 1.4;
    padding-top: 11px;
    border-right: 1px solid #e2e5ec;
    background: rgba(0,0,0,0.015);
}

.mb-setting-field {
    flex: 1;
    padding: 8px 20px 8px 12px;
    max-width: 900px;
}
.mb-setting-field-wide {
    max-width: 900px;
}
.mb-setting-field .mb-form-control { }
.mb-setting-select { max-width: 280px; }

.mb-setting-section {
    background: #f8f9fc;
    border-bottom: 1px solid #e8eaf0;
    border-top: 1px solid #e8eaf0;
    padding: 7px 20px;
    font-size: 16px;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.02em;
    margin-top: 4px;
}

/* ── Force square buttons - override Bootstrap completely ── */
.mb-btn,
.mb-btn:hover,
.mb-btn:focus,
.mb-btn:active,
button.mb-btn,
a.mb-btn {
    border-radius: 5px !important;
    -webkit-border-radius: 5px !important;
    -moz-border-radius: 5px !important;
}

/* ── Global Search Dropdown ── */
.mb-search-wrap { position: relative; }
.mb-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 640px;
    max-width: calc(100vw - var(--mb-sidebar-width) - 40px);
    background: #fff;
    border: 1px solid #e2e5ec;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9999;
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}
.mb-search-results-inner { max-width: 900px; margin: 0 auto; }
.mb-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f2f7;
    transition: background 0.1s;
}
.mb-search-item:last-child { border-bottom: none; }
.mb-search-item:hover { background: #f5f7fb; }
.mb-search-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.mb-search-label { font-size: 16px; font-weight: 500; line-height: 1.3; }
.mb-search-sub { font-size: 15px; color: #888; }
.mb-search-empty {
    padding: 20px 20px;
    text-align: center;
    color: #999;
    font-size: 16px;
}
.mb-search-loading {
    padding: 16px;
    text-align: center;
    color: #aaa;
    font-size: 16px;
}
.mb-search-section {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #aaa;
    padding: 8px 20px 4px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f2f7;
}

/* ── Search footer (active toggle) ── */
.mb-search-footer {
    padding: 8px 20px;
    border-top: 1px solid #e8eaf0;
    background: #fafbfc;
}

/* ── Topbar Quick Access ── */
.mb-topbar-quick {
    display: flex;
    align-items: center;
    gap: 2px;
}
.mb-topbar-quick-btn {
    position: relative;
    margin: 0 6px; /* έξτρα κενό ανάμεσα στα εικονίδια tickets/παραγγελίες/τιμολόγια */
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    border: none; background: none;
}
.mb-topbar-quick-btn:hover,
.mb-topbar-quick-btn.active { background: rgba(255,255,255,0.12); color: #fff; }
.mb-quick-badge {
    position: absolute;
    top: -2px; right: -4px;
    min-width: 18px; height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    line-height: 1;
    border: none;
}
.mb-quick-badge-red { background: #ef4444; }
.mb-quick-dot {
    position: absolute;
    bottom: 4px; right: 4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #aaa;
    border: 1.5px solid #fff;
}
.mb-quick-dot.ok      { background: #1D9E75; }
.mb-quick-dot.warning { background: #e24b4a; }

.mb-mobile-search-btn { display: none; }

/* ── Toggle Switch ── */
.mb-toggle { position: relative; display: inline-block; width: 44px; height: 22px; flex-shrink: 0; }
.mb-toggle input { opacity: 0; width: 0; height: 0; }
.mb-toggle-slider {
    position: absolute; inset: 0;
    background: #ccc; border-radius: 22px;
    cursor: pointer; transition: 0.2s;
}
.mb-toggle-slider:before {
    content: ''; position: absolute;
    width: 16px; height: 16px;
    left: 3px; bottom: 3px;
    background: #fff; border-radius: 50%;
    transition: 0.2s;
}
.mb-toggle input:checked + .mb-toggle-slider { background: #4f8ef7; }
.mb-toggle input:checked + .mb-toggle-slider:before { transform: translateX(22px); }

/* ── Settings mobile dropdown ── */
.mb-settings-tabs-mobile { display: none; margin-bottom: 8px; }
@media (max-width: 650px) {
    .mb-settings-tabs { display: none; }
    .mb-settings-tabs-mobile { display: block; }
}

/* ── Mobile improvements for admin pages ── */
@media (max-width: 767px) {
    .mb-page-header { flex-direction: column; gap: 10px; align-items: flex-start !important; }
    .mb-page-header .mb-btn { width: 100%; text-align: center; }
    .mb-card-header { flex-wrap: wrap; gap: 8px; }
    .mb-table th, .mb-table td { font-size: 16px !important; padding: 8px 6px !important; white-space: nowrap; }
    .nav-tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nav-tabs .nav-link { white-space: nowrap; font-size: 16px; padding: 8px 12px; }
    /* Force all d-flex with gap to wrap */
    .d-flex { flex-wrap: wrap !important; }
    /* Fixed width containers → max-width (only wider elements) */
    .mb-card, .mb-card-body, form, .mb-content > div { max-width: 100% !important; box-sizing: border-box !important; }
    div[style*="width:"][style*="px"] { max-width: 100% !important; box-sizing: border-box !important; }
    /* Hardcoded grids → single column */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(4"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(6"],
    [style*="grid-template-columns:repeat(6"] {
        grid-template-columns: 1fr !important;
    }
    /* Code blocks */
    code { font-size: 15px !important; word-break: break-all; }
    /* Forms */
    .mb-form-control, select.mb-form-control, textarea.mb-form-control { font-size: 16px !important; }
    /* Ensure table wrapper scroll */
    .mb-card > table.mb-table,
    .mb-card > .mb-table { display: block; overflow-x: auto; }
    /* Global safety: any standalone table can scroll instead of overflowing */
    .mb-content table { max-width: 100%; }
    .mb-content table.mb-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}
@media (max-width: 480px) {
    .mb-content { padding: 8px; }
    .mb-table th, .mb-table td { font-size: 16px !important; padding: 6px 4px !important; }
    .mb-btn-sm { font-size: 15px; padding: 3px 6px; }
    .mb-badge { font-size: 15px !important; }
    .mb-page-title { font-size: 20px !important; }
    /* Stat cards: smaller on mobile */
    .mb-stat-card { padding: 10px 12px; gap: 10px; }
    .mb-stat-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 18px; }
    .mb-stat-value { font-size: 20px !important; }
    .mb-stat-label { font-size: 16px; }
    .mb-stat-sub { font-size: 15px; }
    /* Stack stat card columns — 1 per row on small phones */
    .row.g-3 > .col-6,
    .row.g-3 > .col-4,
    .row.g-2 > .col-6,
    .row.g-2 > .col-4 { width: 100% !important; flex: 0 0 100% !important; }
    .row > [class*="col-6 col-md"],
    .row > [class*="col-4 col-md"] { width: 100% !important; flex: 0 0 100% !important; }
}

/* ── Very small screens (375px phones) ── */
@media (max-width: 400px) {
    .mb-stat-card { padding: 8px 10px; gap: 8px; flex-direction: column; align-items: flex-start; }
    .mb-stat-icon { display: none; }
    .mb-stat-value { font-size: 18px !important; }
    .mb-stat-label { font-size: 16px !important; }
    .mb-stat-sub { font-size: 15px !important; }
    .mb-page-title { font-size: 18px !important; }
    .mb-btn { font-size: 16px; padding: 6px 10px; }
    .nav-tabs .nav-link { font-size: 16px; padding: 6px 8px; }
}

/* ── Admin Notes Panel mobile ── */
@media (max-width: 575px) {
    #adminNotesPanel.open {
        top: 0 !important; right: 0 !important; left: 0 !important;
        width: 100% !important; max-width: 100% !important;
        height: 100vh !important; border-radius: 0 !important;
    }
    #adminNotesPanel.open textarea { height: calc(100vh - 160px) !important; }
}


/* ── Mini sidebar (μόνο εικονίδια) — επιλογή χρήστη, μόνο desktop ── */
.mb-mini-toggle {
    display: none; align-items: center; justify-content: center;
    margin: 6px 10px 10px; padding: 6px 0;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
    cursor: pointer; transition: all 0.15s; font-size: 15px;
}
.mb-mini-toggle:hover { background: rgba(255,255,255,0.12); color: #fff; }
@media (min-width: 992px) {
    .mb-mini-toggle { display: flex; }
    body.mb-mini { --mb-sidebar-width: 64px; }
    body.mb-mini .mb-mini-toggle i { transform: rotate(180deg); }
    body.mb-mini .mb-nav-section { display: none; }
    body.mb-mini .mb-sidebar-online { display: none; }
    body.mb-mini .mb-sidebar-logo { justify-content: center; padding-left: 0; padding-right: 0; }
    body.mb-mini .mb-sidebar-logo > *:not(.mb-sidebar-logo-tile):not(.mb-logo-icon) { display: none; }
    /* Τα κείμενα των items είναι text nodes: font-size 0 τα κρύβει
       χωρίς αλλαγές στο markup — το εικονίδιο ξαναπαίρνει μέγεθος. */
    body.mb-mini .mb-nav-item { font-size: 0; gap: 0; justify-content: center; padding: 10px 0; }
    body.mb-mini .mb-nav-item i { font-size: 19px; }
    body.mb-mini .mb-nav-item .mb-nav-badge { display: none; }
    body.mb-mini .mb-nav-caret { display: none; }
    /* Υπομενού σε mini: flyout δίπλα στα εικονίδια (fixed — δεν κόβεται
       από το scroll του μενού· τοποθέτηση top από JS) */
    body.mb-mini .mb-sidebar .collapse:not(.mb-flyout-open),
    body.mb-mini .mb-sidebar .collapsing { display: none; }
    body.mb-mini .mb-flyout-open {
        display: block; position: fixed; left: 64px; z-index: 1100;
        background: var(--mb-sidebar-bg, #16293f);
        min-width: 230px; max-width: 300px; max-height: 70vh; overflow-y: auto;
        border-radius: 0 8px 8px 0; box-shadow: 6px 0 18px rgba(0,0,0,0.35);
        padding: 6px 0; border-left: 1px solid rgba(255,255,255,0.08);
    }
    body.mb-mini .mb-flyout-open .mb-nav-item {
        font-size: 15px; gap: 8px; justify-content: flex-start; padding: 8px 16px;
    }
    body.mb-mini .mb-flyout-open .mb-nav-item i { font-size: 16px; }
    body.mb-mini .mb-flyout-open .mb-nav-item .mb-nav-badge { display: inline-block; }
}

/* (03/10/2026) Κεφαλίδες modal στο χρώμα του θέματος (navy, όπως το topbar).
   Μόνο όσες ΔΕΝ έχουν δικό τους φόντο inline — οι χρωματιστές κατά ενέργεια
   (κόκκινο διαγραφής, μπλε σημειώσεων, μωβ ανανέωσης, πράσινο αναβάθμισης κ.λπ.)
   μένουν ως έχουν. Τίτλος & εικονίδια λευκά για αναγνωσιμότητα. */
.modal-header:not([style*="background"]) { background: #1e3a5f; color: #fff; border-bottom-color: rgba(255,255,255,.08); }
.modal-header:not([style*="background"]) .modal-title,
.modal-header:not([style*="background"]) .modal-title * { color: #fff !important; }
.modal-header:not([style*="background"]) .btn-close { filter: invert(1) grayscale(100%) brightness(200%); opacity: .85; }
.modal-header:not([style*="background"]) .btn-close:hover { opacity: 1; }
/* Κεφαλίδες με pb-0 (π.χ. γενικό modal επιβεβαίωσης): με φόντο θέλουν κανονικό padding κάτω */
.modal-header.pb-0:not([style*="background"]) { padding-bottom: var(--bs-modal-header-padding-y, 1rem) !important; }
