/* ==========================================================================
   GetBizAlert Official Design System (Inspired by getbizalert.com)
   Palette: Forest Emerald (#0b604c), Warm Amber (#c86815), Deep Slate (#172622)
   Background: Creamy Slate Paper (#f7f8f4)
   ========================================================================== */

:root {
    --gb-font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --gb-bg: #f7f8f4;
    --gb-text: #172522;
    --gb-text-muted: #5e6b65;
    
    --gb-primary: #0b604c;
    --gb-primary-hover: #08493a;
    --gb-primary-subtle: #e8f2ed;
    --gb-primary-border: #c2ded3;

    --gb-accent: #c86815;
    --gb-accent-hover: #ab570e;
    --gb-accent-subtle: #fbf0e6;
    --gb-accent-border: #f4d3ba;

    --gb-dark-surface: #172622;
    --gb-dark-border: #3d554a;
    --gb-dark-text-muted: #a9c8bb;

    --gb-card-bg: #ffffff;
    --gb-border: #e1e7df;
    --gb-border-subtle: #edf1eb;
}

body {
    background-color: var(--gb-bg);
    color: var(--gb-text);
    font-family: var(--gb-font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
}

.main-content {
    flex: 1;
}

/* Navbar */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e3e8e2;
    height: 76px;
}

.navbar .nav-link {
    color: #42524b !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem !important;
    transition: color 0.15s ease;
}

.navbar .nav-link:hover {
    color: var(--gb-primary) !important;
}

.navbar .nav-link.active {
    color: var(--gb-primary) !important;
    font-weight: 750;
}

.navbar-brand img {
    height: 34px;
    width: auto;
}

/* Cards */
.card {
    border: 1px solid var(--gb-border);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(11, 96, 76, 0.03);
    background-color: var(--gb-card-bg);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tender-card {
    border: 1px solid var(--gb-border);
    border-radius: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tender-card:hover {
    box-shadow: 0 8px 24px rgba(11, 96, 76, 0.08);
    transform: translateY(-2px);
    border-color: var(--gb-primary-border);
}

/* Primary Buttons */
.btn-primary {
    background-color: var(--gb-primary) !important;
    border-color: var(--gb-primary) !important;
    color: #ffffff !important;
    font-weight: 650;
    border-radius: 9px;
    box-shadow: 0 4px 12px rgba(11, 96, 76, 0.15);
    transition: all 0.15s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--gb-primary-hover) !important;
    border-color: var(--gb-primary-hover) !important;
    box-shadow: 0 6px 16px rgba(11, 96, 76, 0.25);
}

.btn-outline-primary {
    color: var(--gb-primary) !important;
    border-color: var(--gb-primary) !important;
    font-weight: 600;
    border-radius: 9px;
}

.btn-outline-primary:hover {
    background-color: var(--gb-primary) !important;
    color: #ffffff !important;
}

.btn-pill {
    border-radius: 100px !important;
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
}

/* Accent Badges & Urgency */
.badge-itq {
    background-color: #e8f5f0;
    color: var(--gb-primary);
    border: 1px solid var(--gb-primary-border);
    font-weight: 700;
}

.badge-itt {
    background-color: var(--gb-accent-subtle);
    color: var(--gb-accent);
    border: 1px solid var(--gb-accent-border);
    font-weight: 700;
}

/* Pill Tabs */
.nav-pills .nav-link {
    border-radius: 100px;
    color: #55635d;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 1.1rem;
    transition: all 0.15s ease;
}

.nav-pills .nav-link.active {
    background-color: var(--gb-primary) !important;
    color: #ffffff !important;
}

/* Eyebrows & Section Heads */
.eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gb-primary);
}

.doc-no {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    color: var(--gb-primary);
    cursor: pointer;
    font-weight: 600;
}

.doc-no:hover {
    text-decoration: underline;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--gb-primary) !important;
}

.stat-card.urgent {
    border-left-color: var(--gb-accent) !important;
}

.stat-card.success {
    border-left-color: var(--gb-primary) !important;
}

.stat-card.info {
    border-left-color: #3b82f6 !important;
}

/* Dark Signal Banner */
.signal-box {
    background: var(--gb-dark-surface);
    color: white;
    border-radius: 18px;
    padding: 24px 28px;
    box-shadow: 0 20px 45px rgba(23, 62, 45, 0.18);
}

.signal-box .signal-top {
    color: var(--gb-dark-text-muted);
    border-bottom: 1px solid var(--gb-dark-border);
    padding-bottom: 14px;
}

/* Footer */
footer.footer-dark {
    background-color: var(--gb-dark-surface);
    color: #b8c8bf;
    border-top: 1px solid var(--gb-dark-border);
    padding: 40px 0 28px;
}

footer.footer-dark a {
    color: #e8f4ec;
    text-decoration: none;
}

footer.footer-dark a:hover {
    text-decoration: underline;
}

/* Toast Container */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1080;
}

/* ==========================================================================
   Executive App Shell Layout (BidEx-inspired High-Clarity Design)
   ========================================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
    background-color: var(--gb-bg);
    position: relative;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background: #084738;
    color: #ffffff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #06382c;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.25s ease;
}

.sidebar-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-user-card {
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.16);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0b604c;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-group-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8da99f;
    padding: 12px 12px 4px;
    margin-top: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #d1e3dc;
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link.active {
    background: #0b604c;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-link .link-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-link .link-icon {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: #a4c2b7;
}

.sidebar-link.active .link-icon {
    color: #34d399;
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.14);
}

/* Main Panel */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--gb-bg);
}

.app-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--gb-border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.app-content {
    padding: 24px 28px 40px;
    flex: 1;
}

.app-subnav {
    background: #ffffff;
    border-bottom: 1px solid var(--gb-border);
    padding: 0 28px;
}

.app-subnav .nav-link {
    color: #52635c;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 10px 2px;
}

.app-subnav .nav-link.active {
    color: var(--gb-primary);
    border-bottom-color: var(--gb-primary);
}

/* Stat Cards (BidEx Style) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-box {
    background: #ffffff;
    border: 1px solid var(--gb-border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(11, 96, 76, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(11, 96, 76, 0.06);
    color: inherit;
}

.stat-box-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #60736a;
    margin-bottom: 4px;
}

.stat-box-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #172622;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.stat-box-desc {
    font-size: 0.75rem;
    color: #72847c;
}

.stat-box-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-card {
    background: #ffffff;
    border: 1px solid var(--gb-border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(11, 96, 76, 0.03);
    height: 100%;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #60736a;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.kpi-sub {
    font-size: 0.75rem;
    color: #72847c;
}

/* Sector Tabs Filter Bar (BidEx Style Horizontal Scroller) */
.sector-tabs-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: 18px;
    scrollbar-width: thin;
    scrollbar-color: #c2ded3 transparent;
}

.sector-tabs-wrap::-webkit-scrollbar {
    height: 4px;
}

.sector-tabs-wrap::-webkit-scrollbar-thumb {
    background: #c2ded3;
    border-radius: 4px;
}

.sector-tabs {
    display: flex;
    gap: 8px;
    width: max-content;
    white-space: nowrap;
    padding-left: 1px;
    padding-right: 1px;
}

.sector-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--gb-border);
    color: #384b43;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sector-pill:hover {
    background: #f0f7f4;
    border-color: var(--gb-primary-border);
    color: var(--gb-primary);
}

.sector-pill.active {
    background: var(--gb-primary);
    border-color: var(--gb-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(11, 96, 76, 0.2);
}

.btn-check + .sector-pill {
    cursor: pointer;
    margin: 0;
}

.btn-check:checked + .sector-pill {
    background: var(--gb-primary);
    border-color: var(--gb-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(11, 96, 76, 0.2);
}

.btn-check:focus-visible + .sector-pill {
    outline: 2px solid var(--gb-primary);
    outline-offset: 2px;
}

.btn-check:disabled + .sector-pill {
    opacity: 0.5;
    cursor: not-allowed;
}

.sector-pill .pill-badge {
    background: #eef3f0;
    color: #495e54;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.sector-pill.active .pill-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

/* BidEx Style Dense Data Table */
.bidex-table-wrap {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--gb-border);
    box-shadow: 0 2px 10px rgba(11, 96, 76, 0.03);
    overflow: hidden;
}

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

.bidex-table th {
    background: #f8faf8;
    color: #52635c;
    font-size: 0.75rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 13px 18px;
    border-bottom: 1px solid var(--gb-border);
    text-align: left;
}

.bidex-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gb-border-subtle);
    font-size: 0.86rem;
    vertical-align: middle;
    color: #273631;
}

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

.bidex-table tr:hover td {
    background: #fbfdfc;
}

.app-panel {
    background: #ffffff;
    border: 1px solid var(--gb-border);
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(11, 96, 76, 0.03);
    padding: 22px 24px;
}

.app-panel-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #52635c;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-panel-title .bi {
    color: var(--gb-primary);
    font-size: 0.95rem;
}

.app-panel-divider {
    border-top: 1px solid var(--gb-border-subtle);
    margin: 20px 0;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Mobile Sidebar Offcanvas */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

@media (max-width: 991px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .sidebar-backdrop.show {
        display: block;
    }
    .app-topbar {
        padding: 12px 18px;
    }
    .app-subnav {
        padding: 0 18px;
    }
    .app-content {
        padding: 18px;
    }
}

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

/* Filter Pill Groups (Market Intel & Competitors) */
.mi-source-pill, .mi-time-pill, .comp-time-pill {
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4b6358;
    background: transparent;
    border: none;
    border-radius: 999px;
    transition: all 0.15s ease;
}

.mi-source-pill:hover, .mi-time-pill:hover, .comp-time-pill:hover {
    color: var(--gb-primary);
    background: rgba(11, 96, 76, 0.08);
}

.mi-source-pill.active, .mi-time-pill.active, .comp-time-pill.active {
    background: #0b604c !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(11, 96, 76, 0.25);
}

/* Modal Stacking & Layering (Ensure Dossiers open above Tender Modal) */
.modal-backdrop {
    z-index: 1050 !important;
}
#tenderModal {
    z-index: 1055 !important;
}
body.modal-open .modal-backdrop:nth-of-type(2) {
    z-index: 1060 !important;
}
#companyDossierModal,
#agencyDossierModal {
    z-index: 1065 !important;
}
