:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --warning-color: #f8961e;
    --info-color: #480ca8;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: #f0f2f5;
    color: var(--dark-text);
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: #2b2d42;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.card-header h5 {
    margin: 0;
    color: var(--secondary-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
    background: #6c757d;
    border: none;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
}

.table-hover tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.02);
}

/* Computed Section */
.computed-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.computed-field {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.computed-field label {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.computed-field .value {
    font-weight: 600;
    color: var(--dark-text);
}

/* Dashboard & Detail Pills */
.stat-pill {
    border-radius: var(--border-radius);
    background: #f8f9fa;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 90px;
}

.stat-pill .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
}

.group-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    font-size: 0.85rem;
}

.group-header-row td {
    background: rgba(67, 97, 238, 0.08);
    border-top: 1px solid #dee2e6;
}

.grouped-row {
    transition: background-color 0.2s ease;
}

.grouped-row:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.group-edit-trigger {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

.group-edit-trigger .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
}

.group-edit-trigger .small {
    font-size: 0.75rem;
}

.bg-info-subtle {
    background-color: rgba(72, 149, 239, 0.15);
    color: #2653d4;
}

.products-dashboard {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.dashboard-hero__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.dashboard-hero__actions .btn {
    min-width: 150px;
}

.dashboard-stats .stat-pill {
    text-align: center;
}

.filters-card .card-body {
    padding: 1.75rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
}

.filters-field label {
    font-weight: 600;
    color: #495057;
}

.filters-field--wide {
    grid-column: span 2;
}

.filters-field--actions {
    display: flex;
    align-items: flex-end;
}

.filters-field--actions .btn {
    width: 100%;
}

.dashboard-quick-actions,
.dashboard-group-controls {
    gap: 1rem;
}

.dashboard-hero {
    box-shadow: var(--card-shadow);
}

@media (max-width: 992px) {
    .filters-field--wide {
        grid-column: span 1;
    }
    .dashboard-hero__actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .dashboard-stats .stat-pill {
        margin-bottom: 0.75rem;
    }
}

/* Product Thumbnails */
.product-thumb-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-thumb-link:hover .product-thumb-frame {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.2);
}

.product-thumb-frame {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: inherit;
}

.product-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.05);
}

.product-thumb-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f3f4f6;
    border: 1px dashed #d0d4dd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9da3af;
    font-size: 1rem;
}

.product-thumb-link--disabled {
    cursor: default;
}

.product-name {
    max-width: 220px;
}

.table.products-table tbody tr:hover {
    background-color: rgba(72, 149, 239, 0.03);
}

@media (max-width: 991px) {
    .products-table thead {
        display: none;
    }
    .products-table tbody tr {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid #eef0f4;
        background: #fff;
    }
    .products-table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: 0;
        padding: 0.4rem 0;
    }
    .products-table tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #6c757d;
        margin-right: 1rem;
    }
    .products-table tbody tr td[data-label="Image"],
    .products-table tbody tr td[data-label="Select"] {
        justify-content: flex-start;
    }
    .products-table tbody tr td[data-label="Actions"] {
        justify-content: flex-end;
    }
}

/* Images */
.img-thumbnail {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Product detail layout */
.product-detail.minimal-layout {
    max-width: 1100px;
    margin: 0 auto;
}

.minimal-shell {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.minimal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.minimal-header .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ghost-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f2933;
}

.ghost-btn--danger {
    border-color: #f5b5b5;
    color: #c92a2a;
}

.info-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
}

.visual-card {
    background: #f7f7f9;
    border-radius: 24px;
    padding: 1rem;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 320px;
}

.visual-card img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.key-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.key-stats > div {
    background: #f8f9fb;
    border-radius: 14px;
    padding: 0.8rem 1rem;
}

.detail-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.detail-stack article {
    background: #f9fafb;
    border-radius: 12px;
    padding: 0.75rem 1rem;
}

.minimal-card {
    background: #fff;
    border: 1px solid rgba(15,23,42,0.05);
    border-radius: 20px;
    padding: 1.25rem;
}

.description-card {
    max-height: 140px;
    overflow: auto;
}

.two-column-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.combo-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.combo-list li {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
}

.combo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.combo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-grid__details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    .key-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .header-actions {
        flex-wrap: wrap;
    }
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}