/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 19.2px; } /* 20% larger than default 16px */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.5;
}

/* === Header === */
.header {
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}
.header h1 { font-size: 1.25rem; font-weight: 600; }
.nav-menu {
    display: flex;
    gap: 4px;
}
.nav-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.nav-link.active { color: #fff; background: #4361ee; }
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-right label { font-size: 0.85rem; opacity: 0.8; }
#profile-select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2a2a4a;
    color: #fff;
    font-size: 0.85rem;
    min-width: 260px;
}
#profile-select option { background: #2a2a4a; }

/* === Controls Bar === */
.controls-bar {
    background: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.control-group { display: flex; flex-direction: column; gap: 4px; }
.control-group label { font-size: 0.78rem; font-weight: 500; color: #555; }
.control-group input {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.85rem;
}
.control-group input:focus { outline: none; border-color: #4361ee; }
#acos-target { width: 80px; }
.control-actions { display: flex; gap: 8px; margin-left: auto; }
.date-input {
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.85rem;
}
.date-input:focus { outline: none; border-color: #4361ee; }

/* === Buttons === */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #4361ee; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #3a56d4; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover:not(:disabled) { background: #d0d0d0; }

/* === Main Content === */
.main-content { padding: 20px 24px; }

/* === Summary Cards === */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 4px;
}
.card-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
}
.card-value.acos-green { color: #22c55e; }
.card-value.acos-yellow { color: #eab308; }
.card-value.acos-red { color: #ef4444; }

/* === Category Tabs === */
.category-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: #555;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab:hover { background: #eee; }
.tab.active { background: #fff; color: #4361ee; border-color: #ccc; font-weight: 600; }
.badge {
    background: #e0e7ff;
    color: #4361ee;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
}
.tab.active .badge { background: #4361ee; color: #fff; }

/* === Data Table === */
.table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.data-table th:hover { color: #4361ee; }
.data-table th .sort-arrow { font-size: 0.7rem; margin-left: 4px; }
.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.data-table tr:hover { background: #f8f9ff; }
.data-table th.num { text-align: right; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.acos-cell-green { color: #16a34a; font-weight: 600; }
.acos-cell-yellow { color: #ca8a04; font-weight: 600; }
.acos-cell-red { color: #dc2626; font-weight: 600; }

/* === Bid History === */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 16px;
}
.bid-green { color: #16a34a; font-weight: 600; }
.bid-red { color: #dc2626; font-weight: 600; }
.status-enabled { color: #16a34a; font-weight: 500; }
.status-paused { color: #ca8a04; font-weight: 500; }
.status-archived { color: #888; font-weight: 500; }
.copy-cell { cursor: pointer; position: relative; }
.copy-cell:hover { color: #4361ee; }
.copy-cell.copy-flash { background: #e0e7ff; transition: background 0.15s; }
.campaign-link { cursor: pointer; color: #4361ee; }
.campaign-link:hover { color: #3a56d4; text-decoration: underline; }

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #888;
    font-size: 0.95rem;
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.loading-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-message { color: #555; font-size: 0.9rem; }

/* === Filter Bar === */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    white-space: nowrap;
}
.filter-checks {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}
.filter-chip:hover { border-color: #4361ee; }
.filter-chip.active {
    background: #4361ee;
    color: #fff;
    border-color: #4361ee;
}
.filter-chip input { display: none; }
.filter-count {
    font-size: 0.78rem;
    color: #888;
    white-space: nowrap;
}
.select-zero-btn {
    margin-left: 12px;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 4px;
    white-space: nowrap;
}
.view-toggle {
    display: flex;
    margin-left: auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}
.view-btn {
    padding: 4px 14px;
    font-size: 0.78rem;
    border: none;
    background: #fff;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
}
.view-btn:not(:last-child) { border-right: 1px solid #ccc; }
.view-btn.active {
    background: #4361ee;
    color: #fff;
}
.view-btn:hover:not(.active) { background: #f0f0f0; }
td.campaign-oldest { font-weight: 600; color: #d00; }

/* === Inline Bid Editing === */
.bid-editable { cursor: pointer; position: relative; overflow: visible; }
.bid-editable .bid-pencil {
    opacity: 0;
    margin-left: 4px;
    font-size: 0.75rem;
    color: #4361ee;
    transition: opacity 0.15s;
}
.bid-editable:hover .bid-pencil { opacity: 1; }
.bid-editable:hover { background: #f0f4ff; }
.bid-editable .bid-display { border-bottom: 1px dashed transparent; transition: border-color 0.15s; }
.bid-editable:hover .bid-display { border-bottom-color: #4361ee; }

.bid-editing { background: #fff !important; }
.bid-input {
    width: 80px;
    padding: 2px 6px;
    border: 2px solid #4361ee;
    border-radius: 4px;
    font-size: 0.82rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    outline: none;
}
.bid-input:focus { box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15); }

.bid-saving { opacity: 0.6; pointer-events: none; }
.bid-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top-color: #4361ee;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

.bid-success {
    animation: bidFlashGreen 1.2s ease-out;
}
.bid-error {
    animation: bidFlashRed 2.5s ease-out;
}

@keyframes bidFlashGreen {
    0% { background: #dcfce7; }
    100% { background: transparent; }
}
@keyframes bidFlashRed {
    0%, 40% { background: #fee2e2; }
    100% { background: transparent; }
}
.bid-error-msg {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    animation: bidMsgFade 3s ease-out forwards;
}
.bid-error-msg::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 12px;
    border: 5px solid transparent;
    border-top-color: #dc2626;
}
@keyframes bidMsgFade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* === Brand & Marketplace Toggles === */
.brand-toggle {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.25);
    margin-right: 4px;
}
.brand-btn {
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    transition: all 0.15s;
}
.brand-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.brand-btn.active { background: #7c3aed; color: #fff; }
.brand-btn + .brand-btn { border-left: 1px solid rgba(255,255,255,0.15); }

.marketplace-toggle {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.25);
}
.mp-btn {
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.6);
    transition: all 0.15s;
    letter-spacing: 0.5px;
}
.mp-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.mp-btn.active {
    background: #4361ee;
    color: #fff;
}
.mp-btn + .mp-btn { border-left: 1px solid rgba(255,255,255,0.15); }

/* === Auth: Header user info === */
.user-info {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    padding: 0 4px;
}
.logout-form { display: inline; margin: 0; }
.btn-logout {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); color: #fff; }
.nav-link-header {
    font-size: 0.8rem;
    margin-left: 4px;
}

/* === Login Page === */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 52px);
    padding: 20px;
}
.login-card {
    background: #fff;
    border-radius: 10px;
    padding: 40px 36px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 380px;
}
.login-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 24px;
    text-align: center;
}
.login-field {
    margin-bottom: 16px;
}
.login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}
.login-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
}
.login-field input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}
.login-btn {
    width: 100%;
    padding: 11px;
    margin-top: 8px;
    font-size: 0.9rem;
}
.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 16px;
}
.login-success {
    background: #dcfce7;
    color: #16a34a;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 16px;
}
.login-forgot {
    text-align: center;
    margin-top: 16px;
    font-size: 0.82rem;
}
.login-forgot a {
    color: #4361ee;
    text-decoration: none;
}
.login-forgot a:hover {
    text-decoration: underline;
}
.login-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 18px;
    text-align: center;
}

/* === Admin Panel === */
.admin-panel { max-width: 800px; }
.admin-create-form {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.admin-create-form h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
}
.admin-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.admin-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
}
.admin-input:focus {
    outline: none;
    border-color: #4361ee;
}
.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
}
.admin-msg {
    font-size: 0.82rem;
    padding: 8px 12px;
    border-radius: 5px;
    margin-top: 10px;
}
.admin-msg-error { background: #fee2e2; color: #dc2626; }
.admin-msg-success { background: #dcfce7; color: #16a34a; }
.admin-actions { display: flex; gap: 6px; }
.btn-action {
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-change-pw { color: #4361ee; border-color: #4361ee; }
.btn-change-pw:hover { background: #4361ee; color: #fff; }
.btn-delete { color: #dc2626; border-color: #dc2626; }
.btn-delete:hover { background: #dc2626; color: #fff; }

/* === Modal === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    min-width: 340px;
}
.modal-content h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #1a1a2e;
}
.modal-content .admin-input {
    width: 100%;
    margin-bottom: 10px;
}
.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* === Negate Button === */
.negate-cell { text-align: center; padding: 4px 8px !important; position: relative; overflow: visible; }
.btn-negate {
    padding: 3px 10px;
    border: 1px solid #dc2626;
    border-radius: 4px;
    background: #fff;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-negate:hover:not(:disabled) { background: #dc2626; color: #fff; }
.btn-negate:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-negate-done {
    background: #dcfce7; color: #16a34a; border-color: #16a34a;
    opacity: 1 !important; cursor: default; pointer-events: none;
    font-weight: 600;
}
.btn-negate-error { background: #fee2e2; color: #dc2626; border-color: #dc2626; }
.negate-success { animation: negateFlashGreen 2s ease-out; }
@keyframes negateFlashGreen {
    0% { background: #dcfce7; }
    100% { background: transparent; }
}
/* Negated row — subtle left accent */
.row-negated { background: #f0fdf4 !important; }
.row-negated td:first-child { box-shadow: inset 3px 0 0 #16a34a; }
/* Inline error tooltip */
.negate-error-msg {
    position: absolute;
    bottom: calc(100% + 4px);
    right: 0;
    background: #dc2626;
    color: #fff;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 5px;
    white-space: nowrap;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    animation: negateMsgFade 5s ease-out forwards;
}
.negate-error-msg::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 16px;
    border: 5px solid transparent;
    border-top-color: #dc2626;
}
@keyframes negateMsgFade {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* === Column Filters (Search Terms Table) === */
.filter-row td.filter-cell {
    padding: 3px 4px !important;
    background: #f8f9fb;
    border-bottom: 2px solid #e2e8f0;
}
.col-filter-inputs {
    display: flex;
    gap: 3px;
}
.col-filter-input {
    width: 58px;
    padding: 3px 5px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.72rem;
    background: #fff;
    color: #333;
    text-align: right;
}
.col-filter-input::placeholder { color: #aaa; font-size: 0.7rem; }
.col-filter-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 2px rgba(67,97,238,0.15);
}
/* Hide number input spinners for cleaner look */
.col-filter-input::-webkit-outer-spin-button,
.col-filter-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.col-filter-input { -moz-appearance: textfield; }

/* === Bulk Bid Editing === */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #1a1a2e;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.bulk-selected-count {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 90px;
}
.bulk-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}
.bulk-mode-select {
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.82rem;
    cursor: pointer;
}
.bulk-mode-select option { color: #333; background: #fff; }
.bulk-value-input {
    width: 90px;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 0.85rem;
    text-align: right;
}
.bulk-value-input::placeholder { color: rgba(255,255,255,0.4); }
.bulk-value-input:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 2px rgba(67,97,238,0.3); }
.bulk-apply-btn { padding: 6px 18px; font-size: 0.82rem; }
.bulk-apply-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bulk-deselect-btn {
    margin-left: auto;
    padding: 5px 12px;
    font-size: 0.78rem;
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
    background: transparent;
}
.bulk-deselect-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Preset quick-action buttons */
.bulk-presets { display: flex; gap: 6px; }
.bulk-preset-btn {
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.15s;
    white-space: nowrap;
}
.bulk-preset-btn.preset-up {
    background: rgba(22,163,106,0.15);
    color: #4ade80;
    border-color: rgba(22,163,106,0.3);
}
.bulk-preset-btn.preset-up:hover { background: #16a34a; color: #fff; }
.bulk-preset-btn.preset-down {
    background: rgba(220,38,38,0.15);
    color: #f87171;
    border-color: rgba(220,38,38,0.3);
}
.bulk-preset-btn.preset-down:hover { background: #dc2626; color: #fff; }
.bulk-preset-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bulk-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    margin: 0 4px;
}

/* Checkbox column */
.chk-col { width: 36px; text-align: center; padding: 4px 6px !important; }
.chk-col input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; accent-color: #4361ee; }
.row-selected { background: #eef2ff !important; }
.row-selected td:first-child { box-shadow: inset 3px 0 0 #4361ee; }

/* Bulk result feedback */
.bulk-result-msg {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: bulkMsgSlide 3s ease-out forwards;
}
.bulk-result-success { background: #dcfce7; color: #16a34a; }
.bulk-result-error { background: #fee2e2; color: #dc2626; }
@keyframes bulkMsgSlide {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* === Date Preset Buttons === */
.date-presets {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ccc;
}
.date-preset-btn {
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #f5f5f5;
    color: #555;
    transition: all 0.15s;
}
.date-preset-btn:hover { background: #e0e0e0; color: #333; }
.date-preset-btn.active { background: #4361ee; color: #fff; }
.date-preset-btn + .date-preset-btn { border-left: 1px solid #ccc; }

/* === Campaigns Page === */
.campaign-search-group { margin-left: 8px; }
.campaign-search-input {
    padding: 5px 12px;
    border: 1px solid #ccc;
    border-radius: 16px;
    font-size: 0.82rem;
    width: 220px;
    transition: border-color 0.15s;
}
.campaign-search-input:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 2px rgba(67,97,238,0.15); }
.campaign-search-input::placeholder { color: #aaa; }

.campaign-status-badge { font-weight: 500; }
.campaign-name-link { cursor: pointer; color: #4361ee; }
.campaign-name-link:hover { color: #3a56d4; text-decoration: underline; }

/* === Add Targeting Modal === */
.add-targeting-modal-content {
    min-width: 440px;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
}
.add-tgt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.add-tgt-header h3 { margin-bottom: 0; }
.add-tgt-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.add-tgt-close-btn:hover { color: #333; }

.add-tgt-type-toggle {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #ccc;
    margin-bottom: 16px;
}
.add-tgt-type-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: #f5f5f5;
    color: #555;
    transition: all 0.15s;
}
.add-tgt-type-btn:hover { background: #e0e0e0; }
.add-tgt-type-btn.active { background: #4361ee; color: #fff; }
.add-tgt-type-btn + .add-tgt-type-btn { border-left: 1px solid #ccc; }

.add-tgt-field {
    margin-bottom: 12px;
}
.add-tgt-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}
.add-tgt-hint {
    font-weight: 400;
    color: #999;
}
.add-tgt-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
}
.add-tgt-select:focus { outline: none; border-color: #4361ee; }
.add-tgt-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
}
.add-tgt-input:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 2px rgba(67,97,238,0.12); }
.add-tgt-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
}
.add-tgt-textarea:focus { outline: none; border-color: #4361ee; box-shadow: 0 0 0 2px rgba(67,97,238,0.12); }
.add-tgt-row {
    display: flex;
    gap: 12px;
}
.add-tgt-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    margin-bottom: 12px;
}
.add-tgt-results {
    margin-top: 16px;
    border-top: 1px solid #e0e0e0;
    padding-top: 12px;
}
.add-tgt-results-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}
.add-tgt-results-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
}
.add-tgt-results-list li {
    padding: 4px 0;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.add-tgt-result-ok { color: #16a34a; }
.add-tgt-result-ok::before { content: "\2713"; font-weight: 700; margin-right: 2px; }
.add-tgt-result-fail { color: #dc2626; }
.add-tgt-result-fail::before { content: "\2717"; font-weight: 700; margin-right: 2px; }

/* === Responsive === */
@media (max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; }
    #profile-select { min-width: 100%; }
    .controls-bar { flex-direction: column; align-items: stretch; }
    .control-actions { margin-left: 0; }
    .summary-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
