:root {
    --dynamic-red: #d71920;
    --dynamic-red-dark: #b9141a;
    --dynamic-navy: #172033;
    --dynamic-bg: #f4f6f8;
    --dynamic-border: #dee2e6;
    --dynamic-muted: #6c757d;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--dynamic-bg);
    color: #212529;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.dynamic-navbar {
    min-height: 64px;
    background: var(--dynamic-navy);
}

.dynamic-navbar .navbar-brand {
    color: #fff;
    margin-right: 36px;
}

.dynamic-navbar .navbar-brand:hover {
    color: #fff;
}

.dynamic-navbar .navbar-brand > span:last-child {
    display: grid;
    line-height: 1.05;
}

.dynamic-navbar .navbar-brand strong {
    font-size: 18px;
}

.dynamic-navbar .navbar-brand small {
    color: #adb5bd;
    font-size: 10px;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.dynamic-logo-mark {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: var(--dynamic-red);
    color: #fff;
    font-size: 21px;
    font-weight: 800;
}

.dynamic-navbar .nav-link {
    color: rgba(255,255,255,.72);
    font-weight: 600;
    padding: 21px 15px;
    border-bottom: 3px solid transparent;
}

.dynamic-navbar .nav-link:hover {
    color: #fff;
}

.dynamic-navbar .nav-link.active {
    color: #fff;
    border-bottom-color: var(--dynamic-red);
}

.portal-user {
    color: #e9ecef;
    font-size: 13px;
}

.portal-module-bar {
    background: #fff;
    border-bottom: 1px solid var(--dynamic-border);
    padding: 10px 0;
}

.portal-module-title {
    font-weight: 700;
    margin-right: 12px;
}

.portal-module-description {
    color: var(--dynamic-muted);
    font-size: 13px;
}


/* ============================================================
   CONTENT
   ============================================================ */

.portal-main {
    min-height: calc(100vh - 110px);
}

.portal-content {
    max-width: 1600px;
    padding: 28px 32px 50px;
}

.page-hero,
.nexa-project-hero {
    background: var(--dynamic-red);
    border-radius: 8px !important;
}

.page-hero h1,
.nexa-project-hero h1 {
    color: #fff;
    font-weight: 800;
    font-size: 28px;
}

.page-hero p,
.nexa-project-hero p {
    color: rgba(255,255,255,.86);
}

.page-hero .btn,
.nexa-project-hero .btn {
    border-radius: 7px;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
    border: 1px solid var(--dynamic-border);
    border-radius: 8px;
}

.card-header {
    background: #fff;
    font-weight: 650;
    border-bottom: 1px solid var(--dynamic-border);
}

.portal-stat-card {
    height: 100%;
    border: 1px solid var(--dynamic-border);
    background: #fff;
    border-radius: 8px;
    padding: 22px;
}

.portal-stat-card .label {
    color: var(--dynamic-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
}

.portal-stat-card .value {
    font-size: 31px;
    line-height: 1;
    margin-top: 12px;
    font-weight: 800;
}

.portal-stat-card .detail {
    margin-top: 8px;
    color: var(--dynamic-muted);
    font-size: 12px;
}


/* ============================================================
   TABLES
   ============================================================ */

.table-portal {
    margin-bottom: 0;
}

.table-portal thead th {
    background: #f8f9fa;
    color: #495057;
    border-bottom-width: 1px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.table-portal tbody td {
    vertical-align: middle;
    font-size: 13px;
}

.table-portal tbody tr:hover {
    background: #fafafa;
}

.portal-table-link {
    color: #0d6efd;
    font-weight: 650;
    text-decoration: none;
}

.portal-table-link:hover {
    text-decoration: underline;
}


/* ============================================================
   FORMS
   ============================================================ */

.portal-form-card .card-body {
    padding: 25px;
}

.portal-form-card label {
    font-weight: 650;
    font-size: 13px;
}

.portal-form-card input,
.portal-form-card select,
.portal-form-card textarea {
    display: block;
    width: 100%;
    padding: .55rem .75rem;
    font-size: .9rem;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    background: #fff;
}

.portal-form-card input:focus,
.portal-form-card select:focus,
.portal-form-card textarea:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

.portal-form-card textarea {
    min-height: 110px;
}

.field-errors {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

.sync-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    padding: 13px 17px;
    margin-bottom: 20px;
    border: 1px solid #cfe2ff;
    border-radius: 7px;
    background: #e7f1ff;
}

.sync-strip > div {
    display: grid;
}

.sync-strip span {
    color: var(--dynamic-muted);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
}

.sync-strip strong {
    font-size: 13px;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn-dynamic {
    color: #fff;
    background: var(--dynamic-red);
    border-color: var(--dynamic-red);
}

.btn-dynamic:hover {
    color: #fff;
    background: var(--dynamic-red-dark);
    border-color: var(--dynamic-red-dark);
}


/* ============================================================
   EMPTY STATES
   ============================================================ */

.portal-empty {
    text-align: center;
    padding: 55px 20px;
    color: var(--dynamic-muted);
}

.portal-empty h3 {
    color: #343a40;
}


/* ============================================================
   LOGIN
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--dynamic-navy);
    padding: 30px;
}

.login-card {
    width: min(440px, 100%);
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 25px 70px rgba(0,0,0,.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 25px;
}

.login-brand .dynamic-logo-mark {
    margin: 0 auto 13px;
}

.login-brand h1 {
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 3px;
}

.login-brand p {
    color: var(--dynamic-muted);
    margin: 0;
}

.login-card label {
    font-size: 13px;
    font-weight: 650;
}

.login-card input {
    display: block;
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid #ced4da;
    border-radius: .375rem;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991px) {

    .dynamic-navbar .nav-link {
        padding: 10px 5px;
        border-bottom: 0;
    }

    .dynamic-navbar .nav-link.active {
        color: #fff;
        background: rgba(255,255,255,.08);
        border-radius: 5px;
    }

    .portal-user {
        padding: 12px 0;
    }

    .portal-content {
        padding: 20px 15px 40px;
    }
}


/* ============================================================
   DYNAMIC PARTNER PORTAL
   Match the production Dynamic Portal shell.
   ============================================================ */

body {
    background: #f8fafc;
    color: #0f172a;
}

.portal-content {
    max-width: none;
    padding: 1rem 4rem 2rem;
}

.dynamic-navbar,
.portal-module-bar {
    display: none !important;
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15,23,42,.06);
}

.card-header {
    border-radius: 16px 16px 0 0 !important;
}

.btn-dynamic {
    background: #d71920;
    border-color: #d71920;
}

.btn-dynamic:hover,
.btn-dynamic:focus {
    background: #bd151b;
    border-color: #bd151b;
}

@media (max-width: 991.98px) {

    .portal-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

}
