.grid-view {
    margin-bottom: 40px;
}
.domain-index > div > h4 {
    margin-bottom: 20px;
}

.domain-index-top-buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 1rem;
    overflow-x: auto;
    padding-bottom: 4px;
}

.domain-index-top-buttons .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

dialog#tagFilterDialog {
    width: 400px;
    border-radius: 8px;
    padding: 20px;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.dialog-content {
    position: relative;
}
.close-button {
    position: absolute;
    right: 10px;
    top: 5px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.filter-form {
    width: fit-content;
}

.domain-search-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.domain-search-row > .btn {
    display: inline-flex;
    align-items: center;
}

.domain-search-field {
    position: relative;
    width: 250px;
    display: flex;
}

.domain-search-row .domain-search-field .form-control.domain-search-field__input {
    width: 100%;
    height: 100%;
    padding: 0 2.25rem 0 0.75rem;
    border-radius: 8px;
    line-height: 1.5;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.domain-search-field__clear {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    transform: translateY(-50%);
    cursor: pointer;
}

.domain-search-field__clear:hover {
    color: #1e293b;
    background: rgba(15, 23, 42, 0.06);
}

.domain-search-field__clear[hidden] {
    display: none;
}
.mb-20 {
    margin-bottom: 20px;
}

dialog {
    width: fit-content;
    padding: 60px 20px;
    border: none;
    border-radius: 10px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.dialog-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dialog-buttons {
    display: flex;
    justify-content: end;
    margin-top: 10px;
    gap: 10px;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.dialog-wrapper {
    padding: 60px 20px;
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-button {
    position: absolute;
    right: 10px;
    top: -2px;
    border: none;
    background: transparent;
    font-size: 35px;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.cell-with-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 110px;
    padding-left: 30px; /* место для кнопки */
}

.cell-with-btn .update-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    padding: 2px 6px;
    font-size: 12px;
    z-index: 2;
}

.cell-with-btn:hover .update-btn,
.cell-with-btn:focus-within .update-btn {
    opacity: 1;
    pointer-events: auto;
}

.cell-with-btn .cell-value {
    margin-left: 5px;
    display: inline-block;
}

.domain-row--transferred > td:first-child {
    border-left: 3px solid #ea580c !important;
}

.domain-row--transferred > td {
    background-color: #ffedd5 !important;
}

.domain-row--transferred .domain-url-link {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    color: #9a3412;
}

.domain-transferred-badge {
    display: block;
    width: fit-content;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
    background: #ea580c;
    white-space: nowrap;
}

.domain-row--transferred .transfer-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #9a3412;
    background: #fdba74;
    font-weight: 700;
}

.url-wrapper__domain-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.domain-index-copy-url-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border: none;
    border-radius: 4px;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.domain-index-copy-url-btn:hover {
    color: #0d6efd;
    border-color: #bfd0ea;
}

.domain-index-copy-url-btn .bi {
    font-size: 0.8rem;
    line-height: 1;
}

.domain-index-copy-url-btn.is-copied {
    color: #198754;
    border-color: #a3cfbb;
}

.manual-report-toast__icon {
    min-width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    font-size: 0.95rem;
    line-height: 1;
}

.text-bg-warning .manual-report-toast__icon {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
}

/* Схема сеток переездов */
.gtm {
    margin: 0 0 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

.gtm__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.gtm__toggle:hover {
    background: #f1f5f9;
}

.gtm__toggle-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.gtm__chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.gtm.is-collapsed .gtm__chevron {
    transform: rotate(-90deg);
}

.gtm__title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.gtm__meta {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.gtm__body {
    padding: 0 16px 16px;
}

.gtm.is-collapsed .gtm__body {
    display: none;
}

.gtm__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.gtm-legend-item {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.gtm-legend-item--301-hidden {
    color: #9a3412;
    background: #ffedd5;
}

.gtm-legend-item--301-opened {
    color: #9a3412;
    background: #fdba74;
}

.gtm-legend-item--can-hidden {
    color: #1e40af;
    background: #dbeafe;
}

.gtm-legend-item--can-opened {
    color: #1e3a8a;
    background: #93c5fd;
}

.gtm__grids {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.gtm-grid {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    scroll-margin-top: 16px;
}

.gtm-grid__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.gtm-grid__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.gtm-grid__hub-link {
    font-size: 13px;
    font-weight: 700;
    color: #166534;
    text-decoration: none;
    word-break: break-all;
}

.gtm-grid__hub-link:hover {
    text-decoration: underline;
}

.gtm-grid__count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
}

.gtm-grid__flow {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 160px);
    gap: 10px;
    align-items: stretch;
}

.gtm-grid__sources {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.gtm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.gtm-node {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.gtm-node--source {
    border-left: 3px solid #ea580c;
    background: #fff7ed;
}

.gtm-node--hub {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border-left: 3px solid #16a34a;
    background: #f0fdf4;
    align-self: stretch;
}

.gtm-node--blocked {
    opacity: 0.55;
}

.gtm-node__url {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
    word-break: break-all;
    line-height: 1.35;
}

.gtm-node__url:hover {
    color: #2563eb;
    text-decoration: underline;
}

.gtm-node--source .gtm-node__url {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    color: #9a3412;
}

.gtm-node__amp {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: #ea580c;
    word-break: break-all;
}

.gtm-node__chain {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #b45309;
    font-weight: 700;
    text-decoration: none;
    word-break: break-all;
    line-height: 1.35;
}

.gtm-node__chain:hover {
    color: #ea580c;
    text-decoration: underline;
}

.gtm-node__chain-type {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: #92400e;
    font-weight: 600;
}

.gtm-edge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 88px;
    padding: 0 2px;
}

.gtm-edge__line {
    display: none;
}

.gtm-edge__badge {
    display: inline-block;
    max-width: 110px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
}

.gtm-edge__ending {
    font-size: 9px;
    color: #64748b;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gtm-edge__arrow {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: #94a3b8;
}

.gtm-edge--301-hidden .gtm-edge__badge {
    color: #9a3412;
    background: #ffedd5;
}

.gtm-edge--301-opened .gtm-edge__badge {
    color: #9a3412;
    background: #fdba74;
}

.gtm-edge--can-hidden .gtm-edge__badge {
    color: #1e40af;
    background: #dbeafe;
}

.gtm-edge--can-opened .gtm-edge__badge {
    color: #1e3a8a;
    background: #93c5fd;
}

.gtm-edge--unknown .gtm-edge__badge {
    color: #475569;
    background: #e2e8f0;
}

@media (max-width: 640px) {
    .gtm__grids {
        grid-template-columns: 1fr;
    }

    .gtm-grid__flow {
        grid-template-columns: 1fr;
    }

    .gtm-node--hub {
        order: -1;
    }

    .gtm-row {
        grid-template-columns: 1fr;
    }

    .gtm-edge {
        flex-direction: row;
        justify-content: center;
        min-width: 0;
        padding: 4px 0;
    }

    .gtm-edge__arrow {
        transform: rotate(90deg);
    }
}
