/* OTP GLOBAL LIMITED — base application styles
   Brand palette: deep green #1b4332, white, neutral gray, earth/gold accent #b08968 */

:root {
    --otp-green: #1b4332;
    --otp-green-dark: #10281e;
    --otp-gold: #b08968;
    --otp-gray: #6c757d;
    --otp-sidebar: #10251c;
    --otp-sidebar-muted: #8da399;
    --otp-sidebar-line: rgba(218, 232, 224, 0.1);
    --otp-sidebar-active: #d6a66f;
}

body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.navbar-brand {
    letter-spacing: 0.02em;
}

.app-topbar {
    min-height: 68px;
    background: var(--otp-green-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.brand-mark {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 32px;
    border: 1px solid rgba(214, 166, 111, 0.7);
    border-radius: 9px;
    color: var(--otp-sidebar-active);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0;
}

.app-sidebar {
    width: 276px;
    flex: 0 0 276px;
    color: #f5f8f6;
    background: var(--otp-sidebar) !important;
    border-right: 1px solid var(--otp-sidebar-line);
}

.sidebar-brand,
.app-sidebar-mobile-header {
    align-items: center;
    gap: 0.7rem;
    min-height: 88px;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--otp-sidebar-line);
}

.sidebar-brand-copy,
.sidebar-brand {
    display: flex;
}

.sidebar-brand strong,
.sidebar-brand-copy strong {
    display: block;
    color: #f7faf8;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.sidebar-brand small,
.sidebar-brand-copy small {
    display: block;
    margin-top: 0.2rem;
    color: var(--otp-sidebar-muted);
    font-size: 0.72rem;
}

.sidebar-nav {
    padding: 0.75rem 0.7rem 1rem;
}

.sidebar-section-label {
    margin: 0.95rem 0.65rem 0.35rem;
    color: var(--otp-sidebar-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 38px;
    margin: 0.12rem 0;
    padding: 0.55rem 0.65rem 0.55rem 0.9rem;
    border-radius: 6px;
    color: #cbd9d1;
    font-size: 0.86rem;
    transition: color 160ms ease, background-color 160ms ease;
}

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

.sidebar-link.is-active {
    color: #ffffff;
    background: rgba(214, 166, 111, 0.14);
}

.sidebar-link.is-active::before {
    position: absolute;
    top: 7px;
    bottom: 7px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--otp-sidebar-active);
    content: "";
}

.sidebar-link-icon {
    width: 1.2rem;
    margin-right: 0.7rem;
    color: #92a99e;
    font-size: 0.95rem;
    text-align: center;
}

.sidebar-link.is-active .sidebar-link-icon {
    color: var(--otp-sidebar-active);
}

.sidebar-link.is-disabled {
    color: #667d70;
    cursor: default;
}

.sidebar-link.is-disabled:hover {
    background: transparent;
}

.sidebar-soon {
    margin-left: 0.5rem;
    color: #a9baaf;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0 1rem 1rem;
    padding: 0.9rem 0.2rem 0;
    border-top: 1px solid var(--otp-sidebar-line);
    color: #789084;
    font-size: 0.68rem;
    line-height: 1.5;
}

.sidebar-footer-label {
    color: var(--otp-sidebar-active);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.card {
    border-radius: 0.6rem;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(27, 67, 50, 0.25);
}

.table thead.table-light th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--otp-gray);
}

/* Field-usable large touch targets on small screens (spec §34) */
@media (max-width: 576px) {
    .btn, .form-control, .form-select {
        min-height: 44px;
    }
    /* Stack header action button rows cleanly on phones instead of wrapping mid-word */
    .d-flex.flex-wrap.gap-2 > .btn,
    .d-flex.flex-wrap.gap-2 > form {
        flex: 1 1 auto;
    }
    /* KPI cards: 2-up on phones stays readable; avoid cramped 1-up giant cards */
    .card-body {
        padding: 0.9rem;
    }
}

/* Sidebar scroll on short viewports so the footer never hides nav items */
.app-sidebar .offcanvas-body {
    overflow-y: auto;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: min(86vw, 320px);
        flex-basis: auto;
    }
}

#network-status-banner {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1050;
}
