/*
 * UI UX Pro Max redesign layer
 * Direction: youthful clinical-tech dashboard for TCM supplier/product management.
 * Priorities: data clarity, responsive tables, visible focus states, restrained motion.
 */
:root {
    --ui-bg: #eef7f8;
    --ui-bg-grid: rgba(14, 165, 183, 0.12);
    --ui-shell: #071923;
    --ui-shell-2: #0c2530;
    --ui-surface: rgba(255, 255, 255, 0.94);
    --ui-surface-solid: #ffffff;
    --ui-surface-soft: #f3fbfc;
    --ui-surface-active: #e7fbff;
    --ui-border: #b8dce3;
    --ui-border-soft: #d9edf1;
    --ui-text: #102a36;
    --ui-heading: #071923;
    --ui-muted: #5a7480;
    --ui-cyan: #0891b2;
    --ui-cyan-strong: #06677f;
    --ui-green: #059669;
    --ui-green-strong: #047857;
    --ui-blue: #2563eb;
    --ui-amber-bg: #fff7ed;
    --ui-amber-text: #b45309;
    --ui-danger: #dc2626;
    --ui-focus: rgba(8, 145, 178, 0.32);
    --ui-shadow: 0 18px 48px rgba(7, 25, 35, 0.10);
    --ui-shadow-soft: 0 10px 28px rgba(7, 25, 35, 0.08);
    --ui-radius: 18px;
    --ui-radius-sm: 12px;
    --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
    --ui-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    overflow-x: hidden;
    background: var(--ui-bg);
}

body {
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: 0;
    background:
        linear-gradient(90deg, var(--ui-bg-grid) 1px, transparent 1px),
        linear-gradient(180deg, rgba(8, 145, 178, 0.12) 0, transparent 310px),
        linear-gradient(0deg, var(--ui-bg) 0, #f8feff 100%) !important;
    background-size: 36px 36px, auto, auto !important;
}

body::before,
.gradient-bg::before,
.logo::after,
.btn::before,
.view-detail-btn::before,
.btn-primary::before {
    display: none !important;
}

a,
button,
input,
select,
textarea {
    font: inherit;
}

a,
button,
.btn,
.logout-btn,
.page-link,
.category-filter-link,
.product-name-btn,
.product-name-detail-btn,
.supplier-info-btn,
.consult-btn,
.close-btn,
.btn-close,
.qr-close {
    cursor: pointer;
    touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--ui-focus);
    outline-offset: 2px;
}

body.front-login-page,
body.admin-login-page {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(8, 145, 178, 0.22), transparent 30%),
        linear-gradient(135deg, #071923 0%, #0c2530 52%, #eef7f8 52%, #f8feff 100%) !important;
}

.front-login-page .login-container,
.admin-login-page .login-container,
.glass-container {
    width: min(440px, 100%);
    margin: 0;
    padding: 36px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    border-radius: 24px !important;
    box-shadow: var(--ui-shadow) !important;
    backdrop-filter: blur(18px);
}

.front-login-page .login-title,
.admin-login-page .login-title {
    margin: 0 0 10px;
    color: var(--ui-heading);
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 26px;
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: 0;
}

.front-login-page .subtitle,
.admin-login-page .subtitle {
    margin: 0 0 28px;
    color: var(--ui-muted);
    font-size: 14px;
}

.admin-login-page .logo {
    width: auto;
    height: auto;
    justify-content: flex-start;
    margin: 0 0 20px;
    background: transparent;
    color: var(--ui-cyan);
    border-radius: 0;
    box-shadow: none;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.header,
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background:
        linear-gradient(120deg, rgba(7, 25, 35, 0.98), rgba(12, 37, 48, 0.96)) !important;
    border-bottom: 1px solid rgba(125, 211, 252, 0.22) !important;
    box-shadow: 0 12px 32px rgba(7, 25, 35, 0.14) !important;
    backdrop-filter: blur(18px);
}

.header {
    min-height: 70px;
    padding: 12px 4vw !important;
}

.header h1 img {
    max-height: 42px !important;
    filter: brightness(0) invert(1);
}

.navbar {
    padding: 0 !important;
}

.navbar > .container-fluid,
.navbar .container-fluid {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: 100%;
    padding: 0 2.5vw;
}

.navbar-brand {
    position: relative;
    color: #effcff !important;
    font-size: 20px !important;
    font-weight: 850 !important;
    text-decoration: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.navbar-brand::after {
    content: "";
    position: absolute;
    left: 0;
    right: auto;
    bottom: -10px;
    width: 42px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #22d3ee, #22c55e);
}

.navbar-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0;
}

.container-fluid {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.front-products-page .container,
.footer {
    width: min(90%, 1660px) !important;
    max-width: 1660px !important;
}

.front-products-page .container {
    margin: 26px auto 0 !important;
    padding: 0 !important;
}

.admin-page .container {
    width: 95% !important;
    max-width: none !important;
    margin: 26px auto 0 !important;
    padding: 0 !important;
}

.front-products-page .list-toolbar,
.admin-page .admin-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 16px;
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(184, 220, 227, 0.85);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-soft);
    backdrop-filter: blur(14px);
}

.front-products-page .list-title,
.admin-page h3 {
    margin: 0;
    color: var(--ui-heading) !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    line-height: 1.15;
    letter-spacing: 0;
}

.list-count,
.section-subtitle {
    margin-top: 6px;
    color: var(--ui-muted) !important;
    font-size: 13px;
    font-weight: 700;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.btn,
.front-login-page .btn,
.admin-login-page .btn,
.logout-btn,
.page-link,
.supplier-info-btn,
.supplier-btn,
.product-name-detail-btn,
.product-name-btn,
.category-filter-link,
.close-btn,
.btn-close,
.qr-close {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 999px !important;
    box-shadow: none;
    text-decoration: none;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn,
.logout-btn {
    padding: 10px 16px !important;
    border: 1px solid rgba(125, 211, 252, 0.55);
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.2;
    letter-spacing: 0;
}

.btn:hover,
.logout-btn:hover,
.page-link:hover,
.category-filter-link:hover,
.supplier-info-btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    min-height: 36px;
    padding: 7px 12px !important;
    font-size: 12px !important;
}

.btn-primary,
.front-login-page .btn,
.admin-login-page .btn,
.logout-btn {
    background: linear-gradient(135deg, var(--ui-cyan), var(--ui-green)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 10px 24px rgba(8, 145, 178, 0.22) !important;
}

.btn-primary:hover,
.front-login-page .btn:hover,
.admin-login-page .btn:hover,
.logout-btn:hover {
    background: linear-gradient(135deg, var(--ui-cyan-strong), var(--ui-green-strong)) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

.btn-secondary,
.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.88) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text) !important;
}

.btn-outline-primary {
    background: rgba(236, 254, 255, 0.78) !important;
    border-color: rgba(8, 145, 178, 0.42) !important;
    color: var(--ui-cyan-strong) !important;
}

.btn-outline-primary:hover {
    background: #dff8fd !important;
    border-color: var(--ui-cyan) !important;
    color: var(--ui-cyan-strong) !important;
}

.btn-outline-success {
    background: rgba(236, 253, 245, 0.82) !important;
    border-color: rgba(5, 150, 105, 0.36) !important;
    color: var(--ui-green) !important;
}

.btn-outline-danger {
    background: rgba(254, 242, 242, 0.92) !important;
    border-color: rgba(220, 38, 38, 0.28) !important;
    color: var(--ui-danger) !important;
}

.form-group {
    margin-bottom: 16px;
}

.form-label,
.front-login-page .form-label,
.admin-login-page .form-label {
    display: block;
    margin: 0 0 7px;
    color: var(--ui-heading);
    font-size: 13px;
    font-weight: 850;
}

.form-input,
.form-control,
.front-login-page .form-input,
.admin-login-page .form-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    color: var(--ui-text) !important;
    font-size: 15px !important;
}

textarea.form-control {
    min-height: 104px;
    resize: vertical;
}

.form-input:focus,
.form-control:focus,
.front-login-page .form-input:focus,
.admin-login-page .form-input:focus {
    border-color: var(--ui-cyan) !important;
    box-shadow: 0 0 0 4px var(--ui-focus) !important;
    transform: none !important;
}

.form-text,
.cell-muted,
.muted-text,
.text-center {
    color: var(--ui-muted) !important;
}

.radio-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 46px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    color: var(--ui-text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
}

.radio-option + .radio-option {
    border-left: 1px solid var(--ui-border);
}

.radio-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--ui-cyan);
}

.product-list-wrap,
.admin-table-card,
.card,
.modal-content,
.qr-modal-content {
    background: var(--ui-surface) !important;
    border: 1px solid rgba(184, 220, 227, 0.82) !important;
    border-radius: var(--ui-radius) !important;
    box-shadow: var(--ui-shadow-soft) !important;
    backdrop-filter: blur(14px);
}

.product-list-wrap,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-color: rgba(8, 145, 178, 0.56) rgba(255, 255, 255, 0.4);
    scrollbar-width: thin;
}

.admin-page .admin-table-card {
    max-width: 100%;
    overflow: visible !important;
}

.admin-page .admin-table-card .card-body {
    max-width: 100%;
    overflow: visible !important;
}

.admin-page .admin-table-card .table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: scroll !important;
    overflow-y: visible;
    padding-bottom: 12px !important;
    -webkit-overflow-scrolling: touch;
}

.product-list-wrap::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    width: 10px;
    height: 12px;
}

.product-list-wrap::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.56);
    border-radius: 999px;
}

.product-list-wrap::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--ui-cyan), var(--ui-green));
    border: 3px solid rgba(255, 255, 255, 0.56);
    border-radius: 999px;
}

.card {
    margin-bottom: 22px !important;
    overflow: hidden;
}

.card-body {
    padding: 0 !important;
}

.card-header,
.modal-header,
.modal-footer {
    background:
        linear-gradient(90deg, rgba(236, 254, 255, 0.94), rgba(240, 253, 250, 0.94)) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-heading) !important;
}

.product-table,
.admin-data-table,
.table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    table-layout: fixed;
    background: transparent;
}

.product-table {
    min-width: 1120px !important;
}

.admin-products-table {
    width: 2160px !important;
    min-width: 2160px !important;
}

.supplier-table {
    min-width: 780px !important;
}

.categories-table {
    min-width: 980px !important;
}

.recycle-table {
    min-width: 860px !important;
}

.admin-floating-head {
    position: fixed;
    z-index: 220;
    display: none;
    overflow: hidden;
    background: rgba(240, 253, 250, 0.96);
    border: 1px solid rgba(125, 211, 252, 0.42);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 14px 28px rgba(7, 25, 35, 0.12);
    pointer-events: none;
    backdrop-filter: blur(14px);
}

.admin-floating-head.show {
    display: block;
}

.admin-floating-head table {
    margin: 0;
}

.admin-floating-head th {
    position: static !important;
}

.admin-floating-head .admin-data-table th:last-child,
.admin-floating-head .table th:last-child {
    position: sticky !important;
    right: 0;
    z-index: 35;
}

.admin-sticky-action-layer {
    position: fixed;
    z-index: 260;
    display: none;
    overflow: hidden;
    pointer-events: none;
}

.admin-sticky-action-layer.show {
    display: block;
}

.admin-sticky-action-cell {
    position: absolute;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 11px 13px;
    overflow: hidden;
    background: rgba(248, 254, 255, 0.98);
    border-left: 1px solid rgba(8, 145, 178, 0.24);
    border-bottom: 1px solid var(--ui-border-soft);
    box-shadow: -12px 0 24px rgba(7, 25, 35, 0.10);
    pointer-events: auto;
}

.admin-sticky-action-cell.is-header {
    background:
        linear-gradient(180deg, rgba(231, 251, 255, 0.98), rgba(239, 253, 250, 0.98));
    border-bottom-color: var(--ui-border);
    color: #174657;
    font-size: 12px;
    font-weight: 900;
}

.admin-sticky-action-cell .action-buttons {
    width: 100%;
}

.admin-sticky-action-cell > .btn,
.admin-sticky-action-cell > .action-buttons,
.admin-sticky-action-cell > a,
.admin-sticky-action-cell > button {
    pointer-events: auto;
}

.product-table th,
.admin-data-table th,
.table th {
    height: 48px;
    padding: 11px 13px !important;
    background:
        linear-gradient(180deg, rgba(231, 251, 255, 0.98), rgba(239, 253, 250, 0.98)) !important;
    color: #174657 !important;
    border-right: 1px solid var(--ui-border-soft);
    border-bottom: 1px solid var(--ui-border);
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.2;
    text-align: left;
    white-space: nowrap;
    letter-spacing: 0;
}

.admin-page .admin-data-table th {
    position: sticky;
    top: 0;
    z-index: 6;
}

.product-table td,
.admin-data-table td,
.table td {
    padding: 11px 13px !important;
    border-right: 1px solid var(--ui-border-soft);
    border-bottom: 1px solid var(--ui-border-soft);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ui-text);
    font-size: 13px !important;
    line-height: 1.45;
    vertical-align: middle;
}

.product-table tbody tr:nth-child(even) td,
.admin-data-table tbody tr:nth-child(even) td,
.table tbody tr:nth-child(even) td {
    background: rgba(248, 254, 255, 0.92);
}

.product-table tbody tr:hover td,
.admin-data-table tbody tr:hover td,
.table tbody tr:hover td {
    background: var(--ui-surface-active) !important;
}

.product-table th:last-child,
.product-table td:last-child,
.admin-data-table th:last-child,
.admin-data-table td:last-child,
.table th:last-child,
.table td:last-child {
    border-right: 0;
}

.admin-page .admin-data-table th:last-child,
.admin-page .admin-data-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 20;
    background:
        linear-gradient(180deg, rgba(248, 254, 255, 0.98), rgba(239, 253, 250, 0.98)) !important;
    border-left: 1px solid rgba(8, 145, 178, 0.22);
    box-shadow: -12px 0 24px rgba(7, 25, 35, 0.08);
}

.admin-page .admin-data-table th:last-child {
    z-index: 32;
    background:
        linear-gradient(180deg, rgba(231, 251, 255, 0.98), rgba(239, 253, 250, 0.98)) !important;
}

.admin-page .admin-data-table tbody tr:nth-child(even) td:last-child {
    background: rgba(248, 254, 255, 0.98) !important;
}

.admin-page .admin-data-table tbody tr:hover td:last-child {
    background: var(--ui-surface-active) !important;
}

.product-table th:nth-child(1),
.product-table td:nth-child(1),
.admin-products-table th:nth-child(1),
.admin-products-table td:nth-child(1) {
    width: 104px !important;
}

.product-table th:nth-child(2),
.product-table td:nth-child(2) {
    width: 220px !important;
}

.product-table th:nth-child(3),
.product-table td:nth-child(3) {
    width: 150px !important;
}

.product-table th:nth-child(4),
.product-table td:nth-child(4) {
    width: 110px !important;
}

.product-table th:nth-child(5),
.product-table td:nth-child(5) {
    width: 300px !important;
}

.product-table th:nth-child(6),
.product-table td:nth-child(6) {
    width: 170px !important;
}

.product-table th:nth-child(7),
.product-table td:nth-child(7) {
    width: 110px !important;
}

.product-table th:nth-child(8),
.product-table td:nth-child(8) {
    width: 120px !important;
}

.admin-products-table th:nth-child(2),
.admin-products-table td:nth-child(2) {
    width: 210px !important;
}

.admin-products-table th:nth-child(3),
.admin-products-table td:nth-child(3),
.admin-products-table th:nth-child(4),
.admin-products-table td:nth-child(4) {
    width: 120px !important;
}

.admin-products-table th:nth-child(5),
.admin-products-table td:nth-child(5),
.admin-products-table th:nth-child(8),
.admin-products-table td:nth-child(8),
.admin-products-table th:nth-child(9),
.admin-products-table td:nth-child(9),
.admin-products-table th:nth-child(10),
.admin-products-table td:nth-child(10) {
    width: 96px !important;
}

.admin-products-table th:nth-child(6),
.admin-products-table td:nth-child(6),
.admin-products-table th:nth-child(12),
.admin-products-table td:nth-child(12) {
    width: 220px !important;
}

.admin-products-table th:nth-child(7),
.admin-products-table td:nth-child(7),
.admin-products-table th:nth-child(11),
.admin-products-table td:nth-child(11) {
    width: 150px !important;
}

.admin-products-table th:nth-child(13),
.admin-products-table td:nth-child(13) {
    width: 170px !important;
}

.product-thumb,
.admin-thumb,
.admin-thumb-preview {
    width: 76px !important;
    height: 76px !important;
    display: block;
    border: 1px solid rgba(184, 220, 227, 0.92);
    border-radius: 14px !important;
    box-shadow: 0 8px 20px rgba(7, 25, 35, 0.10) !important;
    object-fit: cover;
    background: var(--ui-surface-soft);
}

.admin-thumb-preview {
    width: 96px !important;
    height: 96px !important;
}

.product-name,
.product-title-cell {
    font-weight: 850;
}

.product-name-btn,
.product-name-detail-btn {
    min-height: 32px;
    justify-content: flex-start;
    padding: 0;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: var(--ui-cyan-strong) !important;
    box-shadow: none !important;
    font-weight: 850 !important;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
}

.product-name-btn:hover,
.product-name-detail-btn:hover {
    color: var(--ui-green-strong) !important;
    text-decoration: underline;
    text-underline-offset: 4px;
    transform: none;
}

.price-text,
.price-cell,
.text-success {
    color: var(--ui-green) !important;
    font-family: var(--ui-mono);
    font-weight: 900;
    white-space: nowrap;
}

.discount-pill {
    min-width: 68px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 4px 10px;
    background: var(--ui-amber-bg) !important;
    color: var(--ui-amber-text) !important;
    border: 1px solid #fed7aa;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-family: var(--ui-mono);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.bg-success {
    background: rgba(236, 253, 245, 0.94) !important;
    color: var(--ui-green) !important;
    border: 1px solid rgba(5, 150, 105, 0.28);
}

.bg-secondary {
    background: rgba(241, 245, 249, 0.94) !important;
    color: var(--ui-muted) !important;
    border: 1px solid rgba(100, 116, 139, 0.24);
}

.supplier-btn,
.supplier-info-btn {
    min-height: 34px;
    justify-content: flex-start;
    padding: 6px 11px !important;
    background: rgba(236, 254, 255, 0.88) !important;
    color: var(--ui-cyan-strong) !important;
    border: 1px solid rgba(8, 145, 178, 0.34) !important;
    box-shadow: none !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    text-align: left;
}

.cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-wrap,
.multi-line {
    white-space: normal;
    word-break: break-word;
}

.action-cell {
    vertical-align: top !important;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.alert,
.error-message,
.success-message {
    position: relative;
    margin: 0 0 18px;
    padding: 13px 46px 13px 16px !important;
    border-radius: 16px !important;
    box-shadow: var(--ui-shadow-soft) !important;
    font-size: 14px;
    font-weight: 750;
}

.alert-success,
.success-message {
    background: #ecfdf3 !important;
    color: #05603a !important;
    border: 1px solid #a6f4c5 !important;
}

.error-message {
    background: #fff1f0 !important;
    color: var(--ui-danger) !important;
    border: 1px solid #f3aca6 !important;
}

.alert-danger {
    background: #fff1f0 !important;
    color: var(--ui-danger) !important;
    border: 1px solid #f3aca6 !important;
}

.btn-close,
.close-btn,
.qr-close {
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid var(--ui-border) !important;
    color: var(--ui-text) !important;
    box-shadow: none !important;
}

.modal,
.qr-modal {
    background: rgba(7, 25, 35, 0.68) !important;
    backdrop-filter: blur(8px) !important;
}

.modal.show,
.modal[style*="flex"] {
    align-items: flex-start;
}

.modal-content {
    width: min(980px, 94vw) !important;
    max-height: 90dvh;
    margin: 5dvh auto !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header,
.modal-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 20px !important;
}

.modal-title {
    margin: 0;
    color: var(--ui-heading) !important;
    font-size: 18px !important;
    font-weight: 900 !important;
}

.modal-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 20px !important;
}

.product-description-modal-content,
.supplier-modal-content {
    width: min(740px, 94vw) !important;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
}

.supplier-detail-grid,
.supplier-info-list {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
}

.supplier-detail-grid dt,
.supplier-info-list dt,
.supplier-detail-grid dd,
.supplier-info-list dd {
    min-height: 44px;
    margin: 0;
    padding: 11px 13px;
    border-bottom: 1px solid var(--ui-border-soft);
}

.supplier-detail-grid dt,
.supplier-info-list dt {
    background: var(--ui-surface-soft);
    color: var(--ui-muted);
    font-weight: 850;
}

.supplier-detail-grid dd,
.supplier-info-list dd {
    color: var(--ui-text);
    word-break: break-word;
}

.supplier-detail-grid dt:last-of-type,
.supplier-info-list dt:last-of-type,
.supplier-detail-grid dd:last-of-type,
.supplier-info-list dd:last-of-type {
    border-bottom: 0;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(184, 220, 227, 0.85);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-soft);
    backdrop-filter: blur(14px);
}

.admin-supplier-filter {
    margin-top: -2px;
}

.filter-label {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 6px 0 2px;
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.category-filter-link {
    min-height: 40px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(8, 145, 178, 0.26);
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
}

.category-filter-link.active {
    background: linear-gradient(135deg, var(--ui-cyan), var(--ui-green)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(8, 145, 178, 0.22);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 22px 0 0;
}

.page-link {
    min-width: 42px;
    min-height: 42px;
    padding: 8px 13px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(8, 145, 178, 0.28);
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 850;
}

.page-link.active {
    background: linear-gradient(135deg, var(--ui-cyan), var(--ui-green)) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

.page-link.disabled {
    pointer-events: none;
    opacity: 0.46;
}

.consult-btn {
    right: 28px !important;
    bottom: 28px !important;
    width: 58px !important;
    height: 58px !important;
    background: linear-gradient(135deg, var(--ui-cyan), var(--ui-green)) !important;
    border: 1px solid rgba(255, 255, 255, 0.52) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 32px rgba(8, 145, 178, 0.26) !important;
}

.qr-modal-content {
    width: min(360px, 90vw) !important;
    padding: 22px !important;
}

.qr-title {
    color: var(--ui-heading) !important;
}

.footer {
    margin: 24px auto 0;
    padding: 20px 0 26px;
    color: var(--ui-muted);
    border-top: 1px solid rgba(184, 220, 227, 0.72);
    font-size: 13px;
    text-align: center;
}

.tox-tinymce {
    border: 1px solid var(--ui-border) !important;
    border-radius: 16px !important;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1024px) {
    .admin-page .table-responsive,
    .front-products-page .product-list-wrap {
        overflow-x: scroll;
        padding-bottom: 8px;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .navbar > .container-fluid,
    .navbar .container-fluid {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 4vw;
    }

    .navbar-nav {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .header {
        padding: 10px 16px !important;
    }

    .front-products-page .container,
    .admin-page .container {
        width: 95% !important;
        margin-top: 18px !important;
    }

    .front-products-page .list-toolbar,
    .admin-page .admin-section-head {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .front-products-page .list-title,
    .admin-page h3 {
        font-size: 21px !important;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 96vw !important;
        margin: 2dvh auto !important;
        max-height: 96dvh;
    }

    .supplier-detail-grid,
    .supplier-info-list {
        grid-template-columns: 1fr;
    }

    .supplier-detail-grid dt,
    .supplier-info-list dt {
        border-bottom: 0;
    }

    .front-login-page .login-container,
    .admin-login-page .login-container,
    .glass-container {
        padding: 28px 22px;
        border-radius: 20px !important;
    }
}
