/* ====================================================================
   FOOTER BAR — footerbar.css
   Fixed bottom bar: Logo | Notification Slide | Settings Menu
==================================================================== */

/* ── Main Footer Bar ────────────────────────────────────────────── */
#footer_bar {
    width: 100%;
    height: 30px;
    display: grid;
    grid-template-columns: 200px 1fr auto;
    z-index: 9000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Segoe UI', 'KhmerOSbattambang', Arial, sans-serif;
    font-size: 12px;
    box-sizing: border-box;
    user-select: none;
}

/* ── LEFT: Logo + Company Name ──────────────────────────────────── */
#footer_bar > .fb-left {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    overflow: hidden;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}

#footer_bar > .fb-left > img {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

#footer_bar > .fb-left > .fb-company {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── CENTER: Sliding Notification (តំបន់អត្ថបទជូនដំណឹងកណ្តាល) ───────── */

/* 
 * ប្រអប់កណ្តាល #footer_bar > .fb-center:
 * កំណត់តំបន់បង្ហាញអត្ថបទរមូរ និងតម្រឹមអក្សរនៅចំកណ្តាល (center) ជា Standard
 */
#footer_bar > .fb-center {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center; /* ដាក់អក្សរនៅចំកណ្តាលពេលអក្សរខ្លី */
    padding: 0 8px;
    border-right: 1px solid rgba(255,255,255,0.12);
    position: relative;
}

/* 
 * ធាតុ Ticker (#fb-ticker):
 * កំណត់ Style សម្រាប់អត្ថបទជូនដំណឹងទូទៅ (Fix នៅចំកណ្តាលពេលអក្សរមិនទាន់ overflowing)
 */
#footer_bar > .fb-center > .fb-ticker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    max-width: 100%;
    margin: 0 auto;
}

/* 
 * ករណីអក្សរវែងហួស Element (.fb-ticker.overflowing):
 * ដាក់ animation រមូរ (slide) ពីស្តាំទៅឆ្វេងស្វ័យប្រវត្តិ តែពេលអក្សរវែងជាងប្រអប់ container
 */
#footer_bar > .fb-center > .fb-ticker.overflowing {
    justify-content: flex-start;
    max-width: none;
    margin: 0;
    animation: ticker-scroll 60s linear infinite; /* ដំណើរការរមូរអក្សរ (យឺតស្រួលអាន 60s) */
    will-change: transform;
}

/* ឈប់រមូរ (pause animation) នៅពេលអ្នកប្រើប្រាស់ដាក់ Mouse Hover លើអត្ថបទ */
#footer_bar > .fb-center > .fb-ticker.overflowing:hover {
    animation-play-state: paused;
}

#footer_bar > .fb-center > .fb-ticker > .fb-ticker-icon {
    font-size: 11px;
    flex-shrink: 0;
}

/* Keyframes សម្រាប់ការរមូរអក្សរពីស្តាំទៅឆ្វេង (Slide right-to-left) */
@keyframes ticker-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ── RIGHT: Settings Drop-UP Menu ──────────────────────────────── */
#footer_bar > .fb-right {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

#footer_bar > .fb-right > #fb-lang-btn {
    height: 30px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
    border-right: 1px solid rgba(255,255,255,0.12);
}

#footer_bar > .fb-right > #fb-lang-btn:hover {
    background: rgba(255,255,255,0.12);
}

#footer_bar > .fb-right > #fb-lang-btn > #fb-lang-badge {
    background: rgba(255,255,255,0.18);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
    letter-spacing: 0.5px;
}

/* ── HOME BUTTON ───────────────────────────────────────────────── */
#footer_bar > .fb-right > .fb-home-btn {
    height: 30px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-sizing: border-box;
    position: relative;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    letter-spacing: 0.3px;
    transition: all 0.25s ease;
    /* Subtle gradient highlight */
    background: linear-gradient(135deg, rgba(16,185,129,0.18) 0%, rgba(5,150,105,0.08) 100%);
    border-left: 2px solid rgba(16, 185, 129, 0.55);
}

#footer_bar > .fb-right > .fb-home-btn:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.35) 0%, rgba(5,150,105,0.2) 100%);
    border-left-color: #10b981;
    transform: none;
    box-shadow: inset 0 0 16px rgba(16,185,129,0.15);
}

#footer_bar > .fb-right > .fb-home-btn:active {
    background: linear-gradient(135deg, rgba(5,150,105,0.45) 0%, rgba(4,120,87,0.3) 100%);
    transform: scaleX(0.97);
}

#footer_bar > .fb-right > .fb-home-btn > .fb-home-icon {
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 0 4px rgba(16,185,129,0.6));
    transition: transform 0.2s ease;
}

#footer_bar > .fb-right > .fb-home-btn:hover > .fb-home-icon {
    transform: scale(1.2) rotate(-5deg);
}

#footer_bar > .fb-right > .fb-home-btn > .fb-home-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.4px;
    display: inline-block;
}

#footer_bar > .fb-right > .fb-home-btn > .fb-home-label:empty::before {
    content: attr(kh);
}

[leng="eng"] #footer_bar > .fb-right > .fb-home-btn > .fb-home-label:empty::before,
[leng="en"] #footer_bar > .fb-right > .fb-home-btn > .fb-home-label:empty::before {
    content: attr(eng);
}

/* Pulse animation on the green left border */
@keyframes home-btn-pulse {
    0%, 100% { border-left-color: rgba(16,185,129,0.55); }
    50%       { border-left-color: rgba(16,185,129,1); box-shadow: inset 0 0 10px rgba(16,185,129,0.2); }
}

#footer_bar > .fb-right > .fb-home-btn {
    animation: home-btn-pulse 2.8s ease-in-out infinite;
}

#footer_bar > .fb-right > .fb-home-btn:hover {
    animation: none;
}

#footer_bar > .fb-right > #fb-settings-btn {
    height: 30px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
    box-sizing: border-box;
}

#footer_bar > .fb-right > #fb-settings-btn:hover {
    opacity: 0.85;
}

/* Drop-UP menu */
#fb-settings-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    min-width: 230px;
    border-radius: 8px 8px 0 8px;
    overflow: hidden;
    box-shadow: 0 -6px 20px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    z-index: 9100;
}

#fb-settings-menu.open {
    display: flex;
}

#fb-settings-menu > .fb-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 12.5px;
    transition: background 0.15s;
    white-space: nowrap;
    text-decoration: none;
}

/* ── Home Page Select in Settings Menu ─────────────────────────── */
#fb-settings-menu > .fb-menu-item.fb-home-select-item {
    cursor: default;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 14px;
}

#fb-settings-menu > .fb-menu-item.fb-home-select-item:hover {
    background: transparent;
}

#fb-settings-menu > .fb-menu-item.fb-home-select-item > .fb-mi-icon {
    font-size: 16px;
    margin-top: 3px;
    flex-shrink: 0;
}

.fb-home-select-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.fb-home-select-title {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.85;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.fb-home-select {
    width: 100%;
    padding: 5px 8px;
    font-size: 11.5px;
    font-weight: 500;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
}

.fb-home-select:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

body[bg="light"] .fb-home-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

body[bg="light"] .fb-home-select option {
    background: #ffffff;
    color: #1e293b;
}

body[bg="dark"] .fb-home-select {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

body[bg="dark"] .fb-home-select option {
    background: #1e293b;
    color: #f1f5f9;
}

#fb-settings-menu > .fb-menu-item > .fb-mi-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

#fb-settings-menu > .fb-menu-separator {
    height: 1px;
    margin: 3px 10px;
}

/* ── Dark/Light Toggle ──────────────────────────────────────────── */
#fb-settings-menu > .fb-menu-item.theme-toggle > .fb-theme-switch {
    margin-left: auto;
    width: 32px;
    height: 16px;
    border-radius: 8px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

#fb-settings-menu > .fb-menu-item.theme-toggle > .fb-theme-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

body[bg="dark"] #fb-settings-menu > .fb-menu-item.theme-toggle > .fb-theme-switch::after {
    transform: translateX(16px);
}

/* ── LOGIN POPUP OVERLAY ────────────────────────────────────────── */
#fb-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 9500;
    display: none;
    align-items: center;
    justify-content: center;
}

#fb-login-overlay.open,
#fb-login-overlay.fb-login-open {
    display: flex;
}

#fb-login-box {
    width: 360px;
    max-width: 95vw;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: login-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes login-pop {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

#fb-login-box > .fb-login-head {
    padding: 16px 20px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1a3c5e 0%, #21627b 60%, #2e86ab 100%);
    color: #fff;
}

#fb-login-box > .fb-login-head > .fb-lh-icon {
    font-size: 22px;
}

#fb-login-box > .fb-login-head > .fb-lh-title {
    font-size: 16px;
    font-weight: 700;
}

#fb-login-box > .fb-login-head > .fb-lh-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

#fb-login-box > .fb-login-head > .fb-lh-close:hover {
    background: rgba(255,60,60,0.5);
}

#fb-login-box > .fb-login-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#fb-login-box > .fb-login-body > .fb-login-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#fb-login-box > .fb-login-body > .fb-login-field > label {
    font-size: 12px;
    font-weight: 600;
}

#fb-login-box > .fb-login-body > .fb-login-field > input {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#fb-login-box > .fb-login-body > .fb-login-btn {
    height: 40px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    background: linear-gradient(135deg, #21627b, #2e86ab);
    color: #fff;
    margin-top: 4px;
}

#fb-login-box > .fb-login-body > .fb-login-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#fb-login-box > .fb-login-body > .fb-login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* .fb-login-input — same style as > input, supports ng-model */
#fb-login-box .fb-login-input {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1.5px solid;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Error message in login popup */
#fb-login-box .fb-login-error {
    font-size: 12.5px;
    color: #ef4444;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px;
    padding: 6px 10px;
}

/* ── Switch User info badge ── */
#fb-login-box .fb-login-switch-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 20px;
    background: rgba(99,102,241,0.08);
    border-bottom: 1px solid rgba(99,102,241,0.15);
    font-size: 12px;
}
#fb-login-box .fb-switch-label {
    color: #64748b;
    font-weight: 600;
}
#fb-login-box .fb-switch-user {
    font-weight: 700;
    color: #4f46e5;
    background: rgba(99,102,241,0.12);
    padding: 2px 8px;
    border-radius: 10px;
}
#fb-login-box .fb-switch-arrow {
    color: #94a3b8;
    font-size: 14px;
}
#fb-login-box .fb-switch-new {
    color: #10b981;
    font-weight: 600;
    font-style: italic;
}

/* ── Password field wrapper (input + eye button) ── */
#fb-login-box .fb-login-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
#fb-login-box .fb-login-pass-wrap .fb-login-input {
    padding-right: 38px;  /* space for eye button */
}
#fb-login-box .fb-login-eye {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
    color: #64748b;
    transition: color 0.15s;
}
#fb-login-box .fb-login-eye:hover { color: #4f46e5; }

/* ── Switch User menu item accent ── */
#fb-auth-btn-switch {
    color: #4f46e5 !important;
}
#fb-auth-btn-switch:hover {
    background: rgba(99,102,241,0.1) !important;
}


/* ════════════════════════════════════════════════════════════════
   SWITCH USER FORM — Additional CSS
════════════════════════════════════════════════════════════════ */

/* Header subtitle line */
#fb-login-box .fb-lh-titles {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}
#fb-login-box .fb-lh-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
#fb-login-box .fb-lh-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
    font-weight: 400;
}

/* Switch header color (teal gradient) */
#fb-login-box > .fb-login-head.fb-login-head-switch {
    background: linear-gradient(135deg, #0f4c5c 0%, #0d7377 55%, #14a085 100%);
}

/* Switch User body */
#fb-login-box > .fb-switch-body {
    gap: 12px;
}

/* Current user card */
#fb-login-box .fb-switch-current-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg,rgba(99,102,241,0.08),rgba(79,70,229,0.05));
    border: 1.5px solid rgba(99,102,241,0.2);
    border-radius: 10px;
}

/* Avatar circle (first letter) */
#fb-login-box .fb-switch-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79,70,229,0.35);
    text-transform: uppercase;
}

#fb-login-box .fb-switch-current-info {
    flex: 1;
    min-width: 0;
}
#fb-login-box .fb-switch-current-name {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#fb-login-box .fb-switch-current-role {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
}
#fb-login-box .fb-switch-current-badge {
    font-size: 10px;
    font-weight: 700;
    color: #10b981;
    background: rgba(16,185,129,0.12);
    border: 1px solid rgba(16,185,129,0.25);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Arrow divider */
#fb-login-box .fb-switch-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 4px;
}
#fb-login-box .fb-switch-line {
    flex: 1;
    height: 1.5px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}
#fb-login-box .fb-switch-arrow-icon {
    font-size: 16px;
    color: #94a3b8;
    animation: switchBounce 1.2s ease-in-out infinite;
}
@keyframes switchBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(4px); }
}

/* Action buttons row */
#fb-login-box .fb-switch-actions {
    display: flex;
    gap: 10px;
}
#fb-login-box .fb-switch-cancel-btn {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 16px;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
#fb-login-box .fb-switch-cancel-btn:hover {
    background: #e2e8f0;
    color: #334155;
}
#fb-login-box .fb-switch-confirm-btn {
    flex: 1;
    background: linear-gradient(135deg, #0d7377, #14a085) !important;
    box-shadow: 0 2px 8px rgba(13,115,119,0.35) !important;
}
#fb-login-box .fb-switch-confirm-btn:hover {
    opacity: 0.9;
}

/* ════════════════════════════════════════════════════════════════
   LIGHT MODE THEMING  [bg="light"]
════════════════════════════════════════════════════════════════ */
[bg="light"] #footer_bar {
    background: linear-gradient(135deg, #1a3c5e 0%, #21627b 100%);
    color: #ffffff;
}

[bg="light"] #footer_bar > .fb-left {
    border-color: rgba(255,255,255,0.15);
}

[bg="light"] #footer_bar > .fb-center {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}

[bg="light"] #footer_bar > .fb-right > #fb-lang-btn,
[bg="light"] #footer_bar > .fb-right > #fb-settings-btn {
    color: #ffffff;
}

[bg="light"] #footer_bar > .fb-right > .fb-home-btn,
body[bg="light"] #footer_bar > .fb-right > .fb-home-btn {
    background: linear-gradient(135deg, rgba(16,185,129,0.25) 0%, rgba(5,150,105,0.12) 100%);
    border-left-color: #10b981;
}

[bg="light"] #footer_bar > .fb-right > .fb-home-btn > .fb-home-label,
body[bg="light"] #footer_bar > .fb-right > .fb-home-btn > .fb-home-label {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
    font-weight: 700 !important;
}

[bg="light"] #footer_bar > .fb-right > .fb-home-btn:hover,
body[bg="light"] #footer_bar > .fb-right > .fb-home-btn:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.42) 0%, rgba(5,150,105,0.25) 100%);
}

[bg="light"] #footer_bar > .fb-right > .fb-home-btn:hover > .fb-home-label,
body[bg="light"] #footer_bar > .fb-right > .fb-home-btn:hover > .fb-home-label {
    color: #a7f3d0 !important;
}

[bg="light"] #fb-settings-menu {
    background: #ffffff;
    border: 1px solid #e2ecf4;
}

[bg="light"] #fb-settings-menu > .fb-menu-item {
    color: #1a3c5e;
}

[bg="light"] #fb-settings-menu > .fb-menu-item:hover {
    background: #f0f6fb;
}

[bg="light"] #fb-settings-menu > .fb-menu-separator {
    background: #e2ecf4;
}

[bg="light"] #fb-settings-menu > .fb-menu-item.theme-toggle > .fb-theme-switch {
    background: #c8daea;
}

[bg="light"] #fb-login-box {
    background: #ffffff;
}

[bg="light"] #fb-login-box > .fb-login-body {
    background: #ffffff;
    color: #1a3c5e;
}

[bg="light"] #fb-login-box > .fb-login-body > .fb-login-field > label {
    color: #3a5068;
}

[bg="light"] #fb-login-box > .fb-login-body > .fb-login-field > input {
    background: #f9fbfd;
    border-color: #c8daea;
    color: #1a3c5e;
}

[bg="light"] #fb-login-box > .fb-login-body > .fb-login-field > input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33,150,243,0.12);
    background: #fff;
}

/* ════════════════════════════════════════════════════════════════
   DARK MODE THEMING  [bg="dark"]
════════════════════════════════════════════════════════════════ */
[bg="dark"] #footer_bar {
    background: linear-gradient(135deg, #0f1b2d 0%, #1a3347 100%);
    color: #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

[bg="dark"] #footer_bar > .fb-left {
    border-color: rgba(255,255,255,0.08);
}

[bg="dark"] #footer_bar > .fb-center {
    border-color: rgba(255,255,255,0.08);
    color: rgba(226,232,240,0.85);
}

[bg="dark"] #footer_bar > .fb-right > #fb-lang-btn,
[bg="dark"] #footer_bar > .fb-right > #fb-settings-btn {
    color: #e2e8f0;
}

[bg="dark"] #footer_bar > .fb-right > .fb-home-btn {
    background: linear-gradient(135deg, rgba(16,185,129,0.2) 0%, rgba(5,150,105,0.08) 100%);
    border-left-color: rgba(16,185,129,0.6);
}
[bg="dark"] #footer_bar > .fb-right > .fb-home-btn > .fb-home-label {
    color: #34d399;
    text-shadow: 0 0 10px rgba(52,211,153,0.5);
}
[bg="dark"] #footer_bar > .fb-right > .fb-home-btn:hover {
    background: linear-gradient(135deg, rgba(16,185,129,0.35) 0%, rgba(5,150,105,0.2) 100%);
}

[bg="dark"] #fb-settings-menu {
    background: #1a202c;
    border: 1px solid #2d3748;
}

[bg="dark"] #fb-settings-menu > .fb-menu-item {
    color: #e2e8f0;
}

[bg="dark"] #fb-settings-menu > .fb-menu-item:hover {
    background: #2d3748;
}

[bg="dark"] #fb-settings-menu > .fb-menu-separator {
    background: #2d3748;
}

[bg="dark"] #fb-settings-menu > .fb-menu-item.theme-toggle > .fb-theme-switch {
    background: #2b6cb0;
}

[bg="dark"] #fb-login-box {
    background: #1a202c;
}

[bg="dark"] #fb-login-box > .fb-login-body {
    background: #1a202c;
    color: #e2e8f0;
}

[bg="dark"] #fb-login-box > .fb-login-body > .fb-login-field > label {
    color: #a0aec0;
}

[bg="dark"] #fb-login-box > .fb-login-body > .fb-login-field > input {
    background: #171923;
    border-color: #2d3748;
    color: #e2e8f0;
}

[bg="dark"] #fb-login-box > .fb-login-body > .fb-login-field > input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49,130,206,0.25);
    background: #1a202c;
}

/* ── PRINTER POPUP OVERLAY ────────────────────────────────────────── */
#fb-printer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    z-index: 9550;
    display: none;
    align-items: center;
    justify-content: center;
}

#fb-printer-overlay.open {
    display: flex;
}

#fb-printer-box {
    width: 780px;
    max-width: 96vw;
    height: 88vh;
    max-height: 88vh;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: login-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

#fb-printer-box > .fb-modal-head {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1a3c5e 0%, #21627b 60%, #2e86ab 100%);
    color: #fff;
    flex-shrink: 0;
}

#fb-printer-box > .fb-modal-head > .fb-mh-icon {
    font-size: 20px;
}

#fb-printer-box > .fb-modal-head > .fb-mh-title {
    font-size: 15px;
    font-weight: 700;
}

#fb-printer-box > .fb-modal-head > .fb-mh-close {
    margin-left: auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

#fb-printer-box > .fb-modal-head > .fb-mh-close:hover {
    background: rgba(255,60,60,0.5);
}

#fb-printer-box > .fb-modal-body {
    padding: 16px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.printer-section {
    border-radius: 10px;
    padding: 12px;
}

/* Full-height section (fills body) */
.printer-section-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.printer-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 10px;
}

.btn-add-printer {
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11.5px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-add-printer:hover {
    opacity: 0.85;
}

.printer-list-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
    padding-right: 4px;
    min-height: 0;
}

.printer-list-box::-webkit-scrollbar { width: 4px; }
.printer-list-box::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* Column labels header */
.printer-col-labels {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 8px 8px;
    border-bottom: 1px solid rgba(100,116,139,0.2);
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.printer-col-labels .pcl-index    { width: 24px; text-align: center; }
.printer-col-labels .pcl-nickname { flex: 1; min-width: 105px; padding-left: 4px; }
.printer-col-labels .pcl-name     { flex: 1.25; min-width: 125px; padding-left: 4px; }
.printer-col-labels .pcl-type     { width: 105px; text-align: center; }
.printer-col-labels .pcl-paper    { width: 95px; text-align: center; }
.printer-col-labels .pcl-copies   { width: 56px; text-align: center; }
.printer-col-labels .pcl-del      { width: 34px; }

/* Printer row */
.printer-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 9px;
    flex-shrink: 0;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

/* Row index badge */
.pi-index {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(100,116,139,0.15);
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Printer inputs: Nickname & Printer name */
.pi-nickname,
.pi-name {
    height: 36px;
    padding: 0 11px;
    border-radius: 7px;
    border: 1.5px solid rgba(100,116,139,0.28);
    font-size: 12.5px;
    font-weight: 500;
    outline: none;
    box-sizing: border-box;
    transition: all 0.18s ease;
}
.pi-nickname {
    flex: 1;
    min-width: 105px;
}
.pi-name {
    flex: 1.25;
    min-width: 125px;
}
.pi-nickname:focus,
.pi-name:focus {
    border-color: #2e86ab !important;
    box-shadow: 0 0 0 2px rgba(46,134,171,0.2);
}

/* Printer type select & paper select */
.pi-type-select,
.pi-papper-select {
    height: 36px;
    padding: 0 8px;
    border-radius: 7px;
    border: 1.5px solid rgba(100,116,139,0.28);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: all 0.18s ease;
    color: inherit;
}
.pi-type-select {
    width: 105px;
}
.pi-papper-select {
    width: 95px;
}
.pi-type-select:focus,
.pi-papper-select:focus {
    border-color: #2e86ab !important;
    box-shadow: 0 0 0 2px rgba(46,134,171,0.2);
}

/* Copies input */
.pi-copies {
    width: 56px;
    height: 36px;
    padding: 0 6px;
    border-radius: 7px;
    border: 1.5px solid rgba(100,116,139,0.28);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    outline: none;
    flex-shrink: 0;
    box-sizing: border-box;
    transition: all 0.18s ease;
    -moz-appearance: textfield;
}
.pi-copies::-webkit-inner-spin-button,
.pi-copies::-webkit-outer-spin-button { opacity: 0.8; }
.pi-copies:focus {
    border-color: #2e86ab !important;
    box-shadow: 0 0 0 2px rgba(46,134,171,0.2);
}

/* Delete button */
.printer-item-row .btn-del-printer {
    width: 34px;
    height: 36px;
    border-radius: 7px;
    border: 1px solid rgba(239,68,68,0.25);
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    flex-shrink: 0;
}
.printer-item-row .btn-del-printer:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239,68,68,0.3);
}

/* Empty state */
.printer-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0.35;
    font-size: 13px;
    font-style: italic;
}
.printer-empty span:first-child { font-size: 40px; opacity: 0.6; }

#fb-printer-box > .fb-modal-foot {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.btn-modal-cancel {
    background: #94a3b8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 600;
}

.btn-modal-save {
    background: linear-gradient(135deg, #21627b, #2e86ab);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 700;
}

/* Light / Dark overrides for Printer Modal */
[bg="light"] #fb-printer-box { background: #ffffff; color: #1a3c5e; }
[bg="light"] .printer-section { background: #f8fafc; border: 1px solid #e2e8f0; }
[bg="light"] .printer-item-row { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
[bg="light"] .printer-item-row:hover { background: #f8fafc; border-color: #cbd5e1; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
[bg="light"] .pi-nickname,
[bg="light"] .pi-name { background: #ffffff; border-color: #cbd5e1; color: #1e293b; }
[bg="light"] .pi-type-select { background: #ffffff; border-color: #cbd5e1; color: #1e293b; }
[bg="light"] .pi-papper-select { background: #ffffff; border-color: #cbd5e1; color: #1e293b; }
[bg="light"] .pi-type-select option,
[bg="light"] .pi-papper-select option { background: #ffffff; color: #1e293b; }
[bg="light"] .pi-copies { background: #ffffff; border-color: #cbd5e1; color: #1e293b; }
[bg="light"] #fb-printer-box > .fb-modal-foot { background: #f1f5f9; border-color: #e2e8f0; }

[bg="dark"] #fb-printer-box { background: #1a202c; color: #e2e8f0; }
[bg="dark"] .printer-section { background: #171923; border: 1px solid #2d3748; }
[bg="dark"] .printer-item-row { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
[bg="dark"] .printer-item-row:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); }
[bg="dark"] .pi-index { background: rgba(255,255,255,0.08); color: #94a3b8; }
[bg="dark"] .pi-nickname,
[bg="dark"] .pi-name { background: #1a202c; border-color: #4a5568; color: #e2e8f0; }
[bg="dark"] .pi-type-select { background: #1a202c; border-color: #4a5568; color: #e2e8f0; }
[bg="dark"] .pi-papper-select { background: #1a202c; border-color: #4a5568; color: #e2e8f0; }
[bg="dark"] .pi-type-select option,
[bg="dark"] .pi-papper-select option { background: #1a202c; color: #e2e8f0; }
[bg="dark"] .pi-copies { background: #1a202c; border-color: #4a5568; color: #e2e8f0; }
[bg="dark"] #fb-printer-box > .fb-modal-foot { background: #171923; border-color: #2d3748; }

/* ── Body padding for fixed footer bar ─────────────────────────── */
body {
    padding-bottom: 30px;
}
