/* CineGrid Ads Manager — brand theme */

:root {
    --cg-red: #ff3c3c;
    --cg-red-dark: #d32f2f;
    --cg-red-hover: #e03131;
    --cg-red-soft: #fff0f0;
    --cg-red-muted: rgba(255, 60, 60, 0.12);
    --text-primary: #1a1a1a;
    --text-secondary: #5c5c5c;
    --text-tertiary: #8a8a8a;
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f8;
    --bg-tertiary: #ececef;
    --border-color: #e0e0e5;
    --border-light: #ebebef;
    --success: #16a34a;
    --success-soft: #ecfdf3;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --error: #dc2626;
    --error-soft: #fef2f2;
    --sidebar-width: 260px;
    --top-nav-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-red: 0 4px 14px rgba(255, 60, 60, 0.25);
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--cg-red); text-decoration: none; }
a:hover { color: var(--cg-red-dark); text-decoration: underline; }

/* Layout */
.app-container { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }

.top-nav {
    height: var(--top-nav-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

.top-nav-left { display: flex; align-items: center; gap: 16px; justify-self: start; min-width: 0; }
.top-nav-center {
    justify-self: center;
    width: min(800px, 100%);
    min-width: 0;
}
.top-nav-right { display: flex; align-items: center; gap: 12px; justify-self: end; min-width: 0; flex-shrink: 0; }

.cg-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: var(--text-primary);
}
.cg-brand:hover { color: var(--text-primary); }
.cg-brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cg-red) 0%, var(--cg-red-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow-red);
}
.cg-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.cg-brand-text strong { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.cg-brand-text span { font-size: 11px; color: var(--text-tertiary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

.top-nav-search {
    position: relative;
    display: none;
    width: 100%;
    overflow: visible;
}
@media (min-width: 900px) { .top-nav-search { display: block; } }
.top-nav-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}
.top-nav-search input {
    width: 100%;
    max-width: 100%;
    padding: 11px 16px 11px 42px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.top-nav-search input:focus {
    outline: none;
    border-color: var(--cg-red);
    box-shadow: 0 0 0 3px var(--cg-red-muted);
    background: #fff;
}

.top-nav-search-suggest {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    top: calc(100% + 6px);
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 6px;
    z-index: 320;
}
.top-nav-search-suggest[hidden] { display: none; }
.top-nav-search-suggest.is-open { display: block; }

.top-nav-search-empty {
    margin: 0;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-muted);
}

.top-nav-search-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.top-nav-search-option:hover,
.top-nav-search-option.is-active {
    background: var(--cg-red-muted);
}
.top-nav-search-option-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.top-nav-search-option-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-nav-search-option-id {
    font-size: 12px;
    color: var(--text-tertiary);
}
.top-nav-search-option .badge {
    flex-shrink: 0;
    font-size: 11px;
    padding: 3px 8px;
}

.nav-link-out {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none !important;
    border: 1px solid var(--border-light);
    background: #fff;
    transition: all 0.2s;
}
.nav-link-out:hover { border-color: var(--cg-red); color: var(--cg-red); }

.nav-wallet-btn {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 14px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    border: 1px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}
.user-menu:hover, .user-menu.open {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cg-red), var(--cg-red-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}
.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}
.user-avatar.user-avatar--initials {
    background: linear-gradient(135deg, var(--cg-red), var(--cg-red-dark));
}
.user-name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu > i.fa-chevron-down { font-size: 11px; color: var(--text-tertiary); }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    padding: 6px;
    z-index: 300;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown a,
.user-dropdown a.switch-account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #6b7280;
    text-decoration: none !important;
    font-size: 14px;
}
.user-dropdown a:hover {
    background: var(--bg-secondary);
    color: #4b5563;
}
.user-dropdown a i {
    width: 18px;
    color: #6b7280;
}
.user-dropdown a.logout-item {
    color: var(--cg-red);
}
.user-dropdown a.logout-item:hover {
    background: rgba(255, 60, 60, 0.08);
    color: var(--cg-red);
}
.user-dropdown a.logout-item i {
    color: var(--cg-red);
}

.main-layout { display: flex; flex: 1; width: 100%; min-width: 0; }

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    min-height: calc(100vh - var(--top-nav-height));
    position: sticky;
    top: var(--top-nav-height);
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
}

.sidebar-nav { flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav-item.active {
    background: var(--cg-red-muted);
    color: var(--cg-red);
    font-weight: 600;
}
.nav-item.active i { color: var(--cg-red); }

.main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 28px 32px 48px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.page-title-section h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}
.page-subtitle { color: var(--text-secondary); font-size: 15px; max-width: 560px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Buttons */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none !important;
    line-height: 1.2;
}
.btn-primary {
    background: var(--cg-red);
    color: #fff;
    box-shadow: var(--shadow-red);
}
.btn-primary:hover { background: var(--cg-red-hover); color: #fff; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { border-color: var(--cg-red); color: var(--cg-red); background: var(--cg-red-soft); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-tertiary); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 16px;
}
.stat-card-icon.red { background: var(--cg-red-muted); color: var(--cg-red); }
.stat-card-icon.green { background: var(--success-soft); color: var(--success); }
.stat-card-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-card-icon.gray { background: var(--bg-tertiary); color: var(--text-secondary); }
.stat-label { font-size: 12px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.stat-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }

/* Cards & sections */
.content-section, .card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.section-header h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.link-primary { color: var(--cg-red); font-weight: 600; font-size: 14px; text-decoration: none !important; }
.link-primary:hover { text-decoration: underline !important; }

/* Tables */
.table-container { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-light); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-secondary); }
.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-light);
}
.data-table td { padding: 16px; border-bottom: 1px solid var(--border-light); font-size: 14px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafafa; }
.campaign-id { font-size: 12px; color: var(--text-tertiary); display: block; margin-top: 2px; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-paused, .badge-draft { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-pending, .badge-pending_payment { background: var(--warning-soft); color: var(--warning); }
.badge-completed { background: var(--bg-tertiary); color: var(--text-secondary); }
.badge-stopped { background: var(--error-soft); color: var(--error); }
.badge-rejected { background: var(--error-soft); color: var(--error); }
.badge-verified { background: var(--success-soft); color: var(--success); }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}
.alert-success { background: var(--success-soft); color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: var(--error-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--cg-red-muted);
    color: var(--cg-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); max-width: 400px; margin: 0 auto 20px; }

/* Wizard */
.wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0;
}
.wizard-step {
    flex: 1;
    padding: 14px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}
.wizard-step.active { color: var(--cg-red); border-bottom-color: var(--cg-red); }
.wizard-step.done { color: var(--success); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

.campaign-schedule-panel {
    margin: 20px 0 0;
    padding: 18px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}
.campaign-schedule-panel .schedule-heading {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.campaign-schedule-panel .schedule-intro {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.schedule-fields-row {
    margin-bottom: 0;
}
.schedule-fields-row .form-group {
    margin-bottom: 0;
}
.schedule-field-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.schedule-field-group .form-control[type="date"] {
    width: 100%;
    min-height: 44px;
    font-size: 15px;
    cursor: pointer;
}
.schedule-toggle-inline {
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}
.schedule-toggle-inline input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--cg-red);
    cursor: pointer;
}
.duration-field-group.is-schedule-hidden {
    display: none !important;
}
.schedule-hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.schedule-hint-inline {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.45;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.form-control, .select-input, input[type="text"], input[type="file"], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .select-input:focus, input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cg-red);
    box-shadow: 0 0 0 3px var(--cg-red-muted);
}
select.form-control option:disabled {
    color: var(--text-muted);
}

.placement-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
}
.placement-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.placement-card-header h3 { font-size: 15px; font-weight: 600; }
.placement-card.is-incomplete {
    border-color: #f0b429;
    box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.35);
}
.placement-card.is-incomplete .placement-card-header h3::after {
    content: ' — incomplete';
    font-size: 12px;
    font-weight: 500;
    color: #b8860b;
}
.required-mark {
    color: var(--cg-red);
    font-weight: 700;
}
.search-keywords-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}
.search-keywords-count.is-complete {
    color: var(--success);
}

.listing-picker { position: relative; }
.listing-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.listing-picker-trigger:hover,
.listing-picker-trigger:focus {
    outline: none;
    border-color: var(--cg-red);
    box-shadow: 0 0 0 3px var(--cg-red-muted);
}
.listing-picker-trigger-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.listing-picker-trigger-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.listing-picker-trigger-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listing-picker-trigger-price {
    font-size: 12px;
    color: var(--cg-red);
    font-weight: 600;
}
.listing-picker-chevron {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}
.listing-picker-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}
.listing-picker-thumb--sm {
    width: 40px;
    height: 40px;
}
.listing-picker-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.listing-picker-thumb--placeholder {
    color: var(--text-muted);
    font-size: 16px;
}
.listing-picker-menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
}
.listing-picker-menu.is-open { display: block; }
.listing-picker-empty {
    margin: 0;
    padding: 14px 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.listing-picker-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}
.listing-picker-option:hover,
.listing-picker-option.is-selected {
    background: var(--cg-red-muted);
}
.listing-picker-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.listing-picker-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.listing-picker-price {
    font-size: 12px;
    color: var(--cg-red);
    font-weight: 600;
}

.promoted-item-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}
.promoted-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}
.promoted-item-thumb--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
}
.promoted-item-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.promoted-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}
a.promoted-item-title:hover {
    color: var(--cg-red);
    text-decoration: underline;
}
.promoted-item-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--cg-red);
}

.slot-status { font-size: 13px; margin-top: 8px; }
.slot-status.ok { color: var(--success); }
.slot-status.taken { color: var(--error); }

.social-media-panel {
    background: var(--cg-red-muted);
    border: 1px solid rgba(255, 60, 60, 0.2);
    border-radius: var(--radius-sm);
    padding: 16px;
    font-size: 14px;
    line-height: 1.5;
}
.social-media-panel p { margin: 0; color: var(--text-secondary); }
.social-media-panel i.fa-share-nodes { color: var(--cg-red); margin-right: 6px; }

.price-summary {
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: #fff;
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
}
.price-summary .amount { font-size: 32px; font-weight: 700; margin: 8px 0; }
.price-summary .hint { font-size: 13px; opacity: 0.75; }

/* Create campaign — two-column wizard */
.campaign-wizard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 1100px) {
    .campaign-wizard-layout { grid-template-columns: 1fr; }
}
.campaign-wizard-aside {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (max-width: 1100px) {
    .campaign-wizard-aside { position: static; order: -1; }
}
.audience-panel {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.audience-panel h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.audience-panel h3 i { color: var(--cg-red); }
.audience-panel .sub { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.audience-number {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--cg-red);
    line-height: 1.1;
    transition: color 0.2s;
}
.audience-number.is-updating { opacity: 0.55; }
.audience-number-label { font-size: 13px; color: var(--text-tertiary); margin-top: 4px; }
.audience-meter { margin-top: 16px; }
.audience-meter-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.audience-meter-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: 99px;
    overflow: hidden;
}
.audience-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #f59e0b, var(--cg-red));
    border-radius: 99px;
    transition: width 0.35s ease;
    width: 0%;
}
.audience-meta {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}
.audience-meta strong { color: var(--text-secondary); }

.targeting-section { margin-top: 8px; }
.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.chip-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}
.chip-check input { accent-color: var(--cg-red); margin: 0; }
.chip-check:has(input:checked) {
    border-color: var(--cg-red);
    background: var(--cg-red-muted);
    color: var(--cg-red-dark);
    font-weight: 600;
}
.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    min-height: 8px;
}
.keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--cg-red-muted);
    border: 1px solid rgba(255, 60, 60, 0.2);
    border-radius: 999px;
    font-size: 13px;
}
.keyword-tag button {
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.keyword-row { display: flex; gap: 8px; margin-top: 8px; }
.keyword-row .form-control { flex: 1; }

/* Typeahead + token fields */
.cg-typeahead,
.cg-token-field,
.cg-listing-search,
.cg-check-dropdown { position: relative; }

.cg-typeahead-menu,
.cg-check-dropdown-menu {
    position: absolute;
    z-index: 50;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 6px;
}
.cg-typeahead-menu.is-open,
.cg-check-dropdown-menu.is-open { display: block; }
.cg-typeahead-menu[hidden],
.cg-check-dropdown-menu[hidden] { display: none; }

.cg-typeahead-empty {
    margin: 0;
    padding: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.cg-typeahead-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    transition: background 0.15s;
}
.cg-typeahead-option:hover,
.cg-typeahead-option.is-active {
    background: var(--cg-red-muted);
}
.cg-typeahead-option--custom {
    color: var(--cg-red);
    font-weight: 600;
    gap: 8px;
}
.cg-typeahead-option--custom i {
    font-size: 12px;
    opacity: 0.85;
}

.cg-token-field-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.cg-token-field-inner:focus-within {
    border-color: var(--cg-red);
    box-shadow: 0 0 0 3px var(--cg-red-muted);
}
.cg-token-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.cg-token-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--cg-red-muted);
    border: 1px solid rgba(255, 60, 60, 0.2);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cg-red-dark);
    line-height: 1.3;
}
.cg-token-chip button {
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0 0 0 2px;
    font-size: 16px;
    line-height: 1;
}
.cg-token-input {
    flex: 1;
    min-width: 120px;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 4px 2px;
    background: transparent;
}

.cg-check-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.cg-check-dropdown-trigger i {
    color: var(--text-muted);
    font-size: 12px;
}
.cg-check-dropdown-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cg-check-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}
.cg-check-dropdown-item:hover { background: var(--bg-secondary); }
.cg-check-dropdown-item input { accent-color: var(--cg-red); margin: 0; }

.cg-listing-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cg-listing-thumb--sm { width: 36px; height: 36px; }
.cg-listing-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-listing-thumb--placeholder { color: var(--text-muted); font-size: 14px; }

.cg-listing-option-meta,
.cg-listing-selected-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.cg-listing-option-title,
.cg-listing-selected-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cg-listing-option-price,
.cg-listing-selected-price {
    font-size: 12px;
    color: var(--cg-red);
    font-weight: 600;
}

.cg-listing-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}
.cg-listing-selected[hidden] {
    display: none !important;
}
.cg-listing-clear {
    margin-left: auto;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
}
.cg-listing-clear:hover { color: var(--cg-red); background: var(--cg-red-muted); }

.cg-listing-search .cg-typeahead-menu { top: calc(100% + 4px); }

.price-panel-aside {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.price-panel-aside .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    font-weight: 600;
}
.price-panel-aside .amount {
    font-size: 34px;
    font-weight: 800;
    margin: 8px 0 4px;
    color: var(--cg-red);
}
.price-panel-aside .base-line {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.price-panel-aside .hint {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}
.price-panel-aside .multiplier-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--cg-red-muted);
    color: var(--cg-red);
    font-size: 12px;
    font-weight: 600;
}
.price-breakdown-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    border-top: 1px solid var(--border-light);
}
.price-breakdown-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}
.price-breakdown-list li:last-child { border-bottom: none; }
.price-breakdown-list strong {
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* Slot grid */
.slot-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 900px) { .slot-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .slot-grid { grid-template-columns: repeat(2, 1fr); } }
.slot-tile {
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    border: 2px solid var(--border-light);
    background: #fff;
    transition: transform 0.15s;
}
.slot-tile.available { border-color: var(--success); background: var(--success-soft); }
.slot-tile.taken { border-color: var(--border-color); opacity: 0.85; }
.slot-tile .pos { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-tertiary); }
.slot-tile .status { font-size: 14px; font-weight: 600; margin-top: 6px; }
.slot-tile.available .status { color: var(--success); }
.slot-tile .until { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* Payment cards */
.pay-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.pay-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    background: #fff;
}
.pay-card.featured { border-color: var(--cg-red); box-shadow: 0 0 0 1px var(--cg-red); }
.pay-card h3 { font-size: 17px; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.pay-card h3 i { color: var(--cg-red); }
.pay-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.pay-card .balance-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--border-light); font-size: 14px; }
.pay-card .balance-row strong { font-weight: 700; }

.wallet-hero {
    background: linear-gradient(135deg, var(--cg-red) 0%, var(--cg-red-dark) 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-red);
}
.wallet-hero .label { font-size: 13px; opacity: 0.85; font-weight: 500; }
.wallet-hero .balance { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; margin: 8px 0; }
.wallet-hero .sub { font-size: 14px; opacity: 0.8; }

.placement-info-list { list-style: none; }
.placement-info-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.placement-info-list li:last-child { border-bottom: none; }
.placement-info-list i { color: var(--cg-red); margin-top: 3px; }

/* Breadcrumb */
.breadcrumb { font-size: 13px; color: var(--text-tertiary); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--cg-red); }

/* Footer */
.app-footer {
    width: 100%;
    padding: 16px 32px;
    border-top: 1px solid var(--border-light);
    background: #fff;
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* Mobile */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .top-nav {
        grid-template-columns: 1fr auto;
    }
    .top-nav-center { display: none; }
    .sidebar {
        position: fixed;
        left: -280px;
        top: var(--top-nav-height);
        height: calc(100vh - var(--top-nav-height));
        z-index: 150;
        transition: left 0.25s;
        box-shadow: var(--shadow-md);
    }
    .sidebar.open { left: 0; }
    .main-content { padding: 20px 16px 40px; }
    .user-name { display: none; }
    .nav-link-out { display: none !important; }
    .page-title-section h1 { font-size: 22px; }
}

/* Auth gate (eligibility) */
.auth-gate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-secondary);
}
.auth-gate-card {
    max-width: 480px;
    width: 100%;
    background: #fff;
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}
.auth-gate-form .form-control {
    width: 100%;
    box-sizing: border-box;
}
.auth-gate-login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
}
.auth-gate-login-actions .btn,
.auth-gate-form .btn-auth-submit {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
}
.auth-gate-login-actions .btn-signin-cinegrid-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    filter: brightness(0) invert(1);
}

/* Settings */
.settings-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.settings-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Toasts */
.cg-toast-root {
    position: fixed;
    top: calc(var(--top-nav-height) + 12px);
    right: 16px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
.cg-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
}
.cg-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.cg-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}
.cg-toast-body {
    flex: 1;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
    padding-top: 3px;
}
.cg-toast-close {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    font-size: 13px;
    line-height: 1;
}
.cg-toast-close:hover { color: var(--text-primary); }
.cg-toast-success .cg-toast-icon { background: var(--success-soft); color: var(--success); }
.cg-toast-error .cg-toast-icon { background: var(--error-soft); color: var(--error); }
.cg-toast-warning .cg-toast-icon { background: var(--warning-soft); color: var(--warning); }
.cg-toast-info .cg-toast-icon { background: #eff6ff; color: #2563eb; }
.cg-toast-success { border-left: 3px solid var(--success); }
.cg-toast-error { border-left: 3px solid var(--error); }
.cg-toast-warning { border-left: 3px solid var(--warning); }
.cg-toast-info { border-left: 3px solid var(--cg-red); }

/* Modal */
body.cg-modal-open { overflow: hidden; }
.cg-modal {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cg-modal[hidden] { display: none !important; }
.cg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 20, 0.45);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.cg-modal.open .cg-modal-backdrop { opacity: 1; }
.cg-modal-panel {
    position: relative;
    width: min(420px, 100%);
    background: #fff;
    border-radius: var(--radius);
    padding: 28px 28px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-light);
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
.cg-modal.open .cg-modal-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.cg-modal-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}
.cg-modal-icon-success { background: var(--success-soft); color: var(--success); }
.cg-modal-icon-error { background: var(--error-soft); color: var(--error); }
.cg-modal-icon-warning { background: var(--warning-soft); color: var(--warning); }
.cg-modal-icon-info { background: var(--cg-red-muted); color: var(--cg-red); }
.cg-modal-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}
.cg-modal-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 22px;
}
.cg-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* Table icon actions */
.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.btn-icon.btn-view { color: var(--text-secondary); border: 1px solid var(--border-light); background: #fff; }
.btn-icon.btn-view:hover { border-color: var(--cg-red); color: var(--cg-red); background: var(--cg-red-soft); }
.btn-icon.btn-edit { color: var(--text-secondary); border: 1px solid var(--border-light); background: #fff; }
.btn-icon.btn-edit:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.btn-icon.btn-restart { color: var(--text-secondary); border: 1px solid var(--border-light); background: #fff; }
.btn-icon.btn-restart:hover { border-color: var(--cg-red); color: var(--cg-red); background: var(--cg-red-soft); }

.billing-refund-amount {
    color: #15803d;
    font-weight: 600;
}
.btn-icon.btn-pause { color: var(--warning); border: 1px solid #fde68a; background: var(--warning-soft); }
.btn-icon.btn-pause:hover { border-color: var(--warning); background: #fffbeb; }
.btn-icon.btn-play { color: var(--success); border: 1px solid #bbf7d0; background: var(--success-soft); }
.btn-icon.btn-play:hover { border-color: var(--success); }
.btn-icon.btn-stop { color: var(--error); border: 1px solid #fecaca; background: var(--error-soft); }
.btn-icon.btn-stop:hover { border-color: var(--error); background: #fff; }
.btn-icon.btn-pay { color: #fff; background: var(--cg-red); border: 1px solid var(--cg-red); box-shadow: var(--shadow-red); }
.btn-icon.btn-pay:hover { background: var(--cg-red-hover); color: #fff; }
.btn-icon.btn-delete { color: var(--error); border: 1px solid #fecaca; background: #fff; }
.btn-icon.btn-delete:hover { border-color: var(--error); color: #fff; background: var(--error); }
