:root {
    --fsd-primary: #336699;
    --fsd-primary-dark: #244f78;
    --fsd-primary-soft: #eaf1f7;
    --fsd-accent: #cc6633;
    --fsd-accent-dark: #aa5228;
    --fsd-ink: #1f2a37;
    --fsd-muted: #667085;
    --fsd-surface: #ffffff;
    --fsd-page: #f4f7fa;
}

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

body.app-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 0 0, rgba(51, 102, 153, .08), transparent 30rem),
        linear-gradient(180deg, #f8fafc 0, var(--fsd-page) 22rem, var(--fsd-page) 100%);
    color: var(--fsd-ink);
    -webkit-font-smoothing: antialiased;
}

.app-main {
    flex: 1 0 auto;
}

.app-navbar {
    background: linear-gradient(112deg, #183b5c 0%, var(--fsd-primary) 62%, #3f75a9 100%);
    border-bottom: 3px solid var(--fsd-accent);
    box-shadow: 0 .35rem 1.3rem rgba(25, 52, 77, .18);
    padding-top: .7rem;
    padding-bottom: .7rem;
}

.app-brand {
    color: #fff !important;
    text-decoration: none;
    margin-right: 1.25rem;
}

.app-brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .22rem .48rem;
    border-radius: .72rem;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 .2rem .65rem rgba(0, 0, 0, .16);
}

.app-brand-logo {
    display: block;
    width: auto;
    height: 2.45rem;
}

.app-version {
    display: inline-block;
    margin-left: .35rem;
    padding: .1rem .4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .8);
    font-size: .66rem;
    font-weight: 650;
    vertical-align: .12rem;
}

.app-nav-link {
    color: rgba(255, 255, 255, .84) !important;
    border-radius: .65rem;
    padding: .48rem .7rem !important;
    font-size: .92rem;
    font-weight: 550;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.app-nav-link:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff !important;
}

.app-nav-link.active {
    background: #fff;
    color: var(--fsd-primary-dark) !important;
    box-shadow: 0 .2rem .55rem rgba(0, 0, 0, .1);
}

.app-tenant-pill {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: .7rem;
    color: #fff !important;
    background: rgba(0, 0, 0, .09);
    padding: .4rem .65rem !important;
    line-height: 1.1;
}

.app-tenant-pill:hover {
    background: rgba(255, 255, 255, .12);
}

.app-tenant-label {
    display: block;
    color: rgba(255, 255, 255, .66);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .1rem;
}

.app-logout-btn {
    background: rgba(255, 255, 255, .95);
    color: var(--fsd-primary-dark);
    border: 0;
    border-radius: .65rem;
    font-weight: 650;
    padding: .48rem .72rem;
}

.app-logout-btn:hover {
    background: #fff;
    color: #173a59;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, .25);
}

.page-header {
    margin-bottom: 1.5rem;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(38, 76, 111, .09);
    border-left: .28rem solid var(--fsd-accent);
    border-radius: 1rem;
    box-shadow: 0 .45rem 1.3rem rgba(31, 54, 74, .06);
}

.page-header h1 {
    color: #203b55;
    font-weight: 750;
    letter-spacing: -.025em;
}

.page-header > a:not(.btn),
.page-header div > a:not(.btn) {
    color: var(--fsd-primary);
    font-size: .9rem;
    font-weight: 600;
}

.card {
    border: 1px solid rgba(33, 66, 96, .08);
    border-radius: 1rem;
    box-shadow: 0 .45rem 1.4rem rgba(29, 52, 73, .065);
    overflow: hidden;
}

.card-body {
    padding: 1.25rem;
}

.card-title,
.card h2,
.card h3 {
    color: #254863;
}

.btn {
    border-radius: .7rem;
    font-weight: 600;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff !important;
    background-color: var(--fsd-primary);
    border-color: var(--fsd-primary);
    box-shadow: 0 .25rem .6rem rgba(51, 102, 153, .16);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--fsd-primary-dark);
    border-color: var(--fsd-primary-dark);
}

.btn-outline-primary {
    color: var(--fsd-primary);
    border-color: rgba(51, 102, 153, .55);
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--fsd-primary);
    border-color: var(--fsd-primary);
}

.btn-success,
.btn-outline-success,
.btn-danger,
.btn-outline-danger,
.btn-secondary,
.btn-outline-secondary {
    box-shadow: none;
}

.form-control,
.form-select {
    border-radius: .7rem;
    border-color: #d7dee7;
    min-height: 2.6rem;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(51, 102, 153, .65);
    box-shadow: 0 0 0 .2rem rgba(51, 102, 153, .12);
}

.form-label,
.col-form-label {
    color: #34495e;
    font-weight: 600;
}

.form-text,
.text-secondary {
    color: var(--fsd-muted) !important;
}

.alert {
    border-radius: .85rem;
    border-width: 1px;
}

.badge {
    border-radius: 999px;
    font-weight: 650;
    letter-spacing: .005em;
}

.accordion-item {
    border-color: rgba(33, 66, 96, .1) !important;
    border-radius: .9rem !important;
    box-shadow: 0 .35rem 1rem rgba(29, 52, 73, .045);
}

.accordion-button {
    font-weight: 600;
    background: #fff;
}

.accordion-button:not(.collapsed) {
    color: var(--fsd-primary-dark);
    background: var(--fsd-primary-soft);
    box-shadow: none;
}


.stats-data-badge {
    min-height: 2rem;
    padding-top: .35rem;
    padding-bottom: .35rem;
    line-height: 1;
}

.table > :not(caption) > * > * {
    padding: .85rem .9rem;
}

.table thead th {
    background: #f5f8fb;
    color: #516274;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom-width: 1px;
}

.code-block {
    background: #111827;
    color: #f8f9fa;
    border-radius: .75rem;
    padding: .85rem 1rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .875rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.monospace {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    word-break: break-all;
}

.topic-child {
    border-left: .25rem solid var(--fsd-primary-soft);
    padding-left: 1rem;
}

.review-image {
    width: 100%;
    max-height: 720px;
    object-fit: contain;
    background: #eef2f6;
    border-radius: .85rem;
    border: 1px solid rgba(33, 66, 96, .08);
}

.login-shell {
    max-width: 460px;
    margin: 7vh auto 0;
}

.status-grid {
    display: grid;
    grid-template-columns: minmax(150px, auto) 1fr;
    gap: .5rem 1rem;
}

.setup-steps {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .5rem;
}

.setup-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .75rem;
    border-radius: .7rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    text-decoration: none;
    min-width: 0;
}

.setup-step > span {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--bs-secondary-bg);
    font-weight: 700;
}

.setup-step small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.setup-step.active {
    border-color: var(--fsd-primary);
    color: var(--fsd-primary);
    background: rgba(51, 102, 153, .06);
    font-weight: 600;
}

.setup-step.active > span {
    background: var(--fsd-primary);
    color: #fff;
}

.setup-step.disabled {
    opacity: .5;
}

.setup-finish-icon {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

.setup-finish-icon.complete {
    background: var(--bs-success-bg-subtle);
    color: var(--bs-success-text-emphasis);
}

.app-footer {
    flex: 0 0 auto;
    padding: 1rem 0;
    background: rgba(255, 255, 255, .82);
    border-top: 1px solid rgba(33, 66, 96, .09);
}

.app-footer a {
    color: #536779;
    text-decoration: none;
    font-weight: 550;
}

.app-footer a:hover {
    color: var(--fsd-primary);
}

.footer-dot {
    color: #b0bac4;
}

@media (min-width: 992px) {
    .card-body {
        padding: 1.5rem;
    }
}

@media (max-width: 1199.98px) {
    .app-navbar .navbar-collapse {
        padding-top: .4rem;
        padding-bottom: .25rem;
    }
    .app-nav-link,
    .app-tenant-pill {
        margin-bottom: .2rem;
        max-width: 100%;
    }
}

@media (max-width: 992px) {
    .setup-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .status-grid {
        grid-template-columns: 1fr;
        gap: .15rem;
    }
    .setup-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .page-header {
        padding: 1rem;
        border-radius: .85rem;
    }
    .page-header h1 {
        font-size: 1.6rem;
    }
    .footer-dot {
        display: none;
    }
}

.login-brand {
    text-align: center;
}

.login-brand-logo {
    display: block;
    width: min(100%, 330px);
    height: auto;
    margin: 0 auto;
}

.app-footer-logo {
    width: auto;
    height: 1.55rem;
}

@media (max-width: 575.98px) {
    .app-brand-logo-wrap {
        padding: .18rem .38rem;
    }

    .app-brand-logo {
        height: 2rem;
    }

    .app-version {
        margin-left: 0;
        font-size: .6rem;
    }
}
