/* Управление рекламой WB — стили раздела (префикс am-, не влияют на другие вкладки) */

#advMgmtRoot,
.am-modal-root {
    --am-border: #e5e7eb;
    --am-muted: #374151;
    --am-bg-soft: #f9fafb;
    --am-primary: #4f46e5;
    --am-primary-dark: #4338ca;
    --am-green: #059669;
    --am-red: #dc2626;
    --am-amber: #b45309;
    color: #000;
    font-size: 13px;
}

/* Глобальные стили страницы (тёмная тема: td/th светлым цветом, тёмный hover) не должны
   влиять на раздел — весь текст и цифры здесь чёрные */
#advMgmtRoot table td,
#advMgmtRoot table th,
#advMgmtRoot table td:first-child,
#advMgmtRoot .am-num,
#advMgmtRoot .am-link,
#advMgmtRoot .am-kpi-value,
#advMgmtRoot .am-title,
#advMgmtRoot .am-panel-title,
#advMgmtRoot select,
#advMgmtRoot input,
#advMgmtRoot option,
#advMgmtRoot label,
.am-modal-root table td,
.am-modal-root table th,
.am-modal-root table td:first-child,
.am-modal-root .am-num,
.am-modal-root .am-link,
.am-modal-root .am-kpi-value,
.am-modal-root .am-title,
.am-modal-root .am-panel-title,
.am-modal-root select,
.am-modal-root input,
.am-modal-root option,
.am-modal-root label {
    color: #000;
}
#advMgmtRoot table td,
#advMgmtRoot table th,
.am-modal-root table td,
.am-modal-root table th {
    font-size: 12.5px;
    text-transform: none;
    letter-spacing: normal;
}
#advMgmtRoot table th,
.am-modal-root table th { font-weight: 700; }
#advMgmtRoot tbody tr:hover td,
.am-modal-root tbody tr:hover td { box-shadow: none; background: #f8f9ff; }
#advMgmtRoot tbody tr.am-child:hover td,
.am-modal-root tbody tr.am-child:hover td { background: #f1f3fb; }
#advMgmtRoot tbody tr.am-total:hover td,
.am-modal-root tbody tr.am-total:hover td { background: #f3f4f6; }

.am-card {
    background: #fff;
    border: 1px solid var(--am-border);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ---------- header ---------- */
.am-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.am-title { margin: 0; font-size: 20px; font-weight: 700; }
.am-title i { color: var(--am-primary); margin-right: 4px; }
.am-subtitle { color: var(--am-muted); font-size: 12px; margin-top: 2px; }
.am-controls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.am-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--am-muted); }
.am-field select,
.am-filters select,
.am-custom input,
.am-chart-controls select {
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 8px;
    background: #fff;
    font-size: 13px;
    color: #111827;
}
.am-custom { align-items: center; gap: 6px; }

/* ---------- buttons ---------- */
.am-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.am-btn:disabled { opacity: 0.6; cursor: default; }
.am-btn-primary { background: var(--am-primary); color: #fff; }
.am-btn-primary:hover:not(:disabled) { background: var(--am-primary-dark); }
.am-btn-light { background: #fff; color: #374151; border-color: #d1d5db; }
.am-btn-light:hover:not(:disabled) { background: #f3f4f6; }
.am-btn-dyn { background: #eef2ff; color: var(--am-primary); border-color: #c7d2fe; height: 26px; padding: 0 8px; font-size: 12px; }
.am-btn-dyn:hover { background: #e0e7ff; }
.am-btn-head-dyn { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.am-btn-sm { height: 24px; font-size: 12px; padding: 0 8px; }

/* ---------- sync bar ---------- */
.am-syncbar {
    background: var(--am-bg-soft);
    border: 1px solid var(--am-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #374151;
    margin-bottom: 12px;
}
.am-dot { margin: 0 8px; color: #9ca3af; }
.am-sync-status { margin-top: 6px; }
.am-sync-run { color: var(--am-primary); display: inline-flex; align-items: center; gap: 6px; }
.am-sync-err { color: var(--am-red); }
.am-sync-warn { color: var(--am-amber); }
.am-hint { color: var(--am-muted); font-size: 11px; margin-top: 4px; }

/* ---------- KPI ---------- */
.am-summary {
    display: grid;
    grid-template-columns: repeat(8, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.am-panel-summary { margin-bottom: 12px; }
@media (max-width: 1400px) { .am-summary { grid-template-columns: repeat(4, minmax(140px, 1fr)); } }
@media (max-width: 700px) { .am-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); } }
.am-kpi {
    border: 1px solid var(--am-border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    min-width: 0;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.am-kpi-click { cursor: pointer; }
.am-kpi-click:hover {
    border-color: #a5b4fc;
    background: #fafaff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.08);
}
.am-kpi-active {
    border-color: var(--am-primary);
    background: #eef2ff !important;
    box-shadow: 0 0 0 1px var(--am-primary);
}
.am-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.am-kpi-label { font-size: 11px; color: var(--am-muted); margin: 0; }
.am-kpi-ic { font-size: 11px; color: #9ca3af; transition: color 0.15s; }
.am-kpi-click:hover .am-kpi-ic,
.am-kpi-active .am-kpi-ic { color: var(--am-primary); }
.am-kpi-value { font-size: 18px; font-weight: 700; white-space: nowrap; color: #000; }
.am-kpi-delta {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.am-kpi-prev { font-weight: 400; color: var(--am-muted); }
.am-delta-neutral { color: #1f2937; }
.am-delta-flat { color: var(--am-muted); font-weight: 500; }
.am-kpi-sub { font-size: 11px; color: var(--am-muted); margin-top: 2px; }
.am-kpi-warn {
    font-size: 11px;
    color: var(--am-amber);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- filters ---------- */
.am-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.am-search { position: relative; flex: 1 1 280px; max-width: 420px; }
.am-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 12px; }
.am-search input {
    width: 100%;
    height: 32px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 10px 0 30px;
    font-size: 13px;
    box-sizing: border-box;
}
.am-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #374151; cursor: pointer; }
.am-count { margin-left: auto; font-size: 12px; color: var(--am-muted); }

/* ---------- table ---------- */
.am-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 300px);
    min-height: 200px;
    border: 1px solid var(--am-border);
    border-radius: 8px;
    position: relative;
}
.am-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 12.5px; }
.am-table th,
.am-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f2f4;
    white-space: nowrap;
    background: #fff;
}
.am-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f3f4f6;
    font-weight: 600;
    font-size: 11.5px;
    color: #374151;
    text-align: right;
    border-bottom: 1px solid #d1d5db;
}
.am-table thead th.am-col-name { text-align: left; }
.am-sortable { cursor: pointer; user-select: none; }
.am-sortable:hover { background: #e5e7eb !important; }
.am-sortable i { font-size: 10px; color: var(--am-primary); }
.am-num { text-align: right; font-variant-numeric: tabular-nums; }

.am-sticky { position: sticky; left: 0; z-index: 1; }
.am-table thead th.am-sticky { z-index: 3; }
.am-col-name { min-width: 300px; max-width: 380px; box-shadow: 1px 0 0 var(--am-border); }
.am-col-act { text-align: center; }

.am-camp { cursor: pointer; }
.am-camp:hover td { background: #f8f9ff; }
.am-camp.am-open td { background: #eef2ff; }
.am-name-wrap { display: flex; align-items: flex-start; gap: 8px; white-space: normal; }
.am-name-text { min-width: 0; }
.am-chev { color: #9ca3af; font-size: 10px; margin-top: 4px; transition: transform 0.15s; }
.am-open .am-chev { transform: rotate(90deg); color: var(--am-primary); }
.am-link { color: #1f2937; font-weight: 600; cursor: pointer; text-decoration: none; word-break: break-word; }
.am-link:hover { color: var(--am-primary); text-decoration: underline; }
.am-meta { font-size: 11px; color: var(--am-muted); margin-top: 2px; }
.am-art {
    display: inline-block;
    font-size: 10.5px;
    color: #4b5563;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 0 5px;
    margin-left: 4px;
}
.am-warn-ic { color: var(--am-amber); font-size: 11px; }

/* children */
.am-child td { background: #fbfbfd; font-size: 12px; }
.am-child td.am-col-name { padding-left: 34px; }
.am-child-head td { background: #f5f6fa; font-weight: 600; color: #374151; font-size: 11.5px; }
.am-child-head i { color: var(--am-primary); margin-right: 4px; }
.am-child-note { font-weight: 400; color: var(--am-muted); text-align: left; white-space: normal; }
.am-child-info td { color: var(--am-muted); }
.am-child-name { display: flex; align-items: baseline; gap: 4px; white-space: normal; }
.am-child-name .am-link { font-weight: 500; }
.am-prod-name { font-size: 11px; color: var(--am-muted); }
.am-tag { display: inline-block; font-size: 10px; padding: 0 5px; border-radius: 4px; background: #f3f4f6; color: #6b7280; white-space: nowrap; }
.am-tag-adv { background: #e0e7ff; color: #3730a3; }
.am-more-row td { text-align: center; padding: 10px; }

/* badges */
.am-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.am-st-active { background: #d1fae5; color: #065f46; }
.am-st-paused { background: #fef3c7; color: #92400e; }
.am-st-done { background: #e5e7eb; color: #4b5563; }
.am-st-other { background: #e0e7ff; color: #3730a3; }

.am-pos { color: var(--am-green); font-weight: 600; }
.am-neg { color: var(--am-red); font-weight: 600; }
.am-na { color: #4b5563; }

/* states */
.am-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--am-muted);
    text-align: center;
}
.am-state > i { font-size: 28px; color: #9ca3af; }
.am-state-err, .am-state-err > i { color: var(--am-red); }
.am-loading-strip {
    position: sticky;
    left: 0;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #eef2ff;
    color: var(--am-primary);
    font-size: 12px;
}

/* spinner */
.am-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #c7d2fe;
    border-top-color: var(--am-primary);
    border-radius: 50%;
    animation: am-spin 0.8s linear infinite;
    vertical-align: middle;
}
.am-spinner-light { border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff; }
.am-spinner-big { width: 28px; height: 28px; border-width: 3px; }
@keyframes am-spin { to { transform: rotate(360deg); } }

/* ---------- dynamics panel ---------- */
body.am-no-scroll { overflow: hidden; }
.am-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    z-index: 100200;
    justify-content: flex-end;
}
.am-panel {
    width: min(1400px, 95vw);
    height: 100%;
    background: #fff;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    padding: 18px 22px 28px;
    box-sizing: border-box;
    animation: am-slide 0.18s ease-out;
    color: #111827;
    font-size: 13px;
}
@keyframes am-slide { from { transform: translateX(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.am-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.am-panel-level { font-size: 11px; color: var(--am-primary); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.am-panel-title { margin: 4px 0; font-size: 18px; font-weight: 700; word-break: break-word; }
.am-panel-meta { font-size: 12px; color: var(--am-muted); }
.am-close {
    border: none;
    background: #f3f4f6;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #374151;
    flex-shrink: 0;
}
.am-close:hover { background: #e5e7eb; }

.am-chart-box { border: 1px solid var(--am-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.am-chart-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 6px; }
.am-chart-controls .am-hint { margin: 0 0 0 auto; }
.am-chart-canvas { position: relative; height: 240px; }

.am-dyn-wrap { overflow: auto; max-height: 60vh; border: 1px solid var(--am-border); border-radius: 8px; }
.am-dyn thead tr:first-child th { top: 0; }
.am-dyn thead tr:nth-child(2) th { top: 30px; }
.am-dyn thead th.am-group {
    text-align: center;
    background: #e5e7eb;
    height: 30px;
    box-sizing: border-box;
    border-left: 1px solid #d1d5db;
}
.am-dyn thead th.am-th2 { white-space: normal; min-width: 78px; max-width: 120px; vertical-align: bottom; }
.am-dyn-date { min-width: 90px; text-align: left !important; font-weight: 600; box-shadow: 1px 0 0 var(--am-border); }
.am-dyn thead th.am-dyn-date { z-index: 3; vertical-align: middle; }
.am-row-nodata td { color: #9ca3af; background: #fafafa; }
.am-total td { font-weight: 700; background: #f3f4f6; border-top: 2px solid #d1d5db; }
.am-partial-note { padding: 8px 12px; font-size: 12px; color: var(--am-amber); }
.am-notes { margin: 12px 0 0; padding-left: 18px; color: var(--am-muted); font-size: 12px; }
.am-notes li { margin-bottom: 3px; }

/* ---------- clusters main table & inline bid editor ---------- */
.am-col-cluster { min-width: 260px; max-width: 340px; text-align: left !important; box-shadow: 1px 0 0 var(--am-border); }
.am-col-camp { min-width: 220px; max-width: 300px; text-align: left !important; }
.am-col-seller { min-width: 150px; max-width: 220px; text-align: left !important; }
.am-table td.am-cell-left, .am-table th.am-cell-left { text-align: left !important; }
.am-camp-link {
    color: #1e293b !important;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.am-camp-link:hover { color: var(--am-primary) !important; text-decoration: underline; }
.am-camp-link i { font-size: 11px; color: var(--am-primary); }
.am-seller-code { font-weight: 700; color: #000; font-size: 12.5px; }
.am-sub { font-size: 11px; color: #4b5563; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.am-bid-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}
.am-bid-input {
    width: 72px;
    height: 27px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
    color: #000 !important;
    background: #fff;
    font-variant-numeric: tabular-nums;
}
.am-bid-input:focus {
    outline: none;
    border-color: var(--am-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}
.am-bid-btn {
    height: 27px;
    min-width: 27px;
    padding: 0 6px;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: var(--am-primary) !important;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.am-bid-btn:hover:not(:disabled) { background: #e0e7ff; }
.am-bid-reset {
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #6b7280 !important;
}
.am-bid-reset:hover:not(:disabled) { background: #fee2e2; border-color: #fca5a5; color: #dc2626 !important; }
.am-bid-tag {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    text-align: right;
}
.am-bid-tag-custom { color: #4338ca; font-weight: 600; }
.am-bid-tag-base { color: #6b7280; }
.am-bid-saved { border-color: #10b981 !important; background: #ecfdf5 !important; }
.am-bid-pct-row {
    display: inline-flex;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 3px;
}
.am-bid-pct {
    height: 19px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    color: #000 !important;
    font-variant-numeric: tabular-nums;
}
.am-bid-pct:disabled { opacity: 0.5; cursor: not-allowed; }
.am-bid-pct-minus {
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.am-bid-pct-minus:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
}
.am-bid-pct-plus {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}
.am-bid-pct-plus:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.am-bid-row-compact {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2.5px;
    white-space: nowrap;
}
.am-bid-row-compact .am-bid-input {
    width: 58px;
    height: 24px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: #000 !important;
    background: #fff;
    font-variant-numeric: tabular-nums;
}
.am-bid-row-compact .am-bid-input:focus {
    outline: none;
    border-color: var(--am-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}
.am-bid-row-compact .am-bid-pct {
    height: 22px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 20px;
    cursor: pointer;
    color: #000 !important;
    font-variant-numeric: tabular-nums;
}

.am-col-stacked {
    padding: 3px 8px !important;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
}
.am-stacked-views {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.15;
    color: #101828;
    font-variant-numeric: tabular-nums;
}
.am-stacked-ctr {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    color: #475467;
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}
.am-stacked-clicks {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    color: #98a2b3;
    margin-top: 1px;
    font-variant-numeric: tabular-nums;
}

.am-pos-compact {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    white-space: nowrap;
    font-size: 12.5px;
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.am-pos-compact .am-pos-prev { color: #101828; }
.am-pos-compact .am-pos-today { font-weight: 700; color: #475467; }
.am-pos-compact .am-pos-today.am-pos { color: #12b76a !important; font-weight: 700; }
.am-pos-compact .am-pos-today.am-neg { color: #f04438 !important; font-weight: 700; }
.am-pos-compact .am-pos-today.am-pos-muted { color: #98a2b3; font-weight: 400; }

.am-pos-pair {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 13px;
    white-space: nowrap;
}
.am-pos-prev { color: #000; font-weight: 600; }
.am-pos-arrow { color: #6b7280; font-size: 11px; }
.am-pos-today { font-weight: 800; color: #000; }
.am-pos-today.am-pos { color: #16a34a !important; }
.am-pos-today.am-neg { color: #dc2626 !important; }

.am-roi-val { font-size: 13px; font-weight: 700; }
.am-roi-sub { font-size: 10.5px; color: #4b5563; margin-top: 1px; }

/* ---------- campaign info panel ---------- */
.am-cinfo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.am-cinfo-box {
    border: 1px solid var(--am-border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}
.am-cinfo-box h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.am-cinfo-box h4 i { color: var(--am-primary); margin-right: 5px; }
.am-kv-list { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 12.5px; }
.am-kv-k { color: #4b5563; }
.am-kv-v { color: #000; font-weight: 600; text-align: right; }
.am-budget-big { font-size: 24px; font-weight: 800; color: #000; margin: 4px 0; }
.am-form-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.am-form-row input[type="number"],
.am-form-row input[type="text"],
.am-form-row select {
    height: 30px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 12.5px;
    color: #000;
    background: #fff;
}
.am-minus-area {
    width: 100%;
    min-height: 90px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    color: #000;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
}

.am-act-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.am-btn-excl {
    background: #fef2f2;
    color: #b91c1c !important;
    border-color: #fecaca;
    font-weight: 600;
}
.am-btn-excl:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
}
.am-btn-restore {
    background: #ecfdf5;
    color: #047857 !important;
    border-color: #a7f3d0;
    font-weight: 600;
}
.am-btn-restore:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #6ee7b7;
}
.am-excl-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    vertical-align: middle;
}
.am-restored-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    vertical-align: middle;
}
#advMgmtRoot tbody tr.am-row-excluded td,
.am-modal-root tbody tr.am-row-excluded td {
    background: #fffafa;
}
#advMgmtRoot tbody tr.am-row-excluded .am-link,
.am-modal-root tbody tr.am-row-excluded .am-link,
.am-link.am-link-excluded {
    color: #ef4444 !important;
    font-weight: 600;
    text-decoration: none;
}
#advMgmtRoot tbody tr.am-row-excluded .am-link:hover,
.am-modal-root tbody tr.am-row-excluded .am-link:hover,
.am-link.am-link-excluded:hover {
    color: #dc2626 !important;
    text-decoration: underline;
}

/* ---------- product advertising modal (opened from main report) ---------- */
.am-prod-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    box-sizing: border-box;
}
.am-prod-dialog {
    width: min(1760px, 98vw);
    height: min(94vh, 1080px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 20px;
    box-sizing: border-box;
    color: #000;
}
.am-prod-dialog .am-table-wrap {
    flex: 1 1 auto;
    max-height: none;
    min-height: 180px;
}
.am-prod-camps-box {
    background: #f8fafc;
    border: 1px solid #eaecf0;
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
}
.am-prod-camps-head {
    font-size: 11px;
    font-weight: 700;
    color: #475467;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.am-prod-camps-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.am-prod-camp-chip {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    padding: 6px 10px;
    min-width: 260px;
    max-width: 380px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: #000;
}
.am-prod-camp-chip:hover {
    border-color: #818cf8;
    background: #fafaff;
}
.am-prod-camp-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.am-prod-camp-stats {
    font-size: 11px;
    color: #374151;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
#amProdBody {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
#amProdBody .am-table-wrap {
    flex: 0 0 auto;
    max-height: 62vh;
    min-height: 180px;
    overflow: auto;
}
.am-prod-camps-title {
    font-size: 11px;
    font-weight: 700;
    color: #475467;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.am-prod-camps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 8px;
}
.am-prod-camps-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 6px;
}
.am-prod-camps-grid .am-prod-camp-chip {
    min-width: 0;
    max-width: none;
}
.am-prod-camp-chip.compact {
    border: 1px solid #e4e7ec;
    border-radius: 6px;
    background: #fff;
    padding: 4px 8px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
    font-size: 11.5px;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.am-prod-camp-chip.compact:hover {
    border-color: #cbd5e1;
    background: #fafaff;
}
.am-prod-camp-chip.compact.am-prod-camp-active {
    border-color: #7f56d9;
    background: #f9f5ff;
    box-shadow: 0 0 0 1px #7f56d9;
}
.am-prod-camp-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}
.am-camp-name-text {
    font-weight: 600;
    font-size: 12px;
    color: #101828;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}
.am-camp-badge-budget {
    font-size: 11px;
    color: #344054;
    background: #f2f4f7;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.am-camp-badge-budget b {
    color: #101828;
}
.am-camp-badge-roi {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.am-camp-badge-roi.am-pos {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}
.am-camp-badge-roi.am-neg {
    background: #fef3f2;
    color: #b42318;
    border: 1px solid #fecdca;
}
.am-prod-camp-active {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.18);
}
.am-prod-camp-meta {
    font-size: 11.5px;
    color: #000;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.am-prod-camp-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 0;
    flex-shrink: 0;
}
.am-btn-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    cursor: pointer;
    box-sizing: border-box;
}

/* ---------- группы кампаний в таблице кластеров ---------- */
.am-table tr.am-group-row td {
    background: #eef2ff;
    border-top: 2px solid #c7d2fe;
    border-bottom: 1px solid #c7d2fe;
    padding: 5px 10px;
    white-space: normal;
}
.am-group-inner {
    position: sticky;
    left: 10px;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    max-width: min(1100px, 92vw);
    color: #000;
    font-size: 12px;
}
.am-group-name { font-weight: 700; font-size: 13px; color: #000 !important; }
.am-group-meta { color: #000; font-size: 11.5px; }
.am-group-prod {
    font-size: 11.5px;
    color: #000;
    background: #fff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 1px 6px;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.am-group-actions { display: inline-flex; gap: 6px; }
.am-btn-xs { height: 22px; font-size: 11px; padding: 0 7px; }
.am-btn-archive { background: #fff7ed; border: 1px solid #fdba74; color: #000; }
.am-btn-archive:hover { background: #ffedd5; }

/* ---------- раскладка «таблица + реестр изменений справа» ---------- */
.am-split { display: flex; gap: 12px; align-items: flex-start; }
.am-split-main { flex: 1 1 auto; min-width: 0; }
.am-log {
    flex: 0 0 270px;
    width: 270px;
    position: sticky;
    top: 8px;
    max-height: calc(100vh - 170px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--am-border);
    border-radius: 8px;
    background: #fff;
    color: #000;
    overflow: hidden;
}
#amProdBody .am-log { max-height: 78vh; }
.am-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    background: #f3f4f6;
    border-bottom: 1px solid var(--am-border);
    font-size: 12px;
    font-weight: 700;
    color: #000;
}
.am-log-tz { font-weight: 500; font-size: 10.5px; color: #000; margin-left: 2px; }
.am-log-refresh {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #000;
    font-size: 11px;
    padding: 2px 4px;
}
.am-log-refresh:hover { color: var(--am-primary); }
.am-log-list { overflow-y: auto; flex: 1 1 auto; }
.am-log-item { padding: 4px 8px; border-bottom: 1px solid #f1f2f4; font-size: 11px; line-height: 1.3; color: #000; }
.am-log-item:hover { background: #f8fafc; }
.am-log-top { display: flex; justify-content: space-between; gap: 6px; }
.am-log-ts { font-weight: 700; color: #000; white-space: nowrap; font-variant-numeric: tabular-nums; }
.am-log-user { color: #000; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 165px; }
.am-log-txt { color: #000; word-break: break-word; }
.am-log-txt i { font-size: 10px; color: #4f46e5; width: 12px; }
.am-log-bid-up { color: #16a34a !important; font-weight: 700; }
.am-log-bid-down { color: #dc2626 !important; font-weight: 700; }
.am-log-camp { color: #000; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-log-empty { padding: 10px 8px; font-size: 11.5px; color: #000; }

.am-wb-prod-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #000 !important;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    text-decoration: none !important;
    vertical-align: middle;
    white-space: nowrap;
}
.am-wb-prod-btn i { color: #6d28d9; font-size: 11px; }
.am-wb-prod-btn:hover { background: #ede9fe; border-color: #a78bfa; }

.am-wb-query-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    color: #000 !important;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    text-decoration: none !important;
    vertical-align: middle;
    white-space: nowrap;
}
.am-wb-query-btn i { color: #6d28d9; font-size: 9.5px; }
.am-wb-query-btn:hover { background: #ede9fe; border-color: #a78bfa; }

.am-wb-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
    padding: 0 4px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #000 !important;
    background: #f5f3ff;
    border: 1px solid #c4b5fd;
    text-decoration: none !important;
}
.am-wb-inline-link i { color: #6d28d9; font-size: 9px; }
.am-wb-inline-link:hover { background: #ede9fe; }

@media (max-width: 1200px) {
    .am-split { flex-direction: column; align-items: stretch; }
    .am-log { width: auto; flex: 0 0 auto; position: static; max-height: 300px; }
}

/* ==========================================================================
   Product Modal: Modern Redesigned Header & Top KPI Widgets with Sparklines
   ========================================================================== */

.am-prod-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 0 12px 0;
    border-bottom: 1px solid #f2f4f7;
    flex-shrink: 0;
}
.am-prod-top-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.am-prod-img-box {
    width: 68px;
    height: 68px;
    min-width: 68px;
    border-radius: 12px;
    border: 1px solid #eaecf0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
.am-prod-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}
.am-prod-img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #98a2b3;
    background: #f8fafc;
}

.am-prod-info-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.am-prod-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.am-prod-heading {
    font-size: 17px;
    font-weight: 700;
    color: #101828;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 620px;
}
.am-prod-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.am-status-active { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.am-status-paused { background: #fffaeb; color: #b54708; border: 1px solid #fedf89; }
.am-status-done { background: #f2f4f7; color: #344054; border: 1px solid #eaecf0; }

.am-prod-code-line {
    font-size: 12px;
    color: #475467;
    display: flex;
    align-items: center;
    gap: 8px;
}
.am-prod-code-line b { color: #101828; }
.am-prod-wb-link {
    color: #6941c6;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}
.am-prod-wb-link:hover {
    color: #53389e;
    text-decoration: underline;
}
.am-vbar {
    color: #d0d5dd;
    font-weight: 300;
}

.am-prod-meta-line {
    font-size: 11.5px;
    color: #667085;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.am-prod-meta-line b {
    color: #344054;
    font-weight: 600;
}

.am-prod-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.am-prod-ctrl-period {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.am-prod-ctrl-label {
    font-size: 10.5px;
    font-weight: 500;
    color: #667085;
}
.am-prod-select-box {
    display: inline-flex;
    align-items: center;
    position: relative;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #fff;
    padding: 0 8px;
    height: 34px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.am-prod-preset-select {
    border: none;
    outline: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #344054;
    cursor: pointer;
    padding-left: 20px;
    padding-right: 18px;
    appearance: none;
}
.am-ctrl-ic {
    position: absolute;
    left: 8px;
    font-size: 12px;
    color: #667085;
    pointer-events: none;
}
.am-chev-ic {
    position: absolute;
    right: 8px;
    font-size: 10px;
    color: #667085;
    pointer-events: none;
}

.am-prod-subtext {
    font-size: 10.5px;
    color: #98a2b3;
    white-space: nowrap;
}
.am-prod-btn-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.am-btn-prod-refresh {
    height: 34px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #7f56d9;
    color: #fff;
    border: 1px solid #7f56d9;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.am-btn-prod-refresh:hover {
    background: #6941c6;
    border-color: #6941c6;
}

.am-btn-prod-history {
    height: 34px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f9f5ff;
    color: #6941c6;
    border: 1px solid #e9d7fe;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    cursor: pointer;
    transition: all 0.15s;
}
.am-btn-prod-history:hover,
.am-btn-history-active {
    background: #f4ebff !important;
    border-color: #d6bbfb !important;
    color: #53389e !important;
}
.am-prod-close-btn {
    font-size: 26px;
    color: #98a2b3;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}
.am-prod-close-btn:hover {
    color: #344054;
}

/* ---------- Top Summary 6-Grid KPI Cards with Sparklines ---------- */
.am-prod-summary-top {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin: 12px 0 14px 0;
    flex-shrink: 0;
}
@media (max-width: 1400px) {
    .am-prod-summary-top {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 800px) {
    .am-prod-summary-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

.am-widget-card {
    background: #ffffff;
    border: 1px solid #eaecf0;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    min-width: 0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    user-select: none;
}
.am-widget-card:hover {
    border-color: #d0d5dd;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
    transform: translateY(-1px);
}
.am-widget-card-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    flex: 1 1 auto;
}
.am-widget-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.am-widget-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.am-wic-spend { background: #f4f3ff; color: #7f56d9; }
.am-wic-views { background: #eff8ff; color: #2e90fa; }
.am-wic-clicks { background: #f9f5ff; color: #9e77ed; }
.am-wic-orders { background: #ecfdf3; color: #12b76a; }
.am-wic-cpo { background: #fef3f2; color: #f04438; }
.am-wic-roi { background: #eef4ff; color: #444ce7; }

.am-widget-label {
    font-size: 12.5px;
    font-weight: 500;
    color: #475467;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.am-widget-value {
    font-size: 20px;
    font-weight: 700;
    color: #101828;
    line-height: 1.2;
    margin-bottom: 6px;
    white-space: nowrap;
}
.am-widget-delta-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.am-widget-delta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 600;
}
.am-wdelta-pos { color: #12b76a; }
.am-wdelta-neg { color: #f04438; }
.am-wdelta-neutral { color: #475467; }

.am-widget-sub {
    font-size: 10.5px;
    color: #98a2b3;
    font-weight: 400;
    white-space: nowrap;
}

.am-widget-card-right {
    width: 86px;
    min-width: 86px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding-left: 6px;
}
.am-spark-svg {
    width: 100%;
    height: 38px;
    overflow: visible;
}

/* ---------- 24/7 campaign hourly schedule matrix ---------- */
.am-schedule-box {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px solid #eaecf0;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}
.am-sched-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.am-sched-head h4 {
    margin: 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #101828;
    display: flex;
    align-items: center;
    gap: 8px;
}
.am-sched-badge {
    font-size: 10.5px;
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 600;
}
.am-sched-switch {
    font-size: 11.5px;
    cursor: pointer;
}
.am-sched-desc {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
    line-height: 1.35;
}
.am-sched-presets {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    background: #f8fafc;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.am-sched-presets .am-btn {
    padding: 2px 6px;
    font-size: 10.5px;
    height: 22px;
    line-height: 18px;
}
.am-sched-preset-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-right: 2px;
}
.am-sched-matrix-wrap {
    overflow-x: auto;
    margin-bottom: 8px;
    user-select: none;
    -webkit-user-select: none;
}
.am-mat-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    margin: 0;
}
.am-mat-table th,
.am-mat-table td {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
    background: none;
}
.am-mat-th-corner {
    width: 28px;
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9 !important;
    text-align: center;
    border-radius: 3px;
    cursor: pointer;
    height: 18px;
    line-height: 18px;
}
.am-mat-th-hour {
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9 !important;
    text-align: center;
    border-radius: 3px;
    cursor: pointer;
    height: 18px;
    line-height: 18px;
    transition: background 0.12s;
    user-select: none;
}
.am-mat-th-hour:hover,
.am-mat-th-corner:hover {
    background: #e2e8f0 !important;
    color: #0f172a;
}
.am-mat-th-day {
    width: 28px;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9 !important;
    text-align: center;
    border-radius: 3px;
    cursor: pointer;
    height: 18px;
    line-height: 18px;
    transition: background 0.12s;
    user-select: none;
}
.am-mat-th-day:hover {
    background: #e2e8f0 !important;
    color: #0f172a;
}
.am-mat-td {
    height: 18px;
    background: #eaecf0 !important;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.08s, background 0.1s;
    position: relative;
    text-align: center;
    vertical-align: middle;
}
.am-mat-td:hover {
    filter: brightness(0.92);
    transform: scale(1.08);
    z-index: 3;
}
.am-mat-td.am-mat-active {
    background: #12b76a !important;
}
.am-mat-td.am-mat-active:hover {
    background: #0e9f5b !important;
}
.am-mat-td.am-mat-current {
    box-shadow: inset 0 0 0 2px #2e90fa !important;
    z-index: 2;
}
.am-mat-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    vertical-align: middle;
}
.am-mat-td:not(.am-mat-active) .am-mat-dot {
    background: #2e90fa;
}

.am-sched-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid #f2f4f7;
}
.am-sched-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #64748b;
}
.am-leg-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.am-leg-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}
.am-leg-active { background: #12b76a; }
.am-leg-paused { background: #eaecf0; border: 1px solid #d0d5dd; }
.am-leg-current { background: #eaecf0; border: 2px solid #2e90fa; }

.am-sched-summary {
    font-size: 11.5px;
    color: #344054;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.am-sched-now-pill {
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 10.5px;
    font-weight: 700;
}
.am-now-on {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
}
.am-now-off {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}
.am-now-disabled {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.am-camp-badge-sched {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    background: #eff8ff;
    color: #175cd3;
    border: 1px solid #b2ddff;
}
.am-sched-last-info {
    font-size: 10.5px;
    color: #64748b;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}





