:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #eff3f8;
    --border: #d7dfeb;
    --text: #162031;
    --muted: #617087;
    --brand: #0f4c81;
    --brand-deep: #0a3559;
    --success-soft: #d8f0e1;
    --warning-soft: #fff0c2;
    --danger-soft: #f6d7d9;
}

html {
    font-size: 14px;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(15, 76, 129, 0.12), transparent 25%),
        linear-gradient(180deg, #fbfcfe 0%, var(--bg) 100%);
    color: var(--text);
    overflow-x: hidden;
}

.site-header {
    background: linear-gradient(135deg, var(--brand-deep), var(--brand));
}

.navbar-brand {
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
    border-radius: 999px;
    padding-inline: 0.9rem !important;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #fff !important;
}

.dashboard-hero,
.card {
    border-radius: 1rem;
}

.card {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(15, 32, 49, 0.06);
}

.metric-card .metric-value {
    font-size: 2rem;
    font-weight: 700;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.soft-note {
    background: var(--warning-soft);
    border: 1px solid #f1dd8e;
}

.badge-soft-success {
    background: var(--success-soft);
    color: #16643d;
}

.badge-soft-danger {
    background: var(--danger-soft);
    color: #8c2530;
}

.badge-soft-warning {
    background: var(--warning-soft);
    color: #785d00;
}

.badge-soft-info {
    background: #d8ebff;
    color: #13456e;
}

.table td,
.table th {
    vertical-align: middle;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    min-width: 720px;
}

.form-card {
    max-width: 860px;
}

.coverage-summary-card {
    height: 100%;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    background: var(--surface);
}

.coverage-card-muted {
    background: linear-gradient(180deg, #8d939b 0%, #777d84 100%);
    color: #fff;
    border-color: #777d84;
}

.coverage-card-success {
    background: linear-gradient(180deg, #18a25a 0%, #11894b 100%);
    color: #fff;
    border-color: #11894b;
}

.coverage-card-outline {
    background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.coverage-summary-title {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.92;
}

.coverage-summary-value {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 0.5rem;
}

.coverage-domain-value {
    font-size: clamp(1rem, 0.5vw + 0.85rem, 1.45rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
    letter-spacing: -0.02em;
}

.coverage-summary-detail {
    font-size: 0.9rem;
    margin-top: 0.35rem;
    opacity: 0.88;
}

.coverage-property-banner {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #f9fbff 0%, #eef4fb 100%);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
}

.coverage-property-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.coverage-property-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.coverage-property-note {
    color: var(--muted);
    margin-top: 0.45rem;
    font-size: 0.92rem;
}

.trend-chip {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.json-box {
    min-height: 180px;
    font-family: Consolas, "Courier New", monospace;
}

.footer {
    border-top: 1px solid var(--border);
}

.action-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
}

.records-filter-card {
    background:
        radial-gradient(circle at top right, rgba(15, 76, 129, 0.07), transparent 30%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.records-filter-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.records-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.records-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: #edf5ff;
    color: #11466f;
    border: 1px solid #cfe0f6;
    font-weight: 600;
    font-size: 0.9rem;
}

.records-pill-icon,
.records-button-icon,
.records-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.records-pill-icon svg,
.records-button-icon svg,
.records-hint svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: currentColor;
}

.records-toggle-grid {
    display: grid;
    gap: 0.7rem;
}

.records-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.8rem;
    background: rgba(239, 243, 248, 0.75);
}

.records-toggle .form-check-input {
    margin-top: 0;
}

.records-filter-button {
    min-width: 132px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.searchable-select {
    position: relative;
}

.searchable-select-native {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    inset: 0;
}

.searchable-select-toggle {
    display: flex;
    align-items: center;
    width: 100%;
}

.searchable-select-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 14px 30px rgba(15, 32, 49, 0.12);
    overflow: hidden;
}

.searchable-select-search-wrap {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    background: #f8fbff;
}

.searchable-select-options {
    max-height: 240px;
    overflow-y: auto;
    padding: 0.4rem;
}

.searchable-select-option {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.6rem 0.7rem;
    border-radius: 0.75rem;
    color: var(--text);
}

.searchable-select-option:hover,
.searchable-select-option.active {
    background: #edf5ff;
    color: #11466f;
}

.records-table-card .table thead th {
    background: #fbfcff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.records-head {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.records-hint {
    color: #6d86a3;
    cursor: help;
}

.records-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    background: #f2f6fb;
    border: 1px solid var(--border);
    color: #26415e;
    font-weight: 600;
    white-space: nowrap;
}

.records-google-badge {
    max-width: 360px;
    white-space: normal;
    text-align: left;
}

.records-google-state {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    align-items: start;
    padding: 0.7rem 0.85rem;
    border-radius: 0.95rem;
    border: 1px solid var(--border);
    max-width: 360px;
    background: #fffdf8;
}

.records-google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid currentColor;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.records-google-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.15;
}

.records-google-text {
    font-size: 0.82rem;
    line-height: 1.2;
    margin-top: 0.2rem;
    opacity: 0.92;
}

.record-url-cell {
    min-width: 260px;
}

.record-status-cell {
    min-width: 220px;
}

.record-date-cell {
    white-space: nowrap;
    min-width: 132px;
}

.search-console-action-cell {
    white-space: nowrap;
    min-width: 150px;
}

.search-console-action-cell .action-stack {
    justify-content: flex-end;
}

.external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
}

.external-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.external-link-icon svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: currentColor;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 0.85rem;
        background: rgba(8, 31, 52, 0.26);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 1rem;
        padding: 0.75rem;
        backdrop-filter: blur(10px);
    }

    .navbar-nav {
        gap: 0.35rem !important;
    }

    .nav-link {
        padding: 0.7rem 0.9rem !important;
    }

    .card {
        border-radius: 0.9rem;
    }

    .coverage-summary-value,
    .metric-card .metric-value {
        font-size: 1.8rem;
    }

    .records-pill {
        align-self: flex-start;
    }
}

@media (min-width: 992px) {
    .navbar > .container-xxl {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .main-nav-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
        white-space: nowrap;
        gap: 0.15rem !important;
        padding-bottom: 0.15rem;
    }

    .main-nav-links::-webkit-scrollbar {
        height: 6px;
    }

    .main-nav-links::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.22);
        border-radius: 999px;
    }

    .main-nav-links .nav-link {
        font-size: 0.96rem;
        padding-inline: 0.7rem !important;
        padding-block: 0.45rem !important;
    }

    .nav-user-panel {
        flex: 0 0 auto;
        white-space: nowrap;
    }
}

@media (max-width: 767.98px) {
    html {
        font-size: 13px;
    }

    .table {
        min-width: 0;
    }

    .mobile-card-table thead {
        display: none;
    }

    .mobile-card-table,
    .mobile-card-table tbody,
    .mobile-card-table tr,
    .mobile-card-table td {
        display: block;
        width: 100%;
    }

    .mobile-card-table tbody {
        padding: 0.75rem;
    }

    .mobile-card-table tr {
        border: 1px solid var(--border);
        border-radius: 1rem;
        background: var(--surface);
        box-shadow: 0 8px 24px rgba(15, 32, 49, 0.06);
        margin-bottom: 0.9rem;
        padding: 0.9rem;
    }

    .mobile-card-table td {
        border: 0 !important;
        padding: 0.45rem 0;
    }

    .mobile-card-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 0.22rem;
    }

    .mobile-card-table .action-stack {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mobile-card-table .btn {
        width: 100%;
    }

    .table-responsive {
        overflow: visible;
    }

    .record-url-cell,
    .record-status-cell {
        min-width: 0;
    }

    .coverage-summary-card,
    .coverage-property-banner {
        padding: 1rem;
    }

    .records-toggle-grid {
        grid-template-columns: 1fr;
    }

    .records-google-badge {
        max-width: none;
    }

    .records-google-state {
        max-width: none;
    }

    .search-console-action-cell {
        min-width: 0;
        white-space: normal;
    }
}
