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

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #11111b;
    color: #cdd6f4;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ========== LAYOUT ========== */
.sidebar {
    width: 58px;
    background: #181825;
    border-right: 1px solid #313244;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
}
.sidebar:hover {
    width: 220px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.view-section {
    display: none;
    flex-direction: column;
    height: 100%;
}

.view-section.active {
    display: flex;
}

/* ========== SIDEBAR NAVIGATION ========== */
.sidebar-header {
    padding: 16px 14px;
    border-bottom: 1px solid #313244;
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 700;
    color: #89b4fa;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-logo span { opacity: 0; transition: opacity 0.15s 0.05s; white-space: nowrap; }
.sidebar:hover .sidebar-logo span { opacity: 1; }

.sidebar-nav {
    padding: 10px 0;
    flex: 1;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 17px;
    color: #a6adc8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}
.nav-item span:last-child { opacity: 0; transition: opacity 0.12s 0.05s; }
.sidebar:hover .nav-item span:last-child { opacity: 1; }

.nav-item:hover {
    background: #1e1e2e;
    color: #cdd6f4;
}

.nav-item.active {
    background: #1e1e2e;
    color: #89b4fa;
    border-left-color: #89b4fa;
}

.nav-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #313244;
    font-size: 12px;
    color: #6c7086;
}

/* ========== DASHBOARD ========== */
.dashboard {
    display: flex;
    gap: 12px;
    padding: 16px 20px 8px;
    flex-wrap: wrap;
}

.dash-card {
    background: #1e1e2e;
    border-radius: 10px;
    padding: 14px 20px;
    min-width: 150px;
    flex: 1;
    border: 1px solid #313244;
    transition: transform 0.15s, box-shadow 0.15s;
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.dash-label {
    font-size: 11px;
    color: #6c7086;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dash-value {
    font-size: 22px;
    font-weight: 700;
    color: #cdd6f4;
}

/* ========== CONTROLS ========== */
.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #181825;
    border-bottom: 1px solid #313244;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 100;
}

.controls label {
    font-size: 13px;
    color: #a6adc8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.controls input[type="date"],
.controls input[type="text"],
.controls select {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 6px;
    padding: 6px 10px;
    outline: none;
    transition: border-color 0.2s;
}

.controls input:focus,
.controls select:focus {
    border-color: #89b4fa;
}

.controls input[type="text"] {
    width: 180px;
}

.cb-label {
    cursor: pointer;
    user-select: none;
}

.cb-label input[type="checkbox"] {
    accent-color: #89b4fa;
    cursor: pointer;
}

.controls button {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

#btn-load {
    background: #89b4fa;
    color: #1e1e2e;
}

#btn-load:hover {
    background: #74c7ec;
}

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

#btn-csv {
    background: #a6e3a1;
    color: #1e1e2e;
}

#btn-csv:hover {
    background: #94e2d5;
}

.status {
    font-size: 12px;
    color: #a6e3a1;
    font-style: italic;
}

.btn-primary {
    background: #cba6f7;
    color: #1e1e2e;
}

.btn-primary:hover {
    background: #b4befe;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    color: #f9e2af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== TABLE WRAPPER ========== */
.table-wrap {
    overflow: auto;
    margin: 0 12px 20px;
    border-radius: 8px;
    border: 1px solid #313244;
    max-height: calc(100vh - 180px);
}

/* ========== TABLE ========== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

thead th {
    background: #1e1e2e;
    color: #a6adc8;
    font-weight: 600;
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid #45475a;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

thead th:hover {
    background: #313244;
    color: #cdd6f4;
}

tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid #1e1e2e;
    vertical-align: middle;
    white-space: nowrap;
}

/* ========== ROW LEVELS ========== */
/* Account */
.row-account td {
    background: #1a1a2e;
    font-weight: 700;
    font-size: 13px;
    color: #89b4fa;
    padding: 10px 8px;
    border-bottom: 2px solid #313244;
}

.row-account td:first-child {
    border-left: 4px solid #89b4fa;
}

/* Campaign */
.row-campaign td {
    background: #16213e;
    font-weight: 600;
    font-size: 12.5px;
    color: #cba6f7;
    padding: 8px 8px;
    border-bottom: 1px solid #1e1e2e;
}

.row-campaign td:first-child {
    border-left: 4px solid #cba6f7;
    padding-left: 20px;
}

/* Adset */
.row-adset td {
    background: #1a1f35;
    font-weight: 600;
    font-size: 12px;
    color: #fab387;
    border-bottom: 1px solid #1e1e2e;
}

.row-adset td:first-child {
    border-left: 4px solid #fab387;
    padding-left: 36px;
}

/* Ad - even */
.row-ad td {
    background: #1e1e2e;
    color: #cdd6f4;
    font-size: 12px;
}

.row-ad td:first-child {
    border-left: 4px solid #a6e3a1;
    padding-left: 52px;
}

/* Ad - zebra */
.row-ad-alt td {
    background: #232336;
    color: #cdd6f4;
    font-size: 12px;
}

.row-ad-alt td:first-child {
    border-left: 4px solid #a6e3a1;
    padding-left: 52px;
}

/* Hover */
.row-ad:hover td,
.row-ad-alt:hover td {
    background: #313244;
}

/* ========== PRICE COLORS ========== */
.price-green {
    color: #a6e3a1;
    font-weight: 600;
}

.price-yellow {
    color: #f9e2af;
    font-weight: 600;
}

.price-red {
    color: #f38ba8;
    font-weight: 600;
}

/* ========== QUALITY COLORS ========== */
.q-active {
    color: #a6e3a1;
    font-weight: 600;
}

.q-semi {
    color: #f9e2af;
    font-weight: 600;
}

.q-inactive {
    color: #f38ba8;
    font-weight: 600;
}

.q-unknown {
    color: #6c7086;
}

/* ========== ROI ========== */
.roi-positive {
    color: #a6e3a1;
    font-weight: 700;
}

.roi-negative {
    color: #f38ba8;
    font-weight: 700;
}

/* ========== STATUS ========== */
.ad-name-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== SUMMARY COLUMNS ========== */
.sum-col {
    border-left: 1px solid #45475a;
    font-weight: 600;
}

/* ========== LOADING OVERLAY ========== */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(17, 17, 27, 0.95);
    border: 1px solid #45475a;
    border-radius: 12px;
    padding: 30px 40px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 999;
    font-size: 14px;
    color: #cdd6f4;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #313244;
    border-top: 3px solid #89b4fa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c7086;
    font-size: 14px;
}

.empty-state div {
    font-size: 40px;
    margin-bottom: 10px;
}

/* ========== COLLAPSIBLE ========== */
.expandable {
    cursor: pointer;
}

.expandable:hover td {
    filter: brightness(1.15);
}

.toggle {
    display: inline-block;
    width: 16px;
    font-size: 10px;
    color: #6c7086;
    transition: transform 0.15s;
}

/* ========== COLUMN DROPDOWN ========== */
.dropdown {
    position: relative;
}

.btn-cols {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

.btn-cols:hover {
    background: #45475a;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 8px;
    padding: 8px 0;
    z-index: 200;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.dropdown-menu label {
    display: block;
    padding: 6px 14px;
    font-size: 12.5px;
    color: #cdd6f4;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s;
}

.dropdown-menu label:hover {
    background: #313244;
}

.dropdown-menu input[type="checkbox"] {
    accent-color: #89b4fa;
    margin-right: 6px;
}

/* ========== TOOLTIP (full ad name on hover) ========== */
.ad-name-cell {
    cursor: default;
    position: relative;
}

.ad-name-cell[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: #313244;
    color: #cdd6f4;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 300;
    border: 1px solid #45475a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== CURRENCY TOGGLE ========== */
.currency-toggle {
    display: flex;
    border: 1px solid #45475a;
    border-radius: 6px;
    overflow: hidden;
}

.curr-btn {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border: none;
    cursor: pointer;
    background: #313244;
    color: #6c7086;
    transition: all 0.15s;
}

.curr-btn:hover {
    background: #45475a;
    color: #cdd6f4;
}

.curr-btn.active {
    background: #89b4fa;
    color: #1e1e2e;
}

/* ========== DATE PRESET BUTTONS ========== */
.date-preset-btn {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border: 1px solid #45475a;
    border-radius: 6px;
    cursor: pointer;
    background: #181825;
    color: #6c7086;
    transition: all 0.15s;
}

.date-preset-btn:hover {
    background: #313244;
    color: #cdd6f4;
}

.date-preset-btn.active {
    background: #cba6f7;
    color: #1e1e2e;
    border-color: #cba6f7;
    font-weight: 600;
}

/* ========== CONSTRUCTOR (AVTOZALIV) ========== */
.az-label {
    display: block;
    margin-bottom: 4px;
    color: #a6adc8;
    font-size: 12px;
    font-weight: 500;
}
.az-input {
    background: #181825;
    color: #cdd6f4;
    border: 1px solid #45475a;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
}
.az-input:focus {
    border-color: #cba6f7;
    outline: none;
}
.az-adset-card {
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
}
.az-adset-card h4 {
    font-size: 14px;
    color: #89b4fa;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.az-ad-row {
    background: #181825;
    border: 1px solid #313244;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}
.az-ad-row h5 {
    font-size: 13px;
    color: #fab387;
    margin-bottom: 8px;
}
.az-mode-tab.active {
    background: #cba6f7 !important;
    color: #11111b !important;
}
.az-geo-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #313244;
    color: #cdd6f4;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px;
}
.az-geo-tag .remove {
    cursor: pointer;
    color: #f38ba8;
    font-weight: bold;
    margin-left: 4px;
}
.az-creo-type-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 10px;
}
.az-creo-type-tab {
    padding: 5px 14px;
    background: #313244;
    color: #a6adc8;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}
.az-creo-type-tab:first-child { border-radius: 6px 0 0 6px; }
.az-creo-type-tab:last-child { border-radius: 0 6px 6px 0; }
.az-creo-type-tab.active {
    background: #89b4fa;
    color: #11111b;
}

/* ========== SEPARATOR IN CONTROLS ========== */
.separator {
    width: 1px;
    height: 24px;
    background: #45475a;
    margin: 0 4px;
}

/* ========== INAFF DASHBOARD BUTTON ========== */
.dash-card-btn {
    cursor: pointer;
    border: 1px solid #89b4fa;
    background: linear-gradient(135deg, #1e1e2e, #1a2540);
}

.dash-card-btn:hover {
    background: linear-gradient(135deg, #1a2540, #1e3a5f);
    border-color: #74c7ec;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(137, 180, 250, 0.2);
}

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

.modal-box {
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 12px;
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #313244;
}

.modal-header h3 {
    font-size: 16px;
    color: #cdd6f4;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #6c7086;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #f38ba8;
}

.modal-body {
    padding: 16px 20px;
}

.modal-section {
    margin-bottom: 16px;
}

.modal-label {
    display: block;
    font-size: 13px;
    color: #a6adc8;
    margin-bottom: 8px;
    font-weight: 600;
}

.inaff-date-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.inaff-date-input {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 6px;
    padding: 6px 10px;
    outline: none;
    flex: 1;
}

.inaff-date-input:focus {
    border-color: #89b4fa;
}

.btn-add-date {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #89b4fa;
    background: none;
    border: 1px dashed #45475a;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
}

.btn-add-date:hover {
    border-color: #89b4fa;
    background: rgba(137, 180, 250, 0.05);
}

.btn-remove-date {
    background: none;
    border: none;
    color: #f38ba8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.btn-remove-date:hover {
    background: rgba(243, 139, 168, 0.1);
}

.inaff-delete-label {
    font-size: 13px;
    color: #f38ba8;
    padding: 8px 12px;
    border: 1px solid #45475a;
    border-radius: 6px;
    display: block;
}

.inaff-delete-label:has(input:checked) {
    border-color: #f38ba8;
    background: rgba(243, 139, 168, 0.08);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-inaff-send {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #a6e3a1;
    color: #1e1e2e;
    flex: 1;
}

.btn-inaff-send:hover {
    background: #94e2d5;
}

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

.btn-inaff-cancel {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid #45475a;
    background: #313244;
    color: #cdd6f4;
    cursor: pointer;
}

.btn-inaff-cancel:hover {
    background: #45475a;
}

.inaff-log {
    background: #11111b;
    border: 1px solid #313244;
    border-radius: 6px;
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
}

.log-line {
    color: #6c7086;
    margin-bottom: 2px;
}

.log-ok { color: #a6e3a1; }
.log-err { color: #f38ba8; }
.log-skip { color: #f9e2af; }
.log-reset { color: #fab387; font-weight: 600; }

/* ========== MODAL INPUTS ========== */
.modal-body input[type="text"],
.modal-body select {
    width: 100%;
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 6px;
    padding: 8px 12px;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.modal-body input:focus, .modal-body select:focus {
    border-color: #cba6f7;
}

/* ============================================
   COMMENTS STYLES
   ============================================ */

.btn-action {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin: 2px;
    transition: opacity 0.2s;
}

.btn-action:hover {
    opacity: 0.8;
}

.btn-hide {
    background: #f9e2af;
    color: #1e1e2e;
}

.btn-unhide {
    background: #a6e3a1;
    color: #1e1e2e;
}

.btn-delete {
    background: #f38ba8;
    color: #1e1e2e;
}

#comments-table td {
    vertical-align: top;
    padding: 8px 10px;
}

#comments-table tr:hover {
    background: rgba(137, 180, 250, 0.05);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: rgba(205, 214, 244, 0.1);
}

.token-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(49, 50, 68, 0.5);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 12px;
}
.tok-dot {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    cursor: default;
}
.tok-dot-checking {
    color: #585b70;
    animation: tok-pulse 1.2s ease-in-out infinite;
}
.tok-dot-ok {
    color: #a6e3a1;
    filter: drop-shadow(0 0 4px #a6e3a1);
}
.tok-dot-bad {
    color: #f38ba8;
    filter: drop-shadow(0 0 4px #f38ba8);
}
.tok-dot-unknown {
    color: #f9e2af;
}
@keyframes tok-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.token-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
}

.log-ok {
    color: #a6e3a1;
}

.log-err {
    color: #f38ba8;
}

.log-skip {
    color: #f9e2af;
}

.log-reset {
    color: #89b4fa;
}

/* ========== BUDGET CONTROLS ========== */
.budget-mode-toggle {
    display: flex;
    border: 1px solid #45475a;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.budget-mode-btn {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border: none;
    cursor: pointer;
    background: #313244;
    color: #6c7086;
    transition: all 0.15s;
}

.budget-mode-btn:hover {
    background: #45475a;
    color: #cdd6f4;
}

.budget-mode-btn.active {
    background: #89b4fa;
    color: #1e1e2e;
}

.budget-pct-btn {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border: 1px solid #45475a;
    border-radius: 6px;
    cursor: pointer;
    background: #2a1f1f;
    color: #f38ba8;
    transition: all 0.15s;
}

.budget-pct-btn:hover {
    background: #3a2525;
    border-color: #f38ba8;
}

.budget-pct-btn-up {
    background: #1f2a1f;
    color: #a6e3a1;
}

.budget-pct-btn-up:hover {
    background: #253525;
    border-color: #a6e3a1;
}

.btn-budget {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #45475a;
    border-radius: 4px;
    background: #313244;
    color: #f9e2af;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 8px;
    white-space: nowrap;
}

.btn-budget:hover {
    background: #45475a;
    border-color: #f9e2af;
    transform: translateY(-1px);
}

.btn-budget .budget-amount {
    color: #89b4fa;
    font-weight: 700;
}

.btn-entity-stop {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border: 1px solid #45475a;
    border-radius: 4px;
    background: #313244;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-entity-stop:hover {
    background: #45475a;
    border-color: #f38ba8;
    transform: translateY(-1px);
}

.btn-entity-stop:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Toggle switch */
.entity-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    vertical-align: middle;
}
.entity-toggle {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
    flex-shrink: 0;
}
.entity-toggle input { opacity: 0; width: 0; height: 0; }
.entity-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #45475a;
    border-radius: 16px;
    transition: .25s;
}
.entity-toggle-slider:before {
    position: absolute;
    content: "";
    height: 10px; width: 10px;
    left: 3px; bottom: 3px;
    background: #cdd6f4;
    border-radius: 50%;
    transition: .25s;
}
.entity-toggle input:checked + .entity-toggle-slider { background: #a6e3a1; }
.entity-toggle input:checked + .entity-toggle-slider:before { transform: translateX(14px); background: #1e1e2e; }
.entity-toggle input:disabled + .entity-toggle-slider { opacity: 0.5; cursor: not-allowed; }
.entity-issue-icon {
    font-size: 12px;
    cursor: default;
    line-height: 1;
}

/* ========== CSS TOOLTIPS ========== */
[data-tip] {
    position: relative;
}
[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 9999;
}
[data-tip]:hover::after {
    opacity: 1;
}

/* ========== BULK ACTION BAR ========== */
.bulk-action-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border-top: 2px solid #89b4fa;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 150;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.bulk-action-info {
    font-size: 14px;
    font-weight: 600;
    color: #89b4fa;
}

.bulk-action-info span {
    font-size: 18px;
    font-weight: 700;
    color: #cdd6f4;
}

.bulk-action-buttons {
    display: flex;
    gap: 8px;
}

.bulk-btn {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-btn-pause {
    background: #f9e2af;
    color: #1e1e2e;
}

.bulk-btn-pause:hover {
    background: #f5c97f;
    transform: translateY(-1px);
}

.bulk-btn-activate {
    background: #a6e3a1;
    color: #1e1e2e;
}

.bulk-btn-activate:hover {
    background: #7dd87a;
    transform: translateY(-1px);
}

.bulk-btn-cancel {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
}

.bulk-btn-cancel:hover {
    background: #45475a;
}

/* ========== AD CHECKBOX ========== */
.ad-checkbox {
    accent-color: #89b4fa;
    cursor: pointer;
    width: 15px;
    height: 15px;
}

.row-ad.selected td,
.row-ad-alt.selected td {
    background: rgba(137, 180, 250, 0.1) !important;
    border-bottom-color: rgba(137, 180, 250, 0.2);
}

/* ========== LOGIN PAGE ========== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #11111b;
    margin: 0;
    padding: 0;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-box {
    background: #1e1e2e;
    border: 1px solid #313244;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.login-header h1 {
    color: #89b4fa;
    font-size: 24px;
    margin: 0 0 6px;
}

.login-header p {
    color: #6c7086;
    font-size: 14px;
    margin: 0;
}

.login-error {
    background: rgba(243, 139, 168, 0.15);
    border: 1px solid #f38ba8;
    color: #f38ba8;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    color: #a6adc8;
    font-size: 13px;
    font-weight: 500;
}

.login-field input {
    background: #313244;
    border: 1px solid #45475a;
    border-radius: 8px;
    padding: 12px 14px;
    color: #cdd6f4;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.login-field input:focus {
    border-color: #89b4fa;
}

.login-btn {
    background: #89b4fa;
    color: #11111b;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 6px;
}

.login-btn:hover {
    background: #74c7ec;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: #45475a;
    font-size: 12px;
}

/* ========== USER BAR (sidebar) ========== */
.sidebar-user {
    padding: 10px 14px;
    border-top: 1px solid #313244;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
}
.sidebar-user-name,
.sidebar-user > div:last-child,
.sidebar-footer { opacity: 0; transition: opacity 0.12s 0.05s; }
.sidebar:hover .sidebar-user-name,
.sidebar:hover .sidebar-user > div:last-child,
.sidebar:hover .sidebar-footer { opacity: 1; }

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cdd6f4;
    font-size: 13px;
    min-width: 0;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #313244;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-user-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: none;
    border: 1px solid #45475a;
    color: #a6adc8;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: #f38ba8;
    color: #11111b;
    border-color: #f38ba8;
}

/* ========== DUPLICATE BUTTON ========== */
.btn-dup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #45475a;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 6px;
    color: #89b4fa;
    transition: all 0.2s;
    vertical-align: middle;
}

.btn-dup:hover {
    background: #313244;
    border-color: #89b4fa;
    transform: scale(1.1);
}

/* ========== RECOMMENDATIONS PANEL ========== */
.recommendations-panel {
    margin: 12px 20px;
    padding: 15px;
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 8px;
}

.recommendations-panel h3 {
    font-size: 15px;
    color: #f9e2af;
    margin-bottom: 12px;
}

.rec-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #181825;
    border-radius: 6px;
    border-left: 3px solid #f9e2af;
    gap: 10px;
}

.rec-item.rec-pause {
    border-left-color: #f38ba8;
}

.rec-item.rec-increase {
    border-left-color: #a6e3a1;
}

.rec-item.rec-decrease {
    border-left-color: #fab387;
}

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

.rec-info .rec-name {
    font-weight: 600;
    color: #cdd6f4;
    font-size: 13px;
    margin-bottom: 3px;
}

.rec-info .rec-detail {
    font-size: 11px;
    color: #a6adc8;
}

.rec-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rec-btn {
    padding: 5px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.rec-btn-approve {
    background: #a6e3a1;
    color: #11111b;
}

.rec-btn-approve:hover {
    background: #94e2d5;
    transform: translateY(-1px);
}

.rec-btn-reject {
    background: #45475a;
    color: #cdd6f4;
}

.rec-btn-reject:hover {
    background: #585b70;
}

/* ========== RULES CONFIGURATION ========== */
.rules-config {
    margin-top: 20px;
    padding: 20px;
    background: #181825;
    border-radius: 8px;
    border: 1px solid #45475a;
}

.rules-config h3 {
    font-size: 16px;
    color: #fab387;
    margin-bottom: 15px;
}

.rule-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 6px;
    background: #1e1e2e;
    border-radius: 6px;
    border: 1px solid #313244;
    flex-wrap: wrap;
}

.rule-row select,
.rule-row input[type="number"],
.rule-row input[type="text"] {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12px;
}

.rule-row select {
    min-width: 100px;
}

.rule-row input[type="number"] {
    width: 80px;
}

.rule-row input[type="text"] {
    flex: 1;
    min-width: 120px;
}

.btn-rule-add {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: #89b4fa;
    color: #11111b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-rule-add:hover {
    background: #74c7ec;
}

.btn-rule-del {
    background: none;
    border: none;
    color: #f38ba8;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
}

.btn-rule-del:hover {
    background: rgba(243, 139, 168, 0.2);
}

.btn-rules-save {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #a6e3a1;
    color: #11111b;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    margin-top: 10px;
    transition: all 0.2s;
}

.btn-rules-save:hover {
    background: #94e2d5;
    transform: translateY(-1px);
}

/* ========== RESPONSIVE ========== */

/* ─── Mobile top bar (hamburger header) ─── */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #181825;
    border-bottom: 1px solid #313244;
    z-index: 300;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.mobile-topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #89b4fa;
}

.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 6px;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: #313244; }
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #cdd6f4;
    border-radius: 2px;
    transition: all 0.25s;
}
.hamburger-btn.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ─── Sidebar drawer overlay ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 399;
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.sidebar-overlay.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ─── TABLET: 769px–1024px ─── */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 72px;
        overflow: hidden;
    }
    .sidebar-logo span,
    .nav-item > span:last-child,
    .sidebar-user-name,
    .sidebar-footer {
        display: none;
    }
    .sidebar-header {
        padding: 20px 8px;
        justify-content: center;
    }
    .sidebar-logo {
        justify-content: center;
    }
    .nav-item {
        justify-content: center;
        padding: 14px 8px;
        gap: 0;
    }
    .nav-icon {
        font-size: 22px;
    }
    .sidebar-user {
        justify-content: center;
        padding: 12px 8px;
        flex-direction: column;
        gap: 6px;
    }
    .sidebar-user > div:last-child {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }
}

/* ─── MOBILE: ≤ 768px ─── */
@media (max-width: 768px) {

    /* Body */
    body {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Show mobile top bar */
    .mobile-topbar {
        display: flex;
    }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        z-index: 400;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }
    .sidebar .nav-item span:last-child,
    .sidebar .sidebar-logo span,
    .sidebar .sidebar-user-name,
    .sidebar .sidebar-user > div:last-child,
    .sidebar .sidebar-footer { opacity: 1 !important; }

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

    /* Overlay: only intercepts clicks when drawer is open (.visible added by JS) */
    /* No display:block here - JS handles it via .visible class */

    /* Main content takes full width, pushed down by top bar */
    .main-content {
        width: 100%;
        margin-top: 56px;
        height: auto;
        min-height: calc(100vh - 56px);
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Each view fills the content area */
    .view-section {
        height: auto;
        min-height: calc(100vh - 56px);
        overflow-x: hidden;
    }

    /* Tree (accounts) section needs horizontal scroll for columns */
    #section-accounts .view-section,
    #section-accounts {
        overflow-x: auto;
    }

    /* Dashboard: stack cards vertically */
    .dashboard {
        flex-direction: column;
        padding: 12px;
        gap: 8px;
    }
    .dash-card {
        min-width: unset;
    }

    /* Controls: wrap and stretch */
    .controls {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
        position: sticky;
        top: 0;
    }
    .controls > * {
        width: 100%;
    }
    .controls input[type="text"],
    .controls input[type="date"],
    .controls select {
        width: 100%;
        box-sizing: border-box;
    }
    .controls button {
        width: 100%;
        text-align: center;
    }
    .separator {
        display: none;
    }

    /* Tables: horizontal scroll */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 8px 16px;
        max-height: none;
        border-radius: 6px;
    }
    table {
        min-width: 600px;
    }
    thead th {
        font-size: 10px;
        padding: 7px 5px;
        white-space: nowrap;
    }
    tbody td {
        font-size: 11px;
        padding: 5px 5px;
        white-space: nowrap;
    }
    /* Reduce left indentation for hierarchy */
    .row-campaign td:first-child { padding-left: 12px; }
    .row-adset td:first-child    { padding-left: 22px; }
    .row-ad td:first-child       { padding-left: 32px; }
    .row-ad-alt td:first-child   { padding-left: 32px; }

    /* Dropdown: full width */
    .dropdown { position: relative; width: 100%; }
    .dropdown-menu { left: 0; right: 0; min-width: unset; }
    .btn-cols { width: 100%; text-align: center; }

    /* Currency + preset row: wrap */
    .currency-toggle { flex-wrap: wrap; }
    .curr-btn { flex: 1; min-width: 60px; text-align: center; }

    /* Avtozaliv constructor */
    #view-avtozaliv {
        padding: 0;
    }
    #az-mode-constructor,
    #az-mode-template {
        padding: 0 8px 16px;
    }
    .az-adset-card {
        padding: 10px;
        margin-bottom: 10px;
    }
    .az-adset-card > div[style*="display:flex"],
    .az-ad-row > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .az-ad-row {
        padding: 10px;
    }
    .az-input {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* Avtozaliv log */
    #az-log-container {
        margin: 0 8px 16px;
    }

    /* Avtozaliv prokla row */
    #view-avtozaliv div[style*="gap:10px"] {
        gap: 8px !important;
    }

    /* Creatives section */
    #view-creatives > div {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* BM mgmt tree: scroll */
    #bm-tree-wrap {
        height: 50vh;
        overflow: hidden;
    }

    /* Modal sizing */
    .modal-box {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
    }

    /* Comments tab */
    #view-comments .controls {
        align-items: stretch;
    }

    /* Monitor tab */
    #view-monitor .controls {
        align-items: stretch;
    }

    /* Geo tab */
    #geo-map-container {
        height: 50vh;
    }

    /* Stats filter row */
    #stats-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    /* AI creative modal */
    #ai-creative-modal > div {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    /* Misc: section headings */
    h2 { font-size: 15px !important; }
    h3 { font-size: 13px !important; }
    h4 { font-size: 12px !important; }

    /* Fix sticky controls z-index over topbar */
    .controls {
        z-index: 90;
    }
}

/* ============================================================
   ACCOUNT TREE VIEW
   ============================================================ */

/* ─── Group section: each group is a vertical column, groups side by side ─── */
.bm-tree-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 14px 16px;
    border-radius: 14px;
    background: #13131c;
    border: 1px solid;  /* color set inline */
    flex-shrink: 0;
}
.bm-tree-group-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
    opacity: 0.9;
}
.bm-tree-group-profiles {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ─── Per-profile colored frame ─── */
.bm-profile-frame {
    border: 1.5px solid;  /* color set inline */
    border-radius: 10px;
    padding: 12px 14px;
    background: transparent; /* tint set inline */
}

/* Tree node: card + optional children side-by-side */
.bm-tn {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
}

/* Children column (vertical stack to the right of parent) */
.bm-tc-children {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-left: 0;
    position: relative;
    z-index: 1;
}

/* ─── Card base ─── */
.bm-tc {
    border-radius: 9px;
    padding: 10px 13px;
    min-width: 150px;
    max-width: 210px;
    font-size: 12px;
    line-height: 1.45;
    border: 1px solid #313244;
    background: #1e1e2e;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-right: 32px; /* gap before children / bezier line space */
}

.bm-tc-title {
    font-weight: 600;
    color: #cdd6f4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    margin-bottom: 3px;
}

.bm-tc-sub {
    color: #a6adc8;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.bm-tc-row {
    color: #cdd6f4;
    font-size: 11px;
    margin-top: 2px;
}

.bm-tc-badge {
    font-size: 11px;
    margin-top: 4px;
}

.mono { font-family: monospace; }

/* ─── Profile card: orange ─── */
.bm-tc-profile {
    background: linear-gradient(135deg, #2a1a0a 0%, #1e1e2e 100%);
    border-color: #fab387;
    box-shadow: 0 0 8px rgba(250,179,135,0.15);
}
.bm-tc-profile .bm-tc-title { color: #fab387; font-size: 13px; }

/* ─── BM card: green/red based on token ─── */
.bm-tc-bm {
    background: #181825;
    border-color: #45475a;
}
.bm-tc-bm-ok {
    background: linear-gradient(135deg, #0d1f14 0%, #181825 100%);
    border-color: #a6e3a1;
    box-shadow: 0 0 6px rgba(166,227,161,0.12);
}
.bm-tc-bm-bad {
    background: linear-gradient(135deg, #1f0d0d 0%, #181825 100%);
    border-color: #f38ba8;
    box-shadow: 0 0 6px rgba(243,139,168,0.12);
}

/* ─── Pages card ─── */
.bm-tc-pages {
    background: #181825;
    border-color: #313244;
    min-width: 160px;
}
.bm-tc-pages .bm-tc-title { color: #89b4fa; font-size: 12px; }

.bm-page-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1px 0;
}
.bm-page-dot { font-size: 10px; flex-shrink: 0; }
.bm-page-name {
    font-size: 11px;
    color: #cdd6f4;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Account card: red if banned ─── */
.bm-tc-account {
    background: #181825;
    border-color: #45475a;
    min-width: 180px;
}

/* ─── Campaign card ─── */
.bm-tc-campaign {
    background: #181825;
    border-color: #313244;
    min-width: 170px;
}

/* ─── Adset card ─── */
.bm-tc-adset {
    background: #181825;
    border-color: #313244;
    min-width: 160px;
}

/* ─── Ad card ─── */
.bm-tc-ad {
    background: #181825;
    border-color: #313244;
    min-width: 150px;
}

/* ─── Banned state (red overlay) ─── */
.bm-tc-banned {
    background: linear-gradient(135deg, #1f0d0d 0%, #181825 100%) !important;
    border-color: #f38ba8 !important;
    box-shadow: 0 0 6px rgba(243,139,168,0.1);
}

/* ─── Load button card ─── */
.bm-tc-load {
    background: #181825;
    border: 1px dashed #45475a;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Expand column (▶ button between card and children) ─── */
.bm-tc-expand-col {
    display: flex;
    align-items: center;
    margin-right: 4px;
    flex-shrink: 0;
    align-self: center;
}

.bm-tc-expand-btn {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.bm-tc-expand-btn:hover { background: #45475a; }

/* ─── Load button inside cards ─── */
.bm-tc-load-btn {
    background: #313244;
    color: #cba6f7;
    border: 1px solid #45475a;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s;
}
.bm-tc-load-btn:hover { background: #45475a; }

/* ─── Small info button inside account card ─── */
.bm-tc-sm-btn {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 11px;
    cursor: pointer;
}
.bm-tc-sm-btn:hover { background: #45475a; }

/* ─── Zoom / fullscreen toolbar buttons ─── */
.bm-ctrl-btn {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}
.bm-ctrl-btn:hover { background: #45475a; }

/* ─── Profile row: inactive BMs left (order:-1), active BMs right ─── */
.bm-tn-profile-row {
    flex-direction: row;
    align-items: center;
}
.bm-inactive-col {
    opacity: 0.55;
}
.bm-inactive-col .bm-tc {
    filter: grayscale(0.4);
}

/* ─── Left column: Pages card above BM card ─── */
.bm-left-col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* ─── Page status dot ─── */
.bm-page-status {
    font-size: 11px;
    flex-shrink: 0;
    min-width: 16px;
    text-align: center;
}

/* ─── Page restriction check button ─── */
.bm-page-check-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    padding: 0 2px;
    opacity: 0.5;
    transition: opacity 0.15s;
    flex-shrink: 0;
}
.bm-page-check-btn:hover { opacity: 1; }

/* ─── Fullscreen: expand tree wrap to full viewport ─── */
#bm-tree-wrap:fullscreen {
    height: 100vh !important;
    border-radius: 0;
    background: #181825;
}

/* ============================================================
   FBADS — Facebook Ads Manager Replica Styles
   ============================================================ */

/* ─── Selector bar ─── */
.fbads-selector-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 14px 20px;
    background: #181825;
    border-bottom: 1px solid #313244;
    flex-wrap: wrap;
}
.fbads-sel-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.fbads-sel-label {
    font-size: 11px;
    color: #6c7086;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.fbads-sel-input {
    background: #1e1e2e;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-family: inherit;
    min-width: 160px;
    transition: border-color 0.15s;
    cursor: pointer;
}
.fbads-sel-input:focus { border-color: #89b4fa; outline: none; }
.fbads-sel-input:disabled { opacity: 0.45; cursor: not-allowed; }
.fbads-sel-arrow {
    font-size: 18px;
    color: #45475a;
    padding-bottom: 4px;
    user-select: none;
}
.fbads-load-btn {
    background: #89b4fa;
    color: #11111b;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
    align-self: flex-end;
}
.fbads-load-btn:hover { background: #74c7ec; transform: translateY(-1px); }
.fbads-load-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── Toolbar ─── */
.fbads-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #181825;
    border-bottom: 1px solid #313244;
    flex-wrap: wrap;
    gap: 8px;
}
.fbads-level-tabs {
    display: flex;
    border: 1px solid #313244;
    border-radius: 6px;
    overflow: hidden;
}
.fbads-tab {
    background: #1e1e2e;
    color: #a6adc8;
    border: none;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1px solid #313244;
    white-space: nowrap;
}
.fbads-tab:last-child { border-right: none; }
.fbads-tab:hover { background: #313244; color: #cdd6f4; }
.fbads-tab.active { background: #89b4fa; color: #11111b; font-weight: 700; }
.fbads-date-wrap { display: flex; gap: 6px; align-items: center; }
.fbads-create-btn {
    background: #a6e3a1; color: #11111b;
    border: none; border-radius: 6px;
    padding: 7px 14px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background 0.15s;
    white-space: nowrap; flex-shrink: 0;
}
.fbads-create-btn:hover { background: #94e2d5; }

/* ─── Breadcrumb ─── */
.fbads-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: #13131c;
    border-bottom: 1px solid #313244;
    font-size: 12px;
}
.fbads-bc-item { color: #89b4fa; cursor: pointer; font-weight: 500; }
.fbads-bc-item:hover { text-decoration: underline; }
.fbads-bc-sep { color: #45475a; }
.fbads-bc-current { color: #cdd6f4; font-weight: 600; }

/* ─── Bulk action bar ─── */
.fbads-bulk-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: #1e1e2e;
    border-bottom: 1px solid #313244;
    font-size: 12px;
    color: #cba6f7;
}
.fbads-bulk-bar button {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 5px;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.fbads-bulk-bar button:hover { background: #45475a; }

/* ─── Empty state ─── */
.fbads-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 60px 20px;
    color: #6c7086;
    gap: 12px;
}
.fbads-empty-state div { font-size: 48px; }
.fbads-empty-state p { font-size: 14px; text-align: center; max-width: 320px; line-height: 1.5; }

/* ─── Table ─── */
.fbads-table-wrap { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.fbads-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 900px; }
.fbads-table thead th {
    background: #1e1e2e;
    color: #6c7086;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 9px 10px;
    border-bottom: 2px solid #313244;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
    cursor: pointer;
    user-select: none;
}
.fbads-table thead th:hover { color: #cdd6f4; }
.fbads-th-name { min-width: 220px; }
.fbads-table tbody tr { border-bottom: 1px solid #1e1e2e; transition: background 0.1s; }
.fbads-table tbody tr:hover { background: #1e1e2e; }
.fbads-table tbody tr.fbads-row-selected { background: #1a2540; }
.fbads-table tbody td { padding: 10px 10px; vertical-align: middle; white-space: nowrap; color: #cdd6f4; }

/* Name cells */
.fbads-name-cell { display: flex; align-items: center; gap: 8px; }
.fbads-name-link {
    color: #89b4fa;
    cursor: pointer;
    font-weight: 500;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.fbads-name-link:hover { text-decoration: underline; }
.fbads-name-plain {
    color: #cdd6f4;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Status dot */
.fbads-status-wrap { display: flex; align-items: center; justify-content: center; }
.fbads-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.2s;
    position: relative;
}
.fbads-dot.active { background: #a6e3a1; color: #11111b; }
.fbads-dot.active:hover { background: #94e2d5; transform: scale(1.1); }
.fbads-dot.paused { background: #313244; color: #a6adc8; }
.fbads-dot.paused:hover { background: #45475a; transform: scale(1.1); }
.fbads-dot.error { background: #f38ba8; color: #11111b; cursor: default; }
.fbads-dot::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: #313244;
    color: #cdd6f4;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
    border: 1px solid #45475a;
}
.fbads-dot:hover::after { opacity: 1; }

/* Metrics */
.fbads-spend { color: #f9e2af; font-weight: 600; }
.fbads-leads { color: #a6e3a1; font-weight: 600; }
.fbads-cpl { color: #cba6f7; }
.fbads-zero { color: #45475a; }

/* Budget inline edit */
.fbads-budget-cell { display: flex; align-items: center; gap: 4px; }
.fbads-budget-input {
    background: #1e1e2e;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 12px;
    width: 72px;
    font-family: inherit;
    display: none;
}
.fbads-budget-input.visible { display: block; }
.fbads-budget-text { cursor: pointer; }
.fbads-budget-text:hover { text-decoration: underline; }

/* Action buttons */
.fbads-actions { display: flex; align-items: center; gap: 4px; }
.fbads-action-btn {
    background: #313244;
    color: #cdd6f4;
    border: 1px solid #45475a;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.1s;
}
.fbads-action-btn:hover { background: #45475a; }
.fbads-action-btn.edit:hover { background: #89b4fa; color: #11111b; border-color: #89b4fa; }
.fbads-action-btn.dup:hover { background: #cba6f7; color: #11111b; border-color: #cba6f7; }
.fbads-action-btn.danger { color: #f38ba8; border-color: #f38ba8; }
.fbads-action-btn.danger:hover { background: #f38ba8; color: #11111b; }

/* ─── Geo tag-input ─── */
.fc-geo-wrap {
    background: #1e1e2e; border: 1px solid #45475a; border-radius: 8px;
    padding: 6px 8px; min-height: 42px; cursor: text;
}
.fc-geo-wrap:focus-within { border-color: #89b4fa; }
.fc-geo-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.fc-geo-tag {
    display: inline-flex; align-items: center; gap: 5px;
    background: #313244; color: #cdd6f4; border-radius: 6px;
    padding: 3px 8px; font-size: 12px;
}
.fc-geo-tag.group { background: #1e3a5f; color: #89b4fa; }
.fc-geo-tag button {
    background: none; border: none; color: #6c7086; cursor: pointer;
    font-size: 14px; padding: 0; line-height: 1; margin-left: 2px;
}
.fc-geo-tag button:hover { color: #f38ba8; }
.fc-geo-inp {
    background: none; border: none; outline: none; color: #cdd6f4;
    font-size: 13px; width: 100%; padding: 2px 0;
}
.fc-geo-inp::placeholder { color: #6c7086; }
.fc-geo-drop {
    position: absolute; left: 0; right: 0; top: 100%; margin-top: 3px;
    background: #1e1e2e; border: 1px solid #45475a; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 9999;
    max-height: 220px; overflow-y: auto;
}
.fc-geo-opt {
    padding: 8px 12px; font-size: 13px; color: #cdd6f4; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
}
.fc-geo-opt:hover { background: #313244; }
.fc-geo-tag.interest { background: #2a1f3d; color: #cba6f7; }
.fc-geo-tag.locale   { background: #1a2e1a; color: #a6e3a1; }

/* ─── Targeting preload progress bar ─── */
#fc-preload-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99999;
    background: #181825; border-top: 1px solid #45475a;
    padding: 8px 16px; display: flex; align-items: center; gap: 12px;
}
#fc-preload-text { font-size: 12px; color: #a6adc8; white-space: nowrap; }
#fc-preload-progress {
    flex: 1; height: 4px; background: #313244; border-radius: 2px; overflow: hidden;
}
#fc-preload-fill {
    height: 100%; background: #89b4fa; border-radius: 2px;
    width: 0%; transition: width 0.2s ease;
}

/* ─── Context menu (three-dot) ─── */
.fbads-ctx-menu {
    position: absolute;
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 9999;
    overflow: hidden;
    padding: 4px 0;
    min-width: 190px;
}
.fbads-ctx-item {
    padding: 9px 14px;
    font-size: 13px;
    color: #cdd6f4;
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}
.fbads-ctx-item:hover { background: #313244; }
.fbads-ctx-item.danger { color: #f38ba8; }
.fbads-ctx-item.danger:hover { background: rgba(243,139,168,0.1); }
.fbads-ctx-divider { height: 1px; background: #313244; margin: 4px 0; }
.fbads-menu-btn {
    background: none; border: none; color: #6c7086;
    font-size: 18px; cursor: pointer; padding: 0 4px;
    line-height: 1; border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.fbads-menu-btn:hover { color: #cdd6f4; background: #313244; }

/* ─── Edit Drawer ─── */
.fbads-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 490;
    backdrop-filter: blur(2px);
}
.fbads-drawer-overlay.visible { display: block; }
.fbads-edit-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 65vw;
    min-width: 600px;
    max-width: 100vw;
    background: #1e1e2e;
    border-left: 1px solid #45475a;
    z-index: 500;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.4);
}
.fbads-edit-drawer.open { transform: translateX(0); }
.fbads-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #313244;
    font-size: 15px;
    font-weight: 700;
    color: #89b4fa;
    flex-shrink: 0;
}
.fbads-drawer-close {
    background: none; border: none;
    color: #6c7086; font-size: 20px;
    cursor: pointer; line-height: 1;
    padding: 2px 6px; border-radius: 4px;
    transition: color 0.1s, background 0.1s;
}
.fbads-drawer-close:hover { color: #f38ba8; background: #313244; }
.fbads-drawer-body {
    flex: 1; overflow-y: auto;
    padding: 16px 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.fbads-drawer-section { display: flex; flex-direction: column; gap: 6px; }
.fbads-drawer-section-title {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: #6c7086;
    padding-bottom: 4px;
    border-bottom: 1px solid #313244;
}
.fbads-field-label { display: block; font-size: 11px; color: #a6adc8; margin-bottom: 3px; }
.fbads-field-input {
    background: #181825; color: #cdd6f4;
    border: 1px solid #45475a; border-radius: 6px;
    padding: 8px 10px; font-size: 13px;
    font-family: inherit; width: 100%; box-sizing: border-box;
    transition: border-color 0.15s;
}
.fbads-field-input:focus { border-color: #89b4fa; outline: none; }

/* Gender */
.fbads-gender-wrap { display: flex; gap: 6px; }
.fbads-gender-btn {
    flex: 1; padding: 8px;
    background: #181825; color: #a6adc8;
    border: 1px solid #45475a; border-radius: 6px;
    cursor: pointer; font-family: inherit; font-size: 12px;
    font-weight: 500; transition: all 0.15s; text-align: center;
}
.fbads-gender-btn.active { background: #89b4fa; color: #11111b; border-color: #89b4fa; font-weight: 700; }

/* Placements */
.fbads-placements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fbads-placement-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: #cdd6f4; cursor: pointer;
    padding: 6px 8px;
    background: #181825; border: 1px solid #313244; border-radius: 5px;
    transition: border-color 0.1s;
}
.fbads-placement-item:hover { border-color: #89b4fa; }
.fbads-placement-item input[type="checkbox"] { accent-color: #89b4fa; }

/* Interests */
.fbads-interest-search-wrap { position: relative; }
.fbads-interest-results {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #1e1e2e; border: 1px solid #45475a; border-radius: 6px;
    z-index: 200; max-height: 180px; overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4); display: none;
}
.fbads-interest-results.open { display: block; }
.fbads-interest-result-item { padding: 7px 12px; font-size: 12px; cursor: pointer; transition: background 0.1s; }
.fbads-interest-result-item:hover { background: #313244; }
.fbads-interest-tags, .fbads-geo-tags { display: flex; flex-wrap: wrap; gap: 5px; min-height: 28px; }
.fbads-interest-tag, .fbads-geo-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #313244; color: #cdd6f4;
    padding: 3px 9px; border-radius: 12px; font-size: 11px;
}
.fbads-interest-tag span, .fbads-geo-tag span { cursor: pointer; color: #f38ba8; font-weight: 700; }

/* ─── Create Wizard ─── */
.fcreate-scroll {
    height: 100%;
    overflow-y: auto;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.fcreate-block {
    padding: 20px 0;
    border-bottom: 1px solid #313244;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fcreate-block:last-child { border-bottom: none; }
.fcreate-block-title {
    font-size: 15px;
    font-weight: 600;
    color: #cdd6f4;
    margin-bottom: 8px;
}
.fcreate-budget-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fcreate-budget-opt {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #45475a;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.fcreate-budget-opt input[type=radio] { margin-top: 2px; flex-shrink: 0; }
.fcreate-budget-opt:hover { border-color: #89b4fa; background: #1e1e2e; }
.fcreate-budget-opt.active { border-color: #89b4fa; background: #1a2035; }
.fcreate-budget-opt-title { font-size: 13px; font-weight: 600; color: #cdd6f4; }
.fcreate-budget-opt-desc  { font-size: 11px; color: #6c7086; margin-top: 2px; }
.fcreate-tree-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #a6adc8;
    margin-bottom: 2px;
    transition: background 0.12s, color 0.12s;
}
.fcreate-tree-item:hover { background: #313244; color: #cdd6f4; }
.fcreate-tree-item.active { background: #1e1e2e; color: #89b4fa; font-weight: 600; }
.fcreate-tree-parent {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px; border-radius: 6px;
    background: #1e1e2e; border: 1px solid #313244;
    font-size: 13px; color: #6c7086; margin-bottom: 2px;
}
.fcreate-tree-dots {
    background: none; border: none; color: #6c7086;
    font-size: 16px; cursor: pointer; padding: 0 2px;
    line-height: 1; border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.fcreate-tree-dots:hover { color: #cdd6f4; background: #313244; }
.fcreate-add-node-btn {
    display: flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 5px; font-size: 11px;
    color: #6c7086; cursor: pointer; margin-top: 2px;
    transition: color 0.15s, background 0.15s;
}
.fcreate-add-node-btn:hover { color: #89b4fa; background: #1e1e2e; }
.fcreate-pl-group {
    border: 1px solid #45475a;
    border-radius: 8px;
    overflow: hidden;
}
.fcreate-pl-group-hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: #1e1e2e;
    cursor: pointer;
    user-select: none;
}
.fcreate-pl-group-hdr:hover { background: #262640; }
.fcreate-pl-group-title { font-size: 13px; font-weight: 600; color: #cdd6f4; }
.fcreate-pl-group-desc  { font-size: 11px; color: #6c7086; margin-top: 1px; }
.fcreate-pl-group-arrow { margin-left: auto; color: #6c7086; font-size: 12px; }
.fcreate-pl-items {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    border-top: 1px solid #313244;
}
.fcreate-pl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 38px;
    font-size: 13px;
    color: #a6adc8;
    cursor: pointer;
    transition: background 0.1s;
}
.fcreate-pl-item:hover { background: #1e1e2e; color: #cdd6f4; }
.fcreate-pl-item input[type=checkbox] { flex-shrink: 0; }
.fcreate-media-btn {
    padding: 9px 18px;
    border: 1px solid #45475a;
    border-radius: 7px;
    background: #1e1e2e;
    color: #a6adc8;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.fcreate-media-btn:hover { border-color: #89b4fa; color: #cdd6f4; }
.fcreate-media-btn.active { border-color: #89b4fa; background: #1a2035; color: #89b4fa; font-weight: 600; }
.fcreate-media-preview { margin-bottom: 12px; }
.fbads-draft-badge {
    display: inline-block;
    font-size: 10px;
    color: #f9e2af;
    background: rgba(249,226,175,0.08);
    border: 1px solid rgba(249,226,175,0.25);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 500;
}
.fbads-dot.draft { background: #45475a; color: #f9e2af; font-size: 14px; }

/* Footer */
.fbads-drawer-footer {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 20px; border-top: 1px solid #313244; flex-shrink: 0;
}
.fbads-btn-save {
    background: #89b4fa; color: #11111b;
    border: none; border-radius: 6px;
    padding: 9px 20px; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.fbads-btn-save:hover { background: #74c7ec; }
.fbads-btn-cancel {
    background: #313244; color: #cdd6f4;
    border: 1px solid #45475a; border-radius: 6px;
    padding: 9px 16px; font-size: 13px;
    font-family: inherit; cursor: pointer; transition: background 0.15s;
}
.fbads-btn-cancel:hover { background: #45475a; }

/* ─── Edit Sidebar Tree ─── */
.fbads-sb-row {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: 5px;
    font-size: 12px; cursor: pointer; color: #cdd6f4;
    transition: background 0.12s;
    user-select: none;
}
.fbads-sb-row:hover { background: #313244; }
.fbads-sb-active { background: #1e3a5f !important; color: #89b4fa; }
.fbads-sb-icon { flex-shrink: 0; font-size: 11px; }
.fbads-sb-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbads-sb-campaign { font-weight: 600; }
.fbads-sb-adset { padding-left: 16px; }
.fbads-sb-ad { padding-left: 30px; font-size: 11px; color: #a6adc8; }
.fbads-sb-ad:hover { color: #cdd6f4; }
.fbads-sb-active.fbads-sb-ad { color: #89b4fa; }
.fbads-sb-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.fbads-sb-dot.active { background: #a6e3a1; }
.fbads-sb-dot.paused { background: #6c7086; }
.fbads-sb-dot.error { background: #f38ba8; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .fbads-selector-bar { gap: 6px; padding: 10px 12px; }
    .fbads-sel-input { min-width: 100%; }
    .fbads-sel-group { width: 100%; }
    .fbads-sel-arrow { display: none; }
    .fbads-load-btn { width: 100%; }
    .fbads-toolbar { padding: 8px 12px; }
    .fbads-tab { padding: 6px 10px; font-size: 11px; }
    .fbads-edit-drawer { width: 100%; }
    .fbads-placements-grid { grid-template-columns: 1fr; }
}

/* Hover Actions */
.fbads-row .fbads-row-actions {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.fbads-row:hover .fbads-row-actions {
    display: flex;
}
.fbads-action-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.fbads-action-btn:hover {
    color: var(--text-1);
    background: rgba(255,255,255,0.1);
}

/* Tab Badges */
.fbads-tab-badge {
    background: rgba(137, 180, 250, 0.2);
    color: #89b4fa;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 4px;
    font-weight: 600;
}

/* Sidebar Tree Items */
.fbads-tree-item {
    font-size: 12px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-2);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fbads-tree-item:hover {
    background: rgba(255,255,255,0.05);
}
.fbads-tree-item.active {
    background: rgba(137, 180, 250, 0.15);
    color: #89b4fa;
    font-weight: 500;
}
.fbads-tree-indent {
    width: 12px;
    height: 1px;
    display: inline-block;
}


/* ── Language switcher ── */
.lt-lang-btn {
    background: #313244;
    border: 1px solid #45475a;
    color: #6c7086;
    border-radius: 5px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.lt-lang-btn:hover {
    border-color: #89b4fa;
    color: #cdd6f4;
}
.lt-lang-btn.lt-lang-active {
    background: #89b4fa;
    border-color: #89b4fa;
    color: #11111b;
    font-weight: 700;
}
