/* ===========================
   ALVICO WAREHOUSE PORTAL v2.1
   Redesigned to match alvas.co
   By NexusLoom Limited
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --alvico-navy: #003366;
    --alvico-navy-dark: #002244;
    --alvico-navy-light: #004488;
    --alvico-orange: #E8601C;
    --alvico-orange-hover: #d4540f;
    --alvico-orange-light: #fff4ef;
    --alvico-bg: #ffffff;
    --alvico-bg-alt: #f8f9fb;
    --alvico-surface: #ffffff;
    --alvico-border: #e5e7eb;
    --alvico-border-light: #f0f0f0;
    --alvico-text: #1a1a2e;
    --alvico-text-secondary: #6b7280;
    --alvico-text-muted: #9ca3af;
    --alvico-green: #10b981;
    --alvico-green-bg: #ecfdf5;
    --alvico-yellow: #f59e0b;
    --alvico-yellow-bg: #fffbeb;
    --alvico-red: #ef4444;
    --alvico-red-bg: #fef2f2;
    --alvico-radius: 8px;
    --alvico-radius-sm: 4px;
    --alvico-radius-lg: 12px;
    --alvico-shadow: 0 1px 3px rgba(0,0,0,0.06);
    --alvico-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --alvico-shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --alvico-shadow-hover: 0 8px 25px rgba(0,0,0,0.10);
    --alvico-font: 'Poppins', sans-serif;
    --alvico-transition: all 0.25s ease;
}

/* ═══ PORTAL WRAPPER ═══ */

.alvico-portal-wrap {
    font-family: var(--alvico-font);
    background: var(--alvico-bg);
    min-height: 60vh;
    color: var(--alvico-text);
    line-height: 1.5;
}

.alvico-portal-wrap *, .alvico-portal-wrap *::before, .alvico-portal-wrap *::after {
    box-sizing: border-box;
}

/* ═══ HEADER BAR — Logo + Name + Company ═══ */

.alvico-portal-header {
    background: var(--alvico-navy);
    color: white;
    padding: 14px 30px;
}

.alvico-portal-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.alvico-customer-badge {
    display: flex;
    align-items: center;
    gap: 14px;
}

.alvico-customer-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--alvico-radius);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.alvico-customer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.alvico-customer-icon {
    font-size: 22px;
    background: rgba(255,255,255,0.15);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--alvico-radius);
}

.alvico-customer-greeting {
    font-size: 16px;
    font-weight: 600;
}

.alvico-customer-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    font-weight: 500;
}

.alvico-customer-name {
    font-weight: 600;
    font-size: 16px;
}

.alvico-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* History toggle button */
.alvico-history-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--alvico-radius);
    font-family: var(--alvico-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--alvico-transition);
}

.alvico-history-toggle:hover {
    background: rgba(255,255,255,0.2);
}

.alvico-history-toggle.active {
    background: white;
    color: var(--alvico-navy);
    border-color: white;
}

/* Cart button */
.alvico-cart-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--alvico-orange);
    color: white;
    border: none;
    border-radius: var(--alvico-radius);
    font-family: var(--alvico-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--alvico-transition);
}

.alvico-cart-toggle:hover {
    background: var(--alvico-orange-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 96, 28, 0.3);
}

.alvico-cart-icon { font-size: 16px; }

.alvico-cart-count {
    background: white;
    color: var(--alvico-orange);
    font-size: 12px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* ═══ CATEGORY NAV BAR ═══ */

.alvico-category-nav {
    background: var(--alvico-bg-alt);
    border-bottom: 1px solid var(--alvico-border);
    padding: 0 30px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.alvico-category-nav::-webkit-scrollbar { display: none; }

.alvico-category-nav-inner {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
}

.alvico-cat-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--alvico-text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--alvico-transition);
}

.alvico-cat-nav-link:hover, .alvico-cat-nav-link.active {
    color: var(--alvico-orange);
    border-bottom-color: var(--alvico-orange);
}

.alvico-cat-nav-link .alvico-cat-count {
    background: var(--alvico-border);
    color: var(--alvico-text-muted);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.alvico-cat-nav-link.active .alvico-cat-count {
    background: var(--alvico-orange-light);
    color: var(--alvico-orange);
}

/* ═══ BODY: SIDEBAR + CONTENT ═══ */

.alvico-portal-body {
    display: flex;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 600px;
}

/* ═══ SIDEBAR — scrolls WITH the page (no independent scroll) ═══ */

.alvico-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--alvico-bg);
    padding: 24px 24px 24px 0;
    border-right: 1px solid var(--alvico-border-light);
    /* NO overflow-y, NO max-height, NO sticky — scrolls with grid */
    align-self: flex-start;
}

.alvico-filter-group {
    border-bottom: 1px solid var(--alvico-border-light);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.alvico-filter-group:last-child { border-bottom: none; }

.alvico-filter-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--alvico-text);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Search input */
.alvico-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 13px;
    color: var(--alvico-text);
    background: var(--alvico-bg);
    transition: var(--alvico-transition);
    outline: none;
}

.alvico-search-input:focus { border-color: var(--alvico-orange); box-shadow: 0 0 0 3px rgba(232, 96, 28, 0.1); }
.alvico-search-input::placeholder { color: var(--alvico-text-muted); }

/* Select dropdown */
.alvico-select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 13px;
    color: var(--alvico-text);
    background: var(--alvico-bg);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.alvico-select:focus { border-color: var(--alvico-orange); }

/* Checkboxes */
.alvico-checkbox-group { display: flex; flex-direction: column; gap: 8px; }

.alvico-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--alvico-text-secondary);
    cursor: pointer;
    padding: 4px 0;
    transition: var(--alvico-transition);
}

.alvico-checkbox-group label:hover { color: var(--alvico-text); }

.alvico-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--alvico-border);
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: var(--alvico-transition);
}

.alvico-checkbox-group input[type="checkbox"]:checked {
    background: var(--alvico-orange);
    border-color: var(--alvico-orange);
}

.alvico-checkbox-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.alvico-filter-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--alvico-text-muted);
    background: var(--alvico-bg-alt);
    padding: 1px 8px;
    border-radius: 10px;
}

/* Stock summary */
.alvico-stock-summary {
    background: var(--alvico-bg-alt);
    border-radius: var(--alvico-radius);
    padding: 16px;
    margin-top: 10px;
}

.alvico-stock-summary h3 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--alvico-text-muted);
    margin: 0 0 12px 0;
    font-weight: 600;
}

.alvico-summary-stats { display: flex; justify-content: space-between; gap: 8px; }

.alvico-stat { text-align: center; flex: 1; }

.alvico-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--alvico-text);
}

.alvico-stat-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--alvico-text-muted);
    margin-top: 2px;
}

/* ═══ TOOLBAR ═══ */

.alvico-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 4px;
}

.alvico-showing-count { font-size: 13px; color: var(--alvico-text-secondary); }
.alvico-showing-count strong { color: var(--alvico-text); }

.alvico-toolbar-right { display: flex; align-items: center; gap: 12px; }

.alvico-sort-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 13px;
    color: var(--alvico-text);
    background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    cursor: pointer;
    outline: none;
}

.alvico-view-toggle {
    display: flex;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    overflow: hidden;
}

.alvico-view-btn {
    padding: 7px 12px;
    border: none;
    background: white;
    color: var(--alvico-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 16px;
    transition: var(--alvico-transition);
}

.alvico-view-btn:not(:last-child) { border-right: 1px solid var(--alvico-border); }

.alvico-view-btn.active { background: var(--alvico-navy); color: white; }

/* ═══ PRODUCT GRID ═══ */

.alvico-content { flex: 1; padding: 24px 0 24px 30px; }

.alvico-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

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

.alvico-product-card {
    background: var(--alvico-surface);
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius);
    overflow: hidden;
    transition: var(--alvico-transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.alvico-product-card:hover {
    box-shadow: var(--alvico-shadow-hover);
    transform: translateY(-2px);
}

/* Stock badge */
.alvico-stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

.alvico-badge-in-stock { background: var(--alvico-green); color: white; }
.alvico-badge-low-stock { background: var(--alvico-yellow); color: white; }
.alvico-badge-out-of-stock { background: var(--alvico-red); color: white; }

/* Product image */
.alvico-product-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--alvico-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--alvico-border-light);
}

.alvico-product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.alvico-product-card:hover .alvico-product-image img { transform: scale(1.05); }
.alvico-product-image .alvico-placeholder-icon { font-size: 48px; opacity: 0.3; }

/* Category label */
.alvico-product-category {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--alvico-orange);
    margin-bottom: 4px;
}

/* Product info */
.alvico-product-info { padding: 14px 16px 0; flex: 1; }

.alvico-product-sku { font-size: 11px; color: var(--alvico-text-muted); font-weight: 500; margin-bottom: 2px; }

.alvico-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--alvico-text);
    margin: 0 0 10px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alvico-product-meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }

.alvico-meta-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--alvico-text-secondary); }

.alvico-meta-icon { font-size: 13px; width: 18px; text-align: center; flex-shrink: 0; }
.alvico-meta-item .alvico-qty-display { color: var(--alvico-text-secondary); font-weight: 500; }
.alvico-location { font-size: 12px; color: var(--alvico-text-muted); }
.alvico-multi-bin { font-size: 11px; word-break: break-word; }

/* Product footer */
.alvico-product-footer {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alvico-qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    overflow: hidden;
    width: fit-content;
}

.alvico-qty-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--alvico-bg-alt);
    color: var(--alvico-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--alvico-transition);
}

.alvico-qty-btn:hover { background: var(--alvico-border); }

.alvico-qty-input {
    width: 48px;
    height: 34px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--alvico-border);
    border-right: 1px solid var(--alvico-border);
    font-family: var(--alvico-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--alvico-text);
    outline: none;
    background: white;
    -moz-appearance: textfield;
}

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

.alvico-add-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--alvico-orange);
    color: white;
    border: none;
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--alvico-transition);
}

.alvico-add-btn:hover { background: var(--alvico-orange-hover); box-shadow: 0 4px 12px rgba(232, 96, 28, 0.25); }
.alvico-add-btn.disabled { background: var(--alvico-border); color: var(--alvico-text-muted); cursor: not-allowed; }
.alvico-add-btn.added { background: var(--alvico-green); pointer-events: none; }

/* ═══ LIST VIEW — 2 columns, qty visible ═══ */

.alvico-grid.alvico-list-view {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.alvico-list-view .alvico-product-card {
    flex-direction: row;
    align-items: stretch;
}

.alvico-list-view .alvico-product-image {
    width: 120px;
    min-width: 120px;
    aspect-ratio: 1;
    border-bottom: none;
    border-right: 1px solid var(--alvico-border-light);
}

.alvico-list-view .alvico-product-info {
    padding: 12px 14px;
    flex: 1;
}

.alvico-list-view .alvico-product-name {
    font-size: 13px;
    margin-bottom: 6px;
}

.alvico-list-view .alvico-product-footer {
    flex-direction: column;
    justify-content: center;
    padding: 10px 14px;
    min-width: 180px;
    border-left: 1px solid var(--alvico-border-light);
    gap: 8px;
}

.alvico-list-view .alvico-stock-badge {
    position: static;
    display: inline-block;
    margin-bottom: 6px;
    width: fit-content;
}

/* ═══ INLINE HISTORY (toggled view) ═══ */

.alvico-inline-history {
    display: none;
}

.alvico-inline-history.active {
    display: block;
}

.alvico-inventory-view.hidden {
    display: none;
}

.alvico-category-nav.hidden {
    display: none;
}

/* ═══ CART DRAWER ═══ */

.alvico-cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alvico-cart-overlay.open { display: block; opacity: 1; }

.alvico-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: white;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.alvico-cart-drawer.open { transform: translateX(0); visibility: visible; }

.alvico-cart-header {
    background: var(--alvico-navy);
    color: white;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.alvico-cart-header h3 { margin: 0; font-size: 16px; font-weight: 600; }

.alvico-cart-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--alvico-radius-sm);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--alvico-transition);
    /* Ensure it's tappable on all devices */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 36px;
    min-height: 36px;
}

.alvico-cart-close:hover { background: rgba(255,255,255,0.3); }

.alvico-cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; }

.alvico-cart-empty { text-align: center; padding: 40px 0; color: var(--alvico-text-muted); }
.alvico-cart-empty p { font-size: 13px; margin: 4px 0; }

.alvico-cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--alvico-border-light);
}

.alvico-cart-item-image {
    width: 50px;
    height: 50px;
    border-radius: var(--alvico-radius-sm);
    background: var(--alvico-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.alvico-cart-item-info { flex: 1; }
.alvico-cart-item-name { font-size: 14px; font-weight: 600; color: var(--alvico-text); }

.alvico-cart-item-qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

.alvico-cart-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    background: white;
    color: var(--alvico-text);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.alvico-cart-qty-btn:hover { background: var(--alvico-bg-alt); }
.alvico-cart-qty-val { font-size: 14px; font-weight: 600; min-width: 24px; text-align: center; }

.alvico-cart-item-remove {
    background: none;
    border: none;
    color: var(--alvico-red);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: var(--alvico-transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alvico-cart-item-remove:hover { opacity: 1; }

.alvico-cart-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--alvico-border);
    background: var(--alvico-bg-alt);
    flex-shrink: 0;
}

.alvico-cart-form label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--alvico-text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.alvico-cart-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 13px;
    resize: vertical;
    outline: none;
    margin-bottom: 12px;
}

.alvico-cart-form textarea:focus { border-color: var(--alvico-orange); }

.alvico-submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--alvico-orange);
    color: white;
    border: none;
    border-radius: var(--alvico-radius);
    font-family: var(--alvico-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--alvico-transition);
}

.alvico-submit-btn:hover { background: var(--alvico-orange-hover); }
.alvico-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ═══ TOAST ═══ */

.alvico-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--alvico-navy);
    color: white;
    padding: 14px 24px;
    border-radius: var(--alvico-radius);
    font-family: var(--alvico-font);
    font-size: 14px;
    font-weight: 500;
    z-index: 100000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: var(--alvico-shadow-lg);
}

.alvico-toast.show { opacity: 1; transform: translateY(0); }

/* ═══ EMPTY STATE ═══ */

.alvico-empty-state { text-align: center; padding: 60px 20px; color: var(--alvico-text-muted); }
.alvico-empty-state .alvico-empty-icon { font-size: 48px; opacity: 0.4; margin-bottom: 16px; }
.alvico-empty-state p { font-size: 15px; margin: 0; }

/* ═══ REQUISITION HISTORY ═══ */

.alvico-history-wrap {
    font-family: var(--alvico-font);
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 0;
}

.alvico-history-wrap h2 { font-size: 22px; font-weight: 700; color: var(--alvico-text); margin: 0 0 24px 0; }

.alvico-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.alvico-history-search {
    flex: 1;
    max-width: 320px;
    padding: 10px 14px;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 13px;
    outline: none;
}

.alvico-history-search:focus { border-color: var(--alvico-orange); }

.alvico-history-filters { display: flex; gap: 8px; flex-wrap: wrap; }

.alvico-history-filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--alvico-border);
    border-radius: 20px;
    background: white;
    color: var(--alvico-text-secondary);
    font-family: var(--alvico-font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--alvico-transition);
    -webkit-tap-highlight-color: transparent;
}

.alvico-history-filter-btn:hover, .alvico-history-filter-btn.active {
    background: var(--alvico-orange);
    color: white;
    border-color: var(--alvico-orange);
}

.alvico-history-list { display: flex; flex-direction: column; gap: 12px; }

.alvico-history-card {
    background: white;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius);
    padding: 18px 22px;
    transition: var(--alvico-transition);
}

.alvico-history-card:hover { box-shadow: var(--alvico-shadow); }

.alvico-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
}

.alvico-history-ref { font-weight: 600; color: var(--alvico-text); font-size: 14px; }
.alvico-history-date { font-size: 13px; color: var(--alvico-text-muted); margin-left: 12px; }

.alvico-status {
    display: inline-flex;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.alvico-status-submitted, .alvico-status-pending { background: #dbeafe; color: #1d4ed8; }
.alvico-status-processing, .alvico-status-acknowledged { background: var(--alvico-yellow-bg); color: #b45309; }
.alvico-status-completed, .alvico-status-delivered { background: var(--alvico-green-bg); color: #047857; }
.alvico-status-cancelled { background: var(--alvico-red-bg); color: #b91c1c; }

.alvico-history-items { display: flex; gap: 8px; flex-wrap: wrap; }
.alvico-history-item { display: inline-block; padding: 4px 12px; background: var(--alvico-bg-alt); border-radius: 4px; font-size: 13px; color: var(--alvico-text); }
.alvico-history-address { font-size: 13px; color: var(--alvico-text-muted); margin-top: 8px; }

/* Date filter pills */
.alvico-history-date-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.alvico-history-date-btn {
    padding: 6px 14px;
    border: 1px solid var(--alvico-border);
    border-radius: 20px;
    background: white;
    color: var(--alvico-text-secondary);
    font-family: var(--alvico-font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--alvico-transition);
    -webkit-tap-highlight-color: transparent;
}

.alvico-history-date-btn:hover,
.alvico-history-date-btn.active {
    background: var(--alvico-navy);
    color: white;
    border-color: var(--alvico-navy);
}

/* ═══ NOTICES ═══ */

.alvico-login-notice, .alvico-notice {
    padding: 30px;
    background: var(--alvico-bg-alt);
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius);
    text-align: center;
    font-family: var(--alvico-font);
}

.alvico-login-notice a, .alvico-notice a { color: var(--alvico-orange); font-weight: 600; text-decoration: none; }
.alvico-login-notice a:hover, .alvico-notice a:hover { text-decoration: underline; }

.alvico-admin-notice { padding: 20px; background: var(--alvico-bg-alt); border: 1px solid var(--alvico-border); border-radius: var(--alvico-radius); font-family: var(--alvico-font); }
.alvico-admin-notice a { color: var(--alvico-orange); font-weight: 600; }

/* ═══ MOBILE FILTER TOGGLE ═══ */

.alvico-mobile-filter-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background: white;
    border: 1px solid var(--alvico-border);
    border-radius: var(--alvico-radius-sm);
    font-family: var(--alvico-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--alvico-text);
    cursor: pointer;
    margin-bottom: 16px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 1200px) {
    .alvico-grid { grid-template-columns: repeat(3, 1fr); }
    .alvico-grid.alvico-list-view { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .alvico-portal-body { flex-direction: column; }

    /* SIDEBAR — hidden by default on tablet/mobile */
    .alvico-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--alvico-border);
        padding: 20px;
        display: none; /* HIDDEN by default */
    }

    .alvico-sidebar.open { display: block; }

    .alvico-mobile-filter-toggle { display: block; }

    .alvico-filter-section {
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
    }

    .alvico-filter-group {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        flex: 1;
        min-width: 200px;
    }

    .alvico-stock-summary { width: 100%; }
    .alvico-content { padding: 20px; }
    .alvico-grid { grid-template-columns: repeat(3, 1fr); }
    .alvico-grid.alvico-list-view { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .alvico-portal-header { padding: 14px 16px; }
    .alvico-customer-name { font-size: 14px; }
    .alvico-customer-greeting { font-size: 14px; }
    .alvico-cart-label { display: none; }
    .alvico-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .alvico-grid.alvico-list-view { grid-template-columns: 1fr; }
    .alvico-content { padding: 16px; }
    .alvico-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .alvico-category-nav { padding: 0 16px; }
    .alvico-cat-nav-link { padding: 12px 14px; font-size: 12px; }
    .alvico-cart-drawer { width: 100%; max-width: 100vw; }

    .alvico-list-view .alvico-product-card { flex-direction: column; }
    .alvico-list-view .alvico-product-image { width: 100%; border-right: none; border-bottom: 1px solid var(--alvico-border-light); }
    .alvico-list-view .alvico-product-footer { min-width: unset; border-left: none; }

    .alvico-history-toolbar { flex-direction: column; }
    .alvico-history-search { max-width: 100%; }
}

@media (max-width: 480px) {
    .alvico-grid { grid-template-columns: 1fr; }
    .alvico-filter-section { flex-direction: column; }
    .alvico-portal-header { padding: 12px; }
}

/* ═══ CANCEL BUTTON ═══ */
.alvico-cancel-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e5e7eb; }
.alvico-cancel-btn {
    background: none; border: 1px solid #dc2626; color: #dc2626;
    padding: 6px 16px; border-radius: 6px; font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.alvico-cancel-btn:hover { background: #dc2626; color: #fff; }
.alvico-cancel-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.alvico-status-cancelled { background: #fef2f2 !important; color: #991b1b !important; }

/* ═══ STOCK IN BUTTON ═══ */
.alvico-stockin-toggle { background: #059669 !important; color: #fff !important; border-color: #059669 !important; }
.alvico-stockin-toggle:hover { background: #047857 !important; border-color: #047857 !important; }
.alvico-stockin-toggle.active { background: #1e293b !important; border-color: #1e293b !important; }
.alvico-inline-stockin { display: none; }
.alvico-inline-stockin.active { display: block; }
