/*
 * BCVWDConnect — Main Stylesheet
 *
 * Theme Name:        BCVWDConnect
 * Theme URI:         https://bcvwd.gov
 * Author:            AquilaNera Global
 * Author URI:        https://aquileranera.com
 * Description:       Custom Employee Intranet Portal Designed for Beaumont-Cherry Valley Water District by AquilaNera Global. Role-based access, modular design, board portal, full audit logging and comprehensive staff communication tools. Mobile-first, PWA-ready.
  * Version:           1.6.1
 * Requires at least: 6.0
 * Tested up to:      6.7
 * Requires PHP:      8.0
 * License:           Proprietary
 * License URI:       Private — Beaumont-Cherry Valley Water District
 * Text Domain:       bcvwdconnect
 *
 * TABLE OF CONTENTS
 * -----------------
 * 1.  CSS Custom Properties (Design Tokens)
 * 2.  Reset & Base
 * 3.  Typography
 * 4.  Layout — Portal Shell
 * 5.  Layout — Sidebar Navigation
 * 6.  Layout — Top Bar
 * 7.  Layout — Main Content Area
 * 8.  Components — Cards
 * 9.  Components — Buttons
 * 10. Components — Forms & Inputs
 * 11. Components — Badges & Pills
 * 12. Components — Avatars
 * 13. Components — Setting Rows & Toggles
 * 14. Components — Overlays & Modals
 * 15. Components — Status Indicators
 * 16. Utilities
 * 17. Login Screen
 * 18. Responsive — Tablet (768px - 1199px)
 * 19. Responsive — Mobile (below 768px)
 * 20. Responsive — Small Mobile (below 400px)
 * 21. PWA & Print
 *
 * @package    BCVWDConnect
 * @author     AquilaNera Global, LLC
 * @version    1.0.0
 * @since      1.0.0
 */


/* =============================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   All colors, spacing, typography and shadow values defined here.
   Changing a value here updates it everywhere throughout the portal.
   ============================================================================= */

:root {

    /* --- Brand Colors --- */
    --bcvwd-navy:           #0d1b3e;
    --bcvwd-navy-mid:       #1e3a6e;
    --bcvwd-navy-light:     #2d5a8e;
    --bcvwd-blue:           #1e4db7;
    --bcvwd-blue-mid:       #185fa5;
    --bcvwd-blue-light:     #5b9cf6;
    --bcvwd-blue-pale:      #e6f1fb;

    /* --- UI Background Colors --- */
    --bcvwd-bg-page:        #eceef5;
    --bcvwd-bg-card:        #ffffff;
    --bcvwd-bg-secondary:   #f4f6fb;
    --bcvwd-bg-tertiary:    #f9fafb;

    /* --- Text Colors --- */
    --bcvwd-text-primary:   #0d1b3e;
    --bcvwd-text-secondary: #4a5568;
    --bcvwd-text-muted:     #8a9ab8;
    --bcvwd-text-subtle:    #b0bfd4;
    --bcvwd-text-white:     #ffffff;
    --bcvwd-text-light:     #c5d5ea;
    --bcvwd-text-accent:    #a0bae0;

    /* --- Border Colors --- */
    --bcvwd-border:         rgba(0, 0, 0, 0.07);
    --bcvwd-border-mid:     rgba(0, 0, 0, 0.10);
    --bcvwd-border-strong:  rgba(0, 0, 0, 0.15);
    --bcvwd-border-navy:    rgba(255, 255, 255, 0.07);

    /* --- Status Colors --- */
    --bcvwd-success:        #2ecc71;
    --bcvwd-success-bg:     #eaf3de;
    --bcvwd-success-text:   #27500a;
    --bcvwd-warning:        #f5a623;
    --bcvwd-warning-bg:     #faeeda;
    --bcvwd-warning-text:   #633806;
    --bcvwd-danger:         #e24b4a;
    --bcvwd-danger-bg:      #fcebeb;
    --bcvwd-danger-text:    #791f1f;
    --bcvwd-info:           #1e4db7;
    --bcvwd-info-bg:        #e6f1fb;
    --bcvwd-info-text:      #0c447c;

    /* --- Department Colors --- */
    --dept-finance:         #185fa5;
    --dept-finance-bg:      #e6f1fb;
    --dept-hr:              #4a3aaa;
    --dept-hr-bg:           #eeedfe;
    --dept-it:              #0d6e56;
    --dept-it-bg:           #e1f5ee;
    --dept-engineering:     #534ab7;
    --dept-engineering-bg:  #eeedfe;
    --dept-operations:      #993c1d;
    --dept-operations-bg:   #faece7;
    --dept-payroll:         #854f0b;
    --dept-payroll-bg:      #faeeda;
    --dept-cs:              #3b6d11;
    --dept-cs-bg:           #eaf3de;
    --dept-district:        #1e4db7;
    --dept-district-bg:     #e6f1fb;

    /* --- Typography --- */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
    --font-size-xs:   11px;
    --font-size-sm:   13px;
    --font-size-base: 14px;
    --font-size-md:   15px;
    --font-size-lg:   17px;
    --font-size-xl:   20px;
    --font-size-2xl:  22px;
    --font-size-3xl:  26px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --line-height-tight:   1.3;
    --line-height-base:    1.5;
    --line-height-relaxed: 1.65;

    /* --- Spacing Scale --- */
    --space-1:  4px;
    --space-2:  8px;
    --space-3:  14px;
    --space-4:  20px;
    --space-5:  24px;
    --space-6:  28px;
    --space-8:  36px;
    --space-10: 44px;
    --space-12: 56px;

    /* --- Border Radius --- */
    --radius-sm:   5px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-xl:   14px;
    --radius-2xl:  16px;
    --radius-full: 9999px;

    /* --- Shadows --- */
    --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md:    0 2px 8px rgba(0, 0, 0, 0.10);
    --shadow-lg:    0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-focus: 0 0 0 3px rgba(30, 77, 183, 0.15);

    /* --- Transitions --- */
    --transition-fast: 0.1s ease;
    --transition-base: 0.15s ease;
    --transition-slow: 0.25s ease;

    /* --- Portal Layout Dimensions --- */
    --sidebar-width:        250px;
    --sidebar-width-tablet: 220px;
    --topbar-height:        64px;
    --content-max-width:    1400px;
    --mobile-nav-height:    64px;

    /* --- Z-Index Scale --- */
    --z-base:     1;
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-overlay:  300;
    --z-modal:    400;
    --z-toast:    500;
}


/* =============================================================================
   2. RESET & BASE
   ============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--bcvwd-text-secondary);
    background-color: var(--bcvwd-bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/*
 * Full-width override for portal pages.
 *
 * WPEngine default themes (Twenty Twenty-Four, etc.) add padding,
 * max-width constraints and wrapper margins to body and page elements.
 * These rules strip all of that out for BCVWDConnect portal pages
 * so the portal fills the full browser viewport edge to edge.
 *
 * The .bcvwd-portal-page class is added to <body> in every portal template.
 */
body.bcvwd-portal-page,
body.bcvwd-portal-page #page,
body.bcvwd-portal-page #content,
body.bcvwd-portal-page #primary,
body.bcvwd-portal-page main,
body.bcvwd-portal-page .site,
body.bcvwd-portal-page .site-content,
body.bcvwd-portal-page .content-area,
body.bcvwd-portal-page .entry-content,
body.bcvwd-portal-page .wp-site-blocks,
body.bcvwd-portal-page .is-layout-constrained {
    max-width:  100% !important;
    width:      100% !important;
    margin:     0    !important;
    padding:    0    !important;
    float:      none !important;
}

body.bcvwd-portal-page {
    background-color: var(--bcvwd-bg-page);
    min-height: 100vh;
    min-height: 100dvh;
}

ul, ol { list-style: none; }

a {
    color: var(--bcvwd-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--bcvwd-blue-mid); }

img, svg { display: block; max-width: 100%; }

input, button, textarea, select { font-family: inherit; font-size: inherit; }

button { cursor: pointer; border: none; background: transparent; }

textarea { resize: vertical; }

:focus-visible {
    outline: 2px solid var(--bcvwd-blue-light);
    outline-offset: 2px;
}


/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    color: var(--bcvwd-text-primary);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p { line-height: var(--line-height-relaxed); margin-bottom: var(--space-3); }
p:last-child { margin-bottom: 0; }

/* Page title */
.bcvwd-page-title {
    font-size: 24px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-primary);
    line-height: var(--line-height-tight);
}

/* Page subtitle */
.bcvwd-page-sub {
    font-size: 13px;
    color: var(--bcvwd-text-muted);
    margin-top: var(--space-1);
}

/* Section label — uppercase small labels */
.bcvwd-section-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: var(--space-2);
}

/* Card title */
.bcvwd-card-title {
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
}

/* Text truncation */
.bcvwd-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Screen reader only — accessible but visually hidden */
.bcvwd-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* =============================================================================
   4. LAYOUT — PORTAL SHELL
   Main grid: topbar / sidebar / content
   ============================================================================= */

.bcvwd-portal {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    left: 0;
    right: 0;
}

/* Topbar — spans both columns */
.bcvwd-topbar {
    grid-column: 1 / -1;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

/* Sidebar — left column sticky */
.bcvwd-sidebar {
    grid-column: 1;
    grid-row: 2;
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.bcvwd-sidebar::-webkit-scrollbar { width: 4px; }
.bcvwd-sidebar::-webkit-scrollbar-track { background: transparent; }
.bcvwd-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

/* Main content area — right column */
.bcvwd-main {
    grid-column: 2;
    grid-row: 2;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    overflow-x: hidden;
    background-color: var(--bcvwd-bg-page);
    min-height: calc(100vh - var(--topbar-height));
}

/* All direct children of main get horizontal padding and gap,
   except the status bar which spans full width */
.bcvwd-main > *:not(.bcvwd-status-bar) {
    padding-left:  var(--space-4);
    padding-right: var(--space-4);
    box-sizing:    border-box;
}

/* First non-status-bar child gets top padding */
.bcvwd-main > .bcvwd-status-bar + * {
    padding-top: var(--space-4);
}

/* Gap between content children */
.bcvwd-main > *:not(.bcvwd-status-bar):not(:last-child) {
    margin-bottom: var(--space-3);
}

/* If there's no status bar, first child still gets top padding */
.bcvwd-main > *:not(.bcvwd-status-bar):first-child {
    padding-top: var(--space-4);
}


/* =============================================================================
   5. LAYOUT — SIDEBAR NAVIGATION
   ============================================================================= */

.bcvwd-sidebar {
    background-color: var(--bcvwd-navy);
    display: flex;
    flex-direction: column;
}

/* Sidebar hero — city skyline illustration */
.bcvwd-sidebar-hero {
    position: relative;
    height: 80px;
    overflow: hidden;
    flex-shrink: 0;
}

.bcvwd-sidebar-hero img,
.bcvwd-sidebar-hero svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bcvwd-sidebar-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-2) var(--space-3);
    background: linear-gradient(transparent, rgba(13, 27, 62, 0.95));
}

.bcvwd-sidebar-tagline {
    font-size: var(--font-size-xs);
    color: var(--bcvwd-blue-light);
    letter-spacing: 0.4px;
}

/* Role badge — logged-in user identity */
.bcvwd-role-badge {
    margin: var(--space-2) var(--space-3) var(--space-3);
    background: rgba(91, 156, 246, 0.1);
    border: 0.5px solid rgba(91, 156, 246, 0.25);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.bcvwd-role-badge-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bcvwd-navy-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    flex-shrink: 0;
    overflow: hidden;
}

.bcvwd-role-badge-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bcvwd-role-badge-name {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    line-height: 1.2;
}

.bcvwd-role-badge-dept {
    font-size: 11px;
    color: var(--bcvwd-blue-light);
}

/* Navigation group */
.bcvwd-nav-group { padding: var(--space-2) 0; }

/* Navigation section label */
.bcvwd-nav-label {
    font-size: 10px;
    color: #3a5a7a;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: var(--space-2) var(--space-3) var(--space-1);
    font-weight: 600;
}

/* Navigation item */
.bcvwd-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 9px var(--space-3);
    font-size: 13px;
    color: #6a8aaa;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
    min-height: 40px;
}

.bcvwd-nav-item:hover {
    background-color: rgba(91, 156, 246, 0.06);
    color: #a0bae0;
    border-left-color: rgba(91, 156, 246, 0.3);
}

.bcvwd-nav-item.active,
.bcvwd-nav-item[aria-current="page"] {
    color: var(--bcvwd-text-white);
    background-color: rgba(91, 156, 246, 0.1);
    border-left-color: var(--bcvwd-blue-light);
}

/* Navigation item icon */
.bcvwd-nav-icon {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Navigation badge */
.bcvwd-nav-badge {
    margin-left: auto;
    background: var(--bcvwd-blue);
    color: #c5d5ea;
    font-size: 9px;
    border-radius: var(--radius-md);
    padding: 1px 5px;
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

.bcvwd-nav-badge.alert {
    background: var(--bcvwd-danger);
    color: var(--bcvwd-text-white);
}

/* Sidebar footer */
.bcvwd-sidebar-footer {
    margin-top: auto;
    padding: var(--space-2) var(--space-3);
    border-top: 0.5px solid rgba(255, 255, 255, 0.05);
    font-size: 9px;
    color: #2e4a6a;
}


/* =============================================================================
   6. LAYOUT — TOP BAR
   ============================================================================= */

.bcvwd-topbar {
    background-color: var(--bcvwd-navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    height: var(--topbar-height);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

/* Logo */
.bcvwd-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    flex-shrink: 0;
}

.bcvwd-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bcvwd-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bcvwd-logo-mark img,
.bcvwd-logo-mark svg { width: 20px; height: 20px; }

.bcvwd-logo-text {
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    letter-spacing: 0.2px;
}

.bcvwd-logo-text span { color: var(--bcvwd-blue-light); }

/* Search */
.bcvwd-topbar-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-full);
    padding: 5px var(--space-3);
    flex: 0 1 320px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.bcvwd-topbar-search:hover { background: rgba(255, 255, 255, 0.1); }

.bcvwd-topbar-search span {
    font-size: var(--font-size-sm);
    color: #5a7a9a;
}

/* Top bar right */
.bcvwd-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Notification icon */
.bcvwd-topbar-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background-color var(--transition-fast);
}

.bcvwd-topbar-icon:hover { background: rgba(255, 255, 255, 0.12); }

.bcvwd-notification-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--bcvwd-warning);
    position: absolute;
    top: 4px;
    right: 4px;
    border: 1.5px solid var(--bcvwd-navy);
}

/* User chip */
.bcvwd-user-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-full);
    padding: 4px var(--space-3) 4px 4px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    text-decoration: none;
}

.bcvwd-user-chip:hover { background: rgba(255, 255, 255, 0.12); }

.bcvwd-user-chip-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bcvwd-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    overflow: hidden;
    flex-shrink: 0;
}

.bcvwd-user-chip-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bcvwd-user-chip-name {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: #c5d5ea;
    line-height: 1.2;
}

.bcvwd-user-chip-dept {
    font-size: 10px;
    color: var(--bcvwd-blue-light);
}

/* Staff / Board portal toggle — GM and Board Secretary only */
.bcvwd-portal-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.bcvwd-portal-toggle-btn {
    padding: 5px var(--space-3);
    font-size: var(--font-size-xs);
    color: #7a93b8;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
    min-height: 30px;
}

.bcvwd-portal-toggle-btn.active {
    background: var(--bcvwd-blue);
    color: var(--bcvwd-text-white);
}

/* Hamburger menu — mobile only, hidden on desktop */
.bcvwd-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.07);
    border: none;
    cursor: pointer;
    color: var(--bcvwd-text-white);
}


/* =============================================================================
   7. LAYOUT — MAIN CONTENT AREA
   ============================================================================= */

/* Page header row */
.bcvwd-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.bcvwd-page-header-left { flex: 1; min-width: 0; }

.bcvwd-page-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* Content grids */
.bcvwd-content-grid              { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-4); align-items: start; }
.bcvwd-content-grid--wide-right  { grid-template-columns: 1fr 340px; }
.bcvwd-content-grid--narrow-right { grid-template-columns: 1fr 260px; }
.bcvwd-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.bcvwd-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.bcvwd-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-3); }

/* Stack and row layout helpers */
.bcvwd-stack       { display: flex; flex-direction: column; gap: var(--space-4); }
.bcvwd-stack--tight { gap: var(--space-3); }
.bcvwd-row         { display: flex; align-items: center; gap: var(--space-2); }
.bcvwd-row--between { justify-content: space-between; }
.bcvwd-row--end    { justify-content: flex-end; }

/* Office / Weather status bar — below topbar, IT controlled */
.bcvwd-status-bar {
    background: var(--bcvwd-navy-mid);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    height: 36px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.bcvwd-status-bar-left { display: flex; align-items: center; gap: var(--space-2); }

.bcvwd-status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.bcvwd-status-dot--open   { background: var(--bcvwd-success); }
.bcvwd-status-dot--closed { background: var(--bcvwd-danger); }
.bcvwd-status-dot--remote { background: var(--bcvwd-warning); }

.bcvwd-status-text { font-size: var(--font-size-sm); color: #a0bae0; }
.bcvwd-status-text strong { color: var(--bcvwd-text-white); font-weight: var(--font-weight-medium); }
.bcvwd-status-bar-right { font-size: var(--font-size-xs); color: #5a7a9a; }


/* =============================================================================
   8. COMPONENTS — CARDS
   ============================================================================= */

.bcvwd-card {
    background: var(--bcvwd-bg-card);
    border-radius: var(--radius-xl);
    border: 0.5px solid var(--bcvwd-border);
    padding: var(--space-4) var(--space-5);
    box-shadow: 0 1px 4px rgba(13,27,62,0.05);
}

.bcvwd-card--flush   { padding: 0; overflow: hidden; }
.bcvwd-card--dark    { background: var(--bcvwd-navy); border-color: rgba(255, 255, 255, 0.05); }

/* Stat card */
.bcvwd-stat-card {
    background: var(--bcvwd-bg-card);
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--bcvwd-border);
    border-left: 3px solid var(--bcvwd-blue);
    padding: var(--space-4);
    box-shadow: 0 1px 4px rgba(13,27,62,0.05);
    transition: box-shadow 0.15s;
}

.bcvwd-stat-label  { font-size: 13px; color: var(--bcvwd-text-muted); margin-bottom: var(--space-2); }
.bcvwd-stat-value  { font-size: 32px; font-weight: var(--font-weight-medium); color: var(--bcvwd-text-primary); line-height: 1; }
.bcvwd-stat-sub    { font-size: var(--font-size-xs); color: var(--bcvwd-text-muted); margin-top: var(--space-1); display: flex; align-items: center; gap: var(--space-1); }

/* Card header */
.bcvwd-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.bcvwd-card-action {
    font-size: var(--font-size-sm);
    color: var(--bcvwd-blue);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.bcvwd-card-action:hover { color: var(--bcvwd-blue-mid); }

.bcvwd-card-divider { height: 0.5px; background: var(--bcvwd-border); margin: var(--space-3) 0; }

/* Hero banner */
.bcvwd-hero-banner {
    border-radius: var(--radius-2xl);
    overflow: hidden;
    position: relative;
    background: var(--bcvwd-navy);
    min-height: 120px;
    display: flex;
    align-items: center;
}

.bcvwd-hero-bg { position: absolute; inset: 0; overflow: hidden; }
.bcvwd-hero-bg img, .bcvwd-hero-bg svg { width: 100%; height: 100%; object-fit: cover; }
.bcvwd-hero-overlay { position: absolute; inset: 0; background: rgba(13, 27, 62, 0.6); }

.bcvwd-hero-content {
    position: relative;
    z-index: var(--z-base);
    padding: 0 var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    width: 100%;
}


/* =============================================================================
   9. COMPONENTS — BUTTONS
   ============================================================================= */

.bcvwd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 9px var(--space-4);
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    border: 0.5px solid var(--bcvwd-border-mid);
    background: var(--bcvwd-bg-card);
    color: var(--bcvwd-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
    min-height: 38px;
}

.bcvwd-btn:hover   { background: var(--bcvwd-bg-secondary); border-color: var(--bcvwd-border-strong); }
.bcvwd-btn:active  { transform: scale(0.98); }
.bcvwd-btn:focus-visible { box-shadow: var(--shadow-focus); }

.bcvwd-btn--primary { background: var(--bcvwd-blue);    color: var(--bcvwd-text-white); border-color: var(--bcvwd-blue); }
.bcvwd-btn--primary:hover { background: var(--bcvwd-blue-mid); border-color: var(--bcvwd-blue-mid); }

.bcvwd-btn--danger  { background: var(--bcvwd-danger);  color: var(--bcvwd-text-white); border-color: var(--bcvwd-danger); }
.bcvwd-btn--danger:hover { background: #c43a39; border-color: #c43a39; }

.bcvwd-btn--success { background: var(--bcvwd-success); color: var(--bcvwd-text-white); border-color: var(--bcvwd-success); }

.bcvwd-btn--ghost {
    background: transparent;
    color: var(--bcvwd-blue);
    border-color: rgba(30, 77, 183, 0.25);
}
.bcvwd-btn--ghost:hover { background: var(--bcvwd-blue-pale); }

.bcvwd-btn--dark-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #a0bae0;
    border-color: rgba(255, 255, 255, 0.1);
}
.bcvwd-btn--dark-ghost:hover { background: rgba(255, 255, 255, 0.14); }

.bcvwd-btn--sm   { padding: 4px var(--space-2); font-size: var(--font-size-xs); min-height: 28px; }
.bcvwd-btn--lg   { padding: var(--space-3) var(--space-5); font-size: var(--font-size-md); min-height: 44px; }
.bcvwd-btn--full { width: 100%; }

.bcvwd-btn:disabled,
.bcvwd-btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }


/* =============================================================================
   10. COMPONENTS — FORMS & INPUTS
   All form elements use min-height: 44px for mobile touch targets.
   ============================================================================= */

.bcvwd-input-wrap { position: relative; }

.bcvwd-input-icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.bcvwd-input-icon-right {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--bcvwd-blue);
}

/* Text input */
.bcvwd-input {
    width: 100%;
    background: var(--bcvwd-bg-secondary);
    border: 0.5px solid var(--bcvwd-border-mid);
    border-radius: var(--radius-md);
    padding: 10px var(--space-3);
    font-size: 14px;
    color: var(--bcvwd-text-primary);
    outline: none;
    transition: all var(--transition-base);
    min-height: 42px;
}

.bcvwd-input--with-icon  { padding-left: 36px; }
.bcvwd-input--with-right { padding-right: 60px; }

.bcvwd-input:hover { border-color: var(--bcvwd-border-strong); }
.bcvwd-input:focus { border-color: var(--bcvwd-blue); background: var(--bcvwd-bg-card); box-shadow: var(--shadow-focus); }
.bcvwd-input::placeholder { color: var(--bcvwd-text-subtle); }
.bcvwd-input.error { border-color: var(--bcvwd-danger); box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.1); }

/* Select */
.bcvwd-select {
    width: 100%;
    background: var(--bcvwd-bg-secondary);
    border: 0.5px solid var(--bcvwd-border-mid);
    border-radius: var(--radius-md);
    padding: 8px var(--space-3);
    font-size: var(--font-size-base);
    color: var(--bcvwd-text-primary);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    min-height: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a9ab8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.bcvwd-select:focus { border-color: var(--bcvwd-blue); box-shadow: var(--shadow-focus); }

/* Textarea */
.bcvwd-textarea {
    width: 100%;
    background: var(--bcvwd-bg-secondary);
    border: 0.5px solid var(--bcvwd-border-mid);
    border-radius: var(--radius-md);
    padding: 9px var(--space-3);
    font-size: var(--font-size-base);
    color: var(--bcvwd-text-primary);
    outline: none;
    transition: all var(--transition-base);
    resize: vertical;
    min-height: 80px;
    line-height: var(--line-height-relaxed);
}

.bcvwd-textarea:focus { border-color: var(--bcvwd-blue); background: var(--bcvwd-bg-card); box-shadow: var(--shadow-focus); }
.bcvwd-textarea::placeholder { color: var(--bcvwd-text-subtle); }

/* Form field wrapper */
.bcvwd-field { display: flex; flex-direction: column; gap: 5px; }

/* Form label */
.bcvwd-label { font-size: var(--font-size-sm); font-weight: var(--font-weight-medium); color: #4a5568; letter-spacing: 0.1px; }

/* Search input */
.bcvwd-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--bcvwd-bg-card);
    border: 0.5px solid var(--bcvwd-border-mid);
    border-radius: var(--radius-lg);
    padding: 9px var(--space-4) 9px 36px;
    font-size: var(--font-size-base);
    color: var(--bcvwd-text-primary);
    outline: none;
    width: 100%;
    min-height: 40px;
    transition: all var(--transition-base);
}

.bcvwd-search:focus { border-color: var(--bcvwd-blue); box-shadow: var(--shadow-focus); }
.bcvwd-search::placeholder { color: var(--bcvwd-text-subtle); }

/* Toggle switch */
.bcvwd-toggle {
    width: 32px;
    height: 18px;
    border-radius: var(--radius-full);
    background: var(--bcvwd-blue);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color var(--transition-base);
    border: none;
}

.bcvwd-toggle--off { background: #d0d8e8; }

.bcvwd-toggle-knob {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    background: var(--bcvwd-text-white);
    position: absolute;
    top: 2px;
    right: 2px;
    transition: right var(--transition-base);
    pointer-events: none;
}

.bcvwd-toggle--off .bcvwd-toggle-knob { right: 16px; }

/* Checkbox */
.bcvwd-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-size: var(--font-size-base);
    color: var(--bcvwd-text-secondary);
}

.bcvwd-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--bcvwd-blue); cursor: pointer; }

/* Form row */
.bcvwd-form-row { display: flex; gap: var(--space-2); }
.bcvwd-form-row > * { flex: 1; }


/* =============================================================================
   11. COMPONENTS — BADGES & PILLS
   ============================================================================= */

/* Base badge */
.bcvwd-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    line-height: 1.4;
    white-space: nowrap;
}

.bcvwd-badge--info    { background: var(--bcvwd-info-bg);    color: var(--bcvwd-info-text); }
.bcvwd-badge--success { background: var(--bcvwd-success-bg); color: var(--bcvwd-success-text); }
.bcvwd-badge--warning { background: var(--bcvwd-warning-bg); color: var(--bcvwd-warning-text); }
.bcvwd-badge--danger  { background: var(--bcvwd-danger-bg);  color: var(--bcvwd-danger-text); }
.bcvwd-badge--neutral { background: var(--bcvwd-bg-secondary); color: var(--bcvwd-text-secondary); }
.bcvwd-badge--primary { background: var(--bcvwd-blue);        color: var(--bcvwd-text-white); }
.bcvwd-badge--gold    { background: var(--bcvwd-warning);     color: #412402; }
.bcvwd-badge--new     { background: var(--bcvwd-blue); color: var(--bcvwd-text-white); font-size: 8px; }
.bcvwd-badge--updated { background: var(--bcvwd-blue); color: var(--bcvwd-text-white); font-size: 8px; }

/* Department badge */
.bcvwd-dept-badge {
    font-size: 9px;
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-sm);
    padding: 2px 7px;
    display: inline-block;
    white-space: nowrap;
}

.bcvwd-dept-badge--finance     { background: var(--dept-finance-bg);     color: #0c447c; }
.bcvwd-dept-badge--hr          { background: var(--dept-hr-bg);          color: #3c3489; }
.bcvwd-dept-badge--it          { background: var(--dept-it-bg);          color: #085041; }
.bcvwd-dept-badge--engineering { background: var(--dept-engineering-bg); color: #3c3489; }
.bcvwd-dept-badge--operations  { background: var(--dept-operations-bg);  color: #712b13; }
.bcvwd-dept-badge--payroll     { background: var(--dept-payroll-bg);     color: #633806; }
.bcvwd-dept-badge--cs          { background: var(--dept-cs-bg);          color: #27500a; }
.bcvwd-dept-badge--district    { background: var(--dept-district-bg);    color: #0c447c; }
.bcvwd-dept-badge--all         { background: var(--bcvwd-bg-secondary);  color: var(--bcvwd-text-secondary); }

/* Filter pill */
.bcvwd-filter-pill {
    background: var(--bcvwd-bg-card);
    border: 0.5px solid var(--bcvwd-border-mid);
    border-radius: var(--radius-full);
    padding: 5px var(--space-3);
    font-size: var(--font-size-sm);
    color: #6b7a99;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.bcvwd-filter-pill:hover { border-color: var(--bcvwd-blue); color: var(--bcvwd-blue); }
.bcvwd-filter-pill.active { background: var(--bcvwd-navy); color: var(--bcvwd-text-white); border-color: var(--bcvwd-navy); }
.bcvwd-filter-pill.active-blue { background: var(--bcvwd-blue); color: var(--bcvwd-text-white); border-color: var(--bcvwd-blue); }

/* Tab navigation */
.bcvwd-tabs {
    display: flex;
    background: var(--bcvwd-bg-card);
    border-radius: var(--radius-lg);
    border: 0.5px solid var(--bcvwd-border-mid);
    overflow: hidden;
    width: fit-content;
}

.bcvwd-tab {
    padding: 8px var(--space-4);
    font-size: var(--font-size-sm);
    color: #6b7a99;
    cursor: pointer;
    border-right: 0.5px solid var(--bcvwd-border);
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-height: 36px;
    display: flex;
    align-items: center;
}

.bcvwd-tab:last-child { border-right: none; }
.bcvwd-tab:hover      { background: var(--bcvwd-bg-secondary); color: var(--bcvwd-text-primary); }
.bcvwd-tab.active     { background: var(--bcvwd-blue); color: var(--bcvwd-text-white); font-weight: var(--font-weight-medium); }
.bcvwd-tab.active-dark { background: var(--bcvwd-navy); color: var(--bcvwd-text-white); font-weight: var(--font-weight-medium); }


/* =============================================================================
   12. COMPONENTS — AVATARS
   ============================================================================= */

.bcvwd-avatar {
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.bcvwd-avatar img { width: 100%; height: 100%; object-fit: cover; }

.bcvwd-avatar--xs  { width: 20px; height: 20px; font-size: 7px; }
.bcvwd-avatar--sm  { width: 26px; height: 26px; font-size: 9px; }
.bcvwd-avatar--md  { width: 32px; height: 32px; font-size: 10px; }
.bcvwd-avatar--lg  { width: 42px; height: 42px; font-size: 14px; }
.bcvwd-avatar--xl  { width: 56px; height: 56px; font-size: 17px; }
.bcvwd-avatar--2xl { width: 72px; height: 72px; font-size: 22px; }

/* Presence wrapper */
.bcvwd-avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }

.bcvwd-presence {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    border: 2px solid var(--bcvwd-bg-card);
    position: absolute;
    bottom: 0;
    right: 0;
}

.bcvwd-presence--online  { background: var(--bcvwd-success); }
.bcvwd-presence--away    { background: var(--bcvwd-warning); }
.bcvwd-presence--offline { background: #b0bfd4; }

/* Avatar group */
.bcvwd-avatar-group { display: flex; align-items: center; }
.bcvwd-avatar-group .bcvwd-avatar { border: 2px solid var(--bcvwd-bg-card); margin-right: -8px; }
.bcvwd-avatar-group .bcvwd-avatar:last-child { margin-right: 0; }
.bcvwd-avatar-group--dark .bcvwd-avatar { border-color: var(--bcvwd-navy); }


/* =============================================================================
   13. COMPONENTS — SETTING ROWS & TOGGLES
   Used in Admin Panel settings tabs.
   ============================================================================= */

.bcvwd-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 0.5px solid var(--bcvwd-border);
}

.bcvwd-setting-row:last-child { border-bottom: none; }

.bcvwd-setting-label { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); color: var(--bcvwd-text-primary); }
.bcvwd-setting-sub   { font-size: var(--font-size-xs); color: var(--bcvwd-text-muted); margin-top: 2px; }
.bcvwd-setting-value { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); color: var(--bcvwd-blue); cursor: pointer; white-space: nowrap; flex-shrink: 0; }


/* =============================================================================
   14. COMPONENTS — OVERLAYS & MODALS
   ============================================================================= */

.bcvwd-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 10, 20, 0.85);
    z-index: var(--z-overlay);
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.bcvwd-overlay.active { display: flex; }

.bcvwd-modal {
    background: var(--bcvwd-bg-card);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    width: 100%;
    max-width: 400px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.bcvwd-modal--wide   { max-width: 600px; }
.bcvwd-modal--viewer { max-width: 640px; padding: 0; overflow: hidden; }

.bcvwd-modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--bcvwd-text-muted);
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.bcvwd-modal-close:hover { background: var(--bcvwd-bg-secondary); color: var(--bcvwd-text-primary); }

/* Document / PDF viewer */
.bcvwd-viewer { background: var(--bcvwd-bg-card); border-radius: var(--radius-xl); overflow: hidden; width: 100%; max-width: 580px; }

.bcvwd-viewer-toolbar {
    background: var(--bcvwd-bg-secondary);
    border-bottom: 0.5px solid var(--bcvwd-border);
    padding: 8px var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.bcvwd-viewer-name { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); color: var(--bcvwd-text-primary); flex: 1; min-width: 0; }
.bcvwd-viewer-page { font-size: var(--font-size-sm); color: var(--bcvwd-text-muted); white-space: nowrap; }
.bcvwd-viewer-content { padding: var(--space-6); min-height: 300px; }


/* =============================================================================
   15. COMPONENTS — STATUS INDICATORS
   ============================================================================= */

/* Progress bar */
.bcvwd-progress { height: 6px; background: var(--bcvwd-bg-secondary); border-radius: var(--radius-full); overflow: hidden; }
.bcvwd-progress-fill { height: 100%; border-radius: var(--radius-full); background: var(--bcvwd-blue); transition: width var(--transition-slow); }
.bcvwd-progress-fill--success { background: var(--bcvwd-success); }
.bcvwd-progress-fill--warning { background: var(--bcvwd-warning); }
.bcvwd-progress-fill--danger  { background: var(--bcvwd-danger); }

/* Removed / deleted content notice */
.bcvwd-removed-notice {
    background: var(--bcvwd-bg-tertiary);
    border: 0.5px solid var(--bcvwd-border);
    border-radius: var(--radius-md);
    padding: 7px var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--bcvwd-text-subtle);
    font-style: italic;
    text-align: center;
}

/* Announcement priority borders */
.bcvwd-ann--urgent  { border-left: 3px solid var(--bcvwd-danger);  border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }
.bcvwd-ann--warning { border-left: 3px solid var(--bcvwd-warning); border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }
.bcvwd-ann--info    { border-left: 3px solid var(--bcvwd-blue);    border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }
.bcvwd-ann--success { border-left: 3px solid var(--bcvwd-success); border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }


/* =============================================================================
   16. UTILITIES
   ============================================================================= */

.bcvwd-hidden       { display: none !important; }
.bcvwd-block        { display: block; }
.bcvwd-flex         { display: flex; }
.bcvwd-inline-flex  { display: inline-flex; }
.bcvwd-flex-1       { flex: 1; min-width: 0; }
.bcvwd-flex-col     { display: flex; flex-direction: column; }
.bcvwd-items-center { align-items: center; }
.bcvwd-items-start  { align-items: flex-start; }
.bcvwd-justify-between { justify-content: space-between; }
.bcvwd-justify-end  { justify-content: flex-end; }
.bcvwd-justify-center { justify-content: center; }
.bcvwd-flex-wrap    { flex-wrap: wrap; }
.bcvwd-flex-shrink-0 { flex-shrink: 0; }
.bcvwd-gap-1 { gap: var(--space-1); }
.bcvwd-gap-2 { gap: var(--space-2); }
.bcvwd-gap-3 { gap: var(--space-3); }
.bcvwd-gap-4 { gap: var(--space-4); }
.bcvwd-ml-auto { margin-left: auto; }
.bcvwd-mr-auto { margin-right: auto; }
.bcvwd-text-left   { text-align: left; }
.bcvwd-text-center { text-align: center; }
.bcvwd-text-right  { text-align: right; }
.bcvwd-overflow-hidden { overflow: hidden; }
.bcvwd-relative    { position: relative; }
.bcvwd-w-full      { width: 100%; }
.bcvwd-truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bcvwd-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}


/* =============================================================================
   17. LOGIN SCREEN
   ============================================================================= */

.bcvwd-login-screen {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Left panel */
.bcvwd-login-left {
    flex: 1;
    background: var(--bcvwd-navy);
    position: relative;
    display: flex;
    flex-direction: column;
    padding: var(--space-8);
    overflow: hidden;
}

.bcvwd-login-left-bg { position: absolute; inset: 0; }
.bcvwd-login-left-overlay { position: absolute; inset: 0; background: rgba(13, 27, 62, 0.55); }

.bcvwd-login-left-content {
    position: relative;
    z-index: var(--z-base);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bcvwd-login-headline {
    font-size: 28px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-3);
}

.bcvwd-login-headline span { color: var(--bcvwd-blue-light); }

.bcvwd-login-description {
    font-size: var(--font-size-base);
    color: #7a93b8;
    line-height: var(--line-height-relaxed);
    max-width: 300px;
}

.bcvwd-login-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: var(--space-5); }

.bcvwd-login-pill {
    background: rgba(91, 156, 246, 0.1);
    border: 0.5px solid rgba(91, 156, 246, 0.2);
    border-radius: var(--radius-full);
    padding: 5px var(--space-3);
    font-size: var(--font-size-sm);
    color: #9ab8d8;
}

.bcvwd-login-employee-count { margin-top: auto; padding-top: var(--space-5); }

.bcvwd-login-legal {
    font-size: var(--font-size-xs);
    color: #2a3e58;
    margin-top: var(--space-2);
    line-height: var(--line-height-relaxed);
}

/* Department avatar dots row — on login left panel */
.bcvwd-login-dept-avatars {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: auto;
    padding-top: var(--space-5);
    align-items: center;
}

/* Each department dot — circular badge with initials.
   IMPORTANT: explicit width, height, min-width, min-height and flex-shrink
   prevent divs from stretching to full width in flex containers. */
.bcvwd-dept-dot {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    border-radius: var(--radius-full);
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: var(--font-weight-medium);
    color: var(--bcvwd-text-white);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    line-height: 1;
}

/* Right panel */
.bcvwd-login-right {
    width: 380px;
    max-width: 100%;
    flex-shrink: 0;
    background: #f4f6fb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-10) var(--space-8);
    box-sizing: border-box;
    overflow-x: hidden;
}

.bcvwd-login-title    { font-size: var(--font-size-2xl); font-weight: var(--font-weight-medium); color: var(--bcvwd-text-primary); margin-bottom: 3px; }
.bcvwd-login-subtitle { font-size: var(--font-size-base); color: #6b7a99; margin-bottom: var(--space-5); }

/* Warning box */
.bcvwd-login-warning {
    background: #fffbf0;
    border: 0.5px solid rgba(245, 166, 35, 0.4);
    border-radius: var(--radius-lg);
    padding: 9px var(--space-3);
    margin-bottom: var(--space-5);
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
}

.bcvwd-login-warning-text { font-size: var(--font-size-sm); color: #633806; line-height: var(--line-height-relaxed); }

/* Login form */
.bcvwd-login-form { display: flex; flex-direction: column; gap: var(--space-3); }

/* Attempt tracking */
.bcvwd-attempt-row { display: flex; align-items: center; justify-content: space-between; display: none; }
.bcvwd-attempt-row.visible { display: flex; }
.bcvwd-attempt-dots { display: flex; gap: 5px; }
.bcvwd-attempt-dot { width: 11px; height: 11px; border-radius: var(--radius-full); background: rgba(0, 0, 0, 0.1); transition: background-color var(--transition-base); }
.bcvwd-attempt-dot.used { background: var(--bcvwd-danger); }
.bcvwd-attempt-text { font-size: var(--font-size-sm); color: var(--bcvwd-text-muted); }
.bcvwd-attempt-text.critical { color: var(--bcvwd-danger); }

/* Error message */
.bcvwd-login-error {
    background: var(--bcvwd-danger-bg);
    border: 0.5px solid rgba(226, 75, 74, 0.35);
    border-radius: var(--radius-md);
    padding: 8px var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--bcvwd-danger-text);
    line-height: var(--line-height-relaxed);
    display: none;
}

.bcvwd-login-error.visible { display: block; }

/* Security footer */
.bcvwd-login-security {
    border-top: 0.5px solid rgba(0, 0, 0, 0.07);
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bcvwd-login-security-row { display: flex; align-items: center; gap: var(--space-2); }
.bcvwd-login-security-text { font-size: var(--font-size-xs); color: var(--bcvwd-text-muted); }
.bcvwd-login-security-text strong { color: var(--bcvwd-blue-light); font-weight: var(--font-weight-normal); }

/* Lockout screen */
.bcvwd-lockout-screen { display: flex; flex-direction: column; align-items: center; text-align: center; }
.bcvwd-lockout-icon { width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--bcvwd-danger-bg); display: flex; align-items: center; justify-content: center; margin: 0 auto var(--space-4); }
.bcvwd-lockout-title { font-size: 18px; font-weight: var(--font-weight-medium); color: var(--bcvwd-text-primary); margin-bottom: var(--space-2); }
.bcvwd-lockout-description { font-size: var(--font-size-base); color: #6b7a99; line-height: var(--line-height-relaxed); margin-bottom: var(--space-5); max-width: 280px; }
.bcvwd-lockout-alert { background: var(--bcvwd-danger-bg); border: 0.5px solid rgba(226, 75, 74, 0.3); border-radius: var(--radius-md); padding: 9px var(--space-3); font-size: var(--font-size-sm); color: var(--bcvwd-danger-text); line-height: var(--line-height-relaxed); width: 100%; margin-bottom: var(--space-4); }
.bcvwd-lockout-contact { background: var(--bcvwd-bg-card); border: 0.5px solid var(--bcvwd-border-mid); border-radius: var(--radius-lg); padding: var(--space-4); width: 100%; text-align: left; margin-bottom: var(--space-4); }
.bcvwd-lockout-contact-label { font-size: var(--font-size-xs); color: var(--bcvwd-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-1); }
.bcvwd-lockout-contact-email { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); color: var(--bcvwd-blue); }
.bcvwd-lockout-contact-info { font-size: var(--font-size-sm); color: #6b7a99; margin-top: 3px; }


/* =============================================================================
   18. RESPONSIVE — TABLET (768px – 1199px)
   ============================================================================= */

@media (max-width: 1199px) {

    :root { --sidebar-width: var(--sidebar-width-tablet); }

    .bcvwd-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .bcvwd-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .bcvwd-content-grid { grid-template-columns: 1fr 220px; }
    .bcvwd-topbar-search { flex: 0 1 220px; }
    .bcvwd-login-right { width: 340px; padding: var(--space-8) var(--space-6); }
}


/* =============================================================================
   19. RESPONSIVE — MOBILE (below 768px)
   Single column, slide-in sidebar, bottom navigation bar.
   ============================================================================= */

@media (max-width: 767px) {

    /* Portal — single column with bottom nav padding */
    .bcvwd-portal {
        grid-template-columns: 1fr;
        grid-template-rows: var(--topbar-height) 1fr;
        padding-bottom: var(--mobile-nav-height);
    }

    /* Sidebar — slide-in drawer */
    .bcvwd-sidebar {
        position: fixed;
        left: -100%;
        top: var(--topbar-height);
        width: 260px;
        height: calc(100vh - var(--topbar-height));
        z-index: var(--z-modal);
        transition: left var(--transition-slow);
        box-shadow: var(--shadow-lg);
    }

    .bcvwd-sidebar.open { left: 0; }

    /* Sidebar backdrop */
    .bcvwd-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-modal) - 1);
        top: var(--topbar-height);
    }

    .bcvwd-sidebar-overlay.active { display: block; }

    /* Main content — full width, padding via children */
    .bcvwd-main { grid-column: 1; padding: 0; gap: 0; }
    .bcvwd-main > *:not(.bcvwd-status-bar) { padding-left: var(--space-3); padding-right: var(--space-3); }
    .bcvwd-main > .bcvwd-status-bar + * { padding-top: var(--space-3); }
    .bcvwd-main > *:not(.bcvwd-status-bar):not(:last-child) { margin-bottom: var(--space-3); }
    .bcvwd-main > *:not(.bcvwd-status-bar):first-child { padding-top: var(--space-3); }

    /* Topbar */
    .bcvwd-topbar { padding: 0 var(--space-3); }
    .bcvwd-topbar-search { display: none; }
    .bcvwd-menu-toggle { display: flex; }

    /* User chip — avatar only on mobile */
    .bcvwd-user-chip-name,
    .bcvwd-user-chip-dept { display: none; }
    .bcvwd-user-chip { padding: 3px; border-radius: var(--radius-full); }

    /* Grids */
    .bcvwd-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .bcvwd-grid-3 { grid-template-columns: 1fr; }
    .bcvwd-content-grid,
    .bcvwd-content-grid--wide-right,
    .bcvwd-content-grid--narrow-right { grid-template-columns: 1fr; }

    /* Cards */
    .bcvwd-card { padding: var(--space-3); border-radius: var(--radius-xl); }

    /* Page header */
    .bcvwd-page-header { flex-direction: column; gap: var(--space-2); }
    .bcvwd-page-header-right { width: 100%; justify-content: flex-start; }

    /* Bottom navigation — mobile only */
    .bcvwd-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--mobile-nav-height);
        background: var(--bcvwd-navy);
        border-top: 0.5px solid rgba(255, 255, 255, 0.08);
        z-index: var(--z-sticky);
        padding: 0 var(--space-2);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bcvwd-mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: #6a8aaa;
        cursor: pointer;
        transition: color var(--transition-fast);
        text-decoration: none;
        padding: var(--space-1) 0;
        min-height: 44px;
        position: relative;
    }

    .bcvwd-mobile-nav-item.active { color: var(--bcvwd-blue-light); }
    .bcvwd-mobile-nav-label { font-size: 9px; font-weight: var(--font-weight-medium); }

    .bcvwd-mobile-nav-badge {
        position: absolute;
        top: 6px;
        right: calc(50% - 18px);
        background: var(--bcvwd-danger);
        color: var(--bcvwd-text-white);
        font-size: 8px;
        width: 14px;
        height: 14px;
        border-radius: var(--radius-full);
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid var(--bcvwd-navy);
    }

    /* Hero banner — shorter on mobile */
    .bcvwd-hero-banner { min-height: 80px; }
    .bcvwd-hero-content { padding: 0 var(--space-3); gap: var(--space-3); }

    /* Tabs — horizontal scroll */
    .bcvwd-tabs {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .bcvwd-tabs::-webkit-scrollbar { display: none; }

    /* Filter pills — horizontal scroll */
    .bcvwd-filter-pills-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        display: flex;
        gap: var(--space-2);
        flex-wrap: nowrap;
    }
    .bcvwd-filter-pills-row::-webkit-scrollbar { display: none; }

    /* Login — stacked on mobile */
    .bcvwd-login-screen {
        flex-direction: column;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    .bcvwd-login-left { min-height: 180px; padding: var(--space-5); flex: 0 0 auto; }
    .bcvwd-login-description,
    .bcvwd-login-pills,
    .bcvwd-login-employee-count { display: none; }
    .bcvwd-login-right {
        width: 100%;
        max-width: 100%;
        flex: 1;
        padding: var(--space-5);
        justify-content: flex-start;
        box-sizing: border-box;
    }
    .bcvwd-login-headline { font-size: var(--font-size-xl); }

}

/* Hide bottom nav on desktop */
.bcvwd-mobile-nav { display: none; }


/* =============================================================================
   20. RESPONSIVE — SMALL MOBILE (below 400px)
   ============================================================================= */

@media (max-width: 399px) {

    .bcvwd-main { padding: 0; }
    .bcvwd-main > *:not(.bcvwd-status-bar) { padding-left: var(--space-2); padding-right: var(--space-2); }
    .bcvwd-main > .bcvwd-status-bar + * { padding-top: var(--space-2); }
    .bcvwd-main > *:not(.bcvwd-status-bar):not(:last-child) { margin-bottom: var(--space-2); }
    .bcvwd-main > *:not(.bcvwd-status-bar):first-child { padding-top: var(--space-2); }
    .bcvwd-card { padding: var(--space-2) var(--space-3); }
    .bcvwd-grid-4 { grid-template-columns: 1fr; }
    .bcvwd-topbar { padding: 0 var(--space-2); }
    .bcvwd-login-screen { overflow-x: hidden; max-width: 100vw; }
    .bcvwd-login-right { padding: var(--space-3) var(--space-3); max-width: 100%; box-sizing: border-box; }
    .bcvwd-login-title { font-size: var(--font-size-xl); }
}


/* =============================================================================
   21. PWA & PRINT
   ============================================================================= */

/* PWA standalone mode — account for iOS status bar */
@media (display-mode: standalone) {

    .bcvwd-topbar {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--topbar-height) + env(safe-area-inset-top));
    }

    .bcvwd-mobile-nav {
        padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
    }

    body { overscroll-behavior: none; }
}

/* PWA splash screen */
.bcvwd-splash {
    position: fixed;
    inset: 0;
    background: var(--bcvwd-navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.bcvwd-splash.hidden { opacity: 0; pointer-events: none; }

.bcvwd-splash-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-2xl);
    background: var(--bcvwd-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.bcvwd-splash-name { font-size: var(--font-size-xl); font-weight: var(--font-weight-medium); color: var(--bcvwd-text-white); margin-bottom: var(--space-1); }
.bcvwd-splash-name span { color: var(--bcvwd-blue-light); }
.bcvwd-splash-org { font-size: var(--font-size-sm); color: #5a7a9a; }

/* Offline page */
.bcvwd-offline {
    min-height: 100vh;
    background: var(--bcvwd-navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8);
}

.bcvwd-offline-title { font-size: var(--font-size-xl); font-weight: var(--font-weight-medium); color: var(--bcvwd-text-white); margin-bottom: var(--space-3); }
.bcvwd-offline-text  { font-size: var(--font-size-base); color: #7a93b8; line-height: var(--line-height-relaxed); max-width: 300px; }

/* Print styles */
@media print {

    .bcvwd-topbar,
    .bcvwd-sidebar,
    .bcvwd-mobile-nav,
    .bcvwd-status-bar,
    .bcvwd-btn,
    .bcvwd-overlay,
    .bcvwd-tabs,
    .bcvwd-filter-pill { display: none !important; }

    .bcvwd-portal { display: block; }
    .bcvwd-main   { padding: 0; }
    .bcvwd-content-grid,
    .bcvwd-grid-3,
    .bcvwd-grid-4 { display: block; }

    .bcvwd-card {
        border: 1px solid #ddd;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: var(--space-4);
    }

    @page { size: landscape; margin: 1cm; }

    .bcvwd-print-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-5);
        padding-bottom: var(--space-3);
        border-bottom: 2px solid var(--bcvwd-navy);
    }

    .bcvwd-print-logo-text { font-size: 18px; font-weight: var(--font-weight-medium); color: var(--bcvwd-navy); }
    .bcvwd-print-date { font-size: var(--font-size-sm); color: var(--bcvwd-text-muted); }

    .bcvwd-dept-badge,
    .bcvwd-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.bcvwd-print-header { display: none; }
