/* WMC eBay Listing System — Styles */
:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #3b82f6;
}

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

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

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.5rem;
}

.sidebar-brand h2 {
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
}

.sidebar-brand small {
    font-size: 0.75rem;
    color: var(--sidebar-text);
}

.sidebar-nav { list-style: none; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-nav a.active {
    background: rgba(59,130,246,0.15);
    color: var(--sidebar-active);
    border-right: 3px solid var(--sidebar-active);
}

.sidebar-nav .divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 0.5rem 1.25rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

.sidebar-footer a { color: var(--sidebar-text); text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 1.5rem 2rem;
    min-width: 0;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-dollars {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-weight: 500;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
}

th {
    background: #f1f5f9;
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
}

th a { color: inherit; text-decoration: none; }
th a:hover { color: var(--primary); }

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td.col-desc {
    white-space: normal;
    max-width: 300px;
}

td.col-strategy {
    white-space: normal;
    max-width: 250px;
}

tr:hover { background: #f8fafc; }

/* Tags */
.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tag-fast { background: #dcfce7; color: #166534; }
.tag-hidden { background: #fef3c7; color: #92400e; }
.tag-cash { background: #dbeafe; color: #1e40af; }
.tag-overstock { background: #fce7f3; color: #9d174d; }
.tag-dead { background: #fee2e2; color: #991b1b; }
.tag-premium { background: #ede9fe; color: #5b21b6; }
.tag-easy { background: #ccfbf1; color: #115e59; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn:hover { background: #f1f5f9; }

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

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="email"], select, textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--surface);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}

.tab {
    padding: 0.6rem 1.25rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.pagination a {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--text);
}

.pagination a:hover { background: #f1f5f9; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); padding: 0.4rem 0.75rem; border-radius: 0.375rem; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

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

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.login-box h1 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.login-box p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Progress bar */
.progress-container {
    max-width: 500px;
    margin: 3rem auto;
    text-align: center;
}

.progress-bar-bg {
    width: 100%;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: 12px;
    transition: width 0.3s ease;
    min-width: 0;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.progress-percent {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Checkbox */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Page heading */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Filter builder */
.filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.filter-row select, .filter-row input {
    width: auto;
    min-width: 150px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
