/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-size: 14px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0891b2 100%);
}

/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */
.main-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    padding: 32px 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 16px 16px;
}

.main-nav a {
    padding: 12px 24px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    margin: 2px 16px;
    border-radius: 8px;
}

.main-nav a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 0 3px 3px 0;
    transition: height 0.2s ease;
    box-shadow: 0 0 12px rgba(14, 165, 233, 0.5);
}

.main-nav a:hover {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}

.main-nav a:hover::before,
.main-nav a.active::before {
    height: 24px;
}

.main-nav a.active {
    background: rgba(14, 165, 233, 0.2);
    color: #38bdf8;
    font-weight: 600;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.menu-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 2px;
    background: #1e293b;
    box-shadow: 0 -5px 0 #1e293b, 0 5px 0 #1e293b;
    transition: all 0.2s ease;
}

.menu-toggle.active::before {
    background: transparent;
    box-shadow: 0 0 0 #1e293b;
    transform: translate(-50%, -50%) rotate(45deg);
}

.menu-toggle.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 18px;
    height: 2px;
    background: #1e293b;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.mobile-overlay.show {
    display: block;
    pointer-events: auto;
    opacity: 1;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.logo {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.hero-description {
    font-size: 18px;
    color: #94a3b8;
    margin-bottom: 32px;
    line-height: 1.6;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
    color: #cbd5e1;
}

.feature-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 8px;
    margin-right: 12px;
    font-size: 16px;
}

.platforms-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.platforms-title {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.platforms-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.platform-logo {
    width: 100px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.platform-logo:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.platform-logo svg {
    width: 100%;
    height: 100%;
}

.login-section {
    flex: 0 0 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 40px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.login-box h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #64748b;
    margin-bottom: 28px;
    font-size: 14px;
}

.error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #fca5a5;
    font-size: 13px;
}

.error-icon {
    font-size: 16px;
}

.login-form {
    margin-bottom: 20px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #334155;
    font-size: 13px;
}

.login-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.login-form input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.btn-login {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 8px;
}

.login-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.login-footer p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

.register-link {
    color: #0ea5e9;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.register-link:hover {
    color: #0284c7;
}

@media (max-width: 968px) {
    .login-container {
        flex-direction: column;
    }
    
    .hero-section {
        flex: none;
        min-height: 40vh;
        padding: 32px 20px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-description {
        font-size: 15px;
    }
    
    .features-list {
        display: none;
    }
    
    .login-section {
        flex: 1;
        padding: 20px;
    }
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.container {
    margin-left: 260px;
    padding: 32px;
    max-width: calc(1600px - 260px);
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    color: #0f172a;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

h2 {
    color: #1e293b;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
}

h3 {
    color: #334155;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0891b2 100%);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn-warning {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(251, 146, 60, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 4px 16px rgba(251, 146, 60, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    min-height: 28px;
}

/* ============================================
   ITEMS CONTAINER & CARDS - KOMPAKT
   ============================================ */
.items-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.item-card {
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

.item-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: #0ea5e9;
}

.item-card.sold {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.item-card.sold-profit {
    border-left: 4px solid #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.item-card.sold-loss {
    border-left: 4px solid #f43f5e;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.item-header {
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.item-name {
    font-weight: 600;
    font-size: 13px;
    color: #0f172a;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
}

.item-status {
    font-size: 9px;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-available {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.status-sold {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.item-card-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.item-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    background: #f1f5f9;
}

.item-main-content {
    flex: 1;
    min-width: 0;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.detail-label {
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-value {
    color: #0f172a;
    font-weight: 600;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.profit-positive {
    color: #10b981;
}

.profit-negative {
    color: #ef4444;
}

.item-actions {
    padding: 10px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 4px;
}

.item-actions .btn {
    padding: 6px 4px;
    font-size: 10px;
    white-space: nowrap;
    border-radius: 5px;
    width: 100%;
    min-height: 28px;
}

.item-actions .btn-sm {
    padding: 5px 6px;
}

/* Responsiv design för items */
@media (min-width: 1800px) {
    .items-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1400px) and (max-width: 1799px) {
    .items-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .items-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .items-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .items-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .item-thumbnail {
        height: 100px;
    }
    
    .detail-item {
        font-size: 10px;
    }
    
    .item-actions .btn {
        font-size: 9px;
        padding: 5px 3px;
    }
}

/* ============================================
   PRODUCT CARDS
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.product-card-title h3 {
    margin: 0 0 4px 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 600;
}

.product-card-title .article-number {
    color: #3b82f6;
    font-weight: 600;
    font-size: 12px;
}

.product-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
}

.product-info-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.product-info-value {
    font-weight: 600;
    color: #0f172a;
    text-align: right;
    font-size: 13px;
}

.product-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

/* ============================================
   TABLES
   ============================================ */
.desktop-table {
    display: none;
}

.product-table,
.expense-table,
.itemtable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.product-table th,
.product-table td,
.expense-table th,
.expense-table td,
.itemtable th,
.itemtable td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.product-table th,
.expense-table th,
.itemtable th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-table tr:hover,
.expense-table tr:hover,
.itemtable tr:hover {
    background: #f8fafc;
}

.product-table tr:last-child td,
.expense-table tr:last-child td,
.itemtable tr:last-child td {
    border-bottom: none;
}

/* ============================================
   FORMS
   ============================================ */
.form-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #334155;
    font-size: 13px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.compact-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.compact-form-grid .form-group {
    margin-bottom: 0;
}

.compact-form-grid label {
    font-size: 12px;
    margin-bottom: 4px;
}

.compact-form-grid input,
.compact-form-grid select {
    font-size: 13px;
    padding: 8px;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(2px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 28px;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
}

/* ============================================
   METRIC MODALS
   ============================================ */
.metric-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.metric-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.metric-modal-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.metric-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.metric-modal-close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    padding: 0 8px;
}

.metric-modal-close:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.metric-modal-body {
    padding: 24px 32px;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
}

.metric-modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
}

.metric-modal-stat {
    text-align: center;
}

.metric-modal-stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-modal-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.metric-items-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-items-table thead {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.metric-items-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-items-table td {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 14px;
}

.metric-items-table tbody tr {
    transition: background-color 0.2s;
}

.metric-items-table tbody tr:hover {
    background-color: #f8fafc;
}

.metric-card.clickable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.metric-card.clickable::after {
    content: '👆';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}

.metric-card.clickable:hover::after {
    opacity: 1;
}

.metric-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.item-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge-listed {
    background: #dcfce7;
    color: #166534;
}

.badge-unlisted {
    background: #fef3c7;
    color: #92400e;
}

.badge-sold {
    background: #dbeafe;
    color: #1e40af;
}

.item-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-view {
    background: #e0e7ff;
    color: #4f46e5;
}

.btn-view:hover {
    background: #c7d2fe;
}

.btn-edit {
    background: #dbeafe;
    color: #2563eb;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.modal-search {
    margin-bottom: 16px;
    padding: 12px 16px;
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.modal-search:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* ============================================
   DASHBOARD & CHARTS
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.chart-card h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: #0f172a;
    font-weight: 600;
}

.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.chart-tab {
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.chart-tab.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border-color: #0ea5e9;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-block {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-block h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    color: #0f172a;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 10px;
    font-weight: 600;
}

.category-block p {
    margin: 8px 0;
    font-size: 14px;
    color: #475569;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.metric-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: all 0.2s ease;
}

.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.metric-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

.metric-change {
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================
   FILTERS & PAGINATION
   ============================================ */
.filter-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

.filter-container label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    font-size: 13px;
    color: #334155;
}

.filter-container input[type="date"],
.filter-container input[type="text"] {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    margin-top: 6px;
    transition: all 0.2s ease;
    min-width: 160px;
}

.filter-container input[type="date"]:focus,
.filter-container input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-container button {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    height: 38px;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.filter-container button:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0891b2 100%);
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
    transform: translateY(-1px);
}

.pagination {
    text-align: center;
    margin-top: 32px;
    padding: 16px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination a {
    margin: 0 2px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 13px;
}

.pagination a:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
    background: #f0f9ff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.pagination a.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border-color: #0ea5e9;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

/* ============================================
   COLLAPSIBLE SECTIONS
   ============================================ */
.collapsible-header {
    cursor: pointer;
    padding: 14px 18px;
    background: white;
    color: #0f172a;
    border-radius: 8px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.collapsible-header:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.collapsible-header i.arrow {
    transition: transform 0.2s ease;
}

.collapsible-header.active i.arrow {
    transform: rotate(180deg);
}

.collapsible-content {
    display: none;
    overflow: hidden;
}

.collapsible-content.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

/* ============================================
   ONBOARDING
   ============================================ */
.welcome-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.welcome-content {
    background: white;
    margin: 20px auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    animation: slideIn 0.4s ease-out;
    overflow: hidden;
}

.welcome-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.welcome-icon {
    font-size: 40px;
    margin-bottom: 10px;
    animation: wave 2s infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

.welcome-header h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
    font-weight: 700;
}

.welcome-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.95;
}

.welcome-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.welcome-body h3 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 16px;
}

.welcome-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.welcome-steps li {
    padding: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #0ea5e9;
}

.welcome-steps li .step-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.welcome-steps li .step-content {
    flex: 1;
}

.welcome-steps li .step-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
    font-size: 13px;
}

.welcome-steps li .step-desc {
    font-size: 11px;
    color: #64748b;
}

.welcome-actions {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.welcome-actions .btn {
    flex: 1;
}

.onboarding-checklist {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.onboarding-checklist::before {
    content: '🚀';
    position: absolute;
    font-size: 100px;
    right: -20px;
    top: -30px;
    opacity: 0.1;
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.checklist-header h2 {
    margin: 0;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
}

.progress-badge {
    background: #f59e0b;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.progress-bar-container {
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
}

.checklist-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.checklist-item {
    background: white;
    padding: 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    text-decoration: none !important;
}

.checklist-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.checklist-item.completed {
    opacity: 0.7;
}

.checklist-icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.checklist-icon.pending {
    background: #fef3c7;
    color: #f59e0b;
}

.checklist-icon.completed {
    background: #dcfce7;
    color: #16a34a;
}

.checklist-text {
    flex: 1;
}

.checklist-text strong {
    display: block;
    color: #1e293b;
    margin-bottom: 2px;
    font-size: 13px;
}

.checklist-text small {
    color: #64748b;
    font-size: 11px;
}

.dismiss-onboarding {
    text-align: center;
    margin-top: 16px;
}

/* ============================================
   PACKAGING
   ============================================ */
#packaging_section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 18px;
    margin-top: 18px;
    border: 1px solid #e2e8f0;
}

#packaging_section h4 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 600;
}

.packaging-subsection {
    background: white;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

/* ============================================
   SUBCATEGORIES
   ============================================ */
.subcategory-list {
    list-style: none;
    padding: 0;
    margin: 14px 0;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
}

.subcategory-list li {
    background: #ffffff;
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.subcategory-list li:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.subcategory-delete, .subcategory-edit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.subcategory-edit {
    color: #3b82f6;
}

.subcategory-edit:hover {
    background: #dbeafe;
}

.subcategory-delete {
    color: #ef4444;
}

.subcategory-delete:hover {
    background: #fee2e2;
}

.subcategory-stats {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.subcat-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.subcat-name {
    color: #64748b;
}

.subcat-value {
    font-weight: 600;
    color: #0f172a;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #64748b;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 600;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 14px;
}

.empty-state i {
    font-size: 42px;
    margin-bottom: 14px;
    opacity: 0.5;
}

/* ============================================
   RESPONSIVE - DESKTOP
   ============================================ */
@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
    
    .mobile-overlay {
        display: none !important;
    }
    
    .desktop-table {
        display: block !important;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-nav {
        left: -100%;
        width: 280px;
        transition: left 0.3s ease;
    }
    
    .main-nav.show {
        left: 0;
    }
    
    .mobile-overlay {
        display: block;
    }
    
    .container {
        margin-left: 0;
        padding: 70px 14px 18px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
    
    .modal-content > form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .dashboard-grid,
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-container {
        padding: 16px;
        gap: 10px;
    }
    
    .filter-container input[type="date"],
    .filter-container input[type="text"] {
        min-width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card-actions {
        grid-template-columns: 1fr;
    }
    
    .metric-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .metric-modal-header {
        padding: 16px 20px;
    }
    
    .metric-modal-body {
        padding: 16px 20px;
    }
    
    .metric-items-table {
        font-size: 12px;
    }
    
    .metric-items-table th,
    .metric-items-table td {
        padding: 8px 12px;
    }
    
    .welcome-content {
        width: 95%;
        margin: 10px auto;
        max-height: 95vh;
    }
    
    .welcome-header {
        padding: 16px;
    }
    
    .welcome-icon {
        font-size: 36px;
    }
    
    .welcome-header h2 {
        font-size: 20px;
    }
    
    .welcome-body {
        padding: 12px;
        max-height: calc(95vh - 180px);
    }
    
    .welcome-actions {
        padding: 12px;
        flex-direction: column;
    }
    
    .onboarding-checklist {
        padding: 16px;
    }
    
    .checklist-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .items-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .items-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .item-actions,
    .filter-container,
    .pagination,
    .menu-toggle,
    .main-nav {
        display: none;
    }
    
    .container {
        margin-left: 0;
    }
}