/* ── Reset navbar (sidebar replaces it) ── */
.navbar { display: none !important; }

/* ── Dashboard shell ── */
.dashboard {
    display: flex;
    min-height: 100vh;
    background: #fafafb;
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ════════════════════════════
   SIDEBAR
════════════════════════════ */
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1.5px solid #e6ebf1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1.5px solid #e6ebf1;
}

.sidebar-logo {
    width: 30px;
    height: 30px;
    background: #1890ff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-size: 14px;
    font-weight: 700;
    color: #1c1917;
    letter-spacing: -0.2px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #bfbfbf;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 16px 6px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 4px;
    font-size: 13.5px;
    font-weight: 500;
    color: #78716c;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
    text-decoration: none;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: #f5f6f7;
    color: #1c1917;
}

.nav-item.active {
    background: #e6f4ff;
    color: #1c1917;
    font-weight: 600;
}

.sidebar-footer {
    padding: 10px 8px;
    border-top: 1.5px solid #e6ebf1;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #dc2626;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s;
}

.btn-logout:hover { background: #fef2f2; }
.btn-logout svg { width: 14px; height: 14px; }

/* ════════════════════════════
   MAIN CONTENT
════════════════════════════ */
.main-content {
    margin-left: 220px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── View header ── */
.view-header {
    background: #fff;
    border-bottom: 1.5px solid #e6ebf1;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-header h1 {
    font-size: 16px;
    font-weight: 700;
    color: #1c1917;
    letter-spacing: -0.2px;
}

.view-header p {
    font-size: 12px;
    color: #a8a29e;
    margin-top: 2px;
}

/* ── View body ── */
.view-body {
    padding: 16px 24px;
    flex: 1;
}

.view { display: none; flex-direction: column; flex: 1; }
.view.active { display: flex; }

/* ════════════════════════════
   CAMPAIGNS VIEW
════════════════════════════ */
.campaigns-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1.5px solid #e6ebf1;
    border-radius: 4px;
    padding: 18px 20px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #a8a29e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #1c1917;
    letter-spacing: -0.5px;
}

.stat-value span {
    font-size: 13px;
    font-weight: 500;
    color: #a8a29e;
    margin-left: 4px;
}

/* Campaign list */
.campaign-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.campaign-card {
    background: #fff;
    border: 1.5px solid #e6ebf1;
    border-radius: 4px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.18s;
}

.campaign-card:hover {
    border-color: #bfbfbf;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.campaign-icon {
    width: 42px;
    height: 42px;
    background: #f2f1ee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.campaign-icon svg { width: 20px; height: 20px; color: #a8a29e; }

.campaign-info { flex: 1; min-width: 0; }

.campaign-filename {
    font-size: 14.5px;
    font-weight: 600;
    color: #1c1917;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

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

.campaign-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    background: #f2f1ee;
    color: #78716c;
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 500;
}

.campaign-date {
    font-size: 12px;
    color: #a8a29e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.campaign-date svg { width: 12px; height: 12px; }

.campaign-progress { width: 140px; flex-shrink: 0; }

.progress-track {
    height: 5px;
    background: #e6f4ff;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-fill {
    height: 100%;
    background: #1890ff;
    border-radius: 99px;
    transition: width 0.4s;
}

.progress-fill.done { background: linear-gradient(90deg, #6ee7b7, #34d399); }
.progress-text { font-size: 11px; color: #a8a29e; }

.campaign-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.badge-completed  { background: #f0fdf4; color: #16a34a; }
.badge-completed::before  { background: #16a34a; }
.badge-processing { background: #fefce8; color: #a16207; }
.badge-processing::before { background: #ca8a04; animation: blink 1.4s infinite; }
.badge-stopped    { background: #fff4f4; color: #dc2626; }
.badge-stopped::before    { background: #dc2626; }
.badge-pending    { background: #f5f6f7; color: #78716c; }
.badge-pending::before    { background: #a8a29e; }
.badge-paused     { background: #f5f6f7; color: #44403c; }
.badge-paused::before     { background: #78716c; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.btn-icon {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border: 1.5px solid #bfbfbf !important;
    border-radius: 4px !important;
    background: #e6f4ff !important;
    color: #1c1917 !important;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-icon:hover { background: #bfbfbf !important; border-color: #a8a29e !important; }
.btn-icon svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }

/* Empty / loading */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a8a29e;
    font-size: 14px;
}

.empty-icon {
    width: 52px;
    height: 52px;
    background: #f2f1ee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.empty-icon svg { width: 24px; height: 24px; color: #bfbfbf; }
.empty-title { font-size: 15px; font-weight: 600; color: #44403c; margin-bottom: 6px; }
.empty-sub   { font-size: 13px; color: #a8a29e; }

/* ════════════════════════════
   UPLOAD VIEW
════════════════════════════ */
.upload-container {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.upload-card {
    background: #fff;
    border: 1.5px solid #e6ebf1;
    border-radius: 4px;
    padding: 30px;
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #44403c;
    margin-bottom: 7px;
}

.form-select {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #e6ebf1;
    border-radius: 4px;
    background: #fafafb;
    color: #1c1917;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    cursor: default;
    appearance: none;
}

.drop-zone {
    border: 2px dashed #d4d0c8;
    border-radius: 4px;
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #faf9f7;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: #a8a29e;
    background: #f5f6f7;
}

.dz-icon {
    width: 52px;
    height: 52px;
    background: #f2f1ee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.dz-icon svg { width: 24px; height: 24px; color: #a8a29e; }

.drop-zone p {
    font-size: 14px;
    font-weight: 500;
    color: #44403c;
    margin-bottom: 4px;
}

.drop-zone .hint {
    font-size: 12.5px;
    color: #a8a29e;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f2f1ee;
    border: 1.5px solid #e6ebf1;
    border-radius: 4px;
    padding: 11px 14px;
    margin-top: 14px;
}

.file-info-icon { color: #78716c; display: flex; }
.file-info-icon svg { width: 17px; height: 17px; }
.file-name {
    flex: 1;
    font-size: 13.5px;
    color: #1c1917;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove {
    background: none;
    border: none;
    color: #a8a29e;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.btn-remove:hover { color: #dc2626; }

.billable-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.billable-label {
    font-size: 11px;
    font-weight: 600;
    color: #78716c;
    white-space: nowrap;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider { background: #3b82f6; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.btn-upload {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 4px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #1890ff;
    color: #ffffff;
    margin-top: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-upload:hover:not(:disabled) {
    background: #096dd9;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(24, 144, 255, 0.2);
}

.btn-upload:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-upload svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Alerts ── */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
}

.alert-error   { background: #fff4f4; border: 1px solid #fdd; color: #e11d48; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }
.alert svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Spinner */
.spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(24, 144, 255, 0.15);
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.hidden { display: none !important; }

.pagination { display: flex; align-self: center; align-items: center; gap: 10px; padding: 12px 0 4px; }
.pagination button { padding: 5px 14px; font-size: 12.5px; background: #f5f6f7; color: #1c1917; border: 1.5px solid #e6ebf1; border-radius: 7px; cursor: pointer; font-family: inherit; font-weight: 600; transition: all 0.15s; }
.pagination button:hover:not(:disabled) { background: #e6ebf1; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 12.5px; color: #6b7280; }
.page-size-picker { display: flex; align-items: center; gap: 5px; margin-left: 8px; }
.page-size-picker label { font-size: 12px; color: #6b7280; font-weight: 500; }
.page-size-picker select { font-size: 12.5px; padding: 4px 6px; border: 1.5px solid #e6ebf1; border-radius: 7px; background: #f5f6f7; color: #1c1917; font-family: inherit; font-weight: 600; cursor: pointer; }

@media (max-width: 768px) {
    .sidebar { width: 200px; }
    .main-content { margin-left: 200px; }
    .campaigns-stats { grid-template-columns: 1fr 1fr; }
    .view-body { padding: 20px 16px; }
    .view-header { padding: 16px 20px; }
}
