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

:root {
    --ss-primary: #0e3f99;
    --ss-primary-dark: #114fb5;
    --ss-gradient-start: #1d6ae5;
    --ss-gradient-end: #123b9b;
    --ss-surface: #f8f9fa;
    --bs-primary: #123b9b;
    --bs-primary-rgb: 15, 108, 189;
    --bs-secondary: #5b6b7a;
    --bs-secondary-rgb: 91, 107, 122;
    --bs-link-color: #0f6cbd;
    --bs-link-hover-color: #0b5597;
}

body {
    color: #212529;
    background-color: var(--ss-surface);
}

body > header,
body > main,
body > footer {
    width: min(1120px, calc(100% - 1rem));
    margin-left: auto;
    margin-right: auto;
}

main {
    flex: 1 0 auto;
    background-color: #ffffff;
}

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: #0b5597;
    --bs-btn-hover-border-color: #0b5597;
    --bs-btn-active-bg: #094a83;
    --bs-btn-active-border-color: #094a83;
}

.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: #0b5597;
    --bs-btn-active-border-color: #0b5597;
}

body > header.bg-primary {
    background: linear-gradient(0deg, #0e3f99 0%, #0744b7 100%) !important;
}

/* Legacy class bridge while pages are migrated to Bootstrap-only markup */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

.alert:not([class*="alert-"]) {
    border: 1px solid #ffe69c;
    border-radius: 0.375rem;
    background: #fff3cd;
    color: #664d03;
}

fieldset.form {
    margin: 0 0 1rem;
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
}

fieldset.form .hd {
    margin: 0;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.5rem 0.5rem 0 0;
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
}

ul.form,
ul.form li {
    list-style: none;
    margin: 0;
    padding: 0;
}

ul.form {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid #eef1f4;
}

ul.form.border-0,
ul.form.noBorder {
    border-bottom: 0;
}

.editBtn {
    margin-right: 0.25rem;
}

.login-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.login-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.login-feature-list li i {
    flex: 0 0 auto;
    margin-top: 0.125rem;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

textarea,
input,
select,
button {
    max-width: 100%;
}

table {
    width: 100%;
}

/* Keep legacy wide content usable on phones */
table,
pre,
code {
    overflow-wrap: anywhere;
}

@media (max-width: 991.98px) {
    body > header,
    body > main,
    body > footer {
        width: calc(100% - 0.75rem);
    }

    #mainNav .navbar-nav .nav-link {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 767.98px) {
    body > header,
    body > main,
    body > footer {
        width: calc(100% - 0.5rem);
    }

    ul.form {
        padding: 0.625rem;
    }

    ul.form li,
    .float-start,
    .float-end,
    .editBtn {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    ul.form li + li {
        margin-top: 0.5rem;
    }

    /* Buttons inside legacy list rows should span full width on mobile */
    ul.form .btn,
    fieldset.form .btn {
        width: 100%;
    }

    .cc-customer-form ul.form {
        padding: 0.75rem;
    }

    /* Horizontal scroll fallback for legacy data tables */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Reusable default card header gradient */
.cc-card-header-gradient {
    border: 0;
    color: #fff;
    background: linear-gradient(180deg, #0d6efd 0%, #084298 100%);
}

/* Customer data form: modern spacing and control styling on top of legacy markup */
.cc-customer-form ul.form {
    padding: 0.875rem 1rem;
}

.cc-customer-form ul.form > li:first-child label {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
}

.cc-customer-form input[type="text"],
.cc-customer-form input[type="password"],
.cc-customer-form select {
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.cc-customer-form input[type="text"]:focus,
.cc-customer-form input[type="password"]:focus,
.cc-customer-form select:focus {
    border-color: #6ea8fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    outline: 0;
}

.cc-customer-form input[readonly],
.cc-customer-form select[disabled] {
    background: #f8fafc;
    color: #64748b;
}

.cc-customer-form .alert {
    margin: 0.75rem 1rem;
}

.cc-customer-form .btn {
    border-radius: 0.5rem;
}

#mainNav .nav-link {
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

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

#mainNav .nav-item.show > .nav-link,
#mainNav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.24);
    color: #fff !important;
}

/* Product pages: modernized layout bridge for legacy UL/LI forms */
.product-layout {
    margin-top: 0.5rem;
}

.product-layout fieldset.form.card {
    border-radius: 0.75rem;
    border: 1px solid #dbe3ee !important;
    box-shadow: 0 0.6rem 1.4rem rgba(2, 6, 23, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.product-layout .cc-product-card {
    position: relative;
    overflow: hidden;
}

.product-layout .cc-product-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, #0d6efd 0%, #084298 100%);
}

.product-layout .h5 {
    margin: -0.2rem -0.2rem 1rem !important;
    padding: 0.75rem 0.9rem !important;
    border: 0 !important;
    border-radius: 0.6rem;
    background: linear-gradient(90deg, #0d6efd 0%, #0b5ed7 45%, #084298 100%);
    color: #fff;
    letter-spacing: 0.01em;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.15);
}

.product-layout .h5::before {
    font-family: "bootstrap-icons";
    content: "\f3e8";
    display: inline-block;
    margin-right: 0.5rem;
    color: #fff;
    font-size: 0.95em;
}

.product-layout ul.form {
    display: grid;
    grid-template-columns: minmax(190px, 28%) 1fr;
    gap: 0.35rem 1rem;
    margin: 0 0 0.7rem;
    padding: 0.8rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.55rem;
    background: #fff;
}

.product-layout ul.form:nth-of-type(odd) {
    background: #f8fbff;
    border-color: #dce8fb;
}

.product-layout ul.form:nth-of-type(even) {
    background: #ffffff;
}

.product-layout ul.form > li {
    float: none !important;
    width: auto !important;
    margin: 0;
    grid-column: 2;
}

.product-layout ul.form > li:first-child {
    grid-column: 1;
}

.product-layout ul.form > li label,
.product-layout ul.form > li:first-child label {
    display: inline-block;
    margin-bottom: 0.25rem;
    color: #1e3a5f;
    font-size: 0.875rem;
    font-weight: 600;
}

.product-layout ul.form > li.clearfix {
    display: none !important;
}

.product-layout ul.form.border-0 {
    border: 0;
    background: transparent;
    padding-left: 0;
    padding-right: 0;
}

.product-layout ul.form .float-end {
    justify-self: end;
    text-align: right;
}

.product-layout ul.form input[type="text"],
.product-layout ul.form input[type="password"],
.product-layout ul.form input[type="file"],
.product-layout ul.form textarea,
.product-layout ul.form select {
    width: 100% !important;
    max-width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
}

.product-layout ul.form textarea {
    min-height: 7rem;
}

.product-layout ul.form a {
    text-underline-offset: 2px;
}

.product-layout .btn::before {
    display: none;
}

.product-layout .btn {
    border-radius: 0.5rem;
}

.product-layout .alert {
    border-radius: 0.55rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .product-layout fieldset.form.card {
        padding: 0.85rem !important;
    }

    .product-layout ul.form {
        grid-template-columns: 1fr;
        padding: 0.7rem;
    }

    .product-layout ul.form > li,
    .product-layout ul.form > li:first-child {
        grid-column: 1;
    }

    .product-layout ul.form .float-end {
        justify-self: stretch;
        text-align: left;
    }
}
