/* vAutoAds Admin — Vixor Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #7c3aed;
    --content-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

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

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

.login-card {
    background: #1e293b;
    border-radius: 16px;
    padding: 48px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: var(--accent);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.login-logo h1 {
    color: #e2e8f0;
    font-size: 24px;
    font-weight: 700;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 4px;
}

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

.login-card label {
    display: block;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.login-card input:focus {
    border-color: var(--accent);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 8px;
}

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

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

.btn-secondary {
    background: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

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

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

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== LAYOUT ===== */
#app {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid #1e293b;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--text-light);
}

.project-selector {
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
}

.project-selector select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #e2e8f0;
}

.nav-item.active {
    background: rgba(124, 58, 237, 0.1);
    color: white;
    border-left-color: var(--accent);
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #1e293b;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.user-info span {
    color: #94a3b8;
}

.logout-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 12px;
}

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

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
}

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

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

.kpi-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-change {
    font-size: 12px;
    margin-top: 4px;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--danger); }

/* ===== CARDS ===== */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

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

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

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

tr:hover td {
    background: #f1f5f9;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active { background: #dcfce7; color: #166534; }
.badge-paused { background: #fef3c7; color: #92400e; }
.badge-draft { background: #e2e8f0; color: #475569; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-completed { background: #dbeafe; color: #1e40af; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-meta { background: #dbeafe; color: #1d4ed8; }
.badge-google { background: #fef3c7; color: #92400e; }

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: white;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--card-bg);
    border-radius: 12px;
    width: 560px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

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

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 16px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== PIPELINE NAV ===== */
.pipeline-label {
    padding: 12px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #475569;
    text-transform: uppercase;
}

.pipeline-divider {
    height: 1px;
    background: #1e293b;
    margin: 8px 16px;
}

.pipeline-step {
    position: relative;
    padding-left: 16px !important;
}

.pipeline-step::before {
    content: '';
    position: absolute;
    left: 27px;
    top: 38px;
    width: 2px;
    height: calc(100% - 14px);
    background: #334155;
}

.pipeline-step:last-of-type::before {
    display: none;
}

.step-status {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.step-pending {
    background: #1e293b;
    color: #475569;
    border: 2px solid #334155;
}

.step-active {
    background: var(--accent);
    color: white;
    border: 2px solid var(--accent);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

.step-complete {
    background: var(--success);
    color: white;
    border: 2px solid var(--success);
}

.step-error {
    background: var(--danger);
    color: white;
    border: 2px solid var(--danger);
}

.pipeline-step .step-complete + span,
.nav-item.active .step-status {
    color: white;
}

/* Pipeline completed connector */
.pipeline-step.completed::before {
    background: var(--success);
}

/* ===== PIPELINE PAGE LAYOUT ===== */
.pipeline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.pipeline-header .step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.pipeline-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.pipeline-header .step-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-left: auto;
}

.pipeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.pipeline-footer .btn {
    min-width: 180px;
}

/* Asset grid for creatives */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.asset-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.asset-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.asset-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
}

.asset-card .asset-info {
    padding: 12px 16px;
}

/* Copy variant cards */
.copy-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.copy-card .copy-headline {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.copy-card .copy-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Review launch summary */
.review-section {
    margin-bottom: 24px;
}

.review-section h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-section h4 .review-count {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.launch-box {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    color: white;
}

.launch-box h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.launch-box p {
    opacity: 0.85;
    margin-bottom: 20px;
    font-size: 14px;
}

.launch-box .btn {
    background: white;
    color: var(--accent);
    font-size: 16px;
    padding: 14px 40px;
}

.launch-box .btn:hover {
    background: #f1f5f9;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-title, .sidebar-subtitle, .nav-item span:not(.nav-icon),
    .project-selector, .sidebar-footer span, .logout-link { display: none; }
    .sidebar-header { justify-content: center; padding: 16px 8px; }
    .nav-item { justify-content: center; padding: 12px 8px; }
    .main-content { margin-left: 60px; padding: 16px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}
