/* VK Ads Dashboard — Minimal Clean CSS */

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

input, select, button, textarea {
    font-family: inherit;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #f5f5f5;
    overflow-x: hidden;
}

/* Header */
.header {
    background: #2c3e50;
    color: #fff;
    padding: 0 16px;
    display: flex;
    align-items: center;
    height: 48px;
    gap: 16px;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-logo {
    flex-shrink: 0;
}

.nav {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-status {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* Main Content */
.main {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px;
    overflow-x: clip;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
}

/* Filter Row (date picker + group buttons) */
.filter-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

/* Date Range Picker */
.date-picker-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.filter-row .date-picker-wrapper {
    margin-bottom: 0;
}

.date-picker-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.date-picker-trigger:hover {
    border-color: #3498db;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.15);
}

.date-picker-trigger.active {
    border-color: #3498db;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
}

.date-picker-icon {
    color: #666;
}

.date-picker-text {
    font-weight: 500;
}

.date-picker-arrow {
    color: #999;
    transition: transform 0.2s;
}

.date-picker-trigger.active .date-picker-arrow {
    transform: rotate(180deg);
}

.date-picker-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
}

.date-picker-popup.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}

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

.date-picker-presets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    min-width: 160px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 60px;
}

.preset-btn {
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    text-align: left;
    transition: background 0.15s;
}

.preset-btn:hover {
    background: #e9ecef;
}

.preset-btn.active {
    background: #3498db;
    color: #fff;
}

.date-picker-calendars {
    display: flex;
    gap: 24px;
    padding: 16px 16px 16px 180px;
}

.calendar {
    width: 280px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.calendar-title {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
}

.calendar-nav {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: background 0.15s;
}

.calendar-nav:hover {
    background: #f0f0f0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    padding: 4px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #333;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.calendar-day:hover:not(.empty):not(.disabled) {
    background: #e9ecef;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.other-month {
    color: #bbb;
}

.calendar-day.today {
    font-weight: 600;
    color: #3498db;
}

.calendar-day.selected {
    background: #3498db;
    color: #fff;
}

.calendar-day.in-range {
    background: rgba(52, 152, 219, 0.15);
    border-radius: 0;
}

.calendar-day.range-start {
    background: #3498db;
    color: #fff;
    border-radius: 50% 0 0 50%;
}

.calendar-day.range-end {
    background: #3498db;
    color: #fff;
    border-radius: 0 50% 50% 0;
}

.calendar-day.range-start.range-end {
    border-radius: 50%;
}

.date-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    margin-left: 160px;
}

.date-picker-range-display {
    font-size: 14px;
    color: #666;
}

.date-picker-actions {
    display: flex;
    gap: 8px;
}

.btn-cancel {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: background 0.15s;
}

.btn-cancel:hover {
    background: #f0f0f0;
}

.btn-apply {
    padding: 8px 20px;
    background: #3498db;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-apply:hover {
    background: #2980b9;
}

/* Responsive: stack on mobile */
@media (max-width: 900px) {
    .date-picker-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }

    .date-picker-popup.show {
        animation: none;
    }

    .date-picker-presets {
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #eee;
        bottom: auto;
    }

    .date-picker-calendars {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .date-picker-footer {
        margin-left: 0;
    }

    .calendar {
        width: 100%;
    }
}

/* Group Buttons (day/week/month) */
.group-buttons {
    display: inline-flex;
    gap: 0;
}

.group-btn {
    padding: 10px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.group-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.group-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.group-btn:not(:first-child) {
    border-left: none;
}

.group-btn:hover {
    background: #f0f0f0;
}

.group-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.group-btn.active + .group-btn {
    border-left: 1px solid #ddd;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.metric-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metric-value {
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
}

.metric-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Data Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;

    background: #fff;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

/* Text columns: truncate with ellipsis */
.data-table td.col-text {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Budget table: fixed layout for proper column sizing.
   min-width: без него на узких экранах %-колонки названий сжимаются до ~100px,
   а nowrap-заголовки вытекают за свои ячейки («лишняя полоса» справа от
   последней колонки). Ниже порога враппер просто скроллится по горизонтали. */
.budget-table {
    table-layout: fixed;
    min-width: 1450px;
}
.budget-table td.col-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 3;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Split table layout for drill page (fixed left + scrollable right) */
.split-table {
    display: flex;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #fff;
    overflow: hidden;
}
.split-table-fixed {
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    background: #fff;
    border-right: 1px solid #e2e8f0;
}
.split-table-fixed::after {
    content: '';
    position: absolute;
    top: 0;
    right: -7px;
    bottom: 0;
    width: 6px;
    background: linear-gradient(to right, rgba(0,0,0,0.06), transparent);
    pointer-events: none;
    z-index: 3;
}
.split-table-scroll {
    flex: 1;
    overflow-x: auto;
    min-width: 0;
}
/* Truncate content in fixed table first column */
.split-table-fixed .data-table td:first-child {
    overflow: hidden;
}
/* Flex wrapper: name text truncates, dynamics button stays visible */
.drill-name-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}
.drill-name-wrap .drill-link {
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}
.drill-name-wrap .dynamics-btn {
    flex-shrink: 0;
}
.drill-parent-name {
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Column resize handles */
.col-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    bottom: 0;
    cursor: col-resize;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
}
.col-resize-handle::after {
    content: '';
    position: absolute;
    top: 25%;
    bottom: 25%;
    right: 2px;
    width: 2px;
    background: #94a3b8;
    border-radius: 1px;
}
.data-table th:hover .col-resize-handle,
.col-resize-handle.active {
    opacity: 1;
}
.col-resize-handle.active::after {
    background: #3498db;
}
body.col-resizing,
body.col-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
.split-table-fixed .data-table {
    width: auto;
}
/* Hover sync: JS adds .row-hover to matching rows in opposite table */
.split-table .data-table tbody tr.row-hover {
    background: #f8f9fa;
}
.split-table .data-table tbody tr.row-drr-good.row-hover {
    background: #c8e6c9 !important;
}
.split-table .data-table tbody tr.row-drr-bad.row-hover {
    background: #ffcdd2 !important;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Left-align all columns */
.data-table td:nth-child(n+2),
.data-table th:nth-child(n+2) {
    text-align: left;
}

/* First column stays left-aligned */
.data-table td:first-child,
.data-table th:first-child {
    text-align: left;
}

/* Compact table — tighter padding to fit more columns without horizontal scroll */
.compact-table {
    font-size: 13px;
}
.compact-table th,
.compact-table td {
    padding: 8px 8px;
}

/* Creatives table — expandable rows */
.creatives-table .campaign-row {
    font-weight: 600;
    cursor: pointer;
    background: #fff;
}

.creatives-table .campaign-row:hover {
    background: #f0f4f8;
}

.creatives-table .banner-row {
    background: #fafafa;
}

.creatives-table .banner-row td:first-child {
    padding-left: 32px;
}

.expand-icon {
    display: inline-block;
    width: 16px;
    transition: transform 0.2s;
    color: #999;
}

.badge {
    display: inline-block;
    background: #e0e0e0;
    color: #666;
    font-size: 11px;
    font-weight: normal;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.badge-success-good {
    background: #27ae60;
    color: #fff;
}

.badge-success-mid {
    background: #f39c12;
    color: #fff;
}

.badge-success-low {
    background: #e74c3c;
    color: #fff;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #e0e0e0;
    color: #333;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.btn:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

/* Forms */
.form-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-inline label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.form-inline input[type="text"],
.form-inline input[type="number"],
.form-inline input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Utility Classes */
.text-muted {
    color: #999;
}

.text-success {
    color: #27ae60;
}

.text-danger {
    color: #e74c3c;
}

.indent {
    color: #666;
}

/* Sync status */
#sync-status {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

/* Headings */
h2 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 24px 0 16px;
}

h2:first-of-type {
    margin-top: 0;
}

/* === Report Highlighting === */

/* Good DRR row (< 30%) */
.row-good-drr {
    background: #d9ead3 !important;
}

/* Inefficient ad (active + spent>4500 + 0 orders) */
.row-inefficient {
    background: #f4cccc !important;
}

/* Total / summary row */
.row-total {
    font-weight: 700;
    background: #e8eaf6 !important;
    border-top: 2px solid #999;
}

.row-total td {
    border-bottom: 2px solid #999;
}

/* Unattributed leads row */
.row-unattributed {
    background: #fce4d6 !important;
    font-style: italic;
}

/* Old campaign status row colors — replaced by badges */
/* .status-active { background: #b6d7a8 !important; } */
/* .status-blocked { background: #fff2cc !important; } */

/* Campaign/banner status badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge-blocked {
    background: #ffebee;
    color: #d32f2f;
}

/* Status icons — inline SVG (uxwing) */
.status-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    vertical-align: -2px;
    margin-right: 3px;
}

/* Legacy pause-icon compat */
.pause-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    vertical-align: -1px;
    margin-right: 3px;
}

.status-badge-deleted {
    background: #f5f5f5;
    color: #757575;
}

.status-badge-other {
    background: #f5f5f5;
    color: #666;
}

/* Budget: CBO indicator */
.badge-cbo {
    display: inline-block;
    background: #3498db;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

.badge-abo {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* Group-level row in creatives */
.group-row {
    background: #f0f4f8 !important;
    font-weight: 500;
}

.group-row td:first-child {
    padding-left: 24px;
}

.banner-row td:first-child {
    padding-left: 48px;
}

/* Adaptive table font sizing */
@media (max-width: 1400px) {
    .data-table {
        font-size: 13px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 1200px) {
    .data-table {
        font-size: 12px;
    }
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 1024px) {
    .data-table {
        font-size: 11px;
    }
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

@media (max-width: 768px) {
    .data-table {
        font-size: 10px;
    }
    .data-table th,
    .data-table td {
        padding: 4px 6px;
    }
}

/* User info in header */
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
}
.user-name {
    color: rgba(255, 255, 255, 0.5);
}
.logout-link {
    color: #ef4444;
    text-decoration: none;
    font-size: 10px;
}
.logout-link:hover {
    text-decoration: underline;
}

/* Account switcher (custom dropdown) */
.account-switcher {
    position: relative;
}
.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}
.account-trigger:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
}
.account-trigger.open {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
}
.account-trigger-text {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.account-trigger-arrow {
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.account-trigger.open .account-trigger-arrow {
    transform: rotate(180deg);
}
.account-popup {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    min-width: 240px;
    max-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    color: #1a1a1a;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
    display: none;
}
.account-popup.show {
    display: block;
    animation: fadeIn 0.15s ease-out;
}
.account-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1a1a1a;
    text-align: left;
    font-family: inherit;
    transition: background 0.1s;
}
.account-option:hover {
    background: #f1f5f9;
}
.account-option.active {
    color: #2563eb;
    font-weight: 500;
}
.account-option-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-option-check {
    color: #2563eb;
    flex-shrink: 0;
    opacity: 0;
}
.account-option.active .account-option-check {
    opacity: 1;
}
.account-option-sep {
    height: 1px;
    margin: 6px 8px;
    background: #e5e7eb;
}

/* Left-align text columns (campaign names, group names) */
.data-table th.col-left,
.data-table td.col-text {
    text-align: left !important;
}

/* Center-align columns («ДРР за все время» on budget.php) */
.data-table th.col-center,
.data-table td.col-center {
    text-align: center !important;
}

/* DRR-based campaign row highlighting */
.row-drr-good {
    background: #e8f5e9 !important;
}
.row-drr-good:hover {
    background: #c8e6c9 !important;
}
.row-drr-bad {
    background: #ffebee !important;
}
.row-drr-bad:hover {
    background: #ffcdd2 !important;
}

/* Copyable group name */
.copyable-group {
    cursor: pointer;
    position: relative;
    border-bottom: 1px dashed #999;
    transition: color 0.2s;
}
.copyable-group:hover {
    color: #3498db;
}
.copy-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   Drill page tabs & links
   ========================= */
.drill-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
    margin-top: 16px;
}
.drill-tab {
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.drill-tab:hover {
    color: #1e293b;
}
.drill-tab.active {
    color: #1e293b;
    border-bottom-color: #1e293b;
    font-weight: 600;
}

/* Drill search input */
.drill-search-wrap {
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
}
.drill-search-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
}
.drill-search-input {
    padding: 8px 12px 8px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    width: 250px;
    background: #f1f5f9;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.drill-search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    background: #fff;
}
.drill-search-input::placeholder {
    color: #94a3b8;
}
/* Copyable ID cell */
.copyable-id {
    cursor: pointer;
    border-bottom: 1px dashed #999;
    transition: color 0.2s;
    white-space: nowrap;
}
.copyable-id:hover {
    color: #3498db;
}
.copyable-id.copied {
    color: #999;
    border-bottom-color: #ccc;
}
.copyable-id.copied::after {
    content: ' ✓';
    color: #27ae60;
    font-size: 0.85em;
}
.ag-id-badge {
    font-size: 0.75em;
    color: #8899aa;
    background: #f0f2f5;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    border-bottom: 1px dashed #bbb;
    vertical-align: middle;
}
.ag-id-badge:hover {
    color: #3498db;
    background: #e8f0fe;
}
.ag-id-badge.copied {
    color: #999;
    background: #f5f5f5;
    border-bottom-color: #ccc;
}
.btn-reset-copied {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #999;
    font-size: 0.75rem;
    padding: 2px 8px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
}
.btn-reset-copied:hover {
    border-color: #999;
    color: #666;
}

/* Parent name subtitle in "all groups"/"all banners" views */
.drill-parent-name {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.3;
}

/* Drill links: no underline, no visited purple */
.drill-link {
    color: #2563eb;
    text-decoration: none;
}
.drill-link:visited {
    color: #2563eb;
}
.drill-link:hover {
    color: #1d4ed8;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 12px;
    font-size: 13px;
    color: #64748b;
}
.breadcrumb-link {
    color: #2563eb;
    text-decoration: none;
}
.breadcrumb-link:visited {
    color: #2563eb;
}
.breadcrumb-link:hover {
    text-decoration: underline;
}
.breadcrumb-sep {
    margin: 0 4px;
    color: #94a3b8;
}
.breadcrumb-current {
    color: #1e293b;
    font-weight: 500;
}

/* Table sort indicators */
.data-table th.sort-asc::after,
.data-table th.sort-desc::after {
    margin-left: 4px;
    font-size: 10px;
}
.data-table th.sort-asc::after {
    content: '▲';
}
.data-table th.sort-desc::after {
    content: '▼';
}
.data-table thead th {
    cursor: pointer;
    user-select: none;
}
.data-table thead th:hover {
    background: rgba(0,0,0,0.05);
}

/* =========================
   Preset Bar
   ========================= */
.preset-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.preset-categories-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    min-width: 0;
}

.preset-category {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preset-category-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.preset-category-red .preset-category-label {
    color: #dc2626;
}
.preset-category-green .preset-category-label {
    color: #16a34a;
}
.preset-category-diag .preset-category-label {
    color: #6366f1;
}

.preset-buttons {
    display: flex;
    gap: 4px;
}

.preset-btn-filter {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.preset-btn-filter:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

/* Active states per category */
.preset-category-red .preset-btn-filter.active {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
    font-weight: 600;
}
.preset-category-green .preset-btn-filter.active {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #16a34a;
    font-weight: 600;
}
.preset-category-diag .preset-btn-filter.active {
    background: #eef2ff;
    border-color: #6366f1;
    color: #6366f1;
    font-weight: 600;
}

/* Preset controls (thresholds + reset) */
.preset-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}


.preset-threshold {
    display: flex;
    align-items: center;
    gap: 4px;
}

.preset-threshold-label {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.preset-threshold-input {
    width: 80px;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    background: #fff;
}

.preset-threshold-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.preset-threshold-unit {
    font-size: 12px;
    color: #94a3b8;
}

.preset-default-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
}

.preset-default-btn:hover {
    background: #f1f5f9;
}

.preset-reset-btn {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #ef4444;
    border-radius: 4px;
    background: #fff;
    color: #ef4444;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.preset-reset-btn:hover {
    background: #fef2f2;
}

/* ===== Custom filter ("Свой фильтр") ===== */
.cf-bar {
    margin-bottom: 16px;
}

.cf-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cf-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.cf-toggle svg {
    color: #64748b;
}

.cf-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #3b82f6;
    border-radius: 9px;
}

.cf-chevron {
    transition: transform 0.2s;
}
.cf-toggle[aria-expanded="true"] .cf-chevron {
    transform: rotate(180deg);
}

.cf-panel {
    margin-top: 8px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cf-panel[hidden] {
    display: none;
}

.cf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px 20px;
}

.cf-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cf-field-label {
    font-size: 12px;
    color: #64748b;
    min-width: 62px;
}

.cf-input {
    width: 84px;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
    background: #fff;
}
.cf-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
/* Hide native number spinners for a cleaner look */
.cf-input::-webkit-outer-spin-button,
.cf-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.cf-input {
    -moz-appearance: textfield;
}

.cf-dash {
    color: #94a3b8;
    font-size: 13px;
}

.cf-unit {
    font-size: 12px;
    color: #94a3b8;
    min-width: 26px;
}

.cf-statuses {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding-top: 4px;
    border-top: 1px solid #e2e8f0;
}

.cf-status-opt {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}
.cf-status-opt input {
    cursor: pointer;
}

.cf-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cf-apply {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    cursor: pointer;
}
.cf-apply:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.cf-reset {
    padding: 6px 14px;
    font-size: 13px;
    color: #ef4444;
    background: #fff;
    border: 1px solid #ef4444;
    border-radius: 6px;
    cursor: pointer;
}
.cf-reset:hover {
    background: #fef2f2;
}
.cf-reset[hidden] {
    display: none;
}

/* Summary cards */
.summary-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.metric-card {
    flex: 1;
    min-width: 110px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
}

.metric-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.metric-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.metric-card.card-good {
    border-color: #16a34a;
    background: #f0fdf4;
}

.metric-card.card-bad {
    border-color: #dc2626;
    background: #fef2f2;
}

.metric-card.card-warn {
    border-color: #d97706;
    background: #fffbeb;
}

.metric-card.card-muted {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* =========================
   Creators Page
   ========================= */

/* Creator row — expandable */
.creators-table .creator-row {
    font-weight: 600;
    cursor: pointer;
    background: #fff;
}

.creators-table .creator-row:hover {
    background: #f0f4f8;
}

/* Creative detail row (child of creator) */
.creative-row {
    background: #fafafa;
}

.creative-row td:first-child {
    padding-left: 32px;
}

/* Group detail row (grandchild of creator, child of creative) */
.group-detail-row {
    background: #f0f0f0;
}

.group-detail-row td:first-child {
    padding-left: 56px;
}

/* Group link to VK Ads */
.group-vk-link {
    color: #2563eb;
    text-decoration: none;
}
.group-vk-link:visited {
    color: #2563eb;
}
.group-vk-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Payment cell — green, bold */
.payment-cell {
    color: #16a34a;
    font-weight: 700;
}

/* Payment metric card */
.metric-card.card-payment {
    border-color: #16a34a;
    background: #f0fdf4;
}

/* Info badge "Данные по всем аккаунтам" */
.info-badge {
    display: inline-block;
    padding: 6px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* =========================
   Dynamics Drawer
   ========================= */

/* Chart icon button on campaign/group rows */
.dynamics-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    vertical-align: middle;
    transition: background 0.15s, color 0.15s;
}
.dynamics-btn:hover {
    background: #3498db;
    color: #fff;
}

/* Overlay */
.dynamics-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2000;
}
.dynamics-overlay.open {
    display: block;
}

/* Drawer panel */
.dynamics-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 85vw;
    max-width: 1500px;
    height: 100vh;
    background: #fff;
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}
.dynamics-drawer.open {
    transform: translateX(0);
}

.dynamics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.dynamics-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}
.dynamics-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}
.dynamics-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.dynamics-close:hover {
    background: #f1f5f9;
}

.dynamics-controls {
    display: flex;
    gap: 4px;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.dynamics-group-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}
.dynamics-group-btn:hover {
    background: #f0f0f0;
}
.dynamics-group-btn.active {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.dynamics-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.dynamics-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}
.dynamics-error {
    text-align: center;
    padding: 40px;
    color: #dc2626;
    font-size: 14px;
}

.dynamics-table-wrap {
    overflow-x: auto;
}
.dynamics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.dynamics-table th,
.dynamics-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}
.dynamics-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}
.dynamics-table tbody tr:hover {
    background: #f8f9fa;
}
.dynamics-table .row-total {
    font-weight: 700;
    background: #e8eaf6 !important;
}
.dynamics-table .row-total td {
    border-top: 2px solid #999;
    border-bottom: 2px solid #999;
}

@media (max-width: 768px) {
    .dynamics-drawer {
        width: 100vw;
        max-width: none;
    }
}

/* Discrepancy page */
.discrepancy-link {
    padding: 10px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    margin-left: auto;
    white-space: nowrap;
}
.discrepancy-link:hover {
    background: #f0f0f0;
}
.disc-good { color: #27ae60; font-weight: 600; }
.disc-warn { color: #f39c12; font-weight: 600; }
.disc-bad  { color: #e74c3c; font-weight: 600; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 16px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    margin-top: 16px;
}

/* ====== Drill page: single table with sticky columns ====== */

/* Viewport: scrolls both X and Y */
.vscroll-viewport {
    max-height: calc(100vh - 320px);
    overflow: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #fff;
}

/* Drill table base */
.drill-table {
    border-collapse: separate;
    border-spacing: 0;
    --col0-width: 200px;
    --col1-width: 90px;
    --col2-width: 110px;
    --col1-left: 200px;
    --col2-left: 290px;
}

/* Explicit row background for sticky inherit */
.drill-table tbody tr {
    background: #fff;
}

/* Sticky columns: Название, ID, Статус */
.drill-table .sticky-col {
    position: sticky;
    z-index: 2;
    background: inherit;
}
.drill-table .sticky-col-0 {
    left: 0;
    width: var(--col0-width);
    min-width: 120px;
    max-width: 400px;
}
.drill-table .sticky-col-1 {
    left: var(--col1-left);
    width: var(--col1-width);
    min-width: 60px;
}
.drill-table .sticky-col-2 {
    left: var(--col2-left);
    width: var(--col2-width);
    min-width: 80px;
}

/* Shadow on last sticky column */
.drill-table .sticky-col-2::after {
    content: '';
    position: absolute;
    top: 0; right: -6px; bottom: 0;
    width: 6px;
    background: linear-gradient(to right, rgba(0,0,0,0.06), transparent);
    pointer-events: none;
}

/* Z-index layering: 5=thead corner, 4=thead+total corner, 3=total cells, 2=data sticky */
.drill-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
}
.drill-table thead th.sticky-col { z-index: 5; }

/* ИТОГО row: sticky below header, top set by JS */
.drill-table .row-total td {
    position: sticky;
    z-index: 3;
    background: inherit;
}
.drill-table .row-total td.sticky-col { z-index: 4; }

/* DRR row coloring */
.drill-table tbody tr.row-drr-good { background: #e8f5e9; }
.drill-table tbody tr.row-drr-bad { background: #ffebee; }
.drill-table tbody tr:hover { background: #f8f9fa; }
.drill-table tbody tr.row-drr-good:hover { background: #c8e6c9 !important; }
.drill-table tbody tr.row-drr-bad:hover { background: #ffcdd2 !important; }

/* Explicit hover fallback for sticky cells in Chromium */
.drill-table tbody tr:hover > .sticky-col { background: #f8f9fa; }
.drill-table tbody tr.row-drr-good:hover > .sticky-col { background: #c8e6c9; }
.drill-table tbody tr.row-drr-bad:hover > .sticky-col { background: #ffcdd2; }

/* Cell overflow */
.drill-table td,
.drill-table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Название column: allow wrap for drill-parent-name */
.drill-table .sticky-col-0 {
    white-space: normal;
    overflow: visible;
}

/* Virtual scroll: fixed row height for banners */
.drill-table.vscroll-active tbody tr:not(.row-total):not(.vscroll-spacer) {
    height: 40px;
}
.drill-table.vscroll-active tbody td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* drill-parent-name in vscroll: truncate */
.drill-table.vscroll-active .drill-parent-name {
    font-size: 11px;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 14px;
    line-height: 14px;
}

/* First column in vscroll: two lines (name + parent) */
.drill-table.vscroll-active .sticky-col-0 {
    white-space: normal;
    line-height: 1.2;
    padding-top: 4px;
    padding-bottom: 4px;
}

.vscroll-spacer td {
    padding: 0 !important;
    border: none !important;
    line-height: 0;
}


/* drill2 wrapper: no max-height, page scrolls naturally */
.drill2-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    background: #fff;
}

/* drill2 table: compact sizing without zoom */
.drill2-table {
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 0;
}
.drill2-table th,
.drill2-table td {
    padding: 6px 10px;
}

/* Название column: limited width, ellipsis */
.drill2-table td:first-child {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Allow wrap for drill-parent-name inside Название */
.drill2-table td:first-child .drill-parent-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* thead sticky at top */
.drill2-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f8f9fa;
}

/* ИТОГО row sticky below header */
.drill2-table .row-total td {
    position: sticky;
    z-index: 2;
    background: #e8eaf6;
}

/* DRR row coloring */
.drill2-table tbody tr.row-drr-good { background: #e8f5e9; }
.drill2-table tbody tr.row-drr-bad { background: #ffebee; }
.drill2-table tbody tr:hover { background: #f8f9fa; }
.drill2-table tbody tr.row-drr-good:hover { background: #c8e6c9 !important; }
.drill2-table tbody tr.row-drr-bad:hover { background: #ffcdd2 !important; }

/* Explicit row background for non-DRR rows */
.drill2-table tbody tr { background: #fff; }
.drill2-table tbody tr.row-total { background: #e8eaf6; }

/* Info tooltips (? icon with hover popup) — usable in any context */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    border-radius: 50%;
    background: #b0b8c1;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    vertical-align: middle;
    position: relative;
    line-height: 1;
    text-transform: none;
}
.info-tip:hover { background: #6c757d; }
.info-tip-popup {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    background: #fff;
    color: #212529;
    text-align: left;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.45;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e0e3e7;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    width: 260px;
    z-index: 100;
    white-space: normal;
    letter-spacing: normal;
}
.info-tip:hover .info-tip-popup { display: block; }
.info-tip-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1a1a1a;
}
.info-tip-popup::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 1px;
    left: auto;
    border: 6px solid transparent;
    border-bottom-color: #fff;
}

/* =========================
   Group management (stop/start)
   ========================= */
.group-select-cb {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin: 0 4px 0 0;
    cursor: pointer;
    accent-color: #2563eb;
    align-self: center;
}
.gm-selall {
    display: inline-flex;
    align-items: center;
    margin-right: 7px;
    cursor: pointer;
}
.gm-selall input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #2563eb;
}

.group-action-bar {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1f2937;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
    z-index: 9998;
    font-size: 14px;
    max-width: calc(100vw - 32px);
    flex-wrap: wrap;
}
.group-action-bar[hidden] { display: none; }
.group-action-bar .gm-info { margin-right: 4px; white-space: nowrap; }
.group-action-bar .gm-info b { font-size: 15px; }
.group-action-bar .gm-budget { color: #cbd5e1; }

.gm-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    transition: filter 0.15s, opacity 0.15s;
}
.gm-btn:hover { filter: brightness(1.08); }
.gm-btn:disabled { opacity: 0.55; cursor: default; filter: none; }
.gm-btn-stop  { background: #dc2626; }
.gm-btn-start { background: #16a34a; }
.gm-btn-clear { background: transparent; color: #cbd5e1; padding: 8px 8px; font-weight: 500; }
.gm-btn-clear:hover { color: #fff; filter: none; }

.gm-toast {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translateX(-50%) translateY(10px);
    background: #111827;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.gm-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Inline daily-budget editing (budget.php + drill.php groups).
   VK Ads style: the number itself is the click target — blue with a dashed
   underline so users see it's editable (no pencil icon). */
.budget-cell .budget-display {
    color: #2563eb;
    cursor: pointer;
    border-bottom: 1px dashed rgba(37, 99, 235, 0.45);
    padding-bottom: 1px;
}
.budget-cell .budget-display:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
    border-bottom-style: solid;
}
.budget-edit-wrap { display: inline-flex; align-items: center; gap: 4px; }
.budget-input {
    width: 84px;
    padding: 2px 5px;
    border: 1px solid #2563eb;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}
.budget-save, .budget-cancel {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 7px;
    line-height: 1.1;
    color: #fff;
}
.budget-save { background: #16a34a; }
.budget-cancel { background: #94a3b8; }
.budget-save:disabled, .budget-cancel:disabled, .budget-input:disabled { opacity: 0.6; cursor: default; }

