/* ==========================================================================
   No More Reviews Hub — Editorial Design System
   Colors: dark #1C1C1A, ink #0A0A0A, cream #F8F7F4, gold #D6BB88, brown #3B1F08
   Fonts: Cormorant Garamond (headings), Raleway (body)
   ========================================================================== */

:root {
    --dark: #1C1C1A;
    --ink: #0A0A0A;
    --cream: #F8F7F4;
    --gold: #D6BB88;
    --brown: #3B1F08;
    --card-bg: #232320;
    --card-border: #2E2E2A;
    --text-muted: #A09E98;
    --text-dim: #6B6963;
    --success: #7CB87C;
    --warning: #D6BB88;
    --danger: #C47070;
    --info: #7CAAB8;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Raleway', sans-serif;
    background: var(--ink);
    color: var(--cream);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--dark);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 28px 24px 20px;
    border-bottom: 1px solid var(--card-border);
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--cream);
    letter-spacing: 0.02em;
}

.logo-accent { color: var(--gold); }

.logo-sub {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    margin-top: 2px;
}

.nav-links {
    list-style: none;
    padding: 16px 0;
    flex: 1;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-links a:hover {
    color: var(--cream);
    background: rgba(214, 187, 136, 0.06);
}

.nav-links a.active {
    color: var(--gold);
    border-left-color: var(--gold);
    background: rgba(214, 187, 136, 0.08);
}

.nav-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.badge {
    background: var(--gold);
    color: var(--dark);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
}

.logout-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.logout-link:hover { color: var(--cream); }

.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: var(--dark);
    border: 1px solid var(--card-border);
    color: var(--cream);
    font-size: 20px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

/* ---------- Main Content ---------- */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    min-height: 100vh;
}

/* ---------- Page Header ---------- */

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 4px;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ---------- Stats Grid ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

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

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--cream);
    line-height: 1;
}

.stat-value.gold { color: var(--gold); }
.stat-value.success { color: var(--success); }
.stat-value.danger { color: var(--danger); }

.stat-detail {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* ---------- Cards ---------- */

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--cream);
}

.card-body {
    padding: 20px;
}

/* ---------- Tables ---------- */

.table-wrap {
    overflow-x: auto;
}

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

thead th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
    font-weight: 600;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(46, 46, 42, 0.5);
    font-size: 13px;
    color: var(--cream);
    vertical-align: top;
}

tbody tr:hover {
    background: rgba(214, 187, 136, 0.03);
}

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

/* ---------- Stars ---------- */

.stars {
    color: var(--gold);
    font-size: 14px;
    letter-spacing: 2px;
}

.stars-large {
    font-size: 20px;
    letter-spacing: 3px;
}

.star-filled::before { content: '\2605'; }
.star-empty::before { content: '\2606'; color: var(--text-dim); }

/* ---------- Status Badges ---------- */

.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.status-approved { background: rgba(124, 184, 124, 0.15); color: var(--success); }
.status-pending { background: rgba(214, 187, 136, 0.15); color: var(--warning); }
.status-rejected { background: rgba(196, 112, 112, 0.15); color: var(--danger); }

/* Source badges */
.source-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.source-shopify { background: rgba(124, 184, 124, 0.12); color: var(--success); }
.source-google { background: rgba(124, 170, 184, 0.12); color: var(--info); }
.source-peerspace { background: rgba(214, 187, 136, 0.12); color: var(--gold); }
.source-manual { background: rgba(160, 158, 152, 0.12); color: var(--text-muted); }

/* ---------- Placement Tags ---------- */

.placement-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(214, 187, 136, 0.1);
    color: var(--gold);
    margin: 2px 4px 2px 0;
    border: 1px solid rgba(214, 187, 136, 0.2);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-gold {
    background: var(--gold);
    color: var(--dark);
}

.btn-gold:hover {
    background: #C4A970;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--cream);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-success {
    background: rgba(124, 184, 124, 0.15);
    color: var(--success);
    border: 1px solid rgba(124, 184, 124, 0.3);
}

.btn-success:hover {
    background: rgba(124, 184, 124, 0.25);
}

.btn-danger {
    background: rgba(196, 112, 112, 0.15);
    color: var(--danger);
    border: 1px solid rgba(196, 112, 112, 0.3);
}

.btn-danger:hover {
    background: rgba(196, 112, 112, 0.25);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 9px;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Filters ---------- */

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    align-items: center;
}

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

.filter-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-dim);
}

select, input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea {
    background: var(--dark);
    border: 1px solid var(--card-border);
    color: var(--cream);
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--gold);
}

select {
    cursor: pointer;
    min-width: 120px;
}

textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

/* ---------- Review Card (in list) ---------- */

.review-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.review-card:hover {
    border-color: rgba(214, 187, 136, 0.3);
}

.review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.review-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.review-author {
    font-weight: 600;
    color: var(--cream);
    font-size: 14px;
}

.review-date {
    font-size: 12px;
    color: var(--text-dim);
}

.review-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 16px;
    font-style: italic;
    color: var(--gold);
    margin-bottom: 8px;
}

.review-text {
    color: var(--cream);
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.9;
}

.review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.review-placements {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ---------- Rating Input (submission form) ---------- */

.rating-input {
    display: flex;
    gap: 4px;
    direction: rtl;
    justify-content: flex-end;
}

.rating-input input {
    display: none;
}

.rating-input label {
    font-size: 28px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.15s;
}

.rating-input label:hover,
.rating-input label:hover ~ label,
.rating-input input:checked ~ label {
    color: var(--gold);
}

/* ---------- Grid Layouts ---------- */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

/* ---------- Rating Distribution Bar ---------- */

.rating-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.rating-bar-label {
    font-size: 13px;
    color: var(--text-muted);
    width: 20px;
    text-align: right;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(214, 187, 136, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rating-bar-count {
    font-size: 12px;
    color: var(--text-dim);
    width: 30px;
}

/* ---------- Sync Status ---------- */

.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sync-dot.synced { background: var(--success); }
.sync-dot.unsynced { background: var(--warning); }

/* ---------- Empty State ---------- */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.empty-state h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
}

/* ---------- Modal ---------- */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--dark);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    color: var(--cream);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover { color: var(--cream); }

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ---------- Form ---------- */

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

.form-group label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
}

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.form-help {
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 4px;
}

/* ---------- Checkbox ---------- */

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.checkbox-row input[type="checkbox"] {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}

.checkbox-row label {
    font-size: 13px;
    color: var(--cream);
    cursor: pointer;
}

/* ---------- Placement Selector ---------- */

.placement-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.placement-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.placement-option:hover {
    border-color: var(--gold);
    color: var(--cream);
}

.placement-option.selected {
    border-color: var(--gold);
    background: rgba(214, 187, 136, 0.1);
    color: var(--gold);
}

/* ---------- Notification Toast ---------- */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 600;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--success);
    color: var(--dark);
}

.toast-error {
    background: var(--danger);
    color: var(--cream);
}

/* ---------- Settings Sections ---------- */

.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    color: var(--cream);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(46, 46, 42, 0.3);
}

.settings-row-label {
    font-size: 13px;
    color: var(--cream);
}

.settings-row-desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Toggle switch */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-border);
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: var(--cream);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
    background: var(--gold);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ---------- Sync Log ---------- */

.sync-log-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(46, 46, 42, 0.3);
    font-size: 12px;
}

.sync-log-time {
    color: var(--text-dim);
    min-width: 140px;
}

.sync-log-detail {
    color: var(--text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-top: 60px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .review-header {
        flex-direction: column;
    }

    .review-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Login Page ---------- */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--ink);
}

.login-box {
    background: var(--dark);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-box h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    color: var(--cream);
    margin-bottom: 4px;
}

.login-box .login-sub {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 32px;
}

.login-box input[type="password"] {
    width: 100%;
    margin-bottom: 16px;
    text-align: center;
    font-size: 14px;
    padding: 12px;
}

.login-box .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.login-error {
    color: var(--danger);
    font-size: 12px;
    margin-bottom: 16px;
}

/* ---------- Public Submit Page ---------- */

.public-page {
    min-height: 100vh;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.public-box {
    background: var(--dark);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 48px 40px;
    width: 100%;
    max-width: 520px;
}

.public-box h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    color: var(--cream);
    text-align: center;
    margin-bottom: 4px;
}

.public-box .public-sub {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    text-align: center;
    margin-bottom: 32px;
}

/* Honeypot */
.hp-field { position: absolute; left: -9999px; }

/* ---------- Import Upload ---------- */

.upload-area {
    border: 2px dashed var(--card-border);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover {
    border-color: var(--gold);
}

.upload-area.dragover {
    border-color: var(--gold);
    background: rgba(214, 187, 136, 0.05);
}

/* ---------- Utility ---------- */

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
