/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: #f5f6fa;
    display: flex;
    min-height: 100vh;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 20px 24px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2E77AE, #92B8D4);
    border-radius: 12px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #7F7F7F;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: #f0f7ff;
    color: #2E77AE;
}

.nav-item.active {
    background-color: #E8F1F7;
    color: #2E77AE;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* Sidebar Bottom - User Profile */
.sidebar-bottom {
    padding: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: #2E77AE;
    border-radius: 10px;
    color: #fff;
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 32px 36px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 24px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    border: 1px solid #e8ecf1;
    transition: box-shadow 0.2s ease;
}

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

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    color: #2E77AE;
}

.stat-info {
    color: #b0b7c3;
    font-size: 14px;
    cursor: pointer;
}

.stat-card > .stat-value {
    font-size: 42px;
    font-weight: 800;
    color: #2E77AE;
    margin-bottom: 8px;
    line-height: 1.1;
}

.stat-footer {
    font-size: 12px;
    color: #7F7F7F;
}

/* Completion Bar */
.completion-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #7F7F7F;
}

.completion-bar {
    flex: 1;
    height: 6px;
    background-color: #e8ecf1;
    border-radius: 3px;
    overflow: hidden;
}

.completion-fill {
    height: 100%;
    background-color: #2E77AE;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.completion-numbers {
    font-weight: 500;
    color: #7F7F7F;
}

.completion-percent {
    font-weight: 600;
    color: #1a1a2e;
}

/* ===== TABS ===== */
.tabs-section {
    margin-bottom: 24px;
}

.primary-tabs {
    display: flex;
    gap: 28px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8ecf1;
    padding-bottom: 0;
}

.tab-link {
    font-size: 14px;
    font-weight: 500;
    color: #7F7F7F;
    padding-bottom: 12px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-link:hover {
    color: #2E77AE;
}

.tab-link.active {
    color: #2E77AE;
    border-bottom-color: #2E77AE;
    font-weight: 600;
}

.secondary-tabs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    margin-bottom: 20px;
}

.secondary-tabs {
    display: flex;
    gap: 24px;
}

.sub-tab {
    font-size: 13px;
    font-weight: 500;
    color: #7F7F7F;
    padding-bottom: 6px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.sub-tab:hover {
    color: #333;
}

.sub-tab.active {
    color: #2E77AE;
    border-bottom-color: #2E77AE;
    font-weight: 600;
}

.active-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #2E77AE;
}

.active-dot {
    width: 8px;
    height: 8px;
    background-color: #34a853;
    border-radius: 50%;
}

/* ===== TAB PANELS ===== */
.tab-panel {
    animation: fadeIn 0.3s ease;
}

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

/* ===== CREATE CAMPAIGN ===== */
.create-campaign-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: flex-start;
}

.create-campaign-form-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 32px;
    border: 1px solid #e8ecf1;
}

.form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2E77AE;
    margin-bottom: 24px;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #7F7F7F;
    margin-bottom: 6px;
}

.form-info-icon {
    font-size: 12px;
    color: #b0b7c3;
    cursor: pointer;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    color: #333;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #2E77AE;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-input::placeholder {
    color: #b0b7c3;
}

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

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

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-select-wrapper {
    position: relative;
}

.form-select {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    color: #333;
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-select:focus {
    outline: none;
    border-color: #2E77AE;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-select-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #7F7F7F;
    pointer-events: none;
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

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

.toggle input:checked + .toggle-slider {
    background-color: #2E77AE;
}

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

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #7F7F7F;
}

/* Preview Section */
.create-campaign-preview-section {
    position: sticky;
    top: 32px;
}

.preview-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e8ecf1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.preview-actions {
    display: flex;
    gap: 12px;
}

.action-btn.publish {
    background-color: #2E77AE;
    color: #fff;
    flex: 1;
    padding: 10px 20px;
}

.action-btn.publish:hover {
    background-color: #245F8B;
}

.action-btn.draft {
    background-color: #fff;
    color: #2E77AE;
    border: 1px solid #2E77AE;
    flex: 1;
    padding: 10px 20px;
}

.action-btn.draft:hover {
    background-color: #f0f7ff;
}

/* ===== CAMPAIGN CARDS GRID ===== */
.campaigns-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.campaign-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e8ecf1;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.campaign-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #2E77AE;
}

.points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.points-badge.orange {
    background-color: #FF8E2B;
}

.points-badge.green {
    background-color: #34a853;
}

.points-badge i {
    font-size: 10px;
}

.card-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-description {
    font-size: 13px;
    color: #1a1a2e;
    line-height: 1.5;
    flex: 1;
}

.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.active {
    background-color: #e6f4ea;
    color: #34a853;
    border: 1px solid #34a853;
}

/* Progress Bar */
.card-progress {
    margin: 2px 0;
}

.progress-bar {
    height: 5px;
    background-color: #e8ecf1;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF8E2B, #FF8E2B);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Card Stats */
.card-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #1a1a2e;
}

.stat-item i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #1a1a2e;
}

.stat-value-sm {
    margin-left: auto;
    font-weight: 600;
    color: #1a1a2e;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f2f5;
    font-size: 12px;
    color: #1a1a2e;
}

.time-left {
    font-weight: 500;
}

.submissions {
    color: #2E77AE;
    font-weight: 500;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #e8ecf1;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #7F7F7F;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover {
    background-color: #f0f7ff;
    border-color: #2E77AE;
    color: #2E77AE;
}

.page-btn.active {
    background-color: #2E77AE;
    color: #fff;
    border-color: #2E77AE;
}

.page-btn.nav-btn {
    font-size: 12px;
    color: #7F7F7F;
}

.page-btn.nav-btn:hover {
    color: #2E77AE;
}

/* ===== PAST CAMPAIGN CARDS ===== */
.past-card {
    opacity: 0.75;
    transition: all 0.2s ease;
}

.past-card:hover {
    opacity: 1;
}

.past-card .card-title {
    color: #7F7F7F;
}

.past-card .card-description {
    color: #a0a8b8;
}

.status-badge.ended {
    background-color: #fff3e6;
    color: #FF8E2B;
    border: 1px solid #FF8E2B;
}

.progress-fill.ended-fill {
    background: linear-gradient(90deg, #FF8E2B, #FF8E2B);
    opacity: 0.6;
}

/* ===== CAMPAIGN INSIGHTS (Past Drawer) ===== */
.drawer-progress-section {
    margin: 8px 0;
}

.campaign-insights {
    flex: 1;
    margin-top: 8px;
}

.insights-title {
    font-size: 16px;
    font-weight: 700;
    color: #2E77AE;
    margin-bottom: 16px;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.insight-card {
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    padding: 16px;
    position: relative;
}

.insight-label {
    font-size: 13px;
    font-weight: 600;
    color: #2E77AE;
    display: block;
    margin-bottom: 6px;
}

.insight-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 18px;
}

.insight-icon.green {
    color: #34a853;
}

.insight-value {
    font-size: 12px;
    color: #7F7F7F;
    line-height: 1.5;
}

.top-performer {
    position: absolute;
    top: 12px;
    right: 14px;
}

.top-performer img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.action-btn.republish {
    background-color: #2E77AE;
    color: #fff;
    padding: 10px 24px;
    margin-left: auto;
}

.action-btn.republish:hover {
    background-color: #245F8B;
}

/* ===== DRAWER OVERLAY ===== */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ===== CAMPAIGN DETAIL DRAWER ===== */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 520px;
    height: 100vh;
    background: #fff;
    z-index: 300;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 28px 28px 0;
}

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

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

.drawer-title {
    font-size: 22px;
    font-weight: 700;
    color: #2E77AE;
}

.drawer-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #FF4747;
    background: #fff;
    color: #FF4747;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.drawer-close:hover {
    background: #FF4747;
    color: #fff;
}

.drawer-status {
    margin-bottom: 14px;
    align-self: flex-start;
}

.drawer-description {
    font-size: 13px;
    color: #1a1a2e;
    line-height: 1.6;
    margin-bottom: 8px;
}

.drawer-created {
    font-size: 12px;
    color: #7F7F7F;
    margin-bottom: 16px;
}

.drawer-divider {
    height: 1px;
    background: #e8ecf1;
    margin: 12px 0;
}

/* Drawer Stats */
.drawer-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.drawer-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #1a1a2e;
}

.drawer-stat-row i {
    color: #1a1a2e;
    margin-right: 8px;
    font-size: 13px;
}

.drawer-stat-value {
    font-weight: 600;
    color: #1a1a2e;
}

.drawer-stat-value.submissions {
    color: #2E77AE;
}

/* Activity Section */
.drawer-activity {
    flex: 1;
    margin-top: 8px;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.activity-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #2E77AE;
}

.refresh-btn {
    background: none;
    border: none;
    color: #2E77AE;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.3s ease;
}

.refresh-btn:hover {
    transform: rotate(180deg);
}

.activity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.activity-table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: #7F7F7F;
    padding: 8px 4px;
    border-bottom: 1px solid #e8ecf1;
}

.activity-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
}

.activity-table tbody td {
    padding: 10px 4px;
    color: #1a1a2e;
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-cell img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-cell span {
    font-weight: 500;
    color: #1a1a2e;
}

.review-btn {
    padding: 5px 16px;
    border: 1px solid #2E77AE;
    background: #fff;
    color: #2E77AE;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.review-btn:hover {
    background: #2E77AE;
    color: #fff;
}

/* Activity Pagination */
.activity-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 16px 0;
}

.activity-pagination .page-btn {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

/* Drawer Actions */
.drawer-actions {
    display: flex;
    gap: 12px;
    padding: 20px 0 28px;
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: #fff;
}

.action-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-btn.extend {
    background-color: #fff;
    color: #2E77AE;
    border: 2px solid #2E77AE;
}

.action-btn.extend:hover {
    background-color: #2E77AE;
    color: #fff;
}

.action-btn.archive {
    background-color: #92B8D4;
    color: #fff;
}

.action-btn.archive:hover {
    background-color: #3498db;
}

.action-btn.end {
    background-color: #FF4747;
    color: #fff;
}

.action-btn.end:hover {
    background-color: #D63030;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .create-campaign-layout {
        grid-template-columns: 1fr;
    }

    .create-campaign-preview-section {
        position: static;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .nav-item span,
    .sidebar .user-info,
    .sidebar .user-menu-btn {
        display: none;
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .sidebar .user-profile {
        justify-content: center;
        padding: 10px;
    }

    .main-content {
        margin-left: 70px;
        padding: 24px 20px;
    }

    .logo {
        padding: 20px 11px;
    }
}

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

    .campaigns-grid {
        grid-template-columns: 1fr;
    }

    .secondary-tabs-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .primary-tabs {
        gap: 16px;
    }

    .drawer {
        width: 100%;
    }

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