@font-face {
    font-family: 'Mariupol';
    src: url('/fonts/Mariupol-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mariupol';
    src: url('/fonts/Mariupol-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mariupol';
    src: url('/fonts/Mariupol-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --brand-accent: #fb654f;
    --brand-accent-strong: #ea5b45;
    --brand-accent-soft: #fff0ea;
    --brand-ink: #796f64;
    --brand-ink-strong: #554c43;
    --brand-ink-soft: #9b9186;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --surface-soft: rgba(255, 248, 244, 0.8);
    --surface-muted: #f6efe9;
    --surface-border: rgba(121, 111, 100, 0.12);
    --surface-border-strong: rgba(121, 111, 100, 0.18);
    --text-main: #2f2924;
    --text-muted: #7f7469;
    --success: #2f9d73;
    --warning: #c2862d;
    --danger: #d45543;
    --info: #317db6;
    --shadow-sm: 0 10px 30px rgba(85, 76, 67, 0.08);
    --shadow-md: 0 20px 50px rgba(85, 76, 67, 0.12);
    --shadow-lg: 0 30px 80px rgba(85, 76, 67, 0.16);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
    --radius-pill: 999px;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    position: relative;
    background:
        radial-gradient(circle at top left, rgba(251, 101, 79, 0.15), transparent 28%),
        radial-gradient(circle at top right, rgba(121, 111, 100, 0.14), transparent 24%),
        linear-gradient(180deg, #f7efe8 0%, #efe3d9 48%, #f6eee8 100%);
    color: var(--text-main);
    font-family: 'Mariupol', sans-serif !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 45%),
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.28), transparent 26%);
    opacity: 0.85;
    z-index: 0;
}

::selection {
    background: rgba(251, 101, 79, 0.22);
    color: var(--text-main);
}

h1,
h2,
h3,
h4,
h5,
h6,
.fw-bold,
.fw-semibold,
.fw-medium,
strong,
label,
.btn,
.badge,
.nav-link {
    letter-spacing: -0.02em;
}

p,
.small,
.text-muted,
.form-text,
.page-subtitle {
    color: var(--text-muted) !important;
}

a,
.nav-link,
.text-decoration-none {
    color: var(--brand-ink) !important;
    transition: color 0.18s ease, opacity 0.18s ease;
}

a:hover,
a:focus,
.nav-link:hover,
.text-decoration-none:hover {
    color: var(--brand-ink-strong) !important;
}

.wrapper {
    gap: 22px;
    padding: 18px;
}

#content {
    min-width: 0;
}

.main-container {
    position: relative;
    z-index: 1;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 250, 247, 0.86) 100%);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

#sidebar {
    position: sticky;
    z-index: 1;
    top: 18px;
    min-height: calc(100vh - 36px) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 22%),
        linear-gradient(180deg, #8b7f73 0%, #70655b 100%) !important;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

#sidebar .sidebar-header,
.sidebar-footer {
    background: rgba(32, 27, 23, 0.12) !important;
    backdrop-filter: blur(10px);
}

#sidebar .sidebar-header {
    padding: 24px 22px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#sidebar .sidebar-header h4 {
    font-size: 1.08rem;
    letter-spacing: -0.04em;
    color: #fff8f3;
}

#sidebar ul.components {
    padding: 16px 12px !important;
    display: grid;
    gap: 4px;
}

#sidebar ul li {
    overflow: hidden;
    border-radius: 18px;
}

#sidebar ul li a {
    margin: 0;
    padding: 13px 16px !important;
    border: 1px solid transparent;
    border-left: 0 !important;
    border-radius: 18px;
    font-size: 0.96rem !important;
    font-weight: 500;
    color: rgba(255, 250, 246, 0.84) !important;
}

#sidebar ul li a i {
    opacity: 0.92;
}

#sidebar ul li a:hover,
#sidebar ul li.active > a,
#sidebar ul li > a[aria-expanded='true'] {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#sidebar ul.collapse,
#sidebar ul.collapsing {
    margin: 0;
    padding: 0 6px;
    border-radius: 18px;
    background: transparent !important;
}

#sidebar ul.collapse.show,
#sidebar ul.collapsing {
    margin: 6px 0 4px;
    padding: 6px;
    background: rgba(18, 14, 11, 0.12) !important;
}

#sidebar ul.collapsing {
    transition: height 0.22s ease, opacity 0.18s ease, margin 0.22s ease, padding 0.22s ease;
    opacity: 0.82;
}

#sidebar ul.collapse.show li a {
    font-size: 0.92rem !important;
    color: rgba(255, 246, 240, 0.78) !important;
}

#sidebar ul.collapse li a,
#sidebar ul.collapsing li a {
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#sidebar ul.collapse:not(.show) li a {
    transform: translateY(-2px);
}

#sidebar [data-bs-toggle="collapse"] {
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .text-light {
    color: rgba(255, 250, 246, 0.88) !important;
}

.page-title,
main h1,
main h3 {
    color: var(--brand-ink-strong);
    letter-spacing: -0.05em;
}

.page-title {
    font-size: clamp(1.9rem, 2.4vw, 2.4rem) !important;
    font-weight: 700;
}

.page-subtitle {
    font-size: 0.96rem !important;
    max-width: 72ch;
}

.card,
.table-card,
.login-card,
.list-group,
.modal-content,
.dropdown-menu {
    position: relative;
    border: 1px solid var(--surface-border) !important;
    border-radius: var(--radius-md) !important;
    background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%) !important;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
}

.card.shadow-sm,
.table-card.shadow-sm,
.login-card {
    box-shadow: var(--shadow-md) !important;
}

.card-header,
.card-footer,
.modal-header,
.modal-footer {
    border-color: var(--surface-border) !important;
    background: rgba(255, 255, 255, 0.62) !important;
}

.card-header {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.modal {
    z-index: 2000 !important;
}

.modal-backdrop {
    z-index: 1990 !important;
}

.modal-dialog,
.modal-content,
.modal-body,
.modal-header,
.modal-footer {
    pointer-events: auto;
}

body.modal-open .main-container,
body.modal-open #sidebar,
body.modal-open .sidebar-header,
body.modal-open .sidebar-footer {
    backdrop-filter: none !important;
}

.table-card {
    overflow: hidden;
}

.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: rgba(121, 111, 100, 0.4) transparent;
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(121, 111, 100, 0.025);
    --bs-table-hover-bg: rgba(251, 101, 79, 0.05);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 1rem 1.1rem !important;
    border-bottom-color: rgba(121, 111, 100, 0.08) !important;
}

.table th,
.table thead th,
.table thead td {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-ink-soft) !important;
    background: rgba(249, 243, 238, 0.8) !important;
}

.table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.table-hover > tbody > tr:hover > * {
    color: var(--text-main);
}

code,
.table code {
    padding: 0.28rem 0.52rem;
    border-radius: 10px;
    background: rgba(121, 111, 100, 0.08) !important;
    color: var(--brand-ink-strong) !important;
}

.form-label,
.filter-label,
label.small,
.small.text-muted,
.card-body > h6,
.card-body > .small {
    color: var(--brand-ink-soft);
}

.form-control,
.form-select,
.input-group-text,
.form-control-color,
.btn,
.nav-tabs .nav-link,
.pagination .page-link,
.list-group-item,
.alert {
    border-radius: 14px !important;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 46px;
    border-color: rgba(121, 111, 100, 0.14) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

textarea.form-control {
    min-height: unset;
}

.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .btn,
.form-select-sm,
.form-control-sm,
.btn-sm {
    border-radius: 12px !important;
}

.form-control::placeholder,
.form-select::placeholder {
    color: rgba(121, 111, 100, 0.5);
}

.form-control:focus,
.form-select:focus,
.input-group:focus-within .input-group-text {
    border-color: rgba(251, 101, 79, 0.48) !important;
    background: #fff !important;
    box-shadow: 0 0 0 0.2rem rgba(251, 101, 79, 0.12) !important;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 1.1rem;
    min-width: 1.1rem;
    cursor: pointer;
    border-color: rgba(121, 111, 100, 0.22) !important;
    box-shadow: none !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-check-input:not(:checked) {
    background-color: rgba(255, 255, 255, 0.92) !important;
}

.form-check-input:focus {
    border-color: rgba(251, 101, 79, 0.48) !important;
    box-shadow: 0 0 0 0.2rem rgba(251, 101, 79, 0.12) !important;
}

.form-check-input:checked {
    background-color: var(--brand-accent);
    border-color: var(--brand-accent);
}

.form-switch .form-check-input {
    width: 2.4rem;
    min-width: 2.4rem;
    height: 1.25rem;
    min-height: 1.25rem;
    border-radius: var(--radius-pill) !important;
}

.form-check-label {
    cursor: pointer;
}

.ui-mode-switch {
    position: relative;
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    min-width: 220px;
    padding: 0.26rem;
    border: 1px solid rgba(121, 111, 100, 0.12);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.ui-mode-switch__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.ui-mode-switch__thumb {
    position: absolute;
    top: 0.26rem;
    left: 0.26rem;
    width: calc(50% - 0.26rem);
    height: calc(100% - 0.52rem);
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, rgba(251, 101, 79, 0.16), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(251, 101, 79, 0.14);
    box-shadow: 0 10px 22px rgba(121, 111, 100, 0.1);
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease;
    z-index: 0;
}

.ui-mode-switch.is-secondary-active .ui-mode-switch__thumb {
    transform: translateX(100%);
    background: linear-gradient(135deg, rgba(251, 101, 79, 0.22), rgba(255, 255, 255, 0.94));
}

.ui-mode-switch__option {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    color: var(--brand-ink-soft);
    cursor: pointer;
    user-select: none;
    transition: color 0.18s ease, opacity 0.18s ease;
}

.ui-mode-switch__option.active {
    color: var(--brand-ink-strong);
}

.ui-mode-switch__option i {
    font-size: 0.92rem;
}

.input-group-text {
    color: var(--brand-ink-soft);
}

.btn {
    min-height: 44px;
    padding: 0.72rem 1rem;
    border-width: 1px !important;
    font-weight: 600;
    box-shadow: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary,
.btn-brown {
    background: linear-gradient(135deg, var(--brand-accent) 0%, #ff8c73 100%) !important;
    border-color: rgba(251, 101, 79, 0.72) !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(251, 101, 79, 0.24) !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-brown:hover,
.btn-brown:focus {
    background: linear-gradient(135deg, var(--brand-accent-strong) 0%, #ff7f66 100%) !important;
    border-color: rgba(234, 91, 69, 0.72) !important;
    color: #fff !important;
}

.btn-light,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger,
.btn-action,
button.border,
a.border {
    border-color: rgba(121, 111, 100, 0.14) !important;
    background: rgba(255, 255, 255, 0.72) !important;
    color: var(--brand-ink) !important;
}

.btn-light:hover,
.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover,
.btn-action:hover,
button.border:hover,
a.border:hover {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(121, 111, 100, 0.22) !important;
    color: var(--brand-ink-strong) !important;
}

.btn-danger {
    box-shadow: 0 12px 24px rgba(212, 85, 67, 0.18) !important;
}

.badge,
.badge-soft-success,
.badge-soft-warning,
.badge-soft-secondary,
.badge-soft-info,
.bg-success-subtle,
.bg-light.text-primary,
.bg-light.text-secondary,
.bg-light.text-dark {
    padding: 0.46rem 0.7rem !important;
    font-weight: 600;
    border-radius: var(--radius-pill) !important;
    border: 1px solid transparent;
}

.badge-soft-success,
.bg-success-subtle {
    background: rgba(47, 157, 115, 0.12) !important;
    border-color: rgba(47, 157, 115, 0.18) !important;
    color: var(--success) !important;
}

.badge-soft-warning {
    background: rgba(194, 134, 45, 0.14) !important;
    border-color: rgba(194, 134, 45, 0.16) !important;
    color: var(--warning) !important;
}

.badge-soft-secondary,
.bg-light.text-dark,
.bg-light.text-secondary {
    background: rgba(121, 111, 100, 0.08) !important;
    border-color: rgba(121, 111, 100, 0.12) !important;
    color: var(--brand-ink) !important;
}

.badge-soft-info,
.bg-light.text-primary {
    background: rgba(251, 101, 79, 0.1) !important;
    border-color: rgba(251, 101, 79, 0.14) !important;
    color: var(--brand-accent-strong) !important;
}

.stat-card {
    position: relative;
    overflow: hidden;
    gap: 16px;
    min-height: 122px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 22px !important;
    background:
        radial-gradient(circle at top right, rgba(251, 101, 79, 0.1), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 249, 246, 0.8) 100%) !important;
    box-shadow: var(--shadow-sm) !important;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: auto 18px 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 101, 79, 0.14), transparent 70%);
    pointer-events: none;
}

.stat-icon,
.product-thumb {
    border: 1px solid rgba(251, 101, 79, 0.08);
    border-radius: 18px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.stat-icon.bg-light-brown {
    background: linear-gradient(135deg, rgba(251, 101, 79, 0.16), rgba(255, 255, 255, 0.85)) !important;
    color: var(--brand-accent) !important;
}

.stat-value {
    font-size: clamp(1.4rem, 1.5vw, 1.8rem) !important;
    color: var(--brand-ink-strong);
    letter-spacing: -0.05em;
}

.stat-label {
    color: var(--brand-ink-soft) !important;
    letter-spacing: 0.08em !important;
}

.nav-tabs {
    gap: 8px;
    border-bottom: 0 !important;
}

.nav-tabs .nav-item {
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: 1px solid rgba(121, 111, 100, 0.12) !important;
    background: rgba(255, 255, 255, 0.56) !important;
    color: var(--brand-ink) !important;
    padding: 0.82rem 1.05rem;
    font-weight: 600;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(251, 101, 79, 0.22) !important;
    color: var(--brand-accent-strong) !important;
    box-shadow: 0 10px 24px rgba(121, 111, 100, 0.08);
}

.pagination {
    gap: 6px;
}

.pagination .page-link {
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-color: rgba(121, 111, 100, 0.12) !important;
    background: rgba(255, 255, 255, 0.82) !important;
    color: var(--brand-ink);
}

.pagination .page-item.active .page-link,
.pagination .page-link:hover {
    background: var(--brand-accent-soft) !important;
    border-color: rgba(251, 101, 79, 0.24) !important;
    color: var(--brand-accent-strong) !important;
}

.list-group {
    overflow: hidden;
}

.list-group-item {
    border-color: rgba(121, 111, 100, 0.08) !important;
    background: transparent !important;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.alert {
    border-width: 1px;
    box-shadow: none;
}

.alert-danger {
    background: rgba(212, 85, 67, 0.08) !important;
    border-color: rgba(212, 85, 67, 0.14) !important;
    color: #8c3d31 !important;
}

.alert-success {
    background: rgba(47, 157, 115, 0.09) !important;
    border-color: rgba(47, 157, 115, 0.14) !important;
    color: #226e51 !important;
}

.spinner-border {
    color: var(--brand-accent) !important;
}

.top-navbar {
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72) !important;
}

.login-card {
    width: min(100%, 430px) !important;
    padding: 2.2rem !important;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--brand-accent) 0%, #ffb29f 100%);
}

.login-card h3 {
    color: var(--brand-ink-strong);
    letter-spacing: -0.05em;
}

.login-card .btn-dark,
.login-card .btn-dark:hover,
.login-card .btn-dark:focus {
    background: linear-gradient(135deg, var(--brand-ink-strong) 0%, var(--brand-ink) 100%) !important;
    border-color: var(--brand-ink-strong) !important;
    color: #fff !important;
    box-shadow: 0 16px 26px rgba(85, 76, 67, 0.16) !important;
}

#analytics-widgets .col-md-2,
#analytics-widgets .col-sm-4,
.row.g-3 > [class*='col-'] {
    scroll-margin-top: 24px;
}

.sticky-top {
    top: 24px !important;
}

.text-primary {
    color: var(--brand-accent-strong) !important;
}

.text-secondary {
    color: var(--brand-ink-soft) !important;
}

.bg-white,
.card-footer.bg-white,
.card-header.bg-white {
    background-color: transparent !important;
}

.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: rgba(121, 111, 100, 0.1) !important;
}

.shadow-sm,
.shadow {
    box-shadow: var(--shadow-sm) !important;
}

.dropdown-menu {
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 10px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(251, 101, 79, 0.08);
}

.rounded-0 {
    border-radius: 0 !important;
}

.rounded-top-0 {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.rounded-bottom-0 {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.rounded-start-0 {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.rounded-end-0 {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

@media (max-width: 991.98px) {
    .wrapper {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    #sidebar {
        position: relative;
        top: 0;
        min-height: auto !important;
        max-width: none !important;
        width: 100%;
    }

    .main-container {
        padding: 18px;
        border-radius: 22px;
    }

    .page-title {
        font-size: 1.7rem !important;
    }
}

@media (max-width: 767.98px) {
    body {
        background:
            radial-gradient(circle at top, rgba(251, 101, 79, 0.1), transparent 30%),
            linear-gradient(180deg, #f7efe8 0%, #f1e7df 100%);
    }

    .main-container {
        padding: 16px;
    }

    .card,
    .table-card,
    .login-card,
    .list-group,
    .modal-content {
        border-radius: 18px !important;
    }

    .table > :not(caption) > * > * {
        padding: 0.85rem 0.8rem !important;
    }

    .btn,
    .form-control,
    .form-select,
    .input-group-text {
        min-height: 42px;
    }
}
