/* ========== CSS VARIABLES ========== */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary: #10b981;
    --secondary-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f0f4f8;
    --bg-white: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ========== NAVBAR ========== */
.navbar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-brand i { font-size: 1.6rem; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover { color: var(--primary); background: #e8f0fe; }
.nav-link.active { color: var(--primary); background: #dbeafe; font-weight: 600; }

.cart-badge {
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 50px;
    min-width: 18px;
    text-align: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text);
    cursor: pointer;
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== PAGE SYSTEM ========== */
.page { display: none; }
.page.active { display: block; }

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.page-title i { color: var(--primary); }

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i { color: var(--primary); font-size: 1.1rem; }

/* ========== HERO CAROUSEL ========== */
.hero-carousel-wrapper {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0d6efd 100%);
    padding: 0;
    overflow: hidden;
}

.hero-carousel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 3;
    padding: 0.9rem 2rem;
    background: linear-gradient(180deg, rgba(15,23,42,0.85) 0%, transparent 100%);
    pointer-events: none;
}

.hero-carousel-overlay h2 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0;
}

.hero-carousel::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 300px;
    height: 220px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.carousel-slide:hover img { transform: scale(1.08); }

.carousel-slide-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: rgba(255,255,255,0.7);
}

.carousel-slide-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
}

.carousel-slide-num {
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255,255,255,0.5);
    min-width: 18px;
}

.carousel-slide-name {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.carousel-slide-label .risk-badge { font-size: 0.65rem; }

/* Carousel Nav Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    transition: var(--transition);
}

.carousel-btn:hover { background: #fff; transform: translateY(-50%) scale(1.1); }
.carousel-btn-left { left: 12px; }
.carousel-btn-right { right: 12px; }

/* ========== RISK CLASS BADGES ========== */
.risk-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.risk-badge.risk-a { background: #d1fae5; color: #065f46; }
.risk-badge.risk-b { background: #dbeafe; color: #1e40af; }
.risk-badge.risk-c { background: #fef3c7; color: #92400e; }
.risk-badge.risk-d { background: #fee2e2; color: #991b1b; }

/* ========== INFO BANNER ========== */
.info-banner {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    border: 1px solid #bfdbfe;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.info-banner h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.risk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.risk-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; }

.btn-success { background: var(--secondary); color: #fff; }
.btn-success:hover { background: var(--secondary-dark); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; margin-top: 0.5rem; }

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-number { font-size: 2rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.85rem; color: var(--text-light); font-weight: 500; }

/* ========== CATEGORIES GRID ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.category-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.25rem 0.75rem;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.category-card i { font-size: 1.8rem; margin-bottom: 0.5rem; display: block; }
.category-card span { font-size: 0.8rem; font-weight: 600; display: block; line-height: 1.3; }

.category-class-hint {
    display: block;
    font-size: 0.7rem !important;
    color: var(--text-light);
    margin-top: 0.3rem;
    font-weight: 500 !important;
}

/* ========== PRODUCTS GRID ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.product-card-img {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
}

.product-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }

.product-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.product-card-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
}

.product-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    color: var(--text);
    line-height: 1.3;
}

.product-card-model {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.product-card-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--secondary-dark);
}

.product-card-stock {
    font-size: 0.75rem;
    color: var(--text-light);
}

.out-of-stock { color: var(--danger); font-weight: 600; }

/* ========== SHOP LAYOUT ========== */
.shop-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }

.sort-box select {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-white);
    cursor: pointer;
}

.shop-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
}

.category-sidebar {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.category-sidebar h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.category-filter-list { list-style: none; }

.category-filter-list li {
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    margin-bottom: 1px;
}

.category-filter-list li:hover { background: #f1f5f9; }
.category-filter-list li.active { background: #dbeafe; color: var(--primary); font-weight: 600; }

.category-filter-list li .count {
    background: var(--bg);
    padding: 1px 7px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ========== FORM CARD ========== */
.form-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.form-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-card h3 i { color: var(--primary); }

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

.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #dbeafe;
}

.form-group textarea { resize: vertical; }

/* Image Upload Area */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    min-height: 80px;
    max-width: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: #f8fafc;
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    color: var(--text-light);
}

.image-upload-placeholder i {
    font-size: 1.4rem;
    color: var(--primary);
    opacity: 0.5;
}

.image-upload-placeholder span {
    font-size: 0.8rem;
    font-weight: 600;
}

.image-upload-placeholder small {
    font-size: 0.75rem;
    color: var(--text-light);
}

.image-upload-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    padding: 0.5rem;
}

.image-upload-preview img {
    max-height: 100px;
    max-width: 100%;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.image-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* Product Card with uploaded photo */
.product-card-img-photo {
    background: #f8fafc;
    padding: 0;
    height: 180px;
}

.product-card-img-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ========== TABLE ========== */
.table-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.table-header h3 i { color: var(--primary); }

.table-search input {
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
}

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

.table-responsive { overflow-x: auto; }

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

.data-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover { background: #f8fafc; }

.data-table .actions {
    display: flex;
    gap: 0.4rem;
}

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

.cart-items { min-height: 200px; }

.cart-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.cart-item:hover { box-shadow: var(--shadow-md); }

.cart-item-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.cart-item-details { flex: 1; }
.cart-item-name { font-weight: 700; font-size: 0.95rem; }
.cart-item-price { font-size: 0.82rem; color: var(--text-light); display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-qty button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.cart-item-qty button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.cart-item-qty span { font-weight: 700; min-width: 30px; text-align: center; }

.cart-item-total { font-weight: 800; font-size: 1rem; color: var(--secondary-dark); min-width: 80px; text-align: right; }

.cart-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.cart-item-remove:hover { transform: scale(1.2); }

/* Cart Summary */
.cart-summary {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 80px;
}

.cart-summary h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}

.summary-row span:first-child { color: var(--text-light); font-weight: 500; }
.summary-row span:last-child { font-weight: 600; }

.total-row { font-size: 1.15rem; }
.total-row span { color: var(--text) !important; font-weight: 800 !important; }

.discount-input {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.discount-input input {
    width: 80px;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    text-align: right;
}

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

.customer-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    margin-top: 0.25rem;
}

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

.cart-summary hr { border: none; border-top: 2px solid var(--border); margin: 0.5rem 0; }

/* ========== INVOICE ========== */
.invoice-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.invoice-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

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

.invoice-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.invoice-card-no { font-weight: 800; color: var(--primary); font-size: 1rem; }
.invoice-card-date { font-size: 0.8rem; color: var(--text-light); }

.invoice-card-customer { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; }

.invoice-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-card-total { font-size: 1.15rem; font-weight: 800; color: var(--secondary-dark); }
.invoice-card-items { font-size: 0.8rem; color: var(--text-light); }

/* Invoice Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    overflow-y: auto;
}

.modal-overlay.show { display: flex; flex-direction: column; align-items: center; }

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    max-width: 800px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Invoice Preview */
.invoice-preview {
    padding: 2.5rem;
    font-size: 0.9rem;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary);
}

.invoice-brand h2 {
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.invoice-brand p { font-size: 0.78rem; color: var(--text-light); line-height: 1.6; }

.invoice-meta { text-align: right; }
.invoice-meta h3 { font-size: 1.3rem; color: var(--text); margin-bottom: 0.25rem; }
.invoice-meta p { font-size: 0.82rem; color: var(--text-light); }

.invoice-customer { margin-bottom: 1.5rem; }
.invoice-customer p { font-size: 0.85rem; }
.invoice-customer strong { color: var(--text); }

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.invoice-table th {
    background: var(--primary);
    color: #fff;
    padding: 0.7rem 0.8rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
}

.invoice-table th:last-child,
.invoice-table td:last-child { text-align: right; }

.invoice-table td {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.invoice-table tr:nth-child(even) { background: #f8fafc; }

.invoice-totals {
    display: flex;
    justify-content: flex-end;
}

.invoice-totals table { width: 280px; }

.invoice-totals td {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.invoice-totals tr:last-child td {
    font-weight: 800;
    font-size: 1.1rem;
    border-top: 2px solid var(--text);
    padding-top: 0.6rem;
}

.invoice-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.7;
}

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

.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state p { font-size: 1rem; margin-bottom: 1rem; }

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--text);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideInRight 0.3s ease;
    min-width: 250px;
}

.toast.success { background: #059669; }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== PRINT STYLES ========== */
@media print {
    body * { visibility: hidden; }
    .invoice-preview, .invoice-preview * { visibility: visible; }
    .invoice-preview {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
    }
    .modal-overlay { display: block !important; position: static; background: none; padding: 0; }
    .modal-actions { display: none; }
    .navbar { display: none; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        width: 100%;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border);
    }

    .nav-links.show { display: flex; }

    .mobile-menu-btn { display: block; }

    .carousel-slide { flex: 0 0 220px; height: 170px; }
    .hero-carousel-overlay h2 { font-size: 0.85rem; }
    .carousel-btn { width: 30px; height: 30px; font-size: 0.75rem; }

    .container { padding: 1rem; }

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

    .category-sidebar {
        position: static;
        max-height: none;
        display: flex;
        flex-direction: column;
    }

    .category-filter-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .category-filter-list li { padding: 0.4rem 0.7rem; background: var(--bg); border-radius: 50px; font-size: 0.75rem; }

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

    .cart-summary { position: static; }

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

    .risk-legend { flex-direction: column; gap: 0.5rem; }

    .invoice-header { flex-direction: column; gap: 1rem; }
    .invoice-meta { text-align: left; }

    .carousel-slide { flex: 0 0 180px; height: 150px; }
    .carousel-slide-name { font-size: 0.7rem; }
    .carousel-btn { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: 1fr; }
    .invoice-list { grid-template-columns: 1fr; }

    .cart-item { flex-wrap: wrap; }
    .cart-item-total { min-width: auto; }

    .shop-controls { flex-direction: column; }
}
