/* =====================================================
   MkTech B2B Portal — Main Stylesheet
   Professional B2B Design
   ===================================================== */

/* =====================================================
   CSS CUSTOM PROPERTIES
   ===================================================== */
:root {
    --primary:        #1a56db;
    --primary-dark:   #1e40af;
    --primary-light:  #dbeafe;
    --secondary:      #64748b;
    --success:        #16a34a;
    --success-light:  #dcfce7;
    --danger:         #dc2626;
    --danger-light:   #fee2e2;
    --warning:        #d97706;
    --warning-light:  #fef3c7;
    --info:           #0891b2;
    --info-light:     #cffafe;
    --bg:             #f8fafc;
    --bg-dark:        #f1f5f9;
    --card-bg:        #ffffff;
    --border:         #e2e8f0;
    --border-dark:    #cbd5e1;
    --text:           #1e293b;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;
    --sidebar-bg:     #1e293b;
    --sidebar-text:   #cbd5e1;
    --sidebar-hover:  #334155;
    --sidebar-active: #1a56db;
    --shadow-sm:      0 1px 2px 0 rgba(0,0,0,.05);
    --shadow:         0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
    --shadow-md:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
    --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
    --radius:         6px;
    --radius-md:      8px;
    --radius-lg:      12px;
    --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono:      'SF Mono', 'Fira Code', Consolas, monospace;
    --transition:     0.2s ease;
}

/* =====================================================
   RESET & NORMALIZE
   ===================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

table {
    border-collapse: collapse;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* =====================================================
   LAYOUT
   ===================================================== */
#main-content {
    flex: 1 0 auto;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-fluid {
    width: 100%;
    padding: 0 1.25rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.w-full { width: 100%; }
.hidden { display: none !important; }

/* =====================================================
   NAVBAR — Client Facing
   ===================================================== */
.navbar {
    background: var(--sidebar-bg);
    border-bottom: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    height: 68px;
    gap: 1rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand:hover { color: rgba(255,255,255,0.85); text-decoration: none; }

.navbar-brand img {
    height: 38px;
    width: auto;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.navbar-brand-sub {
    font-size: 0.625rem;
    font-weight: 400;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.navbar-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.navbar-nav a {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    border-bottom: 3px solid transparent;
    border-top: 3px solid transparent;
    transition: color var(--transition), border-color var(--transition), background-color var(--transition);
    text-decoration: none;
}

.navbar-nav a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.06);
    border-bottom-color: rgba(255,255,255,0.25);
    text-decoration: none;
}

.navbar-nav a.active {
    color: #fff;
    font-weight: 600;
    background-color: transparent;
    border-bottom-color: var(--primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.65);
    padding: 0.375rem 0.75rem;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius);
}

.navbar-user strong {
    color: #fff;
    font-weight: 600;
}

.navbar .btn-outline {
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
}

.navbar .btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.55);
    color: #fff;
}

.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--transition);
}

.cart-btn:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 6px;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: var(--transition);
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--bg);
}

.card-header h2, .card-header h3, .card-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}
.btn-secondary:hover {
    background: #475569;
    border-color: #475569;
    color: #fff;
    text-decoration: none;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
    text-decoration: none;
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}
.btn-warning:hover {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-dark);
    color: var(--text);
}
.btn-outline:hover {
    background: var(--bg);
    border-color: var(--secondary);
    color: var(--text);
    text-decoration: none;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
}

.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

.form-label-required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.15);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control:disabled {
    background: var(--bg-dark);
    color: var(--text-muted);
    cursor: not-allowed;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1rem;
    padding-right: 2rem;
}

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

.form-control.is-invalid {
    border-color: var(--danger);
}
.form-control.is-valid {
    border-color: var(--success);
}

.form-feedback {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}
.form-feedback.invalid { color: var(--danger); }
.form-feedback.valid   { color: var(--success); }

.form-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin-top: 0.2rem;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group .btn {
    border-radius: 0;
}

.input-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Quantity control */
.qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
}

.qty-control button {
    width: 32px;
    height: 32px;
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition);
    color: var(--text);
}

.qty-control button:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}

.qty-control button:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: none;
}

.qty-control button:hover {
    background: var(--border-dark);
}

.qty-control input {
    width: 56px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border-dark);
    font-size: 0.875rem;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.qty-control input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Search box */
.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-box .form-control {
    padding-left: 2.25rem;
}

.search-box-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.table {
    width: 100%;
    font-size: 0.875rem;
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
}

.table tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
    background: rgba(248,250,252,0.6);
}

.table tbody tr:hover {
    background: var(--primary-light);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-success  { background: var(--success-light); color: var(--success); }
.badge-danger   { background: var(--danger-light);  color: var(--danger); }
.badge-warning  { background: var(--warning-light); color: var(--warning); }
.badge-info     { background: var(--info-light);    color: var(--info); }
.badge-secondary{ background: #f1f5f9;              color: var(--secondary); }

.badge-promo {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: #fff;
    border-radius: 100px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.45);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.badge-new {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 100px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.badge-eol {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: #fff;
    border-radius: 100px;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.4);
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.badge-rivenditore  { background: #e0e7ff; color: #3730a3; }
.badge-distributore { background: #fce7f3; color: #9d174d; }
.badge-gdo          { background: #f0fdf4; color: #166534; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.alert-content { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 0.25rem; }

.alert-success {
    background: var(--success-light);
    border-color: #86efac;
    color: #166534;
}
.alert-danger {
    background: var(--danger-light);
    border-color: #fca5a5;
    color: #991b1b;
}
.alert-warning {
    background: var(--warning-light);
    border-color: #fcd34d;
    color: #92400e;
}
.alert-info {
    background: var(--info-light);
    border-color: #67e8f9;
    color: #155e75;
}

/* =====================================================
   PRODUCT GRID & CARDS
   ===================================================== */
.catalog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--border-dark);
}

.product-image {
    aspect-ratio: 1;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image-placeholder {
    font-size: 3rem;
    color: var(--border-dark);
}

.product-badges {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 1;
}

.product-info {
    padding: 0.875rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.product-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name a {
    color: inherit;
    text-decoration: none;
}

.product-name a:hover {
    color: var(--primary);
}

.product-codes {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: auto;
    padding-top: 0.375rem;
}

.product-price-excluded {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

.product-footer {
    padding: 0.75rem 0.875rem;
    border-top: 1px solid var(--border);
}

.product-add-form {
    width: 100%;
}

.product-add-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.product-add-row .qty-control {
    flex-shrink: 0;
}

.product-add-row .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
    white-space: nowrap;
}

.product-add-form input[type="number"] {
    width: 48px;
    padding: 0.375rem 0.25rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.875rem;
}

/* =====================================================
   FILTER SIDEBAR
   ===================================================== */
.filter-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.filter-sidebar-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.filter-option input {
    accent-color: var(--primary);
}

/* =====================================================
   BRAND MULTISELECT DROPDOWN
   ===================================================== */
.filter-dropdown {
    position: relative;
}

.filter-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition);
    text-align: left;
}

.filter-dropdown-btn:hover {
    border-color: var(--primary);
}

.filter-dropdown-btn i {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.filter-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    overflow: hidden;
}

.filter-dropdown-panel.open {
    display: block;
}

.filter-dropdown-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-dropdown-search .form-control {
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
}

.filter-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.375rem 0;
}

.filter-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color var(--transition);
}

.filter-dropdown-item:hover {
    background: var(--bg);
}

.filter-dropdown-item input[type="checkbox"] {
    accent-color: var(--primary);
    flex-shrink: 0;
}

.filter-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* =====================================================
   CART
   ===================================================== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

.cart-table-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 4px;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.cart-item-code {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cart-summary {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cart-summary-header {
    padding: 1rem 1.25rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.cart-summary-body {
    padding: 1.25rem;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.cart-summary-row:last-of-type {
    border-bottom: none;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
    border-top: 2px solid var(--border-dark);
    margin-top: 0.5rem;
}

.cart-summary-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* =====================================================
   ADMIN LAYOUT
   ===================================================== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
    transition: transform var(--transition);
}

.admin-sidebar-logo {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.admin-sidebar-logo-text {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

.admin-sidebar-logo-sub {
    display: block;
    font-size: 0.625rem;
    font-weight: 400;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-nav-section {
    padding: 0.75rem 1rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(203,213,225,0.5);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.active {
    background: rgba(26, 86, 219, 0.2);
    color: #93c5fd;
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar-nav a .nav-icon {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

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

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    color: var(--sidebar-text);
    font-size: 0.6875rem;
    text-transform: capitalize;
}

.admin-main {
    margin-left: 250px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-topbar h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-content {
    flex: 1;
    padding: 1.5rem;
}

/* Sidebar mobile toggle */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text);
}

.sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    margin: 4px 0;
    transition: var(--transition);
}

/* =====================================================
   ADMIN DASHBOARD STATS
   ===================================================== */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: box-shadow var(--transition);
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card-icon-blue   { background: var(--primary-light);  color: var(--primary); }
.stat-card-icon-green  { background: var(--success-light);  color: var(--success); }
.stat-card-icon-yellow { background: var(--warning-light);  color: var(--warning); }
.stat-card-icon-red    { background: var(--danger-light);   color: var(--danger); }

.stat-card-info { flex: 1; }
.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}
.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.375rem;
}

.stat-change-up   { color: var(--success); }
.stat-change-down { color: var(--danger); }

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1, .page-header h2 {
    margin: 0;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.page-breadcrumb a {
    color: var(--text-muted);
}

.page-breadcrumb a:hover {
    color: var(--primary);
}

.page-breadcrumb-sep {
    font-size: 0.625rem;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination-nav {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-item {}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.625rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--card-bg);
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: var(--text-light);
    cursor: default;
    pointer-events: none;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

.modal-lg { max-width: 760px; }
.modal-sm { max-width: 400px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3, .modal-header h4 {
    margin: 0;
    font-size: 1rem;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: var(--radius);
    line-height: 1;
    transition: color var(--transition), background-color var(--transition);
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.625rem;
    flex-shrink: 0;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 60%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.auth-card-header {
    background: var(--primary);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
}

.auth-card-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-card-sub {
    color: rgba(255,255,255,0.75);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.auth-card-body {
    padding: 2rem;
}

.auth-card-body h2 {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.auth-footer {
    text-align: center;
    padding: 1rem 2rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* =====================================================
   PRODUCT DETAIL
   ===================================================== */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.product-detail-image {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.product-detail-image.zoomed img {
    transform: scale(1.5);
    cursor: zoom-out;
}

.product-detail-info { }

.product-detail-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.product-detail-codes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.product-detail-codes dt {
    color: var(--text-muted);
}

.product-detail-codes dd {
    font-weight: 600;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
}

.product-detail-box-info {
    background: var(--warning-light);
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #92400e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =====================================================
   FILTERS BAR
   ===================================================== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filters-results {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.sort-select {
    margin-left: auto;
}

/* =====================================================
   TABS
   ===================================================== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text);
    text-decoration: none;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* =====================================================
   SPECS TABLE
   ===================================================== */
.specs-table {
    width: 100%;
    font-size: 0.875rem;
}

.specs-table tr:nth-child(even) td {
    background: var(--bg);
}

.specs-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.specs-table td:first-child {
    font-weight: 500;
    color: var(--text-muted);
    width: 40%;
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto 1.25rem;
}

/* =====================================================
   SEARCH DROPDOWN
   ===================================================== */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 50;
    max-height: 360px;
    overflow-y: auto;
    display: none;
}

.search-results-dropdown.open {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background-color var(--transition);
    text-decoration: none;
    color: var(--text);
}

.search-result-item:hover {
    background: var(--bg);
    text-decoration: none;
}

.search-result-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 3px;
    flex-shrink: 0;
}

.search-result-info { flex: 1; min-width: 0; }

.search-result-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-result-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

/* =====================================================
   BULK ACTION BAR
   ===================================================== */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--primary-dark);
    font-weight: 500;
}

.bulk-bar.visible {
    display: flex;
}

/* =====================================================
   STATUS INDICATOR
   ===================================================== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.375rem;
}

.status-dot-green  { background: var(--success); }
.status-dot-yellow { background: var(--warning); }
.status-dot-red    { background: var(--danger); }
.status-dot-gray   { background: var(--text-light); }

/* =====================================================
   IMPORT / FILE UPLOAD
   ===================================================== */
.file-drop-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background-color var(--transition);
    background: var(--bg);
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.file-drop-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.file-drop-text {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.file-drop-sub {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* =====================================================
   MARKETING DOCUMENTS
   ===================================================== */
.doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: box-shadow var(--transition);
}

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

.doc-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--danger-light);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.doc-icon-zip   { background: #fef3c7; color: var(--warning); }
.doc-icon-img   { background: var(--info-light); color: var(--info); }
.doc-icon-other { background: var(--bg-dark); color: var(--secondary); }

.doc-info { flex: 1; min-width: 0; }

.doc-title {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* =====================================================
   ORDER STATUS
   ===================================================== */
.order-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
}

.timeline-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.timeline-step::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--border-dark);
    z-index: 0;
}

.timeline-step:last-child::before {
    display: none;
}

.timeline-step.done::before {
    background: var(--success);
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    margin: 0 auto 0.5rem;
    position: relative;
    z-index: 1;
}

.timeline-step.done .timeline-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.timeline-step.active .timeline-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.timeline-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.timeline-step.done .timeline-label,
.timeline-step.active .timeline-label {
    color: var(--text);
    font-weight: 600;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* =====================================================
   PRINT
   ===================================================== */
@media print {
    .admin-sidebar, .navbar, .btn, .pagination-nav { display: none !important; }
    .admin-main { margin-left: 0 !important; }
    .admin-content { padding: 0 !important; }
}

/* =====================================================
   RESPONSIVE — TABLET
   ===================================================== */
@media (max-width: 1024px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .catalog-layout {
        grid-template-columns: 220px 1fr;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
    }

    .product-detail-image {
        max-width: 420px;
    }
}

/* =====================================================
   RESPONSIVE — MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .hamburger {
        display: flex;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--sidebar-bg);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        flex-direction: column;
        padding: 0.5rem;
        box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    }

    .navbar-nav a {
        padding: 0.625rem 1rem;
        border-bottom: none;
        border-top: none;
        border-left: 3px solid transparent;
        border-radius: var(--radius);
    }

    .navbar-nav a:hover {
        border-bottom-color: transparent;
        border-left-color: rgba(255,255,255,0.3);
    }

    .navbar-nav a.active {
        border-bottom-color: transparent;
        border-left-color: var(--primary);
    }

    .navbar-nav.open {
        display: flex;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .stat-cards {
        grid-template-columns: 1fr 1fr;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

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

    .modal {
        margin: 0;
        max-height: 100dvh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        align-self: flex-end;
    }

    .modal-overlay {
        align-items: flex-end;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-wrapper {
        font-size: 0.8125rem;
    }

    .admin-content {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr;
    }

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

    .auth-card {
        max-width: 100%;
    }

    h1 { font-size: 1.375rem; }
    h2 { font-size: 1.25rem; }
}

/* =====================================================
   UTILITY: VISUALLY HIDDEN
   ===================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* =====================================================
   DIVIDER
   ===================================================== */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

/* =====================================================
   TOOLTIP (CSS only)
   ===================================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 50;
}

[data-tooltip]:hover::after {
    opacity: 1;
}
