/* ECWID Order Manager - Dark Mode Styles */

:root {
    --primary: #6366F1;
    --primary-hover: #818CF8;
    --secondary: #9CA3AF;
    --success: #34D399;
    --warning: #FBBF24;
    --danger: #F87171;
    --bg-dark: #0F172A;
    --bg-card: #1E293B;
    --bg-input: #334155;
    --border: #334155;
    --text-light: #F1F5F9;
    --text-muted: #94A3B8;
    --text-dark: #F8FAFC;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    z-index: 100;
}

.main-content {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;  /* Add this to center the logo */
    gap: 12px;
    padding: 0 24px 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.logo i {
    font-size: 28px;
    color: var(--primary);
}

.logo span {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-light);
}

.logo img {
    display: block;
}

/* Navigation */
nav {
    padding: 0 16px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

nav a:hover {
    background: var(--bg-input);
    color: var(--text-light);
}

nav a.active {
    background: #312E81;
    color: var(--primary-hover);
    font-weight: 500;
}

nav a i {
    width: 20px;
    text-align: center;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-light);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-input);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-input);
    color: var(--primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: #312E81; color: #818CF8; }
.stat-icon.green { background: #064E3B; color: #34D399; }
.stat-icon.orange { background: #78350F; color: #FBBF24; }
.stat-icon.purple { background: #581C87; color: #A78BFA; }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-light);
}

.stat-info p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Filter Bar */
.filter-bar {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.filter-bar form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}

.filter-group select,
.filter-group input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    min-width: 150px;
    background: var(--bg-input);
    color: var(--text-light);
}

.filter-group input[type="date"] {
    min-width: 140px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
}

.card-header .link {
    color: var(--primary-hover);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.card-header .link:hover {
    text-decoration: underline;
}

/* Table */
.table-container {
    overflow-x: auto;
}

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

thead {
    background: var(--bg-input);
}

th {
    padding: 14px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

tbody tr:hover {
    background: var(--bg-input);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-awaiting_processing { background: #451A03; color: #FBBF24; }
.badge-processing { background: #1E3A8A; color: #60A5FA; }
.badge-shipped { background: #312E81; color: #A5B4FC; }
.badge-delivered { background: #064E3B; color: #34D399; }
.badge-will_not_deliver { background: #450A0A; color: #F87171; }
.badge-returned { background: #581C87; color: #A78BFA; }
.badge-ready_for_pickup { background: #065F46; color: #6EE7B7; }
.badge-out_for_delivery { background: #78350F; color: #FCD34D; }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* Text Helpers */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.link { color: var(--primary-hover); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
    }
    
    .logo span,
    nav a span {
        display: none;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-bar form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 24px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--bg-input);
    color: var(--text-light);
}

.pagination .current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Order Detail */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.order-info-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border);
}

.order-info-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 14px;
}

.info-value {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
}

/* Order Items */
.order-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 8px;
}

.item-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 8px;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 4px;
}

.item-details p {
    font-size: 12px;
    color: var(--text-muted);
}

.item-price {
    text-align: right;
}

.item-price .price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
}

.item-price .quantity {
    font-size: 12px;
    color: var(--text-muted);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

.login-box {
    background: var(--bg-card);
    padding: 48px;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-light);
}

.login-box p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-input);
    color: var(--text-light);
}

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

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.login-btn:hover {
    background: var(--primary-hover);
}

.login-error {
    background: #450A0A;
    color: #F87171;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* A6 Label */
.label-container {
    width: 100mm;
    height: 148mm;
    padding: 8mm;
    background: white;
    margin: 0 auto;
}

.label-content {
    border: 1px solid #ccc;
    padding: 10px;
    height: 100%;
    font-size: 12px;
}

.label-header {
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.label-header h2 {
    font-size: 18px;
    color: #333;
}

.label-row {
    display: flex;
    margin-bottom: 8px;
}

.label-label {
    width: 80px;
    font-weight: 600;
    color: #666;
}

.label-value {
    flex: 1;
    color: #333;
}

.label-items {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.label-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 11px;
}

@media print {
    body * {
        visibility: hidden;
    }
    .label-container, .label-container * {
        visibility: visible;
    }
    .label-container {
        position: absolute;
        left: 0;
        top: 0;
    }
}