:root {
    --rf-teal: #16d7aa;
    --rf-teal-strong: #0fb590;
    --rf-teal-soft: rgb(22 215 170 / 14%);
    --rf-navy: #17213d;
    --rf-ink: #071230;
    --rf-blue: #0a84ff;
    --rf-orange: #ff9f43;
    --rf-surface: #ffffff;
    --rf-muted: #6b7489;
    --rf-border: rgb(23 33 61 / 10%);
    --rf-danger: #dc3545;
    --rf-radius-xs: 6px;
    --rf-radius-sm: 8px;
    --rf-radius-md: 12px;
    --rf-radius-lg: 18px;
    --rf-shadow-xs: 0 1px 2px rgb(23 33 61 / 8%);
    --rf-shadow-sm: 0 2px 10px rgb(23 33 61 / 8%);
    --rf-shadow-md: 0 10px 28px rgb(23 33 61 / 12%);
    --rf-shadow-lg: 0 22px 48px rgb(23 33 61 / 18%);
    --rf-shadow-accent: 0 12px 28px rgb(22 215 170 / 30%);
    --rf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --rf-speed: 0.22s;
    --rf-font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rf-page-bg: linear-gradient(
        100deg,
        rgb(10 132 255 / 15%) 0%,
        rgb(240 246 253) 36%,
        rgb(255 249 242) 64%,
        rgb(255 159 67 / 16%) 100%
    );
}

html {
    min-height: 100%;
}

body {
    font-family: var(--rf-font);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--rf-navy);
    background-color: #f6f9fd;
    background-image: var(--rf-page-bg);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    font-family: var(--rf-font);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--rf-ink);
}

p {
    font-weight: 400;
    letter-spacing: 0;
}

small,
.small {
    letter-spacing: 0.01em;
}

table,
.table {
    font-variant-numeric: tabular-nums;
}

a {
    transition: color var(--rf-speed) var(--rf-ease);
}

.card {
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius-lg);
    background-color: var(--rf-surface);
    box-shadow: var(--rf-shadow-sm);
    transition: box-shadow var(--rf-speed) var(--rf-ease), transform var(--rf-speed) var(--rf-ease),
        border-color var(--rf-speed) var(--rf-ease);
}

.card:hover {
    box-shadow: var(--rf-shadow-md);
}

.card.border-0 {
    border: 1px solid var(--rf-border) !important;
}

.btn {
    border-radius: var(--rf-radius-md);
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: background-color var(--rf-speed) var(--rf-ease), border-color var(--rf-speed) var(--rf-ease),
        color var(--rf-speed) var(--rf-ease), box-shadow var(--rf-speed) var(--rf-ease),
        transform var(--rf-speed) var(--rf-ease);
}

.btn:not(.btn-link):not(.btn-close):hover {
    box-shadow: var(--rf-shadow-md);
    transform: translateY(-2px);
}

.btn:not(.btn-link):not(.btn-close):active {
    box-shadow: var(--rf-shadow-xs);
    transform: translateY(0);
}

.btn-sm {
    border-radius: var(--rf-radius-sm);
}

.form-control,
.form-select {
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius-md);
    background-color: rgb(255 255 255 / 92%);
    color: var(--rf-navy);
    transition: border-color var(--rf-speed) var(--rf-ease), box-shadow var(--rf-speed) var(--rf-ease),
        background-color var(--rf-speed) var(--rf-ease);
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
    border-color: var(--rf-teal);
    box-shadow: var(--rf-shadow-xs);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rf-teal);
    background-color: #fff;
    box-shadow: 0 0 0 0.22rem var(--rf-teal-soft), var(--rf-shadow-sm);
}

.form-label,
label {
    font-weight: 500;
}

.table > :not(caption) > * > * {
    border-color: var(--rf-border);
}

.table thead th {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--rf-muted);
    background-color: rgb(23 33 61 / 3%);
    border-bottom: 1px solid var(--rf-border);
}

.table tbody tr {
    transition: background-color var(--rf-speed) var(--rf-ease), box-shadow var(--rf-speed) var(--rf-ease);
}

.table tbody tr:hover {
    background-color: var(--rf-teal-soft);
    box-shadow: inset 3px 0 0 var(--rf-teal), var(--rf-shadow-xs);
}

.pagination {
    flex-wrap: wrap;
    gap: 0.4rem;
}

.pagination .page-item .page-link,
.pagination .page-item:first-child .page-link,
.pagination .page-item:last-child .page-link {
    min-width: 2.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius-sm);
    background-color: var(--rf-surface);
    color: var(--rf-navy);
    font-weight: 500;
    text-align: center;
    box-shadow: var(--rf-shadow-xs);
    transition: background-color var(--rf-speed) var(--rf-ease), color var(--rf-speed) var(--rf-ease),
        box-shadow var(--rf-speed) var(--rf-ease), transform var(--rf-speed) var(--rf-ease),
        border-color var(--rf-speed) var(--rf-ease);
}

.pagination .page-item:not(:first-child) .page-link {
    margin-left: 0;
}

.pagination .page-item:not(.active):not(.disabled) .page-link:hover {
    border-color: var(--rf-teal);
    background-color: var(--rf-teal-soft);
    color: var(--rf-ink);
    box-shadow: var(--rf-shadow-md);
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    color: #fff;
    box-shadow: var(--rf-shadow-accent);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.55;
    box-shadow: none;
}

.dropdown-menu {
    padding: 0.5rem;
    border: 1px solid var(--rf-border);
    border-radius: var(--rf-radius-md);
    box-shadow: var(--rf-shadow-lg);
}

.dropdown-item {
    border-radius: var(--rf-radius-sm);
    transition: background-color var(--rf-speed) var(--rf-ease), color var(--rf-speed) var(--rf-ease),
        box-shadow var(--rf-speed) var(--rf-ease);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--rf-teal-soft);
    color: var(--rf-ink);
    box-shadow: var(--rf-shadow-xs);
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background-color: rgb(220 53 69 / 10%);
    color: var(--rf-danger) !important;
}

.modal-content {
    border: 0;
    border-radius: var(--rf-radius-lg);
    box-shadow: var(--rf-shadow-lg);
}

.alert {
    border: 0;
    border-radius: var(--rf-radius-md);
    box-shadow: var(--rf-shadow-sm);
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

img {
    max-width: 100%;
}

.product-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--rf-radius-md);
    background: radial-gradient(circle at 30% 20%, #fff, rgb(23 33 61 / 4%));
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-grid {
    --gap: 1rem;
    --per-row: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gap);
}

.product-grid__item {
    display: flex;
    flex: 0 0 calc((100% - (var(--per-row) - 1) * var(--gap)) / var(--per-row));
    max-width: calc((100% - (var(--per-row) - 1) * var(--gap)) / var(--per-row));
    min-width: 0;
}

.product-grid__item > .card,
.product-grid__item > .item-bg {
    width: 100%;
}

@media (min-width: 768px) {
    .product-grid {
        --gap: 1.25rem;
        --per-row: 3;
    }
}

@media (min-width: 992px) {
    .product-grid {
        --per-row: 4;
    }
}

.product-grid--compact {
    --per-row: 2;
}

.product-grid--three {
    --per-row: 2;
}

@media (min-width: 768px) {
    .product-grid--three {
        --per-row: 3;
    }
}

.product-grid .item-bg {
    border-radius: var(--rf-radius-lg);
    overflow: hidden;
    background: #fff;
}

.product-grid .item-bg:hover {
    box-shadow: var(--rf-shadow-lg);
}

.product-grid .scrap-img {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    overflow: hidden;
    border-radius: var(--rf-radius-md);
    background: radial-gradient(circle at 30% 20%, #fff, rgb(23 33 61 / 4%));
}

.product-grid .scrap-img img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.35s var(--rf-ease);
}

.product-grid .item-bg:hover .scrap-img img {
    transform: scale(1.06);
}

.product-grid .scrap-content {
    text-align: center;
}

.product-grid .scrap-content h3 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
    line-height: 1.3;
}

::selection {
    background: var(--rf-teal-soft);
    color: var(--rf-ink);
}

@media (prefers-reduced-motion: reduce) {
    .btn:not(.btn-link):not(.btn-close):hover,
    .pagination .page-item:not(.active):not(.disabled) .page-link:hover {
        transform: none;
    }
}

@media (hover: none) {
    .btn:not(.btn-link):not(.btn-close):hover,
    .pagination .page-item:not(.active):not(.disabled) .page-link:hover {
        transform: none;
    }
}

@media (max-width: 991.98px) {
    body {
        font-size: 0.92rem;
    }

    .table {
        font-size: 0.88rem;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.88rem;
    }

    h1,
    .h1 {
        font-size: 1.6rem;
    }

    h2,
    .h2 {
        font-size: 1.4rem;
    }

    h3,
    .h3 {
        font-size: 1.2rem;
    }

    h4,
    .h4 {
        font-size: 1.08rem;
    }

    h5,
    .h5 {
        font-size: 1rem;
    }

    h6,
    .h6 {
        font-size: 0.92rem;
    }

    p {
        font-size: 0.88rem;
    }

    .table {
        font-size: 0.82rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.55rem 0.5rem;
    }

    .table thead th {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }

    .btn {
        padding: 0.45rem 0.95rem;
        font-size: 0.88rem;
    }

    .btn-sm {
        font-size: 0.8rem;
    }

    .form-control,
    .form-select {
        padding-top: 0.45rem;
        padding-bottom: 0.45rem;
        font-size: 0.9rem;
    }

    .card-title {
        font-size: 1.05rem;
    }

    .pagination .page-item .page-link,
    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        min-width: 2.1rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }

    .dropdown-item {
        font-size: 0.88rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 0.84rem;
    }

    h1,
    .h1 {
        font-size: 1.4rem;
    }

    h2,
    .h2 {
        font-size: 1.25rem;
    }

    h3,
    .h3 {
        font-size: 1.1rem;
    }

    h4,
    .h4 {
        font-size: 1rem;
    }

    h5,
    .h5 {
        font-size: 0.94rem;
    }

    h6,
    .h6 {
        font-size: 0.88rem;
    }

    p {
        font-size: 0.84rem;
    }

    .table {
        font-size: 0.76rem;
    }

    .table > :not(caption) > * > * {
        padding: 0.45rem 0.4rem;
    }

    .table thead th {
        font-size: 0.64rem;
    }

    .btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.84rem;
    }

    .form-control,
    .form-select {
        font-size: 0.86rem;
    }
}

@media (max-width: 575.98px) {
    .pagination {
        gap: 0.25rem;
    }

    .pagination .page-item .page-link,
    .pagination .page-item:first-child .page-link,
    .pagination .page-item:last-child .page-link {
        min-width: 1.6rem;
        padding: 0.18rem 0.4rem;
        font-size: 0.72rem;
        line-height: 1.4;
    }
}
