/* ==========================================================================
   ZITEO Dashboard Styles
   ========================================================================== */

:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --secondary: #6366f1;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --white: #ffffff;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sidebar-width: 240px;
    --radius: 12px;
    --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

/* ==========================================================================
   Auth Pages
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.auth-container { width: 100%; max-width: 400px; padding: 20px; }

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-card .logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: block;
    margin-bottom: 24px;
}

.auth-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-card .subtitle { color: var(--gray); margin-bottom: 24px; }

.auth-form { text-align: left; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.form-group small { display: block; margin-top: 4px; color: var(--gray); font-size: 12px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.input-group { display: flex; }
.input-group input { border-radius: 0; }
.input-group .input-prefix, .input-group .input-suffix {
    padding: 12px;
    background: var(--light);
    border: 1px solid var(--gray-light);
    color: var(--gray);
    white-space: nowrap;
}
.input-group .input-prefix { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-group .input-suffix { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }

.auth-footer { margin-top: 24px; color: var(--gray); }
.auth-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */

.dashboard-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header { padding: 20px; border-bottom: 1px solid var(--dark-lighter); }
.sidebar-header .logo { color: var(--primary); font-size: 1.5rem; font-weight: 700; text-decoration: none; }

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-item:hover, .nav-item.active { background: var(--dark-lighter); color: var(--white); }
.nav-icon { font-size: 1.25rem; }

.sidebar-footer { border-top: 1px solid var(--dark-lighter); padding: 16px 0; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
}

/* ==========================================================================
   Dashboard Content
   ========================================================================== */

.dashboard-content { max-width: 1200px; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h1 { font-size: 1.5rem; }

.dashboard-header { margin-bottom: 32px; }
.dashboard-header h1 { font-size: 1.75rem; margin-bottom: 8px; }
.store-link a { color: var(--primary); text-decoration: none; font-weight: 500; }
.btn-copy { background: none; border: none; cursor: pointer; margin-left: 8px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.stat-value { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: var(--gray); font-size: 0.875rem; }

/* Quick Actions */
.quick-actions h3 { margin-bottom: 16px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.action-card {
    background: var(--white);
    padding: 24px 16px;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.action-icon { font-size: 1.5rem; display: block; margin-bottom: 8px; }

/* Empty State */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state-icon { font-size: 4rem; margin-bottom: 16px; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { color: var(--gray); margin-bottom: 24px; }

.empty-state-small { text-align: center; padding: 40px 20px; background: var(--white); border-radius: var(--radius); }
.empty-state-small p { color: var(--gray); margin-bottom: 16px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-size: 14px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--gray-light); color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-large { padding: 16px 32px; font-size: 1rem; }

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* ==========================================================================
   Products Grid
   ========================================================================== */

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.product-image { aspect-ratio: 1; background: var(--light); display: flex; align-items: center; justify-content: center; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.no-image { font-size: 3rem; color: var(--gray-light); }
.product-info { padding: 16px; }
.product-info h3 { font-size: 1rem; margin-bottom: 8px; }
.product-price { margin-bottom: 8px; }
.price-strike { text-decoration: line-through; color: var(--gray); margin-right: 8px; }
.price-current { font-weight: 700; color: var(--primary); }
.stock-badge { font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; }
.stock-badge.in_stock { background: #dcfce7; color: var(--success); }
.stock-badge.out_of_stock { background: #fef2f2; color: var(--danger); }

/* ==========================================================================
   Orders Table
   ========================================================================== */

.orders-table-wrapper { overflow-x: auto; }
.orders-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.orders-table th, .orders-table td { padding: 16px; text-align: left; border-bottom: 1px solid var(--gray-light); }
.orders-table th { font-weight: 600; background: var(--light); }
.orders-table tr:last-child td { border-bottom: none; }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}
.status-initiated { background: #fef3c7; color: #92400e; }
.status-confirmed { background: #dbeafe; color: #1e40af; }
.status-shipped { background: #e0e7ff; color: #4338ca; }
.status-delivered { background: #dcfce7; color: var(--success); }
.status-cancelled { background: #fef2f2; color: var(--danger); }
.status-pending { background: #fef3c7; color: #92400e; }
.status-active { background: #dcfce7; color: var(--success); }

.status-form select { padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--gray-light); }

/* ==========================================================================
   Forms
   ========================================================================== */

.product-form, .store-form { max-width: 600px; background: var(--white); padding: 32px; border-radius: var(--radius); }
.form-actions { margin-top: 24px; }

.create-store-container { max-width: 500px; }
.create-store-container h1 { margin-bottom: 8px; }
.create-store-container .subtitle { color: var(--gray); margin-bottom: 24px; }

/* Settings */
.settings-section { background: var(--white); padding: 24px; border-radius: var(--radius); margin-bottom: 24px; }
.settings-section h3 { margin-bottom: 16px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.info-item label { display: block; color: var(--gray); font-size: 0.875rem; margin-bottom: 4px; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
}
