/* =========================================================
   Consolidated CSS
   (site.css + inline <style> blocks + _Layout.cshtml.css)
   ========================================================= */

/* =========================================================
   Consolidated CSS (was: site.css + inline <style> blocks)
   File: sites.css
   ========================================================= */

/* =========================================================
   Base / Typography
   ========================================================= */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* =========================================================
   CSS Variables
   ========================================================= */
:root {
    --appbar-h: 56px;
    --sidebar-w: 280px;
    --appbar-gray: #6b6b6b;

    /* Environment-aware Xercor brand color.
       _Layout.cshtml overrides these for XERTEST (DEV). */
    --xercor-primary: #b30000;
    --xercor-primary-rgb: 179, 0, 0;

    /* Landing cards max height (your “X”) */
    --landing-card-max-h: 520px;
}

.app-footer {
    text-align: center;
    font-size: 13px;
    color: #666;
    padding: 12px 8px;
    border-top: 1px solid rgba(0,0,0,0.10);
    background: #fafafa;
}


/* =========================================================
   Layout Shell
   ========================================================= */
body {
    padding-top: var(--appbar-h);
}

.app-shell {
    display: block;
}


.ag-wrapper {
    width: 100%;
}

.ag-row.row-archived {
    opacity: 0.75;
}

    .ag-row.row-archived .ag-cell {
        text-decoration-line: line-through;
        text-decoration-color: var(--xercor-primary);
        text-decoration-thickness: 2px;
    }

.grid-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 8px;
    font-size: 14px;
    color: #444;
}

    .grid-pager .pager-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .grid-pager .pager-pageSize {
        padding: 4px 6px;
    }

    .grid-pager .pager-right {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .grid-pager .pager-btn {
        border: 1px solid rgba(0,0,0,0.2);
        background: #fff;
        padding: 4px 8px;
        border-radius: 4px;
        cursor: pointer;
    }

        .grid-pager .pager-btn:hover {
            background: rgba(0,0,0,0.05);
        }


.grid-action-btn {
    border: 1px solid rgba(0,0,0,0.20);
    background: #fff;
    border-radius: 4px;
    width: 34px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .grid-action-btn:hover {
        background: rgba(var(--xercor-primary-rgb),0.06);
        border-color: rgba(var(--xercor-primary-rgb),0.45);
    }

    .grid-action-btn svg {
        width: 18px;
        height: 18px;
        fill: var(--xercor-primary); /* environment-aware Xercor color */
        display: block;
    }

/* Tabs */
.page-tabs {
    display: flex;
    gap: 10px;
    padding: 6px 0 12px;
    border-bottom: 1px solid rgba(0,0,0,0.10);
    margin-bottom: 10px;
}

.tab-btn {
    border: 1px solid rgba(0,0,0,0.25);
    background: #fff;
    padding: 10px 18px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-weight: 700;
    color: #555;
}

    .tab-btn:hover {
        background: rgba(0,0,0,0.04);
    }

    .tab-btn.is-active {
        border-color: rgba(0,0,0,0.35);
        background: #fff;
        color: #222;
        box-shadow: 0 -2px 0 var(--xercor-primary) inset; /* environment-aware underline */
    }

.tab-panel {
    display: none;
}

    .tab-panel.is-active {
        display: block;
    }

/* =========================================================
   Sidebar
   ========================================================= */
.app-sidebar {
    position: fixed;
    top: var(--appbar-h);
    left: 0;
    height: calc(100vh - var(--appbar-h));
    width: var(--sidebar-w);
    background: #ffffff;
    border-right: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    z-index: 1020;
}

body.sidebar-open .app-sidebar {
    transform: translateX(0);
}

/* =========================================================
   Main Content
   ========================================================= */
.app-main {
    margin-left: 0;
    transition: margin-left 200ms ease;
    min-height: calc(100vh - var(--appbar-h));
}

body.sidebar-open .app-main {
    margin-left: var(--sidebar-w);
}

/* =========================================================
   Sidebar Content
   ========================================================= */
.sidebar-title {
    font-size: 24px;
    padding: 18px 16px 12px;
    color: #444;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0 16px;
}

.sidebar-link {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
}

.sidebar-nav .sidebar-link,
.sidebar-nav .sidebar-link:visited,
.sidebar-nav .sidebar-link:active,
.sidebar-nav .sidebar-link:focus {
    color: #000000 !important;
    text-decoration: none !important;
}

    .sidebar-nav .sidebar-link:hover {
        background: var(--appbar-gray);
        color: #ffffff !important;
    }

    .sidebar-nav .sidebar-link.active {
        background: #666;
        color: #ffffff !important;
    }

.sidebar-indent {
    padding-left: 32px;
}

/* =========================================================
   Sidebar Groups
   ========================================================= */
.sidebar-group {
    width: 100%;
    border: 0;
    background: var(--xercor-primary);
    color: #ffffff;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-caret {
    display: inline-block;
    opacity: 0.9;
    transition: transform 160ms ease;
    transform: rotate(0deg);
}

.sidebar-group:not(.is-collapsed) .sidebar-caret {
    transform: rotate(180deg);
}

.sidebar-group.is-collapsed .sidebar-caret {
    transform: rotate(0deg);
}

.sidebar-group-items {
    overflow: hidden;
    transition: max-height 200ms ease;
}

    .sidebar-group-items.is-collapsed {
        max-height: 0;
    }

    .sidebar-group-items.is-expanded {
        max-height: 800px;
    }

/* =========================================================
   App Bar
   ========================================================= */
.appbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--appbar-h);
    background: var(--appbar-gray);
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    z-index: 1030;
}

.appbar-inner {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 14px;
}

/* Hamburger (no white block) */
.appbar-hamburger {
    width: 44px;
    height: 44px;
    margin-right: 10px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background-color: transparent !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
}

    .appbar-hamburger:hover {
        background-color: rgba(255,255,255,0.10) !important;
    }

    .appbar-hamburger:focus,
    .appbar-hamburger:focus-visible,
    .appbar-hamburger:active {
        outline: none;
        box-shadow: none;
        background-color: transparent !important;
    }

    .appbar-hamburger svg {
        width: 26px;
        height: 26px;
        fill: #ffffff;
        display: block;
        pointer-events: none;
    }

.appbar-logo {
    height: 100%;
    object-fit: contain;
}

.appbar-environment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--xercor-primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.20);
}

.appbar-logout {
    display: inline-flex;
    align-items: center;
    background: var(--xercor-primary);
    color: #ffffff;
    border: 0;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
    cursor: pointer;
}

    .appbar-logout:hover {
        filter: brightness(1.05);
    }


#operatorsGrid, #sitesGrid {
    width: 100%;
    height: 650px; /* pick what you want */
    min-height: 450px;
}


/* =========================================================
   Landing Page (wide, Mud-like)
   ========================================================= */
.landing {
    padding: 18px 8px 22px; /* reduced side padding */
}

.landing-title {
    text-align: center;
    /*font-size: clamp(26px, 5vw, 72px);*/
    font-weight: 600;
    /*margin: 6px 0 16px;*/
    color: #4a4a4a;
    font-size: 30px;
}

/* Wider grid with smaller gaps */
.landing-grid {
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    align-items: stretch;
}

/* Equal-height cards with max height */
.landing-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 4px;
    box-shadow: 0px 2px 1px -1px rgba(0,0,0,0.20), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: var(--landing-card-max-h);
    max-height: var(--landing-card-max-h);
}

.landing-card-header {
    background: var(--xercor-primary);
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    padding: 10px 12px;
}

.landing-card-body {
    flex: 1;
    padding: 18px 12px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
}

/* Landing links – keep color, underline only */
.landing-link,
.landing-link:visited,
.landing-link:active,
.landing-link:focus {
    color: var(--appbar-gray) !important;
    text-decoration: none;
    font-size: 16px;
}

    .landing-link:hover {
        color: var(--appbar-gray) !important; /* <-- prevents blue */
        text-decoration: underline;
    }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
    .landing-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    body.sidebar-open .app-main {
        margin-left: 0;
    }

    .app-sidebar {
        width: min(86vw, var(--sidebar-w));
    }

    .landing-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Bootstrap focus override
   ========================================================= */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #ffffff, 0 0 0 0.25rem #258cfb;
}

/* =========================================================
   Legacy layout/site defaults (was: _Layout.cshtml.css)
   ========================================================= */
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-all;
}

a {
    color: #0077cc;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px;
}

/* =========================================================
   Units / Tenants page
   ========================================================= */
/* =========================================================
           Grid sizing
           ========================================================= */
#tenantsGrid, #unitsGrid {
    width: 100%;
    height: 650px;
    min-height: 450px;
}

/* =========================================================
           Action row above grids
           ========================================================= */
.grid-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0 10px 0;
    flex-wrap: wrap;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.18);
    background: rgba(255,255,255,0.75);
    color: inherit;
    cursor: pointer;
    line-height: 1;
    user-select: none;
}

    .icon-btn:hover {
        background: rgba(255,255,255,0.95);
    }

    .icon-btn svg {
        fill: currentColor;
        display: block;
    }

.search-notice {
    display: none;
    margin-left: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.16);
    background: rgba(255,255,255,0.9);
    font-size: 12px;
    line-height: 1.2;
    max-width: 100%;
}

    .search-notice.is-show {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .search-notice strong {
        font-weight: 700;
    }

    .search-notice .muted {
        opacity: 0.8;
    }

/* =========================================================
           Modals (shared)
           IMPORTANT: these must NOT be inside a tab panel.
           ========================================================= */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.modal-card {
    width: 100%;
    max-width: 780px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.12);
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
}

    .modal-close:hover {
        background: rgba(0,0,0,0.06);
    }

.modal-body {
    padding: 14px 16px;
    overflow-y: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-field span {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.form-field input,
.form-field select {
    width: 100%;
    height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.18);
    outline: none;
}

.modal-hint {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.75;
}

.modal-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

    .modal-foot .spacer {
        flex: 1;
    }

.modal.is-open {
    display: flex;
}

.modal-backdrop.is-open {
    display: block;
}

/* =========================================================
           Units Actions icon
           ========================================================= */
.ut-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 10px;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    padding: 0;
}

    .ut-action-btn:hover {
        background: rgba(0,0,0,0.04);
    }

    .ut-action-btn svg {
        width: 18px;
        height: 18px;
        fill: rgba(0,0,0,0.62);
    }

.ut-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal grid tweaks */
#tenantDetailsGrid .ag-root-wrapper {
    border-radius: 12px;
}

/* =========================================================
   Login page (scoped)
   ========================================================= */
/* NOTE: kept scoped to .xercor-login-wrapper so it won't affect the rest of the app */
.xercor-login-wrapper {
    min-height: calc(100vh - var(--appbar-h, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(to bottom, #ffffff 0%, #f5f5f7 40%, #edf0f5 100%);
    color: #1f2933;
}

.xercor-login-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 2.5rem 2.75rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.xercor-logo-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

    .xercor-logo-container img {
        max-width: 260px;
        height: auto;
    }

.xercor-login-title {
    text-align: center;
    margin-bottom: 1.75rem;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #4b5563;
}

    .xercor-login-title span {
        color: #c12026; /* Xercor red accent */
    }

.form-group {
    margin-bottom: 1.1rem;
}

label {
    display: block;
    font-size: 0.86rem;
    margin-bottom: 0.35rem;
    color: #4b5563;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f9fafb;
    color: #111827;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

    .form-control::placeholder {
        color: #9ca3af;
    }

    .form-control:focus {
        border-color: #c12026;
        box-shadow: 0 0 0 1px rgba(193, 32, 38, 0.45);
        background: #ffffff;
    }

.xercor-btn-primary {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.4rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #c12026 0%, #e1393f 48%, #c12026 100%);
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.86rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(193, 32, 38, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

    .xercor-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(193, 32, 38, 0.45);
        filter: brightness(1.03);
    }

    .xercor-btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 10px 20px rgba(193, 32, 38, 0.30);
        filter: brightness(0.98);
    }

.validation-summary-errors {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    background: rgba(193, 32, 38, 0.06);
    border: 1px solid rgba(193, 32, 38, 0.35);
    color: #7f1d1d;
    font-size: 0.85rem;
}

.text-muted {
    margin-top: 0.9rem;
    font-size: 0.8rem;
    text-align: center;
    color: #6b7280;
}

.validation-summary-valid {
    display: none;
}

@media (max-width: 480px) {
    .xercor-login-card {
        padding: 2rem 1.75rem;
    }

    .xercor-logo-container img {
        max-width: 220px;
    }
}
