@font-face {
    font-family: "Playfair Display";
    src: url("../fonts/playfair/PlayfairDisplay-VariableFont_wght.ttf") format("truetype-variations"),
         url("../fonts/playfair/PlayfairDisplay-VariableFont_wght.ttf") format("truetype");
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "DM Sans";
    src: url("../fonts/DM_Sans/DMSans-VariableFont.ttf") format("truetype-variations"),
         url("../fonts/DM_Sans/DMSans-VariableFont.ttf") format("truetype");
    font-weight: 100 1000;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #000016;
    --primary-light: #1A5580;
    --accent: #11115C;
    --accent-hover: #C29560;
    --bg-main: #F8F9FA;
    --bg-card: #FFFFFF;
    --text-primary: #1A2332;
    --text-secondary: #5F6B7A;
    --border: #E5E8EB;
    --success: #2D7A3E;
    --warning: #C17A2F;
    --danger: #B83C3C;
    --info: #1A5580;
    --archive: #7C6A4E;
    --shadow-sm: 0 1px 3px rgba(10, 59, 92, 0.08);
    --shadow-md: 0 4px 12px rgba(10, 59, 92, 0.12);
    --shadow-lg: 0 8px 24px rgba(10, 59, 92, 0.16);
}

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

.d-none { display: none !important; }
.d-flex { display: flex !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.text-center { text-align: center !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--primary-light) !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-light { color: #f4f4f6 !important; }
.fw-bold { font-weight: 700 !important; }
.text-white { color: #fff !important; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.pt-1 { padding-top: 0.25rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-auto { margin-left: auto !important; }
.w-100 { width: 100% !important; }
.flex-fill { flex: 1 1 auto !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.border { border: 1px solid var(--border) !important; }
.border-0 { border: none !important; }
.rounded-top { border-radius: 12px 12px 0 0; }
.h4 { font-size: 1.25rem; }
.fs-5 { font-size: 1.05rem; }

@media (min-width: 768px) {
    .p-md-5 { padding: 3rem !important; }
}

.container-fluid { width: 100%; padding: 0 1rem; }
.row { display: flex; flex-wrap: wrap; margin: 0 -0.5rem; }
.col-sm { flex: 1 0 0%; padding: 0 0.5rem; }

.col-1 { flex: 0 0 auto; width: 8.3333%; }
.col-2 { flex: 0 0 auto; width: 16.6667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.3333%; }
.col-5 { flex: 0 0 auto; width: 41.6667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.3333%; }
.col-8 { flex: 0 0 auto; width: 66.6667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-1 { flex: 0 0 auto; width: 8.3333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.3333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 auto; width: 8.3333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

@media (min-width: 1200px) {
    .col-xl-1 { flex: 0 0 auto; width: 8.3333%; }
    .col-xl-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-xl-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-xl-9 { flex: 0 0 auto; width: 75%; }
    .col-xl-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-xl-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin: 1rem 2rem 0;
}

.alert-danger { background: rgba(184, 60, 60, 0.1); color: var(--danger); }
.alert-success { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.alert-info { background: rgba(26, 85, 128, 0.1); color: var(--info); }
.alert-warning { background: rgba(193, 122, 47, 0.1); color: var(--warning); }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 250px;
    height: 100vh;
    background: var(--primary);
    color: white;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.logo-subtitle {
    font-size: 0.875rem;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.nav-menu {
    padding: 1.5rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: white;
}

.nav-icon {
    margin-right: 0.875rem;
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
}

.nav-icon .bi-person-circle      { color: #5B9BD5; }  /* Profile - blue */
.nav-icon .bi-calculator         { color: #5B9BD5; }  /* Accounts - blue */
.nav-icon .bi-box-arrow-right    { color: #6BCB77; }  /* Logout - green */
.nav-icon .bi-speedometer2       { color: #5B9BD5; }  /* Dashboard - blue */
.nav-icon .bi-graph-up           { color: #6BCB77; }  /* Reports - green */
.nav-icon .bi-buildings          { color: #A8A8A8; }  /* Properties - silver */
.nav-icon .bi-building           { color: #5B9BD5; }  /* Companies - blue */
.nav-icon .bi-people             { color: #F5C542; }  /* Tenants - gold */
.nav-icon .bi-file-earmark-ruled { color: #81C784; }  /* Leases - green */
.nav-icon .bi-file-earmark-text  { color: #FFB74D; }  /* Applications - orange */
.nav-icon .bi-archive            { color: #FFB74D; }  /* Asset Register - orange */
.nav-icon .bi-hourglass-split    { color: #CE93D8; }  /* Waiting Lists - purple */
.nav-icon .bi-cash-stack         { color: #66BB6A; }  /* Rent Collection - green */
.nav-icon .bi-wrench-adjustable  { color: #90A4AE; }  /* Maintenance - steel */
.nav-icon .bi-cash               { color: #66BB6A; }  /* Maintenance - steel */
.nav-icon .bi-tree               { color: #66BB6A; }  /* Grounds - green */
.nav-icon .bi-bug                { color: #EF5350; }  /* Pest Control - red */
.nav-icon .bi-p-square           { color: #42A5F5; }  /* Parking - blue */
.nav-icon .bi-calendar-check     { color: #5B9BD5; }  /* Make Ready - blue */
.nav-icon .bi-bullseye           { color: #EF5350; }  /* Tasks - red */
.nav-icon .bi-clock-history      { color: #FFB74D; }  /* Timekeeping - orange */
.nav-icon .bi-award-fill         { color: #F5ED05; }  /* Incentives - yellow */
.nav-icon .bi-person-badge       { color: #42A5F5; }  /* Employees - blue */
.nav-icon .bi-dash-circle-fill   { color: #EF5350; }  /* Debits - red */
.nav-icon .bi-plus-circle-fill   { color: #66BB6A; }  /* Credits - green */
.nav-icon .bi-house-heart        { color: #EF5350; }  /* Pets - red */
.nav-icon .bi-shield-exclamation { color: #42A5F5; }  /* Crimes - blue */
.nav-icon .bi-cash-coin          { color: #FFB74D; }  /* Receive Payment - orange */
.nav-icon .bi-fire               { color: #EF5350; }  /* Fire Prevention - red */
.nav-icon .bi-archive            { color: #6BCB77; }  /* Storage - green */
.nav-icon .bi-fan                { color: #66BB6A; }  /* Fans - green */
.nav-icon .bi-droplet            { color: #42A5F5; }  /* Laundry - blue */
.nav-icon .bi-water              { color: #42A5F5; }  /* Pools - Blue */
.nav-icon .bi-brush              { color: #42A5F5; }  /* Cleaning - blue */
.nav-icon .bi-lightning-charge   { color: #F5ED05; }  /* Generators - yellow */
.nav-icon .bi-heart-pulse        { color: #F5ED05; }  /* Behavioral Health - yellow */
.nav-icon .bi-lightning          { color: #F5ED05; }  /* Electricity - yellow */
.nav-icon .bi-lightbulb          { color: #FFB74D; }  /* Electricity - orange */
.nav-icon .bi-arrows-vertical    { color: #66BB6A; }  /* Elevators - green */
.nav-icon .bi-house-up           { color: #FFB74D; }  /* Roofing - orange */
.nav-icon .bi-key                { color: #FFB74D; }  /* Keys - orange */
.nav-icon .bi-box-seam           { color: #C19A6C; }  /* Inventory - brown */
.nav-icon .bi-shield-check       { color: #F5ED05; }  /* Insurance - yellow */
.nav-icon .bi-shop-window        { color: #66BB6A; }  /* Vending Machines - green */
.nav-icon .bi-tools              { color: #42A5F5; }  /* Tools - blue */
.nav-icon .bi-graph-down-arrow   { color: #EF5350; }  /* Delinquency Report - red */
.nav-icon .bi-shield-slash       { color: #EF5350; }  /* Lease Violations - red */
.nav-icon .bi-list-stars         { color: #66BB6A; }  /* Reservations - green */
.nav-icon .bi-door-open          { color: #C19A6C; }  /* Vacancy Report - brown */
.nav-icon .bi-bank               { color: #F5ED05; }  /* Bank Accounts - yellow */
.nav-icon .bi-arrow-up-right     { color: #66BB6A; }  /* Escalators - steel */
.nav-icon .bi-file-text          { color: #EF5350; }  /* SDS Sheets - red */
.nav-icon .bi-hammer             { color: #C19A6C; }  /* Capital Projects - brown */
.nav-icon .bi-snow               { color: #B3E5FC; }  /* Snow Removal - ice blue */
.nav-icon .bi-trash              { color: #90A4AE; }  /* Garbage - steel */
.nav-icon .bi-shield-lock        { color: #CE93D8; }  /* Security Systems - purple */
.nav-icon .bi-pass               { color: #81C784; }  /* Permits & Licenses - green */
.nav-icon .bi-percent            { color: #5B9BD5; }  /* Prorated Calculator - blue */
.nav-icon .bi-shop               { color: #FFB74D; }  /* Vendors - orange */
.nav-icon .bi-receipt            { color: #81C784; }  /* Purchase Orders - green */
.nav-icon .bi-megaphone          { color: #CE93D8; }  /* Notices - purple */
.nav-icon .bi-moisture           { color: #5B9BD5; }  /* Loaner Equipment - blue */
.nav-icon .bi-thermometer-high   { color: #EF5350; }  /* Fireplaces - red */
.nav-icon .bi-box-arrow-in-right { color: #81C784; }  /* Login - green */
.nav-icon .bi-person-plus        { color: #5B9BD5; }  /* Create Account - blue */

/* Icons render as class="bi bi-xxx", so match on .bi rather than a class prefix */
.nav-item.active .nav-icon .bi {
    color: #FFFFFF;
}

.main-content {
    margin-left: 250px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.search-bar {
    flex: 1;
    max-width: 400px;
    margin: 0 2rem;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 59, 92, 0.1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-btn, .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification-btn {
    background: var(--bg-main);
    border: none;
    font-size: 1.25rem;
    position: relative;
}

.notification-btn:hover {
    background: var(--border);
}

.notification-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 59, 92, 0.25);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--danger);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 14px;
    text-align: center;
    border-radius: 9px;
    border: 2px solid var(--bg-card);
}

.notification-badge[hidden] {
    display: none;
}

.notification-dropdown {
    position: relative;
}

.notification-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 2rem);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.notification-menu[hidden] {
    display: none;
}

.notification-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notification-menu-title {
    font-weight: 600;
    color: var(--text-primary);
}

.notification-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 6px;
    background: none;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--info);
    cursor: pointer;
}

.notification-clear:hover:not(:disabled),
.notification-clear:focus-visible {
    outline: none;
    background: var(--bg-main);
}

.notification-clear:disabled {
    color: var(--text-secondary);
    opacity: 0.6;
    cursor: default;
}

.notification-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.375rem;
}

.notification-list:empty {
    display: none;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
}

.notification-item:hover,
.notification-item:focus-visible {
    outline: none;
    background: var(--bg-main);
}

.notification-item.unread {
    background: rgba(26, 85, 128, 0.06);
}

.notification-item.unread:hover,
.notification-item.unread:focus-visible {
    background: rgba(26, 85, 128, 0.12);
}

.notification-item.unread::after {
    content: "";
    position: absolute;
    top: 0.875rem;
    right: 0.75rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--info);
}

.notification-icon {
    font-size: 1.125rem;
    line-height: 1.4;
}

.notification-info { color: var(--info); }
.notification-success { color: var(--success); }
.notification-warning { color: var(--warning); }
.notification-danger { color: var(--danger); }

.notification-item-body {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    padding-right: 1rem;
}

.notification-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-item-message {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.notification-item-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.notification-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.notification-empty[hidden] {
    display: none;
}

.notification-modal-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-modal-heading .notification-icon {
    font-size: 1.5rem;
}

.notification-modal-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.notification-modal-body {
    white-space: pre-line;
    color: var(--text-primary);
    line-height: 1.5;
}

.user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
}

.user-avatar:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 59, 92, 0.25);
}

.user-dropdown {
    position: relative;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    padding: 0.375rem;
    list-style: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.user-dropdown-menu[hidden] {
    display: none;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 6px;
    background: none;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.user-dropdown-item:hover,
.user-dropdown-item:focus-visible {
    outline: none;
    background: var(--bg-main);
}

.user-dropdown-item i {
    color: var(--text-secondary);
}

.dashboard {
    padding: 2rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    animation: slideUp 0.5s ease;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(10, 59, 92, 0.1); color: var(--primary); }
.stat-icon.accent { background: rgba(212, 165, 116, 0.1); color: var(--accent); }
.stat-icon.success { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.stat-icon.warning { background: rgba(193, 122, 47, 0.1); color: var(--warning); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-action {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.card-action:hover {
    color: var(--accent-hover);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(26, 85, 128, 0.12);
}

.form-control::placeholder { color: var(--text-secondary); opacity: 0.7; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--bg-main);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border);
}

.table-hover tbody tr:hover {
    background: var(--bg-main);
}

.table-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.table-card .toolbar {
    border-radius: 0;
}

.table-card .table {
    font-size: 0.9rem;
}

.table-card .table th {
    padding: 0.875rem 1.25rem;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table-card .table td {
    padding: 0.875rem 1.25rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.table-card .table tbody tr:nth-child(even) {
    background: rgba(10, 20, 30, 0.015);
}

.table-card .table tbody tr:hover {
    background: rgba(26, 85, 128, 0.06);
}

.table-card .table tbody tr:last-child td {
    border-bottom: none;
}

.table-card .table td.text-center {
    text-align: center;
}

.table-card > .container-fluid {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-main);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.table-card > .container-fluid .btn-sm {
    min-width: 32px;
}

.table-card .table td.perm-group {
    background: var(--bg-main);
    font-weight: 600;
    color: var(--text-primary);
    vertical-align: top;
    border-right: 1px solid var(--border);
}

.table-card .table td.perm-name {
    color: var(--text-secondary);
}

.perm-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.perm-toggle button {
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    padding: 0.35rem 0.9rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.perm-toggle button + button {
    border-left: 1px solid var(--border);
}

.perm-toggle button.active.is-allow { background: var(--success); color: #fff; }
.perm-toggle button.active.is-deny { background: var(--danger); color: #fff; }

.perm-toggle button:not(.active):hover { background: var(--bg-main); }

.save-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 0;
}

.save-bar .save-status {
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.property-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.property-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge.occupied { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.badge.vacant { background: rgba(193, 122, 47, 0.1); color: var(--warning); }
.badge.maintenance { background: rgba(184, 60, 60, 0.1); color: var(--danger); }
.badge.pending { background: rgba(212, 165, 116, 0.1); color: var(--accent); }

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.maintenance { background: rgba(193, 122, 47, 0.1); color: var(--warning); }
.activity-icon.payment { background: rgba(45, 122, 62, 0.1); color: var(--success); }
.activity-icon.application { background: rgba(212, 165, 116, 0.1); color: var(--accent); }
.activity-icon.alert { background: rgba(184, 60, 60, 0.1); color: var(--danger); }

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.activity-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.activity-time {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.action-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.action-btn-text {
    font-weight: 600;
    font-size: 0.9375rem;
}

@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .search-bar {
        display: none;
    }

    .dashboard {
        padding: 1.5rem 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

.bottom-bar {
    position: sticky;
    bottom: 0;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    background: #fff;
    border-top: 1px solid #dee2e6;
    z-index: 100;
}

.bottom-bar-text {
    font-size: 0.85rem;
    color: #6c757d;
}

.toolbar {
  background: #1a1a1a;
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.toolbar-group.flex-grow-1 {
  flex: 1 1 auto;
  min-width: 160px;
}

.toolbar-group.ms-auto {
  margin-left: auto;
  flex-shrink: 0;
}

.tb-divider {
  width: 1px;
  height: 22px;
  background: #333;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 8px;
  color: #666;
  pointer-events: none;
  font-size: 14px;
}

.tb-input {
  background: #eeeeee;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  color: #000000;
  padding: 6px 10px;
  font-size: 13px;
  height: 32px;
  outline: none;
  transition: border-color .15s;
}

.tb-input.with-icon {
  padding-left: 28px;
}

.tb-input:focus {
  border-color: #f5a623;
}

.tb-select {
  background-color: #2a2a2a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid #3a3a3a;
  border-radius: 5px;
  color: #e8e8e8;
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  height: 32px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}

.tb-select:focus {
  border-color: #f5a623;
}

.tb-select:hover {
  border-color: #555;
}

.tb-label {
  color: #888;
  font-size: 12px;
  white-space: nowrap;
}

.tb-btn {
  background: #f5a623;
  border: none;
  border-radius: 5px;
  color: #1a1a1a;
  padding: 0 14px;
  height: 32px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}

.tb-btn:hover {
  background: #f7b84b;
}

.tb-btn:active {
  transform: scale(0.97);
}

.tb-per-page {
 width: 70px;
}

@media (max-width: 600px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .toolbar-group {
    width: 100%;
  }

  .toolbar-group.ms-auto {
    margin-left: 0;
    justify-content: space-between;
  }

  .tb-input,
  .tb-select {
    width: 100%;
    box-sizing: border-box;
  }

  .tb-divider {
    display: none;
  }

  .tb-btn {
    flex: 1;
    justify-content: center;
  }
}

body {
  overflow: auto !important;
}

#content_mbs .pos-main {
  height: auto !important;
  overflow: visible !important;
}

#content_mbs .cart-panel,
#content_mbs .right-panel {
  height: auto !important;
  overflow: visible !important;
}

#content_mbs .cart-table-wrap {
  flex: 0 0 220px;
  height: 220px;
}

#content_mbs .products-section {
  flex: unset;
  overflow: visible;
  max-height: none;
}

#content_mbs .payment-section {
  overflow: visible;
}

#content_mbs .pos-header {
  display: none;
}

@media (max-width: 640px) {
  #content_mbs .mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  #content_mbs .pos-main {
    display: block;
    height: auto;
    overflow: visible;
    position: static;
  }

  #content_mbs .cart-panel,
  #content_mbs .right-panel {
    position: static;
    width: 100%;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #content_mbs .cart-panel.panel-hidden,
  #content_mbs .right-panel.panel-hidden {
    display: none !important;
  }

  #content_mbs .cart-panel:not(.panel-hidden) {
    display: flex;
    flex-direction: column;
  }

  #content_mbs .right-panel:not(.panel-hidden) {
    display: flex;
    flex-direction: column;
  }

  #content_mbs .cart-table-wrap {
    flex: 0 0 220px;
    height: 220px;
    overflow-y: auto;
  }
}

/* ============================================================
   EDIT / DETAIL PAGES — tabs, field tables, missing utilities
   (Bootstrap replacement layer for edit.html-style fragments)
   ============================================================ */

/* ---------- Utilities used by edit pages ---------- */
.m-1  { margin: 0.25rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.w-25 { width: 25%; }
.rounded-3 { border-radius: 8px; }
.text-dark  { color: var(--text-primary) !important; }
.bg-white   { background-color: var(--bg-card) !important; }
.bg-light   { background-color: var(--bg-main) !important; }
.bg-card-header { background-color: var(--bg-main); color: var(--text-primary); }

/* ---------- Tab navigation (.nav-tabs) ----------
   NOTE: .nav-item is also used by the sidebar with heavy styling,
   so everything here is scoped under .nav-tabs to reset it. */
.nav-tabs {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 2px solid var(--border);
    gap: 4px;
}

.nav-tabs .nav-item {
    display: block;
    padding: 0;
    color: inherit;
    background: transparent !important; /* neutralize bg-light on the li */
    position: static;
}
.nav-tabs .nav-item:hover { background: transparent !important; color: inherit; }
.nav-tabs .nav-item.active { background: transparent !important; }
.nav-tabs .nav-item.active::before { display: none; }

.nav-tabs .nav-link {
    display: block;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;           /* sit on top of the ul border */
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    background: var(--border);
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    background: var(--bg-card);
    border-color: var(--border);
    border-bottom-color: var(--accent);
}

/* ---------- Tab panes ---------- */
.tab-content {
    text-align: left;              /* undo container text-center for form content */
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.fade { transition: opacity 0.15s linear; }
.fade:not(.show) { opacity: 0; }
.fade.show { opacity: 1; }

/* ---------- Table variants used on edit pages ---------- */
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-striped tbody tr:nth-child(odd) {
    background: var(--bg-main);
}

/* header-tinted table (was Bootstrap's .table-primary) */
.table-primary thead th {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* highlighted entry row (was Bootstrap's .table-success) */
tr.table-success,
tr.table-success > td {
    background: rgba(45, 122, 62, 0.08);
}

/* field-label icons in edit tables */
.tab-content td > .bi {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ---------- Date dropdown trio (.date-control) ---------- */
.date-control {
    display: inline-block;
    padding: 0.45rem 0.6rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: 100%;
}

.date-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(17, 17, 92, 0.1);
}

/* ---------- Responsive behaviour ---------- */

/* Tablets: allow the 12 tabs to scroll sideways instead of wrapping forever */
@media (max-width: 991px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

/* Phones: stack the 4-column field tables into a single column */
@media (max-width: 767px) {
    .tab-content { padding: 1rem 0.75rem; }

    /* Field-label tables (the w-25 four-column grids) stack into one
       column; the striped data-entry tables (vehicles, occupants,
       criminal history) are excluded — they keep their grid and
       scroll sideways via .table-responsive instead */
    .tab-content .table:not(.table-striped),
    .tab-content .table:not(.table-striped) tbody,
    .tab-content .table:not(.table-striped) tr,
    .tab-content .table:not(.table-striped) td {
        display: block;
        width: 100% !important;    /* overrides .w-25 cells */
    }

    .tab-content .table:not(.table-striped) td { border: none; padding: 0.4rem 0.25rem; }
    .tab-content .table:not(.table-striped) td:empty { display: none; }

    .tab-content .table-striped td { min-width: 130px; }

    .date-control { margin-bottom: 0.25rem; }
}

/* three-part date selector inside a field */
.date-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

/* ---------- Data-entry tables inside tabs: breathing room + soft edges ----------
   The base .table has no horizontal cell padding, which is what made these
   look crammed. Scoped to .tab-content so list pages elsewhere are untouched. */
.tab-content .table-striped {
    border-collapse: separate;   /* enables rounded corners */
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 1rem 0;
}

.tab-content .table-striped thead th {
    padding: 0.7rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    white-space: nowrap;
    background: var(--primary);
    color: #fff;
    border: none;
}

.tab-content .table-striped tbody td {
    padding: 0.7rem 0.9rem;
    vertical-align: middle;
    text-align: left;
    white-space: nowrap;
    border: none;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

/* round the corner cells (overflow:hidden would break .table-responsive scroll) */
.tab-content .table-striped thead th:first-child { border-top-left-radius: 9px; }
.tab-content .table-striped thead th:last-child { border-top-right-radius: 9px; }
.tab-content .table-striped tbody tr:last-child td:first-child { border-bottom-left-radius: 9px; }
.tab-content .table-striped tbody tr:last-child td:last-child { border-bottom-right-radius: 9px; }

/* entry row: swap the full green wash for a slim accent bar */
.tab-content .table-striped tbody tr.table-success > td { background: var(--bg-card); }
.tab-content .table-striped tbody tr.table-success > td:first-child {
    box-shadow: inset 3px 0 0 var(--success);
}

/* keep each date trio on one line; the table scrolls sideways instead */
.tab-content .table-striped .date-group { flex-wrap: nowrap; }
.tab-content .table-striped .form-control { min-width: 140px; }

/* ---------- Form grid (replaces the w-25 layout tables) ----------
   Single-column flow: every field the same width, top to bottom.
   For multi-column on wide screens, swap grid-template-columns back
   to: repeat(auto-fit, minmax(220px, 1fr)) */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    max-width: 640px;
    text-align: left;
}

.form-grid .field { min-width: 0; }

.field-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    margin-bottom: 0.15rem;
}

.field-label .bi {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* row-breaks matter only in multi-column mode; hidden in single column
   so the vertical rhythm stays uniform */
.form-grid .row-break { display: none; }

/* let a field span the full row (textareas, date trios) */
.form-grid .field-wide { grid-column: 1 / -1; }

.jax_loader {
	width: 20px;
}
