:root {
    --dd-bg: #eef2f6;
    --dd-surface: #ffffff;
    --dd-surface-alt: #f8fafc;
    --dd-border: #d7dde6;
    --dd-border-strong: #bec9d8;
    --dd-text: #172539;
    --dd-muted: #66758a;
    --dd-primary: #1f4d78;
    --dd-primary-dark: #163957;
    --dd-secondary: #51647c;
    --dd-success: #1f6b4f;
    --dd-warning: #8b6125;
    --dd-danger: #8f3f3f;
    --dd-shadow: 0 18px 38px rgba(22, 38, 58, 0.08);
    --dd-radius: 1rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(31, 77, 120, 0.08), transparent 22rem),
        linear-gradient(180deg, #f6f8fb 0%, var(--dd-bg) 100%);
    color: var(--dd-text);
    font-family: "Aptos", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
}

a {
    color: var(--dd-primary);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 290px;
    background: linear-gradient(180deg, #10263b 0%, #173450 100%);
    color: rgba(255, 255, 255, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .offcanvas-header,
.app-sidebar .offcanvas-body {
    color: inherit;
}

.sidebar-overline,
.sidebar-heading,
.sidebar-stat-label,
.section-kicker,
.topbar-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.25rem 0 1.5rem;
    color: inherit;
}

.brand-mark {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(118, 166, 209, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
}

.brand-title,
.brand-subtitle {
    display: block;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.brand-subtitle,
.sidebar-stat-copy {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
}

.sidebar-search {
    margin-bottom: 1.35rem;
}

.sidebar-search-label {
    display: block;
    margin-bottom: 0.45rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
}

.sidebar-search .form-control {
    min-width: 0;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-search .form-control::placeholder {
    color: rgba(255, 255, 255, 0.56);
}

.sidebar-search .form-control:focus {
    border-color: rgba(144, 178, 214, 0.56);
    box-shadow: 0 0 0 0.2rem rgba(99, 146, 191, 0.2);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.app-nav .nav-link {
    color: rgba(255, 255, 255, 0.84);
    padding: 0.78rem 0.9rem;
    border-radius: 0.85rem;
    margin-bottom: 0.35rem;
    border: 1px solid transparent;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

.app-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-section {
    margin-top: 1.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer {
    margin-top: 1.8rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-stat-value {
    margin: 0.35rem 0 0.5rem;
    font-weight: 700;
    font-size: 1rem;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(246, 248, 251, 0.88);
    backdrop-filter: blur(14px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-value {
    font-weight: 600;
}

.app-content {
    padding: 1.5rem;
}

.page-banner {
    margin-bottom: 1.5rem;
}

.page-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 700;
    color: #11233a;
}

.page-subtitle,
.section-copy,
.detail-copy,
.stat-meta,
.table-meta-bar,
.form-text,
.empty-state-copy {
    color: var(--dd-muted);
}

.content-stack {
    display: grid;
    gap: 1.5rem;
}

.shell-card {
    border: 1px solid var(--dd-border);
    border-radius: var(--dd-radius);
    box-shadow: var(--dd-shadow);
    background: rgba(255, 255, 255, 0.94);
}

.stats-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card {
    overflow: hidden;
}

.stat-card .card-body {
    padding: 1.2rem;
}

.stat-label {
    color: var(--dd-muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    margin: 0.45rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--dd-primary-dark);
}

.section-header,
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.detail-title {
    margin: 0.3rem 0 0.55rem;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 700;
}

.detail-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.detail-item {
    padding: 1rem;
    border-radius: 0.95rem;
    background: var(--dd-surface-alt);
    border: 1px solid var(--dd-border);
}

.detail-item-label {
    margin-bottom: 0.4rem;
    font-size: 0.77rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dd-muted);
}

.detail-item-value {
    font-weight: 600;
    word-break: break-word;
}

.activity-list,
.stack-list,
.result-list {
    display: grid;
    gap: 0.9rem;
}

.activity-item,
.stack-item,
.result-item {
    padding: 1rem 1.1rem;
    border: 1px solid var(--dd-border);
    border-radius: 0.95rem;
    background: var(--dd-surface-alt);
}

.activity-item-head,
.stack-item-head,
.result-item-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.35rem;
}

.activity-item-title,
.stack-item-title,
.result-item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.activity-item-meta,
.stack-item-meta,
.result-item-meta {
    color: var(--dd-muted);
    font-size: 0.88rem;
}

.quick-links-grid {
    display: grid;
    gap: 0.9rem;
}

.quick-link-card {
    display: block;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid var(--dd-border);
    background: linear-gradient(180deg, #fff 0%, #f9fbfd 100%);
    text-decoration: none;
}

.quick-link-title,
.quick-link-copy {
    display: block;
}

.quick-link-title {
    margin-bottom: 0.35rem;
    font-weight: 700;
    color: var(--dd-text);
}

.quick-link-copy {
    color: var(--dd-muted);
    font-size: 0.95rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}

.status-pill--verified,
.status-pill--confidence-high,
.status-pill--confirmed {
    color: #0d513c;
    background: rgba(31, 107, 79, 0.14);
}

.status-pill--unverified,
.status-pill--confidence-medium,
.status-pill--inferred {
    color: #82581d;
    background: rgba(139, 97, 37, 0.16);
}

.status-pill--danger,
.status-pill--confidence-low {
    color: #7c3030;
    background: rgba(143, 63, 63, 0.15);
}

.status-pill--neutral,
.status-pill--technical {
    color: #37506b;
    background: rgba(81, 100, 124, 0.12);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(31, 77, 120, 0.04);
    --bs-table-border-color: var(--dd-border);
}

.dense-table th,
.dense-table td {
    font-size: 0.92rem;
    white-space: nowrap;
    vertical-align: top;
}

.dense-table td.wrap,
.dense-table .wrap {
    white-space: normal;
    min-width: 15rem;
}

.empty-state,
.loading-state,
.error-state {
    padding: 2rem 1rem;
    border: 1px dashed var(--dd-border-strong);
    border-radius: 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.95));
}

.empty-state.compact,
.loading-state.compact,
.error-state.compact {
    padding: 1.2rem;
}

.empty-state-title,
.error-state-title {
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.pagination-shell {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.page-link {
    color: var(--dd-primary);
}

.page-item.active .page-link {
    background: var(--dd-primary);
    border-color: var(--dd-primary);
}

.match-highlight,
mark.search-hit {
    padding: 0 0.12rem;
    color: inherit;
    background: rgba(255, 210, 120, 0.55);
}

.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb {
    --bs-breadcrumb-divider-color: var(--dd-muted);
    --bs-breadcrumb-item-active-color: var(--dd-muted);
    margin-bottom: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.table-meta-bar {
    margin-bottom: 1rem;
}

.source-code-block {
    margin: 0;
    padding: 1.15rem;
    border-radius: 1rem;
    border: 1px solid var(--dd-border);
    background: #132235;
    color: #edf4fb;
    font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.source-code-block code {
    color: inherit;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
    color: var(--dd-muted);
    font-size: 0.9rem;
}

@media (max-width: 1399.98px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 767.98px) {
    .app-content,
    .topbar,
    .app-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .stats-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .section-header,
    .detail-header,
    .activity-item-head,
    .stack-item-head,
    .result-item-head {
        flex-direction: column;
        align-items: stretch;
    }

    .app-footer {
        flex-direction: column;
    }
}

/* UX Refresh */

body {
    background:
        radial-gradient(circle at top left, rgba(24, 78, 126, 0.12), transparent 24rem),
        radial-gradient(circle at bottom right, rgba(18, 52, 85, 0.1), transparent 26rem),
        linear-gradient(180deg, #f4f7fb 0%, #edf2f7 44%, #e7edf4 100%);
}

.app-shell {
    position: relative;
}

.app-sidebar {
    width: 304px;
    box-shadow: 18px 0 40px rgba(12, 24, 38, 0.14);
}

.brand-lockup {
    padding: 0.5rem 0 1.8rem;
}

.brand-mark {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.app-nav .nav-link {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.topbar {
    padding: 1rem;
    background: rgba(247, 250, 252, 0.84);
    box-shadow: 0 8px 24px rgba(14, 29, 45, 0.06);
}

.topbar-left {
    flex: 1 1 auto;
    min-width: 0;
}

.topbar-copy {
    display: grid;
    gap: 0.2rem;
}

.topbar-value {
    color: #0f243b;
}

.app-content {
    padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom));
}

.page-banner {
    margin-bottom: 1rem;
    padding: 1.1rem 1.1rem 1rem;
    background:
        linear-gradient(135deg, rgba(31, 77, 120, 0.12), rgba(255, 255, 255, 0) 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98));
}

.page-title {
    font-size: clamp(1.65rem, 5vw, 2.4rem);
    line-height: 1.04;
}

.page-subtitle {
    margin-top: 0.55rem;
    max-width: 62rem;
    font-size: 0.98rem;
    line-height: 1.55;
}

.content-stack {
    gap: 1rem;
}

.shell-card {
    border-color: rgba(23, 50, 79, 0.1);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 16px 34px rgba(17, 34, 52, 0.08),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.shell-card > .card-body {
    padding: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.stat-card .card-body {
    position: relative;
    padding: 1rem;
}

.stat-card .card-body::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 1rem 0 0 1rem;
    background: linear-gradient(180deg, rgba(31, 77, 120, 0.95), rgba(22, 57, 87, 0.55));
}

.stat-label {
    font-size: 0.76rem;
    font-weight: 700;
}

.stat-value {
    margin: 0.35rem 0;
    font-size: clamp(1.55rem, 5vw, 2.1rem);
}

.quick-links-grid {
    grid-template-columns: 1fr;
}

.quick-link-card {
    border-radius: 1.05rem;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.quick-link-card:hover,
.quick-link-card:focus {
    transform: translateY(-1px);
    border-color: rgba(31, 77, 120, 0.24);
    box-shadow: 0 14px 28px rgba(18, 38, 58, 0.08);
}

.summary-card .card-body,
.filter-card .card-body {
    background:
        linear-gradient(180deg, rgba(250, 252, 254, 1), rgba(246, 249, 252, 1));
}

.filter-form .form-label {
    margin-bottom: 0.42rem;
    color: var(--dd-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filter-form .form-control,
.filter-form .form-select,
form .form-control,
form .form-select,
form textarea {
    border-radius: 0.95rem;
    border-color: rgba(31, 77, 120, 0.16);
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.filter-form .form-control,
.filter-form .form-select {
    min-height: 2.9rem;
}

.filter-form .btn,
.form-actions .btn,
.topbar .btn {
    min-height: 2.9rem;
    border-radius: 0.95rem;
    font-weight: 700;
}

.filter-form .form-control:focus,
.filter-form .form-select:focus,
form .form-control:focus,
form .form-select:focus,
form textarea:focus {
    border-color: rgba(31, 77, 120, 0.42);
    box-shadow: 0 0 0 0.24rem rgba(31, 77, 120, 0.12);
}

.results-card .card-body {
    padding: 1rem;
}

.table-meta-bar,
#tablesMeta,
#fieldsMeta,
#relationshipsMeta,
#triggersMeta,
#proceduresMeta,
#viewsMeta,
#notesMeta {
    font-size: 0.96rem;
    font-weight: 600;
}

.table-responsive.data-table-shell {
    border: 1px solid rgba(23, 50, 79, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    overflow: auto;
}

.data-table {
    min-width: 720px;
    margin-bottom: 0;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.85rem 0.95rem;
    background: rgba(245, 249, 252, 0.98);
    color: var(--dd-secondary);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-bottom-width: 1px;
}

.data-table td {
    padding: 0.95rem;
}

.data-table tbody tr:hover > * {
    background-color: rgba(31, 77, 120, 0.05);
}

.dense-table td.wrap,
.dense-table .wrap {
    min-width: 18rem;
}

.detail-header,
.section-header {
    margin-bottom: 1.15rem;
}

.detail-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

.detail-item {
    min-height: 100%;
    padding: 1rem 1rem 0.95rem;
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(250, 252, 254, 1), rgba(244, 248, 252, 1));
}

.detail-item-label {
    font-size: 0.73rem;
    font-weight: 700;
}

.activity-item,
.stack-item,
.result-item {
    padding: 1rem 1rem 0.95rem;
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(251, 253, 254, 1), rgba(246, 249, 252, 1));
}

.activity-item-title,
.stack-item-title,
.result-item-title {
    line-height: 1.3;
}

.activity-item-meta,
.stack-item-meta,
.result-item-meta {
    margin-top: 0.12rem;
    font-size: 0.84rem;
}

.note-body {
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--dd-text);
}

.note-body--constants {
    font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
    font-size: 0.92rem;
}

.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-shell {
    width: min(100%, 34rem);
}

.auth-panel > .card-body {
    padding: 1.5rem;
}

.auth-panel-copy {
    display: grid;
    gap: 0.5rem;
}

.auth-form .form-control,
.auth-form .btn {
    min-height: 3.25rem;
}

.auth-help {
    color: var(--dd-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.access-check,
.access-table-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.status-pill {
    padding: 0.36rem 0.7rem;
    font-size: 0.74rem;
}

.empty-state,
.loading-state,
.error-state {
    border-style: solid;
    border-color: rgba(23, 50, 79, 0.1);
    background:
        linear-gradient(180deg, rgba(250, 252, 254, 1), rgba(245, 249, 252, 1));
}

.pagination-shell {
    justify-content: center;
    margin-top: 1.15rem;
}

.pagination .page-link {
    min-width: 2.5rem;
    text-align: center;
    border-radius: 0.75rem;
    margin-inline: 0.14rem;
    border-color: rgba(31, 77, 120, 0.14);
}

.form-actions {
    margin-top: 1.35rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(23, 50, 79, 0.08);
}

.source-code-block {
    padding: 1.15rem;
    border-color: rgba(144, 178, 214, 0.18);
    background:
        linear-gradient(180deg, #102035 0%, #14283f 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-footer {
    padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom));
    font-size: 0.84rem;
}

.mobile-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.65rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom));
    background: rgba(10, 22, 36, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.mobile-dock-link {
    display: grid;
    gap: 0.1rem;
    justify-items: center;
    padding: 0.5rem 0.35rem;
    border: 1px solid transparent;
    border-radius: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    background: transparent;
    text-decoration: none;
    font: inherit;
}

.mobile-dock-link.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.mobile-dock-button {
    cursor: pointer;
}

.mobile-dock-label {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mobile-dock-copy {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.7);
}

@media (min-width: 768px) {
    .app-content {
        padding: 1.2rem 1.2rem calc(6rem + env(safe-area-inset-bottom));
    }

    .shell-card > .card-body,
    .results-card .card-body {
        padding: 1.15rem 1.2rem;
    }

    .quick-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .topbar {
        margin: 1rem 1rem 0;
        padding: 1rem 1.15rem;
        border: 1px solid rgba(23, 50, 79, 0.08);
        border-radius: 1.2rem;
    }

    .app-content {
        padding: 1.2rem 1rem 1.75rem;
    }

    .page-banner {
        padding: 1.35rem 1.35rem 1.15rem;
    }

    .quick-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-footer {
        padding: 1rem 1.5rem 1.5rem;
    }
}

@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.85rem;
}

.result-item-copy {
    color: var(--dd-text);
}

.result-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(23, 50, 79, 0.08);
}

.result-item-context,
.result-group-footnote {
    color: var(--dd-muted);
    font-size: 0.84rem;
}

.result-group-footnote {
    margin-top: 0.7rem;
}

.table-inline-actions {
    margin-top: 0;
}

.stack-item-actions {
    margin-top: 0.75rem;
}

.note-context-banner {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(31, 77, 120, 0.14);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(247, 250, 253, 1), rgba(241, 246, 251, 1));
}

.note-context-banner--empty {
    border-style: dashed;
    background: linear-gradient(180deg, rgba(251, 253, 254, 1), rgba(246, 249, 252, 1));
}

.note-context-kicker {
    margin-bottom: 0.3rem;
    color: var(--dd-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.note-context-title {
    font-size: 1rem;
    font-weight: 700;
}

.note-context-copy {
    margin-top: 0.18rem;
    color: var(--dd-muted);
}

@media (max-width: 767.98px) {
    .topbar-copy {
        gap: 0.1rem;
    }

    .topbar-value {
        font-size: 0.95rem;
    }

    .table-responsive.data-table-shell {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table tr,
    .data-table th,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: grid;
        gap: 0.85rem;
    }

    .data-table tbody tr {
        overflow: hidden;
        border: 1px solid rgba(23, 50, 79, 0.08);
        border-radius: 1rem;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
        box-shadow: 0 14px 28px rgba(16, 31, 48, 0.06);
    }

    .data-table tbody td,
    .dense-table tbody td {
        display: grid;
        grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr);
        gap: 0.8rem;
        align-items: start;
        padding: 0.78rem 0.95rem;
        white-space: normal;
        border: 0;
        border-top: 1px solid rgba(23, 50, 79, 0.07);
    }

    .data-table tbody tr > td:first-child {
        border-top: 0;
    }

    .data-table tbody td::before,
    .dense-table tbody td::before {
        content: attr(data-label);
        color: var(--dd-secondary);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .data-table tbody td[data-full-row="true"],
    .dense-table tbody td[data-full-row="true"] {
        display: block;
        padding: 0.95rem;
        border-top: 0;
    }

    .data-table tbody td[data-full-row="true"]::before,
    .dense-table tbody td[data-full-row="true"]::before {
        display: none;
    }

    .data-table tbody td.wrap,
    .data-table tbody .wrap,
    .dense-table tbody td.wrap,
    .dense-table tbody .wrap {
        min-width: 0;
    }

    .data-table .metric-row,
    .dense-table .metric-row {
        justify-content: flex-start;
    }

    .data-table .status-pill,
    .dense-table .status-pill {
        justify-self: start;
    }

    .result-item-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .action-row {
        width: 100%;
    }
}

/* Tightened Layout Pass */

.workspace-frame {
    width: 100%;
    max-width: 1368px;
    margin: 0 auto;
}

.app-sidebar {
    width: 292px;
}

.app-sidebar .offcanvas-body {
    padding: 1rem 1rem 1.1rem;
}

.brand-lockup {
    gap: 0.75rem;
    padding: 0.3rem 0 1.15rem;
}

.brand-mark {
    width: 2.7rem;
    height: 2.7rem;
}

.brand-title {
    font-size: 0.98rem;
}

.brand-subtitle,
.sidebar-stat-copy {
    font-size: 0.82rem;
}

.sidebar-search {
    margin-bottom: 1rem;
}

.sidebar-search-row {
    gap: 0.45rem;
}

.sidebar-search .form-control,
.sidebar-search .btn {
    min-height: 2.7rem;
}

.app-nav .nav-link {
    padding: 0.62rem 0.8rem;
    margin-bottom: 0.22rem;
    border-radius: 0.78rem;
}

.sidebar-section {
    margin-top: 1.2rem;
    padding-top: 1rem;
}

.sidebar-footer {
    margin-top: 1.35rem;
    padding: 0.85rem 0.9rem;
    border-radius: 0.92rem;
}

.sidebar-actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.sidebar-actions .btn {
    min-height: 2.45rem;
    border-radius: 0.78rem;
    font-weight: 700;
}

.sidebar-stat-value {
    margin: 0.22rem 0 0.32rem;
    font-size: 0.96rem;
}

.topbar {
    padding: 0.78rem 0.95rem;
    box-shadow: 0 6px 18px rgba(14, 29, 45, 0.05);
}

.topbar-copy {
    gap: 0.08rem;
}

.topbar-label {
    font-size: 0.7rem;
}

.topbar-value {
    font-size: 0.96rem;
}

.app-content {
    padding: 0.85rem 0.9rem calc(5.75rem + env(safe-area-inset-bottom));
}

.page-banner {
    margin-bottom: 0.8rem;
    padding: 0.95rem 1rem 0.88rem;
    border-radius: 1.05rem;
}

.page-title {
    font-size: clamp(1.45rem, 4vw, 2.1rem);
    line-height: 1.02;
}

.page-subtitle {
    margin-top: 0.4rem;
    max-width: 56rem;
    font-size: 0.92rem;
    line-height: 1.42;
}

.breadcrumb {
    margin-bottom: 0;
    font-size: 0.84rem;
}

.content-stack {
    gap: 0.8rem;
}

.content-stack .row.g-4 {
    --bs-gutter-x: 0.85rem;
    --bs-gutter-y: 0.85rem;
}

.shell-card {
    border-radius: 1.05rem;
    box-shadow:
        0 12px 24px rgba(17, 34, 52, 0.06),
        0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.shell-card > .card-body,
.results-card .card-body {
    padding: 0.88rem 0.95rem;
}

.stats-grid {
    gap: 0.7rem;
}

.stat-card .card-body {
    padding: 0.88rem 0.95rem 0.9rem;
}

.stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
}

.stat-value {
    margin: 0.22rem 0;
    font-size: clamp(1.42rem, 4vw, 1.9rem);
}

.stat-meta {
    font-size: 0.82rem;
}

.quick-links-grid {
    gap: 0.7rem;
}

.dashboard-side-stack {
    display: grid;
    gap: 0.85rem;
}

.export-panel {
    background:
        linear-gradient(135deg, rgba(31, 77, 120, 0.08), rgba(255, 255, 255, 0) 58%),
        linear-gradient(180deg, rgba(250, 252, 254, 1), rgba(245, 249, 252, 1));
}

.export-panel-actions {
    margin-top: 0.8rem;
}

.embedded-layout {
    min-height: 100vh;
    height: 100vh;
    background: linear-gradient(180deg, #f4f7fb 0%, #edf2f7 100%);
    overflow: hidden;
}

.embedded-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    padding: 0.8rem;
}

.report-card {
    background:
        linear-gradient(135deg, rgba(31, 77, 120, 0.06), rgba(255, 255, 255, 0) 54%),
        linear-gradient(180deg, rgba(251, 253, 254, 1), rgba(246, 249, 252, 1));
}

.embedded-map-shell {
    position: relative;
    min-height: 38rem;
    border: 1px solid rgba(23, 50, 79, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
}

.embedded-map-host {
    min-height: inherit;
}

.embedded-map-frame {
    width: 100%;
    height: 100%;
    min-height: 38rem;
    border: 0;
    display: block;
    background: transparent;
}

.map-fullscreen-button {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 20;
    min-height: auto;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    border-color: rgba(27, 58, 89, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 24px rgba(17, 34, 51, 0.12);
    backdrop-filter: blur(10px);
}

.map-fullscreen-button:hover,
.map-fullscreen-button:focus-visible {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(27, 58, 89, 0.2);
}

.embedded-map-shell:fullscreen,
.embedded-map-shell:-webkit-full-screen {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    background: #eef3f8;
}

.embedded-map-shell:fullscreen .embedded-map-host,
.embedded-map-shell:-webkit-full-screen .embedded-map-host,
.embedded-map-shell:fullscreen .embedded-map-frame,
.embedded-map-shell:-webkit-full-screen .embedded-map-frame {
    height: 100%;
    min-height: 100vh;
}

.query-workbench-sql {
    min-height: 18rem;
    font-family: "Cascadia Mono", "Consolas", "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre;
    overflow: auto;
}

.query-workbench-side-stack {
    display: grid;
    gap: 0.85rem;
}

.quick-link-card {
    padding: 0.88rem 0.95rem;
    border-radius: 0.92rem;
}

.quick-link-title {
    margin-bottom: 0.22rem;
    font-size: 0.96rem;
}

.quick-link-copy {
    font-size: 0.87rem;
    line-height: 1.38;
}

.summary-card .card-body,
.filter-card .card-body {
    padding: 0.9rem 0.95rem;
}

.filter-form {
    --bs-gutter-x: 0.8rem;
    --bs-gutter-y: 0.72rem;
}

.filter-form .form-label {
    margin-bottom: 0.28rem;
    font-size: 0.7rem;
}

.filter-form .form-control,
.filter-form .form-select,
form .form-control,
form .form-select,
form textarea {
    border-radius: 0.82rem;
}

.filter-form .form-control,
.filter-form .form-select,
.form-actions .btn,
.topbar .btn {
    min-height: 2.65rem;
}

form textarea {
    min-height: 8.5rem;
}

.table-meta-bar,
#tablesMeta,
#fieldsMeta,
#relationshipsMeta,
#triggersMeta,
#proceduresMeta,
#viewsMeta,
#notesMeta,
#searchSummary {
    font-size: 0.9rem;
}

.section-header,
.detail-header {
    gap: 0.75rem;
    margin-bottom: 0.82rem;
}

.section-title {
    font-size: 1rem;
}

.detail-title {
    margin: 0.2rem 0 0.38rem;
    font-size: clamp(1.28rem, 2.2vw, 1.74rem);
}

.detail-copy,
.section-copy {
    font-size: 0.9rem;
    line-height: 1.42;
}

.detail-grid {
    gap: 0.7rem;
}

.detail-item {
    padding: 0.82rem 0.88rem 0.78rem;
    border-radius: 0.9rem;
}

.detail-item-label {
    margin-bottom: 0.28rem;
    font-size: 0.69rem;
}

.detail-item-value {
    font-size: 0.94rem;
}

.activity-list,
.stack-list,
.result-list {
    gap: 0.68rem;
}

.activity-item,
.stack-item,
.result-item {
    padding: 0.82rem 0.9rem 0.8rem;
    border-radius: 0.92rem;
}

.activity-item-head,
.stack-item-head,
.result-item-head {
    gap: 0.8rem;
    margin-bottom: 0.24rem;
}

.activity-item-title,
.stack-item-title,
.result-item-title {
    font-size: 0.95rem;
}

.activity-item-meta,
.stack-item-meta,
.result-item-meta,
.result-item-context,
.result-group-footnote {
    font-size: 0.8rem;
}

.result-item-footer {
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.68rem;
}

.status-pill {
    padding: 0.3rem 0.58rem;
    font-size: 0.71rem;
}

.action-row {
    gap: 0.42rem;
    margin-top: 0.68rem;
}

.action-row .btn {
    min-height: 2.2rem;
    padding: 0.42rem 0.72rem;
    border-radius: 0.76rem;
    font-size: 0.78rem;
}

.table-responsive.data-table-shell {
    border-radius: 0.92rem;
}

.data-table {
    min-width: 680px;
}

.data-table thead th {
    padding: 0.72rem 0.78rem;
    font-size: 0.69rem;
}

.data-table td {
    padding: 0.74rem 0.78rem;
    font-size: 0.9rem;
}

.dense-table th,
.dense-table td {
    font-size: 0.88rem;
}

.dense-table td.wrap,
.dense-table .wrap {
    min-width: 14rem;
}

.empty-state,
.loading-state,
.error-state {
    padding: 1.45rem 0.9rem;
    border-radius: 0.92rem;
}

.empty-state.compact,
.loading-state.compact,
.error-state.compact {
    padding: 0.95rem 0.85rem;
}

.form-actions {
    gap: 0.55rem;
    margin-top: 1rem;
    padding-top: 0.8rem;
}

.note-context-banner {
    margin-bottom: 0.82rem;
    padding: 0.86rem 0.92rem;
    border-radius: 0.92rem;
}

.note-context-title {
    font-size: 0.95rem;
}

.source-code-block {
    padding: 0.95rem;
    border-radius: 0.92rem;
    font-size: 0.84rem;
    line-height: 1.46;
}

.pagination-shell {
    margin-top: 0.9rem;
}

.pagination .page-link {
    min-width: 2.28rem;
    padding: 0.46rem 0.68rem;
}

.app-footer {
    padding: 0.9rem 1rem calc(5.45rem + env(safe-area-inset-bottom));
    font-size: 0.8rem;
}

.mobile-dock {
    gap: 0.35rem;
    padding: 0.5rem 0.65rem calc(0.58rem + env(safe-area-inset-bottom));
}

.mobile-dock-link {
    padding: 0.42rem 0.28rem;
    border-radius: 0.78rem;
}

@media (min-width: 768px) {
    .app-content {
        padding: 0.95rem 1rem calc(5.6rem + env(safe-area-inset-bottom));
    }

    .shell-card > .card-body,
    .results-card .card-body {
        padding: 0.95rem 1rem;
    }
}

@media (min-width: 992px) {
    .topbar {
        max-width: 1368px;
        margin: 0.82rem auto 0;
        width: calc(100% - 1.8rem);
        padding: 0.8rem 0.95rem;
        border-radius: 1.05rem;
    }

    .app-content {
        padding: 0.95rem 0.9rem 1.35rem;
    }

    .page-banner {
        padding: 1rem 1.05rem 0.92rem;
    }

    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .app-footer {
        padding: 0.9rem 1.15rem 1.2rem;
    }
}

@media (min-width: 1400px) {
    .workspace-frame,
    .topbar {
        max-width: 1420px;
    }

    .stats-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .app-sidebar .offcanvas-body {
        padding-bottom: 1rem;
    }

    .page-banner {
        padding: 0.85rem 0.9rem 0.8rem;
    }

    .filter-form {
        --bs-gutter-x: 0.65rem;
        --bs-gutter-y: 0.65rem;
    }

    .data-table tbody {
        gap: 0.65rem;
    }

    .data-table tbody tr {
        border-radius: 0.9rem;
        box-shadow: 0 10px 18px rgba(16, 31, 48, 0.05);
    }

    .data-table tbody td,
    .dense-table tbody td {
        gap: 0.68rem;
        padding: 0.68rem 0.82rem;
    }

    .action-row {
        width: 100%;
    }

    .embedded-shell {
        padding: 0.55rem;
    }

    .embedded-map-shell,
    .embedded-map-frame {
        min-height: 28rem;
    }

    .map-fullscreen-button {
        top: 0.65rem;
        right: 0.65rem;
    }
}

/* UX Cleanup Pass */

#reportsListMeta:empty {
    display: none;
}

#reportsListMeta {
    margin-bottom: 0.85rem;
}

.reports-filter-actions {
    margin-top: 0;
    justify-content: flex-end;
}

.summary-card .section-header .action-row,
.filter-card .section-header .action-row {
    margin-top: 0;
}

.query-workbench-sql {
    background: linear-gradient(180deg, #fbfdff 0%, #f2f6fb 100%);
    border-color: rgba(31, 77, 120, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 0 rgba(255, 255, 255, 0.82);
    tab-size: 4;
}

.query-workbench-sql::placeholder {
    color: #75859a;
}

.action-row .btn {
    white-space: nowrap;
}

.table-meta-bar {
    color: #2e4764;
}

@media (max-width: 991.98px) {
    .reports-filter-actions {
        justify-content: stretch;
    }
}

@media (max-width: 767.98px) {
    .reports-filter-actions .btn,
    .summary-card .section-header .action-row .btn {
        flex: 1 1 0;
    }
}

/* Dashboard Landing Pass */

.dashboard-shell {
    gap: 1rem;
}

.dashboard-hero > .card-body {
    padding: 1.05rem 1.1rem;
    background:
        radial-gradient(circle at top right, rgba(31, 77, 120, 0.16), transparent 22rem),
        linear-gradient(135deg, rgba(15, 36, 59, 0.96), rgba(28, 63, 96, 0.94));
    color: #f5f8fb;
}

.dashboard-eyebrow {
    margin-bottom: 0.7rem;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dashboard-hero-title {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.dashboard-hero-text,
.dashboard-hero-summary {
    max-width: 42rem;
    color: rgba(245, 248, 251, 0.86);
    font-size: 0.98rem;
    line-height: 1.62;
}

.dashboard-hero-text {
    margin: 1rem 0 0;
}

.dashboard-hero-summary {
    margin: 1rem 0 0;
}

.dashboard-hero-summary strong {
    color: #ffffff;
    font-weight: 800;
}

.dashboard-hero-actions {
    margin-top: 1.1rem;
}

.dashboard-hero-actions .btn {
    min-height: 2.65rem;
    border-radius: 0.9rem;
}

.dashboard-journey-card {
    height: 100%;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dashboard-mini-heading {
    margin-bottom: 0.7rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.dashboard-journey-list {
    display: grid;
    gap: 0.7rem;
}

.dashboard-journey-item {
    display: block;
    padding: 0.9rem 0.95rem;
    border-radius: 0.92rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.dashboard-journey-item:hover,
.dashboard-journey-item:focus-visible {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.dashboard-journey-step,
.dashboard-journey-copy {
    display: block;
}

.dashboard-journey-step {
    font-weight: 700;
}

.dashboard-journey-copy {
    margin-top: 0.22rem;
    color: rgba(245, 248, 251, 0.78);
    font-size: 0.88rem;
    line-height: 1.45;
}

.dashboard-metrics-board {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.dashboard-metric-card {
    overflow: hidden;
}

.dashboard-metric-card .card-body {
    position: relative;
    padding: 1rem 1rem 0.95rem;
}

.dashboard-metric-card--primary {
    grid-column: span 4;
}

.dashboard-metric-card--secondary {
    grid-column: span 3;
}

.dashboard-metric-card .card-body::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 1rem 0 0 1rem;
    background: linear-gradient(180deg, rgba(31, 77, 120, 0.95), rgba(22, 57, 87, 0.5));
}

.dashboard-metric-label {
    color: var(--dd-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-metric-value {
    margin: 0.28rem 0 0.22rem;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    color: var(--dd-primary-dark);
    line-height: 1;
}

.dashboard-metric-meta {
    color: var(--dd-muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.dashboard-route-grid {
    display: grid;
    gap: 0.72rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-route-card {
    display: block;
    padding: 0.95rem 1rem;
    border-radius: 0.98rem;
    border: 1px solid rgba(23, 50, 79, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-route-card:hover,
.dashboard-route-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(31, 77, 120, 0.22);
    box-shadow: 0 12px 24px rgba(17, 34, 52, 0.08);
    color: inherit;
}

.dashboard-route-title,
.dashboard-route-copy {
    display: block;
}

.dashboard-route-title {
    font-weight: 700;
}

.dashboard-route-copy {
    margin-top: 0.28rem;
    color: var(--dd-muted);
    font-size: 0.89rem;
    line-height: 1.42;
}

@media (max-width: 1399.98px) {
    .dashboard-metric-card--primary,
    .dashboard-metric-card--secondary {
        grid-column: span 6;
    }
}

@media (max-width: 991.98px) {
    .dashboard-hero-title {
        max-width: none;
    }

    .dashboard-metrics-board {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .dashboard-metric-card--primary,
    .dashboard-metric-card--secondary {
        grid-column: span 3;
    }
}

@media (max-width: 767.98px) {
    .dashboard-hero > .card-body {
        padding: 0.95rem;
    }

    .dashboard-hero-title {
        font-size: clamp(1.7rem, 7vw, 2.25rem);
    }

    .dashboard-hero-actions .btn {
        flex: 1 1 100%;
    }

    .dashboard-metrics-board {
        grid-template-columns: 1fr;
    }

    .dashboard-metric-card--primary,
    .dashboard-metric-card--secondary {
        grid-column: span 1;
    }

    .dashboard-route-grid {
        grid-template-columns: 1fr;
    }
}

/* Table Detail Fields */

.table-fields-grid {
    width: 100%;
    min-width: 0;
    table-layout: auto;
}

.table-fields-grid th,
.table-fields-grid td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    vertical-align: top;
}

.table-fields-grid thead th {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.table-fields-grid .status-pill {
    white-space: nowrap;
}

.table-fields-grid th:nth-child(1),
.table-fields-grid td:nth-child(1) {
    min-width: 9rem;
}

.table-fields-grid th:nth-child(2),
.table-fields-grid td:nth-child(2) {
    min-width: 7.5rem;
}

.table-fields-grid th:nth-child(3),
.table-fields-grid td:nth-child(3) {
    min-width: 7rem;
}

.table-fields-grid th:nth-child(4),
.table-fields-grid td:nth-child(4) {
    min-width: 5rem;
}

.table-fields-grid th:nth-child(5),
.table-fields-grid td:nth-child(5),
.table-fields-grid th:nth-child(7),
.table-fields-grid td:nth-child(7),
.table-fields-grid th:nth-child(8),
.table-fields-grid td:nth-child(8),
.table-fields-grid th:nth-child(10),
.table-fields-grid td:nth-child(10),
.table-fields-grid th:nth-child(11),
.table-fields-grid td:nth-child(11),
.table-fields-grid th:nth-child(12),
.table-fields-grid td:nth-child(12) {
    width: 1%;
    white-space: nowrap;
}

.table-fields-grid .table-field-name {
    min-width: 10rem;
}

.table-fields-grid td:nth-child(6) {
    min-width: 6rem;
}

.table-fields-grid .table-field-description {
    min-width: 14rem;
}

.table-fields-grid .table-field-flag {
    text-align: center;
}

.table-fields-grid .table-field-actions .action-row {
    margin-top: 0;
    justify-content: flex-start;
}

.table-fields-grid .table-field-actions .btn {
    min-width: 6.25rem;
}

@media (max-width: 1199.98px) {
    .table-fields-shell {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .table-fields-grid,
    .table-fields-grid thead,
    .table-fields-grid tbody,
    .table-fields-grid tr,
    .table-fields-grid th,
    .table-fields-grid td {
        display: block;
        width: 100%;
    }

    .table-fields-grid {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
        table-layout: auto;
    }

    .table-fields-grid thead {
        display: none;
    }

    .table-fields-grid tbody {
        display: grid;
        gap: 0.75rem;
    }

    .table-fields-grid tbody tr {
        overflow: hidden;
        border: 1px solid rgba(23, 50, 79, 0.08);
        border-radius: 1rem;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.98));
        box-shadow: 0 12px 24px rgba(16, 31, 48, 0.06);
    }

    .table-fields-grid tbody td {
        display: grid;
        grid-template-columns: minmax(7.5rem, 34%) minmax(0, 1fr);
        gap: 0.75rem;
        align-items: start;
        padding: 0.78rem 0.9rem;
        border: 0;
        border-top: 1px solid rgba(23, 50, 79, 0.07);
        text-align: left;
    }

    .table-fields-grid tbody tr > td:first-child {
        border-top: 0;
    }

    .table-fields-grid tbody td::before {
        content: attr(data-label);
        color: var(--dd-secondary);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .table-fields-grid tbody td[data-full-row="true"] {
        display: block;
        padding: 0.95rem;
        border-top: 0;
    }

    .table-fields-grid tbody td[data-full-row="true"]::before {
        display: none;
    }

    .table-fields-grid .table-field-actions .btn {
        min-width: 0;
        width: auto;
    }
}
