/**
 * BOM Academy Portal - Main Stylesheet
 * Responsive, dark-mode-first, CSS variable driven.
 * Addendum D: Code Ready responsive spec.
 *
 * Color system:
 *   --bom-primary:   Main brand color — buttons, links, nav highlights, spinners, toggles
 *   --bom-secondary: Secondary brand color — logo text, hover accents
 *   --bom-accent:    Accent/highlight color — info badges, secondary highlights
 *
 * Breakpoints:
 *   Mobile:  < 768px
 *   Tablet:  768px – 1024px
 *   Desktop: > 1024px
 */

/* ─── CSS Variables ─────────────────────────────────────── */
:root {
    --bom-primary: #0A1F3F;
    --bom-secondary: #C8A951;
    --bom-accent: #1A73E8;
    --bom-success: #28A745;
    --bom-warning: #FFC107;
    --bom-danger: #DC3545;
    --bom-bg: #0D1117;
    --bom-bg-card: #161B22;
    --bom-bg-sidebar: #0D1117;
    --bom-bg-topbar: #161B22;
    --bom-text: #E6EDF3;
    --bom-text-muted: #8B949E;
    --bom-border: #30363D;
    --bom-radius: 12px;
    --bom-radius-sm: 8px;
    --bom-radius-lg: 16px;
    --bom-shadow: 0 4px 24px rgba(0,0,0,0.3);
    --bom-shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --bom-font: 'Inter', system-ui, -apple-system, sans-serif;
    --bom-sidebar-width: 260px;
    --bom-topbar-height: 64px;
    --bom-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Derived: primary with alpha for backgrounds */
    --bom-primary-rgb: 10, 31, 63;
}

.bom-light,
body.bom-light {
    --bom-bg: #F6F8FA;
    --bom-bg-card: #FFFFFF;
    --bom-bg-sidebar: #FFFFFF;
    --bom-bg-topbar: #FFFFFF;
    --bom-text: #1F2328;
    --bom-text-muted: #656D76;
    --bom-border: #D0D7DE;
    --bom-shadow: 0 4px 24px rgba(0,0,0,0.08);
    --bom-shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
}

/* Dark mode — applied via JS toggle on <html> or <body> */
.bom-dark,
body.bom-dark {
    --bom-bg: #0D1117;
    --bom-bg-card: #161B22;
    --bom-bg-sidebar: #0D1117;
    --bom-bg-topbar: #161B22;
    --bom-text: #E6EDF3;
    --bom-text-muted: #8B949E;
    --bom-border: #30363D;
    --bom-shadow: 0 4px 24px rgba(0,0,0,0.3);
    --bom-shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
}

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body.bom-portal-body,
body.bom-login-body {
    font-family: var(--bom-font);
    background: var(--bom-bg);
    color: var(--bom-text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bom-primary); text-decoration: none; transition: color var(--bom-transition); }
a:hover { color: var(--bom-secondary); }

img { max-width: 100%; height: auto; }

/* ─── Portal Layout ─────────────────────────────────────── */
.bom-portal-body {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────── */
.bom-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--bom-sidebar-width);
    height: 100vh;
    background: var(--bom-bg-sidebar);
    border-right: 1px solid var(--bom-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--bom-transition);
    overflow-y: auto;
    overflow-x: hidden;
}

.bom-sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bom-border);
    min-height: 64px;
}

.bom-logo img { height: 60px; width: auto; }
.bom-logo-text { font-size: 1.1rem; font-weight: 700; color: var(--bom-secondary); }

.bom-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--bom-text-muted);
    cursor: pointer;
    padding: 4px;
}

.bom-nav { flex: 1; padding: 12px 0; }

.bom-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--bom-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--bom-transition);
    cursor: pointer;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.bom-nav-item:hover {
    color: var(--bom-text);
    background: rgba(255,255,255,0.05);
}

.bom-nav-item.active {
    color: var(--bom-primary);
    background: rgba(var(--bom-primary-rgb), 0.1);
    border-left-color: var(--bom-primary);
}

.bom-nav-item .material-icons-outlined { font-size: 20px; }

.bom-nav-section {
    padding: 16px 20px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bom-text-muted);
}

.bom-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--bom-border);
}

.bom-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bom-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.bom-avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; cursor: pointer; }

.bom-user-info { display: flex; flex-direction: column; }
.bom-user-name { font-size: 0.85rem; font-weight: 600; color: var(--bom-text); }
.bom-user-role { font-size: 0.72rem; color: var(--bom-text-muted); }

/* ─── Main Content ──────────────────────────────────────── */
.bom-main {
    margin-left: var(--bom-sidebar-width);
    width: calc(100% - var(--bom-sidebar-width));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--bom-transition), width var(--bom-transition);
}

/* ─── Topbar ────────────────────────────────────────────── */
.bom-topbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    height: var(--bom-topbar-height);
    background: #ffc200;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 900;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.bom-topbar-left { display: flex; align-items: center; gap: 12px; }
.bom-topbar-right { display: flex; align-items: center; gap: 8px; }

.bom-hamburger {
    display: none;
    background: none;
    border: none;
    color: #1a1a2e;
    cursor: pointer;
    padding: 4px;
}

.bom-page-title { font-size: 1.15rem; font-weight: 600; color: #1a1a2e; }

.bom-icon-btn {
    position: relative;
    background: none;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: var(--bom-radius-sm);
    color: #1a1a2e;
    cursor: pointer;
    padding: 6px;
    transition: all var(--bom-transition);
}

.bom-icon-btn:hover { color: #000; background: rgba(0,0,0,0.08); }

.bom-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--bom-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.bom-topbar-user { position: relative; }

.bom-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    box-shadow: var(--bom-shadow);
    min-width: 180px;
    padding: 8px 0;
    z-index: 1100;
}

.bom-dropdown.open { display: block; }

.bom-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--bom-text);
    font-size: 0.85rem;
    transition: background var(--bom-transition);
}

.bom-dropdown a:hover { background: rgba(255,255,255,0.05); }
.bom-dropdown hr { border: none; border-top: 1px solid var(--bom-border); margin: 4px 0; }

/* ─── Content Area ──────────────────────────────────────── */
.bom-content {
    flex: 1;
    padding: 24px;
    width: 100%;
}

/* ─── Notification Panel ────────────────────────────────── */
.bom-notification-panel {
    position: fixed;
    top: var(--bom-topbar-height);
    right: 24px;
    width: 380px;
    max-height: 480px;
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    box-shadow: var(--bom-shadow);
    z-index: 1050;
    overflow-y: auto;
}

.bom-notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--bom-border);
}

.bom-notif-header h3 { font-size: 0.95rem; font-weight: 600; }

.bom-text-btn {
    background: none;
    border: none;
    color: var(--bom-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.bom-notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bom-border);
    transition: background var(--bom-transition);
}

.bom-notif-item:hover { background: rgba(255,255,255,0.03); }
.bom-notif-item.unread { background: rgba(var(--bom-primary-rgb), 0.05); }

.bom-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.bom-notif-icon.success { background: rgba(40,167,69,0.15); color: var(--bom-success); }
.bom-notif-icon.warning { background: rgba(255,193,7,0.15); color: var(--bom-warning); }
.bom-notif-icon.info { background: rgba(var(--bom-primary-rgb), 0.15); color: var(--bom-primary); }

.bom-notif-body { flex: 1; }
.bom-notif-title { font-size: 0.85rem; font-weight: 600; }
.bom-notif-msg { font-size: 0.78rem; color: var(--bom-text-muted); margin-top: 2px; }
.bom-notif-time { font-size: 0.7rem; color: var(--bom-text-muted); margin-top: 4px; }

/* ─── Cards ─────────────────────────────────────────────── */
.bom-card {
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    padding: 20px;
    transition: box-shadow var(--bom-transition);
}

.bom-card:hover { box-shadow: var(--bom-shadow-sm); }

.bom-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.bom-card-title { font-size: 0.95rem; font-weight: 600; }

/* ─── Grid Layouts ──────────────────────────────────────── */
.bom-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.bom-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bom-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─── Stat Cards ────────────────────────────────────────── */
.bom-stat-card {
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.bom-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--bom-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.bom-stat-icon.primary { background: rgba(var(--bom-primary-rgb), 0.15); color: var(--bom-primary); }
.bom-stat-icon.success { background: rgba(40,167,69,0.15); color: var(--bom-success); }
.bom-stat-icon.warning { background: rgba(255,193,7,0.15); color: var(--bom-warning); }
.bom-stat-icon.secondary { background: rgba(200,169,81,0.15); color: var(--bom-secondary); }

.bom-stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.bom-stat-label { font-size: 0.78rem; color: var(--bom-text-muted); }

/* ─── Buttons ───────────────────────────────────────────── */
.bom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--bom-radius-sm);
    font-family: var(--bom-font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--bom-transition);
    text-decoration: none;
}

.bom-btn-primary { background: var(--bom-primary); color: var(--bom-primary-contrast, #fff); }
.bom-btn-primary:hover { filter: brightness(0.85); color: var(--bom-primary-contrast, #fff); }

.bom-btn-secondary { background: var(--bom-secondary); color: #fff; }
.bom-btn-secondary:hover { filter: brightness(0.85); }

.bom-btn-accent { background: var(--bom-accent); color: #fff; }
.bom-btn-accent:hover { filter: brightness(0.85); color: #fff; }

.bom-btn-outline {
    background: transparent;
    border: 1px solid var(--bom-border);
    color: var(--bom-text);
}
.bom-btn-outline:hover { background: rgba(255,255,255,0.05); }

.bom-btn-danger { background: var(--bom-danger); color: #fff; }
.bom-btn-danger:hover { background: #c82333; }

.bom-btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.bom-btn-block { width: 100%; }

.bom-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Forms ─────────────────────────────────────────────── */
.bom-form { width: 100%; }

.bom-form-group { margin-bottom: 16px; }

.bom-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bom-text-muted);
    margin-bottom: 6px;
}

.bom-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bom-bg);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius-sm);
    padding: 0 12px;
    transition: border-color var(--bom-transition);
}

.bom-input-wrap:focus-within { border-color: var(--bom-primary); }

.bom-input-wrap .material-icons-outlined {
    font-size: 18px;
    color: var(--bom-text-muted);
    margin-right: 8px;
}

.bom-input-wrap input,
.bom-input-wrap select {
    flex: 1;
    background: none;
    border: none;
    color: var(--bom-text);
    font-family: var(--bom-font);
    font-size: 0.9rem;
    padding: 10px 0;
    outline: none;
}

.bom-input-wrap input::placeholder { color: var(--bom-text-muted); }

.bom-form-group input:not(.bom-input-wrap input),
.bom-form-group select:not(.bom-input-wrap select),
.bom-form-group textarea {
    width: 100%;
    background: var(--bom-bg);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius-sm);
    color: var(--bom-text);
    font-family: var(--bom-font);
    font-size: 0.9rem;
    padding: 10px 12px;
    outline: none;
    transition: border-color var(--bom-transition);
}

.bom-form-group input:focus,
.bom-form-group select:focus,
.bom-form-group textarea:focus { border-color: var(--bom-primary); }

.bom-form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.bom-form-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.bom-form-error {
    background: rgba(220,53,69,0.1);
    border: 1px solid var(--bom-danger);
    border-radius: var(--bom-radius-sm);
    color: var(--bom-danger);
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.bom-form-success {
    background: rgba(40,167,69,0.1);
    border: 1px solid var(--bom-success);
    border-radius: var(--bom-radius-sm);
    color: var(--bom-success);
    padding: 10px 14px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.bom-toggle-pw {
    background: none;
    border: none;
    color: var(--bom-text-muted);
    cursor: pointer;
    padding: 4px;
}

.bom-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--bom-text-muted);
    cursor: pointer;
}

.bom-link { color: var(--bom-primary); font-size: 0.85rem; }

/* ─── Tables ────────────────────────────────────────────── */
.bom-table-wrap { overflow-x: auto; border-radius: var(--bom-radius); border: 1px solid var(--bom-border); }

.bom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bom-table th {
    background: var(--bom-bg);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--bom-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--bom-border);
}

.bom-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bom-border);
}

.bom-table tr:last-child td { border-bottom: none; }
.bom-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ─── Status Badges ─────────────────────────────────────── */
.bom-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.bom-status-active { background: rgba(40,167,69,0.15); color: var(--bom-success); }
.bom-status-inactive { background: rgba(139,148,158,0.15); color: var(--bom-text-muted); }
.bom-status-pending { background: rgba(255,193,7,0.15); color: var(--bom-warning); }
.bom-status-cancelled { background: rgba(220,53,69,0.15); color: var(--bom-danger); }

/* ─── Spinners ──────────────────────────────────────────── */
.bom-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bom-border);
    border-top-color: var(--bom-primary);
    border-radius: 50%;
    animation: bom-spin 0.8s linear infinite;
}

.bom-spinner-sm {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bom-spin 0.8s linear infinite;
    display: inline-block;
}

@keyframes bom-spin { to { transform: rotate(360deg); } }

.bom-loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
    color: var(--bom-text-muted);
}

/* ─── Toast Notifications ───────────────────────────────── */
.bom-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.bom-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius-sm);
    box-shadow: var(--bom-shadow);
    font-size: 0.85rem;
    min-width: 280px;
    max-width: 400px;
    animation: bom-toast-in 0.3s ease;
}

.bom-toast.success { border-left: 3px solid var(--bom-success); }
.bom-toast.warning { border-left: 3px solid var(--bom-warning); }
.bom-toast.error { border-left: 3px solid var(--bom-danger); }
.bom-toast.info { border-left: 3px solid var(--bom-primary); }

@keyframes bom-toast-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Login Page ────────────────────────────────────────── */
.bom-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.bom-login-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bom-login-card {
    width: 100%;
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius-lg);
    padding: 32px;
    box-shadow: var(--bom-shadow);
}

.bom-login-header {
    text-align: center;
    margin-bottom: 24px;
}

.bom-login-logo { height: 60px; margin-bottom: 12px; }
.bom-login-header h1 { font-size: 1.3rem; font-weight: 700; }
.bom-login-subtitle { color: var(--bom-text-muted); font-size: 0.9rem; }

.bom-login-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--bom-text-muted);
}

.bom-login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--bom-text-muted);
}

.bom-login-footer a { color: var(--bom-text-muted); }
.bom-login-footer a:hover { color: var(--bom-secondary); }

/* ─── Footer ────────────────────────────────────────────── */
.bom-footer {
    padding: 20px 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--bom-text-muted);
    border-top: 1px solid var(--bom-border);
    margin-top: auto;
}

.bom-footer a { color: var(--bom-text-muted); }
.bom-footer a:hover { color: var(--bom-secondary); }

/* ─── Empty States ──────────────────────────────────────── */
.bom-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--bom-text-muted);
    font-size: 0.9rem;
}

.bom-empty .material-icons-outlined { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.4; }

/* ─── Overlay ──────────────────────────────────────────── */
.bom-overlay {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.bom-overlay.active { display: block; }

/* ─── Responsive: Tablet ────────────────────────────────── */
@media (max-width: 1024px) {
    .bom-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .bom-grid-3 { grid-template-columns: repeat(2, 1fr); }

    .bom-notification-panel { width: 340px; right: 16px; }
}

/* ─── Responsive: Mobile ────────────────────────────────── */
@media (max-width: 768px) {
    :root { --bom-sidebar-width: 280px; }

    .bom-sidebar {
        transform: translateX(-100%);
    }

    .bom-sidebar.open {
        transform: translateX(0);
    }

    .bom-sidebar-close { display: block; }
    .bom-hamburger { display: block; }

    .bom-main {
        margin-left: 0;
        width: 100%;
    }

    .bom-content { padding: 16px; }

    .bom-grid-2,
    .bom-grid-3,
    .bom-grid-4 { grid-template-columns: 1fr; }

    .bom-form-row-2col { grid-template-columns: 1fr; }

    .bom-notification-panel {
        position: fixed;
        top: var(--bom-topbar-height);
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 0 0 var(--bom-radius) var(--bom-radius);
    }

    .bom-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .bom-toast { min-width: auto; max-width: 100%; }

    .bom-page-title { font-size: 1rem; }

    .bom-topbar { padding: 0 16px; }

    .bom-stat-card { padding: 16px; }
    .bom-stat-value { font-size: 1.25rem; }

    .bom-login-card { padding: 24px; }
}

/* ─── Responsive: Small Mobile ──────────────────────────── */
@media (max-width: 480px) {
    .bom-login-card { padding: 20px 16px; border-radius: var(--bom-radius); }
    .bom-login-header h1 { font-size: 1.1rem; }
    .bom-btn { padding: 10px 16px; font-size: 0.8rem; }
}

/* ─── Print ─────────────────────────────────────────────── */
@media print {
    .bom-sidebar,
    .bom-topbar,
    .bom-footer,
    .bom-toast-container { display: none !important; }

    .bom-main { margin-left: 0 !important; width: 100% !important; }
    .bom-content { padding: 0 !important; }
}

/* ─── Toggle Switch ──────────────────────────────── */
.bom-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.bom-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bom-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bom-border);
    transition: 0.3s;
    border-radius: 26px;
}

.bom-toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.bom-toggle input:checked + .bom-toggle-slider {
    background-color: var(--bom-primary);
}

.bom-toggle input:checked + .bom-toggle-slider::before {
    transform: translateX(22px);
    background-color: var(--bom-primary-contrast, #fff);
}

/* ─── Form Input ─────────────────────────────────── */
.bom-input {
    padding: 8px 12px;
    border: 1px solid var(--bom-border);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--bom-bg);
    color: var(--bom-text);
    outline: none;
    transition: border-color 0.2s;
}

.bom-input:focus {
    border-color: var(--bom-primary);
    box-shadow: 0 0 0 3px rgba(var(--bom-primary-rgb), 0.15);
}

/* ─── Progress Bar ──────────────────────────────── */
.bom-progress {
    height: 8px;
    background: var(--bom-border);
    border-radius: 4px;
    overflow: hidden;
}

.bom-progress-bar {
    height: 100%;
    background: var(--bom-primary);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ─── Tabs ──────────────────────────────────────── */
.bom-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--bom-border);
    margin-bottom: 20px;
}

.bom-tab-item {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bom-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--bom-transition);
}

.bom-tab-item:hover { color: var(--bom-text); }

.bom-tab-item.active {
    color: var(--bom-primary);
    border-bottom-color: var(--bom-primary);
}

/* ─── Chip / Tag ────────────────────────────────── */
.bom-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bom-primary);
    color: var(--bom-primary-contrast, #fff);
}

.bom-chip-outline {
    background: rgba(var(--bom-primary-rgb), 0.12);
    color: var(--bom-primary);
}

/* ─── Tooltip ───────────────────────────────────── */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.72rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    border: 1px solid var(--bom-border);
}

[data-tooltip]:hover::after { opacity: 1; }

/* ─── Modal System ─────────────────────────────── */
.bom-modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.bom-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bom-modal {
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    box-shadow: var(--bom-shadow);
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.bom-modal-overlay.open .bom-modal {
    transform: translateY(0);
}

.bom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--bom-border);
}

.bom-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bom-text);
}

.bom-modal-close {
    background: none;
    border: none;
    color: var(--bom-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background 0.15s;
}

.bom-modal-close:hover {
    background: rgba(var(--bom-primary-rgb), 0.1);
    color: var(--bom-text);
}

.bom-modal-body {
    padding: 20px 24px;
}

.bom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--bom-border);
}

.bom-form-group {
    margin-bottom: 16px;
}

.bom-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bom-text);
    margin-bottom: 6px;
}

.bom-form-group input,
.bom-form-group select,
.bom-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius-sm);
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.9rem;
    font-family: var(--bom-font);
    outline: none;
    transition: border-color 0.2s;
}

.bom-form-group input:focus,
.bom-form-group select:focus,
.bom-form-group textarea:focus {
    border-color: var(--bom-primary);
    box-shadow: 0 0 0 3px rgba(var(--bom-primary-rgb), 0.15);
}

.bom-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 480px) {
    .bom-form-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Bug Report FAB ───────────────────────────── */
.bom-bug-report-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bom-danger, #DC3545);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 8000;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bom-bug-report-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.bom-bug-report-fab .material-icons-outlined {
    font-size: 26px;
}

/* ─── Bug Report Modal ─────────────────────────── */
.bom-bug-modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.bom-bug-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bom-bug-modal {
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    box-shadow: var(--bom-shadow);
    width: 92%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.bom-bug-modal-overlay.open .bom-bug-modal {
    transform: translateY(0);
}

.bom-bug-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--bom-border);
}

.bom-bug-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bom-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.bom-bug-modal-header h3 .material-icons-outlined {
    color: var(--bom-danger, #DC3545);
    font-size: 22px;
}

.bom-bug-modal-body {
    padding: 20px 24px;
}

.bom-bug-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--bom-border);
}

.bom-bug-screenshot-preview {
    margin-top: 12px;
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius-sm);
    overflow: hidden;
    max-height: 200px;
    position: relative;
}

.bom-bug-screenshot-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.bom-bug-screenshot-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bom-text-muted);
    margin-top: 16px;
    margin-bottom: 4px;
}

.bom-bug-screenshot-label .material-icons-outlined {
    font-size: 18px;
}

.bom-bug-capturing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--bom-text-muted);
    font-size: 0.9rem;
}

.bom-bug-severity-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bom-bug-severity-btn {
    padding: 6px 14px;
    border-radius: 100px;
    border: 2px solid var(--bom-border);
    background: transparent;
    color: var(--bom-text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.bom-bug-severity-btn:hover {
    border-color: var(--bom-text-muted);
}

.bom-bug-severity-btn.active-low {
    border-color: #28a745;
    background: rgba(40,167,69,0.1);
    color: #28a745;
}

.bom-bug-severity-btn.active-medium {
    border-color: #ffc107;
    background: rgba(255,193,7,0.1);
    color: #d4a106;
}

.bom-bug-severity-btn.active-high {
    border-color: #fd7e14;
    background: rgba(253,126,20,0.1);
    color: #fd7e14;
}

.bom-bug-severity-btn.active-critical {
    border-color: #dc3545;
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

@media (max-width: 768px) {
    .bom-bug-report-fab {
        bottom: 16px;
        right: 16px;
        width: 46px;
        height: 46px;
    }

    .bom-bug-report-fab .material-icons-outlined {
        font-size: 22px;
    }
}

/* ─── Impersonation Banner ─────────────────────── */
.bom-impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(220,53,69,0.4);
    animation: bom-impersonate-pulse 3s ease-in-out infinite;
}

@keyframes bom-impersonate-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.bom-impersonation-banner .material-icons-outlined {
    font-size: 20px;
}

.bom-impersonation-banner .bom-impersonate-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bom-impersonation-banner .bom-impersonate-user-name {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bom-impersonation-banner .bom-impersonate-role {
    opacity: 0.85;
    font-weight: 400;
    font-size: 0.82rem;
}

.bom-impersonation-banner .bom-btn-switch-back {
    background: #fff;
    color: #dc3545;
    border: none;
    padding: 5px 16px;
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bom-impersonation-banner .bom-btn-switch-back:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.bom-impersonation-banner .bom-btn-switch-back .material-icons-outlined {
    font-size: 16px;
}

/* Push portal content down when impersonation banner is active */
body.bom-impersonating .bom-sidebar {
    top: 40px;
    height: calc(100vh - 40px);
}

body.bom-impersonating .bom-main {
    padding-top: 40px;
}

body.bom-impersonating .bom-bug-report-fab {
    bottom: 24px;
}

/* ─── Impersonation User Picker Modal ──────────── */
.bom-impersonate-search {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--bom-border);
    border-radius: 6px;
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.9rem;
    font-family: var(--bom-font);
    outline: none;
}

.bom-impersonate-search:focus {
    border-color: var(--bom-primary);
}

.bom-impersonate-search-wrap {
    position: relative;
    margin-bottom: 12px;
}

.bom-impersonate-search-wrap .material-icons-outlined {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--bom-text-muted);
    pointer-events: none;
}

.bom-impersonate-role-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bom-impersonate-role-btn {
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--bom-border);
    background: transparent;
    color: var(--bom-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.bom-impersonate-role-btn:hover {
    border-color: var(--bom-primary);
    color: var(--bom-primary);
}

.bom-impersonate-role-btn.active {
    background: var(--bom-primary);
    color: var(--bom-primary-contrast);
    border-color: var(--bom-primary);
}

.bom-impersonate-user-list {
    max-height: 360px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bom-impersonate-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.bom-impersonate-user-item:hover {
    background: rgba(var(--bom-primary-rgb), 0.08);
    border-color: rgba(var(--bom-primary-rgb), 0.2);
}

.bom-impersonate-user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.bom-impersonate-user-item .bom-impersonate-user-details {
    flex: 1;
    min-width: 0;
}

.bom-impersonate-user-item .bom-impersonate-user-details .name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--bom-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bom-impersonate-user-item .bom-impersonate-user-details .meta {
    font-size: 0.78rem;
    color: var(--bom-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bom-impersonate-user-item .bom-impersonate-login-btn {
    padding: 5px 14px;
    border-radius: 6px;
    background: var(--bom-primary);
    color: var(--bom-primary-contrast);
    border: none;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: filter 0.15s;
}

.bom-impersonate-user-item .bom-impersonate-login-btn:hover {
    filter: brightness(1.1);
}

.bom-impersonate-user-item .bom-impersonate-login-btn .material-icons-outlined {
    font-size: 16px;
}

.bom-impersonate-empty {
    text-align: center;
    padding: 24px;
    color: var(--bom-text-muted);
    font-size: 0.88rem;
}

.bom-impersonate-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 10px;
    color: var(--bom-text-muted);
}

/* ─── Topbar Impersonate Button (Super Admin) ──── */
.bom-topbar-impersonate-btn {
    background: none;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a2e;
    transition: background 0.15s;
}

.bom-topbar-impersonate-btn:hover {
    background: rgba(0,0,0,0.08);
}

.bom-topbar-impersonate-btn .material-icons-outlined {
    font-size: 22px;
}

/* ═══════════════════════════════════════════════════════
 *  MESSAGING SYSTEM
 * ═══════════════════════════════════════════════════════ */

.bom-msg-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 520px;
    border: 1px solid var(--bom-border);
    border-radius: var(--bom-radius);
    overflow: hidden;
    background: var(--bom-bg);
}

.bom-msg-sidebar {
    border-right: 1px solid var(--bom-border);
    background: var(--bom-bg-card);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bom-msg-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--bom-border);
}

.bom-msg-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.bom-msg-search {
    margin: 12px 16px;
    padding: 8px 12px;
    border: 1px solid var(--bom-border);
    border-radius: 8px;
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.85rem;
    width: calc(100% - 32px);
}

.bom-msg-thread-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.bom-msg-thread-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--bom-border);
    position: relative;
    transition: background 0.15s;
}

.bom-msg-thread-item:hover {
    background: var(--bom-bg);
}

.bom-msg-thread-item.active {
    background: rgba(37, 99, 235, 0.08);
    border-left: 3px solid var(--bom-accent);
}

.bom-msg-thread-item.unread {
    background: rgba(37, 99, 235, 0.04);
}

.bom-msg-thread-item.unread .bom-msg-thread-name,
.bom-msg-thread-item.unread .bom-msg-thread-subject {
    font-weight: 600;
}

.bom-msg-thread-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.bom-msg-thread-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--bom-text);
}

.bom-msg-thread-time {
    font-size: 0.75rem;
    color: var(--bom-text-muted);
}

.bom-msg-thread-subject {
    font-size: 0.82rem;
    color: var(--bom-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bom-msg-thread-preview {
    font-size: 0.78rem;
    color: var(--bom-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bom-msg-unread-dot {
    position: absolute;
    top: 16px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bom-accent);
}

.bom-msg-empty-list {
    padding: 24px 16px;
    text-align: center;
    color: var(--bom-text-muted);
    font-size: 0.85rem;
}

/* --- Main Area --- */

.bom-msg-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bom-msg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px;
    color: var(--bom-text-muted);
}

.bom-msg-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bom-border);
    background: var(--bom-bg-card);
}

.bom-msg-thread-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.bom-msg-thread-participants {
    font-size: 0.78rem;
    color: var(--bom-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Message Bubbles --- */

.bom-msg-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bom-msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.bom-msg-bubble.theirs {
    align-self: flex-start;
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-bottom-left-radius: 4px;
}

.bom-msg-bubble.mine {
    align-self: flex-end;
    background: var(--bom-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bom-msg-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.bom-msg-bubble-header strong {
    font-size: 0.8rem;
}

.bom-msg-bubble.mine .bom-msg-bubble-header strong {
    color: rgba(255,255,255,0.9);
}

.bom-msg-bubble-time {
    font-size: 0.72rem;
    opacity: 0.7;
}

.bom-msg-bubble-body {
    word-wrap: break-word;
}

.bom-msg-bubble-body p {
    margin: 0 0 4px;
}

/* --- Reply Bar --- */

.bom-msg-reply-bar {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--bom-border);
    background: var(--bom-bg-card);
    align-items: flex-end;
}

.bom-msg-reply-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--bom-border);
    border-radius: 10px;
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 120px;
}

.bom-msg-reply-input:focus {
    outline: none;
    border-color: var(--bom-accent);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

/* --- Compose View --- */

.bom-msg-compose {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.bom-msg-compose-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bom-msg-compose-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

.bom-msg-compose-select,
.bom-msg-compose-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--bom-border);
    border-radius: 8px;
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.88rem;
    font-family: inherit;
}

.bom-msg-compose-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--bom-border);
    border-radius: 8px;
    background: var(--bom-bg);
    color: var(--bom-text);
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.bom-msg-compose-textarea:focus,
.bom-msg-compose-select:focus,
.bom-msg-compose-input:focus {
    outline: none;
    border-color: var(--bom-accent);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.bom-msg-compose-preview {
    padding: 12px 16px;
    background: var(--bom-bg-card);
    border: 1px solid var(--bom-border);
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bom-msg-compose-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.bom-msg-merge-tags {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--bom-text-muted);
}

.bom-msg-merge-tags code {
    background: var(--bom-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    border: 1px solid var(--bom-border);
}

/* --- Session Picker --- */

.bom-msg-session-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--bom-border);
    border-radius: 8px;
}

.bom-msg-session-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--bom-border);
    transition: background 0.15s;
}

.bom-msg-session-item:last-child {
    border-bottom: none;
}

.bom-msg-session-item:hover {
    background: var(--bom-bg);
}

.bom-msg-session-item input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.bom-msg-session-item div {
    display: flex;
    flex-direction: column;
}

.bom-msg-session-item strong {
    font-size: 0.85rem;
}

.bom-msg-session-item span {
    font-size: 0.78rem;
    color: var(--bom-text-muted);
}

/* --- Custom User Search --- */

.bom-msg-user-results {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid var(--bom-border);
    border-radius: 8px;
    margin-top: 6px;
}

.bom-msg-user-result {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--bom-border);
    font-size: 0.85rem;
    transition: background 0.15s;
}

.bom-msg-user-result:last-child {
    border-bottom: none;
}

.bom-msg-user-result:hover {
    background: var(--bom-bg);
}

.bom-msg-selected-users {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.bom-msg-selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bom-accent);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
}

.bom-msg-remove-tag {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.8;
}

.bom-msg-remove-tag:hover {
    opacity: 1;
}

/* --- Unread Badge --- */

.bom-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--bom-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: auto;
}

/* --- Spin Animation --- */

@keyframes bom-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bom-spin {
    animation: bom-spin 1s linear infinite;
}

/* --- Messaging Responsive --- */

@media (max-width: 768px) {
    .bom-msg-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .bom-msg-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--bom-border);
        max-height: 300px;
    }

    .bom-msg-bubble {
        max-width: 90%;
    }

    .bom-msg-compose-actions {
        flex-direction: column;
    }
}
