/* ═══════════════════════════════════════
   TOM E-COMMERCE — GLOBAL STYLES
   Dark theme + neon purple/green
═══════════════════════════════════════ */

:root {
    --bg: #05050a;
    --bg-card: #0a0a14;
    --bg-card-hover: #0f0f1a;
    --bg-input: #0d0d18;
    --border: #1a1a2e;
    --border-focus: #8b5cf6;
    --text: #e0e0e8;
    --text-dim: #7a7a8e;
    --text-bright: #ffffff;
    --neon-purple: #8b5cf6;
    --neon-purple-dim: rgba(139, 92, 246, 0.15);
    --neon-purple-glow: rgba(139, 92, 246, 0.4);
    --neon-green: #10b981;
    --neon-green-dim: rgba(16, 185, 129, 0.15);
    --neon-green-glow: rgba(16, 185, 129, 0.4);
    --neon-cyan: #06b6d4;
    --neon-red: #ef4444;
    --neon-red-dim: rgba(239, 68, 68, 0.15);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #6d28d9);
    --gradient-green: linear-gradient(135deg, #10b981, #059669);
    --gradient-hero: linear-gradient(160deg, #8b5cf6 0%, #06b6d4 50%, #10b981 100%);
    --radius: 12px;
    --radius-lg: 20px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--neon-purple); text-decoration: none; transition: all 0.3s; }
a:hover { color: var(--neon-green); }

/* ═══════════ BUTTONS ═══════════ */
.btn {
    padding: 0.85rem 1.8rem;
    border-radius: var(--radius);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient-purple);
    color: white;
    box-shadow: 0 0 25px var(--neon-purple-dim);
}
.btn-primary:hover {
    box-shadow: 0 0 40px var(--neon-purple-glow);
    transform: translateY(-2px);
    color: white;
}

.btn-green {
    background: var(--gradient-green);
    color: white;
    box-shadow: 0 0 25px var(--neon-green-dim);
}
.btn-green:hover {
    box-shadow: 0 0 40px var(--neon-green-glow);
    transform: translateY(-2px);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--neon-purple);
    color: var(--neon-purple);
    background: var(--neon-purple-dim);
}

.btn-danger {
    background: var(--neon-red-dim);
    color: var(--neon-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

/* ═══════════ FORMS ═══════════ */
.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
    letter-spacing: 0.3px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-bright);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--neon-purple);
    box-shadow: 0 0 15px var(--neon-purple-dim);
}

.form-textarea { min-height: 120px; resize: vertical; }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-card); }

/* ═══════════ NAVIGATION ═══════════ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(20px);
    background: rgba(5, 5, 10, 0.85);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-bright);
    text-decoration: none;
}
.nav-logo span {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}
.nav-links a:hover { color: var(--neon-purple); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--gradient-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

/* ═══════════ DASHBOARD LAYOUT ═══════════ */
.dashboard {
    display: flex;
    min-height: 100vh;
    padding-top: 60px;
}

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 2rem 0;
    position: fixed;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 0 1.2rem;
    margin-bottom: 2rem;
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 0.8rem;
    padding: 0 0.8rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.2rem;
}
.sidebar-link:hover {
    background: var(--neon-purple-dim);
    color: var(--text-bright);
}
.sidebar-link.active {
    background: var(--neon-purple-dim);
    color: var(--neon-purple);
    font-weight: 600;
}

.sidebar-link .icon { font-size: 1.1rem; }

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    max-width: calc(100% - 260px);
}

/* ═══════════ CARDS ═══════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    transition: all 0.3s;
}
.card:hover {
    border-color: rgba(139, 92, 246, 0.2);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-bright);
}

.stat-value.green { color: var(--neon-green); text-shadow: 0 0 20px var(--neon-green-glow); }
.stat-value.purple { color: var(--neon-purple); text-shadow: 0 0 20px var(--neon-purple-glow); }

/* ═══════════ REPORTS LIST ═══════════ */
.report-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.8rem;
    transition: all 0.3s;
    background: var(--bg);
}
.report-item:hover {
    border-color: rgba(139, 92, 246, 0.3);
    background: var(--bg-card);
}

.report-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--neon-purple-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.report-info { flex: 1; }

.report-title {
    font-weight: 600;
    color: var(--text-bright);
    font-size: 0.95rem;
}

.report-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ═══════════ BADGE / TAG ═══════════ */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: var(--neon-green-dim); color: var(--neon-green); }
.badge-purple { background: var(--neon-purple-dim); color: var(--neon-purple); }
.badge-red { background: var(--neon-red-dim); color: var(--neon-red); }

/* ═══════════ TABLE ═══════════ */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
th {
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
td { color: var(--text); }
tr:hover td { background: rgba(139, 92, 246, 0.03); }

/* ═══════════ EMPTY STATE ═══════════ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-dim);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { color: var(--text-bright); margin-bottom: 0.5rem; }

/* ═══════════ MODAL ═══════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
}

/* ═══════════ TOAST ═══════════ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    z-index: 300;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--neon-green-dim); color: var(--neon-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.toast-error { background: var(--neon-red-dim); color: var(--neon-red); border: 1px solid rgba(239, 68, 68, 0.3); }

/* ═══════════ AUTH PAGE ═══════════ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}
.auth-bg-orb.purple { width: 400px; height: 400px; background: var(--neon-purple); top: 10%; left: -5%; }
.auth-bg-orb.green { width: 350px; height: 350px; background: var(--neon-green); bottom: 10%; right: -5%; }

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gradient-hero);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo a {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-bright);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-bright);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-sub {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.auth-tab {
    flex: 1;
    padding: 0.7rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-dim);
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
}
.auth-tab.active {
    background: var(--neon-purple-dim);
    color: var(--neon-purple);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-error {
    background: var(--neon-red-dim);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--neon-red);
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: none;
}

.auth-divider {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    margin: 1.5rem 0;
}

/* ═══════════ PAGE HEADER ═══════════ */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.5px;
}

.page-sub {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

/* ═══════════ LOADING ═══════════ */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--neon-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; max-width: 100%; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .main-content { padding: 1rem; }
    .navbar { padding: 0.8rem 1rem; }
}
