html {
    font-size: 16px;
}

:root {
    --surface: rgba(21, 24, 30, 0.96);
    --surface-page: #090b0f;
    --surface-soft: #12161c;
    --surface-strong: #171b22;
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-muted: #9ba6b8;
    --brand: #ff7a00;
    --brand-hover: #ff5c00;
    --brand-soft: rgba(255, 122, 0, 0.12);
    --brand-soft-strong: rgba(255, 122, 0, 0.2);
    --info-soft: rgba(59, 130, 246, 0.12);
    --info-border: rgba(96, 165, 250, 0.35);
    --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.24);
    --shadow-strong: 0 32px 70px rgba(0, 0, 0, 0.34);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

body {
    margin: 0;
    position: relative;
    font-family: "Segoe UI Variable", "Segoe UI", Tahoma, sans-serif;
    color: var(--text-main);
    background:
        linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0, rgba(24, 27, 34, 0.98) 68px, transparent 68px),
        radial-gradient(circle at top right, rgba(255, 122, 0, 0.08), transparent 18%),
        radial-gradient(circle at bottom left, rgba(249, 115, 22, 0.08), transparent 24%),
        var(--surface-page);
    min-height: 100vh;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: #ff9f1a;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

button {
    appearance: none;
}

.page-shell {
    max-width: none;
    margin: 0;
    padding: 0 0 40px;
}

.page-shell-with-sidebar {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 0;
    align-items: start;
}

.page-shell-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr);
}

.page-content-shell {
    min-width: 0;
    display: grid;
    gap: 20px;
    padding: 18px 20px 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 68px;
    padding: 0 20px;
    background: rgba(24, 27, 34, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-topbar-brand,
.app-topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.app-topbar-brand-button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.app-topbar-brand-button:hover .app-topbar-logo {
    transform: translateY(-1px);
}

.app-topbar-logo,
.app-topbar-user-avatar {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-weight: 800;
}

.app-topbar-logo {
    background: linear-gradient(180deg, #ffb000 0%, #ff6a00 100%);
    color: #10141a;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.app-topbar-copy,
.app-topbar-user-copy {
    display: grid;
    gap: 2px;
}

.app-topbar-copy strong,
.app-topbar-user-copy strong {
    color: #ffffff;
    font-size: 0.98rem;
}

.app-topbar-copy small,
.app-topbar-user-copy small {
    color: #98a2b3;
    font-size: 0.8rem;
}

.workspace-sidebar {
    position: sticky;
    top: 68px;
    display: grid;
    gap: 10px;
    padding: 10px 8px 14px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(18, 21, 27, 0.98) 0%, rgba(13, 16, 21, 0.98) 100%);
    box-shadow: var(--shadow-soft);
    min-height: calc(100vh - 68px);
    max-height: calc(100vh - 68px);
    overflow: auto;
}

.workspace-sidebar-nav {
    display: grid;
    gap: 6px;
    align-content: start;
}

.workspace-sidebar-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    color: #ffffff;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.workspace-sidebar-link:hover {
    text-decoration: none;
    border-color: rgba(255, 122, 0, 0.22);
    background: rgba(255, 122, 0, 0.08);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.workspace-sidebar-link-active {
    border-color: rgba(255, 122, 0, 0.22);
    background: rgba(255, 122, 0, 0.12);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.workspace-sidebar-link-code {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: #98a2b3;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.workspace-sidebar-link-active .workspace-sidebar-link-code {
    background: linear-gradient(180deg, #ffb000 0%, #ff6a00 100%);
    color: #10141a;
}

.workspace-sidebar-link-copy {
    display: inline-flex;
    align-items: center;
}

.workspace-sidebar-link-copy strong {
    color: #f8fafc;
    font-size: 0.78rem;
}

.page-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 0;
}

.page-toolbar-copy {
    display: grid;
    gap: 4px;
}

.page-toolbar-copy h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2rem);
    letter-spacing: -0.03em;
    color: #ffffff;
}

body[data-theme="light"] {
    color: #18212f;
    background:
        radial-gradient(circle at top left, rgba(255, 186, 120, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(191, 219, 254, 0.22), transparent 22%),
        linear-gradient(180deg, #fffaf4 0%, #f8f1e7 38%, #f2e8dd 100%);
}

body[data-theme="light"] a {
    color: #1d4ed8;
}

body[data-theme="light"] .app-topbar {
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 34px -30px rgba(15, 23, 42, 0.3);
}

body[data-theme="light"] .app-topbar-copy strong,
body[data-theme="light"] .app-topbar-user-copy strong,
body[data-theme="light"] .page-toolbar-copy h1,
body[data-theme="light"] .workspace-sidebar-link-copy strong,
body[data-theme="light"] .section-kicker,
body[data-theme="light"] .panel h3,
body[data-theme="light"] .modal-header h3,
body[data-theme="light"] .modal-field strong,
body[data-theme="light"] .reference-title,
body[data-theme="light"] .credit-panel-head h4,
body[data-theme="light"] .credit-metric-card strong,
body[data-theme="light"] .audit-placeholder-card h4 {
    color: #18212f;
}

body[data-theme="light"] .app-topbar-copy small,
body[data-theme="light"] .app-topbar-user-copy small,
body[data-theme="light"] .subtle,
body[data-theme="light"] .workspace-sidebar-link-code,
body[data-theme="light"] .modal-label,
body[data-theme="light"] .credit-panel-kicker,
body[data-theme="light"] .credit-metric-label,
body[data-theme="light"] .audit-placeholder-kicker,
body[data-theme="light"] .job-status-pill,
body[data-theme="light"] .table-browser-search span,
body[data-theme="light"] .table-browser-page-size span,
body[data-theme="light"] .table-browser-page-label {
    color: #5f6b7b;
}

body[data-theme="light"] .app-topbar-logo,
body[data-theme="light"] .workspace-sidebar-link-active .workspace-sidebar-link-code,
body[data-theme="light"] .upload-icon,
body[data-theme="light"] .ui-button-primary {
    background: linear-gradient(180deg, #ff8a3d 0%, #ea580c 100%);
    color: #ffffff;
}

body[data-theme="light"] .workspace-sidebar,
body[data-theme="light"] .panel,
body[data-theme="light"] .flash-message,
body[data-theme="light"] .modal-card,
body[data-theme="light"] .modal-field,
body[data-theme="light"] .reference-card,
body[data-theme="light"] .credit-panel,
body[data-theme="light"] .credit-metric-card,
body[data-theme="light"] .audit-placeholder-card,
body[data-theme="light"] .table-wrap,
body[data-theme="light"] .table-browser-toolbar,
body[data-theme="light"] .upload-dropzone,
body[data-theme="light"] .workspace-theme-toggle {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 36px -30px rgba(15, 23, 42, 0.28);
}

body[data-theme="light"] .workspace-sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(250, 243, 234, 0.96) 100%);
    border-right-color: rgba(148, 163, 184, 0.16);
    box-shadow: 20px 0 40px -34px rgba(15, 23, 42, 0.28);
}

body[data-theme="light"] .workspace-sidebar-link,
body[data-theme="light"] .workspace-theme-toggle,
body[data-theme="light"] .ui-button-secondary,
body[data-theme="light"] .cell-select,
body[data-theme="light"] .obser-input,
body[data-theme="light"] .table-browser-search input,
body[data-theme="light"] .table-browser-page-size select,
body[data-theme="light"] .observation-field textarea,
body[data-theme="light"] .observation-promise-grid input,
body[data-theme="light"] .modal-close {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(148, 163, 184, 0.24);
    color: #334155;
}

body[data-theme="light"] .workspace-sidebar-link:hover {
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(255, 247, 237, 0.96);
    box-shadow: 0 16px 30px -28px rgba(249, 115, 22, 0.72);
}

body[data-theme="light"] .workspace-sidebar-link-active {
    border-color: rgba(234, 88, 12, 0.22);
    background: linear-gradient(180deg, #fff3e7 0%, #ffe5cf 100%);
    box-shadow: 0 18px 32px -28px rgba(234, 88, 12, 0.9);
}

body[data-theme="light"] .workspace-sidebar-link-code {
    background: rgba(234, 88, 12, 0.1);
}

body[data-theme="light"] .workspace-theme-toggle-icon {
    background: rgba(234, 88, 12, 0.1);
}

body[data-theme="light"] .page-toolbar {
    padding: 22px 24px;
    border: 1px solid rgba(255, 226, 204, 0.8);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(255, 249, 242, 0.95) 0%, rgba(255, 241, 226, 0.9) 54%, rgba(239, 246, 255, 0.86) 100%);
    box-shadow: 0 24px 48px -40px rgba(15, 23, 42, 0.32);
}

body[data-theme="light"] .section-kicker,
body[data-theme="light"] .workspace-sidebar-kicker,
body[data-theme="light"] .workspace-sidebar-group-title {
    color: #ea580c;
}

body[data-theme="light"] .table-filter-chip {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(148, 163, 184, 0.24);
    color: #334155;
}

body[data-theme="light"] .table-filter-chip strong {
    background: rgba(148, 163, 184, 0.18);
}

body[data-theme="light"] .table-filter-chip:hover {
    border-color: rgba(249, 115, 22, 0.34);
    background: rgba(255, 247, 237, 0.96);
}

body[data-theme="light"] .table-filter-chip-active {
    border-color: rgba(249, 115, 22, 0.38);
    background: linear-gradient(180deg, #fff4e8 0%, #ffedd5 100%);
    color: #9a3412;
    box-shadow: 0 10px 24px -18px rgba(249, 115, 22, 0.9);
}

body[data-theme="light"] .excel-table thead th {
    background: linear-gradient(180deg, #fff8f1 0%, #f7efe7 100%);
    color: #7c3e12;
}

body[data-theme="light"] .excel-table th,
body[data-theme="light"] .excel-table td {
    border-color: rgba(223, 228, 234, 0.82);
    color: #18212f;
}

body[data-theme="light"] .excel-table tbody tr:nth-child(even) td,
body[data-theme="light"] .excel-table-freeze tbody tr:nth-child(even) td:nth-child(1),
body[data-theme="light"] .excel-table-freeze tbody tr:nth-child(even) td:nth-child(2),
body[data-theme="light"] .excel-table-freeze tbody tr:nth-child(even) td:nth-child(3),
body[data-theme="light"] .excel-table-freeze tbody tr:nth-child(even) td:nth-child(4),
body[data-theme="light"] .excel-table-freeze tbody tr:nth-child(even) td:nth-child(5),
body[data-theme="light"] .excel-table-freeze tbody tr:nth-child(even) td:nth-child(6) {
    background: rgba(250, 250, 250, 0.88);
}

body[data-theme="light"] .excel-table tbody tr:hover td,
body[data-theme="light"] .excel-table-freeze tbody tr:hover td:nth-child(1),
body[data-theme="light"] .excel-table-freeze tbody tr:hover td:nth-child(2),
body[data-theme="light"] .excel-table-freeze tbody tr:hover td:nth-child(3),
body[data-theme="light"] .excel-table-freeze tbody tr:hover td:nth-child(4),
body[data-theme="light"] .excel-table-freeze tbody tr:hover td:nth-child(5),
body[data-theme="light"] .excel-table-freeze tbody tr:hover td:nth-child(6) {
    background: rgba(255, 244, 235, 0.78);
}

body[data-theme="light"] .excel-table-freeze tbody td:nth-child(1),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(2),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(3),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(4),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(5),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(6) {
    background: rgba(255, 255, 255, 0.98);
}

body[data-theme="light"] .view-trigger svg {
    fill: #1f2937;
}

body[data-theme="light"] .job-status-pill,
body[data-theme="light"] .audit-load-metrics span {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(148, 163, 184, 0.18);
    color: #475569;
}

body[data-theme="light"] .audit-load-card,
body[data-theme="light"] .audit-placeholder-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(252, 246, 239, 0.95) 100%);
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 22px 44px -36px rgba(15, 23, 42, 0.28);
}

body[data-theme="light"] .audit-load-card:hover {
    border-color: rgba(249, 115, 22, 0.26);
    box-shadow: 0 26px 44px -34px rgba(249, 115, 22, 0.36);
}

body[data-theme="light"] .audit-load-card-active {
    background: linear-gradient(180deg, rgba(255, 242, 232, 0.98) 0%, rgba(255, 231, 211, 0.96) 100%);
    border-color: rgba(234, 88, 12, 0.22);
    box-shadow: 0 26px 48px -34px rgba(234, 88, 12, 0.34);
}

body[data-theme="light"] .audit-load-card h4,
body[data-theme="light"] .audit-summary-card h4 {
    color: #18212f;
}

body[data-theme="light"] .audit-load-card .job-status-pill {
    background: rgba(255, 255, 255, 0.84);
    color: #64748b;
}

body[data-theme="light"] .table-wrap,
body[data-theme="light"] .table-browser-toolbar {
    box-shadow: 0 22px 42px -36px rgba(15, 23, 42, 0.25);
}

.page-shell-sidebar-collapsed .workspace-sidebar {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    border-right-width: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.workspace-sidebar-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: center;
}

.workspace-theme-toggle {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.workspace-theme-toggle:hover {
    background: rgba(255, 122, 0, 0.08);
    border-color: rgba(255, 122, 0, 0.18);
    transform: translateY(-1px);
}

.workspace-theme-toggle-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

.workspace-theme-icon {
    width: 16px;
    height: 16px;
    display: none;
    fill: #ffd08a;
}

body[data-theme="dark"] .workspace-theme-icon-moon,
body:not([data-theme]) .workspace-theme-icon-moon {
    display: block;
}

body[data-theme="light"] .workspace-theme-icon-sun {
    display: block;
    fill: #ea580c;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
}

.page-header h1 {
    margin: 4px 0 8px;
    font-size: 2rem;
    line-height: 1.1;
}

.eyebrow {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ff9f1a;
}

.subtle {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.header-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.page-main {
    display: grid;
    gap: 22px;
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 20px;
    padding: 26px 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(22, 25, 31, 0.98) 0%, rgba(17, 20, 25, 0.96) 48%, rgba(14, 17, 22, 0.98) 100%);
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.hero-panel::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 122, 0, 0.14) 0%, rgba(255, 122, 0, 0) 72%);
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    align-content: start;
}

.hero-copy h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(2rem, 3.2vw, 3.2rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.hero-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    align-content: center;
}

.hero-metric {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(6px);
}

.hero-metric-label {
    color: #98a2b3;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-metric strong {
    font-size: 1rem;
}

.workspace-switcher {
    display: grid;
    gap: 10px;
}

.workspace-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
    width: fit-content;
    backdrop-filter: blur(8px);
}

.workspace-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #334155;
    font-weight: 600;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.workspace-tab:hover {
    text-decoration: none;
    background: rgba(255, 255, 255, 0.85);
}

.workspace-tab-active {
    border-color: rgba(234, 88, 12, 0.18);
    background: linear-gradient(180deg, #fff4ea 0%, #ffe8d4 100%);
    color: #b45309;
    box-shadow: 0 10px 22px rgba(234, 88, 12, 0.14);
}

.workspace-note {
    margin: 0;
    color: #7b8796;
    font-size: 0.92rem;
}

.panel {
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.panel h2,
.panel h3,
.panel h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.panel h3 {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.section-kicker {
    margin: 0 0 4px;
    color: #ff9f1a;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pill-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.pill {
    display: inline-block;
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    color: #dbeafe;
    font-size: 0.88rem;
    font-weight: 600;
}

.lookup-form {
    display: grid;
    gap: 16px;
}

.field-block label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

.field-block-file {
    display: grid;
    gap: 8px;
}

.upload-picker {
    position: relative;
}

.upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.upload-dropzone {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
    padding: 14px 16px;
    border: 1px dashed rgba(255, 122, 0, 0.24);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(17, 20, 25, 0.98) 100%);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.upload-dropzone:hover {
    border-color: rgba(255, 122, 0, 0.48);
    background: linear-gradient(180deg, rgba(28, 32, 39, 0.98) 0%, rgba(19, 23, 29, 0.98) 100%);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.upload-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffb000 0%, #ff6a00 100%);
    box-shadow: 0 14px 28px rgba(255, 106, 0, 0.28);
    grid-row: 1 / span 3;
}

.upload-icon svg {
    width: 22px;
    height: 22px;
    fill: #10141a;
}

.upload-title {
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 800;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.upload-filename {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 30px;
    width: fit-content;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #98a2b3;
    font-size: 0.88rem;
    font-weight: 600;
    max-width: min(100%, 420px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.field-block textarea {
    width: 100%;
    min-height: 160px;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    resize: vertical;
}

.field-block input[type="file"] {
    display: block;
    width: min(480px, 100%);
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-strong);
    box-sizing: border-box;
}

.button-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.ui-button:hover {
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.ui-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ui-button-primary {
    border-color: #ff7a00;
    background: linear-gradient(180deg, #ffb000 0%, #ff6a00 100%);
    color: #10141a;
}

.ui-button-primary:hover {
    border-color: #ff5c00;
    background: linear-gradient(180deg, #ffc14d 0%, #ff6a00 100%);
}

.ui-button-secondary {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
}

.ui-button-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.table-wrap {
    position: relative;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: var(--surface-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.table-browser {
    display: grid;
    gap: 14px;
}

.table-browser-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(17, 20, 25, 0.98) 100%);
}

.page-shell-with-sidebar:not(.page-shell-sidebar-collapsed) .table-browser-toolbar {
    gap: 12px;
    padding: 12px 14px;
}

.table-browser-search,
.table-browser-page-size,
.table-browser-filter {
    display: grid;
    gap: 6px;
}

.table-browser-search span,
.table-browser-page-size span,
.table-browser-filter span {
    color: #dbe2ea;
    font-size: 0.88rem;
    font-weight: 600;
}

.table-browser-search input,
.table-browser-page-size select,
.table-browser-filter select {
    min-height: 40px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.04);
    font: inherit;
    color: #f8fafc;
}

.table-browser-search input {
    width: min(420px, calc(100vw - 96px));
}

.page-shell-with-sidebar:not(.page-shell-sidebar-collapsed) .table-browser-search input {
    width: min(340px, calc(100vw - 360px));
}

.table-browser-controls {
    display: flex;
    align-items: end;
    gap: 16px;
    flex-wrap: wrap;
}

.table-browser-filter select {
    min-width: 220px;
}

.table-browser-page-size select option,
.table-browser-filter select option {
    background: var(--theme-input-option-bg);
    color: var(--theme-text);
}

.table-browser-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.table-filter-chip strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    min-height: 26px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font-size: 0.78rem;
}

.table-filter-chip:hover {
    border-color: rgba(255, 122, 0, 0.28);
    background: rgba(255, 122, 0, 0.08);
}

.table-filter-chip-active {
    border-color: rgba(255, 122, 0, 0.22);
    background: rgba(255, 122, 0, 0.14);
    color: #ffd08a;
    box-shadow: 0 10px 24px -18px rgba(255, 122, 0, 0.9);
}

.table-browser-summary {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
}

.table-browser-empty {
    margin: 0;
}

.table-browser-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-browser-page-button {
    min-height: 38px;
    padding: 0 14px;
}

.table-browser-page-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.table-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.table-sort-button:hover {
    color: var(--brand);
}

.table-sort-button-active {
    color: var(--brand);
}

.table-sort-indicator {
    font-size: 0.88rem;
    line-height: 1;
}

.table-browser-page-label {
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
}

.excel-table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.84rem;
}

.excel-table th,
.excel-table td {
    padding: 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
}

.excel-table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #1a1f27 0%, #13171d 100%);
    z-index: 1;
    font-weight: 700;
    color: #ffd08a;
    letter-spacing: 0.01em;
}

.excel-table th:nth-child(1),
.excel-table td:nth-child(1) {
    width: 72px;
}

.excel-table th:nth-child(2),
.excel-table td:nth-child(2) {
    width: 78px;
}

.excel-table th:nth-child(3),
.excel-table td:nth-child(3) {
    width: 170px;
}

.excel-table th:nth-child(4),
.excel-table td:nth-child(4) {
    width: 92px;
}

.excel-table th:nth-child(5),
.excel-table td:nth-child(5) {
    width: 92px;
}

.excel-table th:nth-child(6),
.excel-table td:nth-child(6) {
    width: 118px;
}

.excel-table th:nth-child(7),
.excel-table td:nth-child(7),
.excel-table th:nth-child(8),
.excel-table td:nth-child(8) {
    width: 156px;
}

.excel-table th:nth-child(9),
.excel-table td:nth-child(9) {
    width: 136px;
}

.excel-table th:nth-child(10),
.excel-table td:nth-child(10) {
    width: 132px;
}

.excel-table th:last-child,
.excel-table td:last-child {
    width: 136px;
}

.excel-table-freeze th:nth-child(1),
.excel-table-freeze td:nth-child(1),
.excel-table-freeze th:nth-child(2),
.excel-table-freeze td:nth-child(2),
.excel-table-freeze th:nth-child(3),
.excel-table-freeze td:nth-child(3),
.excel-table-freeze th:nth-child(4),
.excel-table-freeze td:nth-child(4),
.excel-table-freeze th:nth-child(5),
.excel-table-freeze td:nth-child(5),
.excel-table-freeze th:nth-child(6),
.excel-table-freeze td:nth-child(6) {
    position: sticky;
    z-index: 2;
}

.excel-table-freeze thead th:nth-child(1),
.excel-table-freeze thead th:nth-child(2),
.excel-table-freeze thead th:nth-child(3),
.excel-table-freeze thead th:nth-child(4),
.excel-table-freeze thead th:nth-child(5),
.excel-table-freeze thead th:nth-child(6) {
    z-index: 3;
}

.excel-table-freeze th:nth-child(1),
.excel-table-freeze td:nth-child(1) {
    left: 0;
}

.excel-table-freeze th:nth-child(2),
.excel-table-freeze td:nth-child(2) {
    left: 72px;
}

.excel-table-freeze th:nth-child(3),
.excel-table-freeze td:nth-child(3) {
    left: 150px;
}

.excel-table-freeze th:nth-child(4),
.excel-table-freeze td:nth-child(4) {
    left: 320px;
}

.excel-table-freeze th:nth-child(5),
.excel-table-freeze td:nth-child(5) {
    left: 412px;
}

.excel-table-freeze th:nth-child(6),
.excel-table-freeze td:nth-child(6) {
    left: 504px;
}

.excel-table-freeze tbody td:nth-child(1),
.excel-table-freeze tbody td:nth-child(2),
.excel-table-freeze tbody td:nth-child(3),
.excel-table-freeze tbody td:nth-child(4),
.excel-table-freeze tbody td:nth-child(5),
.excel-table-freeze tbody td:nth-child(6) {
    background: rgba(17, 21, 26, 0.98);
}

.excel-table-freeze tbody tr:nth-child(even) td:nth-child(1),
.excel-table-freeze tbody tr:nth-child(even) td:nth-child(2),
.excel-table-freeze tbody tr:nth-child(even) td:nth-child(3),
.excel-table-freeze tbody tr:nth-child(even) td:nth-child(4),
.excel-table-freeze tbody tr:nth-child(even) td:nth-child(5),
.excel-table-freeze tbody tr:nth-child(even) td:nth-child(6) {
    background: rgba(20, 24, 30, 0.98);
}

.excel-table-freeze tbody tr:hover td:nth-child(1),
.excel-table-freeze tbody tr:hover td:nth-child(2),
.excel-table-freeze tbody tr:hover td:nth-child(3),
.excel-table-freeze tbody tr:hover td:nth-child(4),
.excel-table-freeze tbody tr:hover td:nth-child(5),
.excel-table-freeze tbody tr:hover td:nth-child(6) {
    background: rgba(255, 122, 0, 0.08);
}

.excel-table-freeze th:nth-child(6),
.excel-table-freeze td:nth-child(6) {
    box-shadow: 8px 0 18px -16px rgba(15, 23, 42, 0.7);
}

.payment-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.payment-status-current {
    background: #dcfce7;
    color: #166534;
}

.payment-status-upcoming {
    background: #e0f2fe;
    color: #075985;
}

.payment-status-warning {
    background: #ffedd5;
    color: #9a3412;
}

.payment-status-fpd3 {
    background: #fef3c7;
    color: #92400e;
}

.payment-status-fpd7 {
    background: #fed7aa;
    color: #9a3412;
}

.payment-status-fpd15 {
    background: #fecaca;
    color: #991b1b;
}

.payment-status-still-in-arrears {
    background: #7f1d1d;
    color: #ffffff;
}

.payment-status-unknown {
    background: #e5e7eb;
    color: #374151;
}

.excel-table tbody tr:nth-child(even) td {
    background: rgba(20, 24, 30, 0.88);
}

.excel-table tbody tr:hover td {
    background: rgba(255, 122, 0, 0.08);
}

.excel-table tbody tr.row-saving td {
    background: rgba(255, 247, 237, 0.92);
}

.excel-table tbody tr.row-save-success td {
    background: rgba(220, 252, 231, 0.88);
}

.excel-table tbody tr.row-save-error td {
    background: rgba(254, 226, 226, 0.9);
}

.excel-table td.fpd-cell {
    font-weight: 700;
}

.excel-table td.fpd-cell-3 {
    background: #fef3c7;
}

.excel-table td.fpd-cell-7 {
    background: #fed7aa;
}

.excel-table td.fpd-cell-15 {
    background: #fecaca;
}

.obser-cell {
    min-width: 0;
}

.select-cell {
    min-width: 156px;
    vertical-align: middle;
}

.cell-select,
.obser-input {
    width: 100%;
    min-width: 0;
    padding: 9px 36px 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(30, 35, 43, 0.96) 0%, rgba(21, 25, 31, 0.96) 100%);
    box-sizing: border-box;
    min-height: 42px;
    color: var(--text-main);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cell-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 208, 138, 0.95) 50%),
        linear-gradient(135deg, rgba(255, 208, 138, 0.95) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.cell-select option {
    background: #151a21;
    color: #f8fafc;
}

.cell-select:focus,
.obser-input:focus {
    outline: none;
    border-color: rgba(255, 122, 0, 0.5);
    box-shadow:
        0 0 0 3px rgba(255, 122, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.view-cell {
    min-width: 136px;
    text-align: center;
    vertical-align: middle;
}

.action-group {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.view-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.view-trigger:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.view-trigger svg {
    width: 20px;
    height: 20px;
    fill: #f8fafc;
}

.view-trigger-debt {
    background: rgba(255, 122, 0, 0.12);
    border-color: rgba(255, 177, 66, 0.72);
}

.view-trigger-debt:hover {
    background: rgba(255, 122, 0, 0.22);
}

.view-trigger-person {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.58);
}

.view-trigger-person:hover {
    background: rgba(59, 130, 246, 0.24);
}

.view-trigger-note {
    background: rgba(216, 180, 254, 0.18);
    border-color: rgba(216, 180, 254, 0.62);
}

.view-trigger-note:hover {
    background: rgba(216, 180, 254, 0.28);
}

.view-trigger-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #7c3aed;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(124, 58, 237, 0.24);
}

.modal-shell[hidden] {
    display: none;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(8px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 32px));
    max-height: min(84vh, 900px);
    overflow: auto;
    padding: 20px 20px 18px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(17, 20, 25, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.38);
}

[data-person-modal] .modal-card {
    width: min(820px, calc(100vw - 32px));
}

[data-credit-modal] .modal-card {
    width: min(1120px, calc(100vw - 32px));
}

[data-observation-modal] .modal-card {
    width: min(980px, calc(100vw - 32px));
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-eyebrow {
    margin: 0 0 8px;
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.modal-eyebrow-debt {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.modal-eyebrow-note {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.32rem;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.modal-body {
    display: grid;
    gap: 14px;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.modal-field {
    display: grid;
    gap: 6px;
    min-height: 72px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(18, 21, 27, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.modal-label {
    color: #98a2b3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.modal-field strong {
    display: block;
    color: #f8fafc;
    font-size: 0.95rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}

.modal-field-full {
    grid-column: 1 / -1;
}

.modal-field-double {
    grid-column: span 2;
}

.modal-references {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.reference-card {
    position: relative;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(18, 21, 27, 0.98) 100%);
    overflow: hidden;
}

.reference-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
}

.reference-title {
    margin: 0 0 12px;
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.96rem;
    letter-spacing: -0.01em;
}

.credit-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.credit-panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(18, 21, 27, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.credit-panel-head {
    display: grid;
    gap: 4px;
}

.credit-panel-kicker {
    margin: 0;
    color: #98a2b3;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.credit-panel-head h4 {
    margin: 0;
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.credit-panel-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.credit-panel-customer {
    gap: 10px;
}

.customer-panel-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(140px, 1fr));
    gap: 10px;
}

.modal-field-customer-primary {
    min-width: 0;
}

.observation-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

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

.case-modal-section {
    display: grid;
    gap: 12px;
    scroll-margin-top: 24px;
}

.observation-form {
    display: grid;
    gap: 10px;
}

.observation-management-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.observation-promise-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.credit-panel-compact {
    gap: 10px;
}

.credit-panel-grid-tight {
    gap: 10px;
}

.observation-management-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.observation-promise-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.observation-field {
    display: grid;
    gap: 8px;
}

.observation-field textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-strong);
    box-sizing: border-box;
    resize: vertical;
}

.observation-promise-grid input,
.modal-field-input input,
.bonus-discount input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-strong);
    box-sizing: border-box;
}

.modal-field-input,
.modal-field-bonus {
    min-height: 0;
    align-content: start;
}

.bonus-control {
    display: grid;
    gap: 8px;
}

.bonus-toggle {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-input-plain);
    color: var(--theme-text);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bonus-toggle:hover {
    border-color: rgba(255, 122, 0, 0.45);
}

.bonus-toggle-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(255, 122, 0, 0.2);
}

.bonus-discount {
    display: grid;
}

.bonus-discount[hidden] {
    display: none !important;
}

.bonus-discount-field {
    display: grid;
    gap: 6px;
}

.bonus-discount-visible {
    margin-top: 2px;
}

.case-tabbar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    width: fit-content;
    border: 1px solid var(--theme-border-soft);
    border-radius: 14px;
    background: var(--theme-action-shell);
}

.case-tab {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--theme-text-muted);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.case-tab:hover {
    color: var(--theme-text);
}

.case-tab-active {
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(255, 122, 0, 0.16);
}

.case-tab-panel {
    display: grid;
    gap: 10px;
}

.case-tab-panel[hidden] {
    display: none !important;
}

.modal-actions-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.observation-entry-chip-support {
    background: rgba(14, 165, 233, 0.12);
    color: #0369a1;
}

.observation-feedback {
    min-height: 20px;
}

.observation-history-list {
    display: grid;
    gap: 10px;
}

.observation-history-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.observation-history .section-head {
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.observation-history .section-head h4 {
    margin: 0;
}

.observation-entry {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}

.observation-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    color: #64748b;
    font-size: 0.82rem;
}

.observation-entry-head strong {
    color: var(--theme-text);
    font-size: 0.9rem;
    font-weight: 700;
}

.observation-entry p {
    margin: 0;
    color: var(--theme-text);
    line-height: 1.5;
}

.observation-entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0;
}

.observation-entry-chip {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid transparent;
}

.observation-entry-chip-status {
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.18);
}

.observation-entry-chip-type {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
    border-color: rgba(148, 163, 184, 0.2);
}

.observation-entry-chip-result {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
    border-color: rgba(249, 115, 22, 0.18);
}

.excel-table-operational {
    font-size: 0.79rem;
}

.excel-table-operational th,
.excel-table-operational td {
    padding: 10px 10px;
    line-height: 1.45;
}

.excel-table-operational thead th {
    white-space: nowrap;
}

.excel-table-operational th:nth-child(1),
.excel-table-operational td:nth-child(1) {
    width: 74px;
}

.excel-table-operational th:nth-child(2),
.excel-table-operational td:nth-child(2) {
    width: 144px;
}

.excel-table-operational th:nth-child(3),
.excel-table-operational td:nth-child(3) {
    width: 148px;
}

.excel-table-operational th:nth-child(4),
.excel-table-operational td:nth-child(4) {
    width: 96px;
}

.excel-table-operational th:nth-child(5),
.excel-table-operational td:nth-child(5) {
    width: 90px;
}

.excel-table-operational th:nth-child(6),
.excel-table-operational td:nth-child(6) {
    width: 164px;
}

.excel-table-operational th:nth-child(7),
.excel-table-operational td:nth-child(7),
.excel-table-operational th:nth-child(8),
.excel-table-operational td:nth-child(8),
.excel-table-operational th:nth-child(9),
.excel-table-operational td:nth-child(9),
.excel-table-operational th:nth-child(10),
.excel-table-operational td:nth-child(10) {
    width: 92px;
    white-space: nowrap;
}

.excel-table-operational th:nth-child(11),
.excel-table-operational td:nth-child(11) {
    width: 90px;
}

.excel-table-operational th:nth-child(12),
.excel-table-operational td:nth-child(12) {
    width: 74px;
}

.excel-table-operational.excel-table-freeze th:nth-child(1),
.excel-table-operational.excel-table-freeze td:nth-child(1),
.excel-table-operational.excel-table-freeze th:nth-child(2),
.excel-table-operational.excel-table-freeze td:nth-child(2),
.excel-table-operational.excel-table-freeze th:nth-child(3),
.excel-table-operational.excel-table-freeze td:nth-child(3),
.excel-table-operational.excel-table-freeze th:nth-child(4),
.excel-table-operational.excel-table-freeze td:nth-child(4),
.excel-table-operational.excel-table-freeze th:nth-child(5),
.excel-table-operational.excel-table-freeze td:nth-child(5),
.excel-table-operational.excel-table-freeze th:nth-child(6),
.excel-table-operational.excel-table-freeze td:nth-child(6) {
    position: sticky;
    z-index: 2;
}

.excel-table-operational.excel-table-freeze thead th:nth-child(1),
.excel-table-operational.excel-table-freeze thead th:nth-child(2),
.excel-table-operational.excel-table-freeze thead th:nth-child(3),
.excel-table-operational.excel-table-freeze thead th:nth-child(4),
.excel-table-operational.excel-table-freeze thead th:nth-child(5),
.excel-table-operational.excel-table-freeze thead th:nth-child(6) {
    z-index: 3;
}

.excel-table-operational.excel-table-freeze th:nth-child(1),
.excel-table-operational.excel-table-freeze td:nth-child(1) {
    left: 0;
}

.excel-table-operational.excel-table-freeze th:nth-child(2),
.excel-table-operational.excel-table-freeze td:nth-child(2) {
    left: 74px;
}

.excel-table-operational.excel-table-freeze th:nth-child(3),
.excel-table-operational.excel-table-freeze td:nth-child(3) {
    left: 218px;
}

.excel-table-operational.excel-table-freeze th:nth-child(4),
.excel-table-operational.excel-table-freeze td:nth-child(4) {
    left: 366px;
}

.excel-table-operational.excel-table-freeze th:nth-child(5),
.excel-table-operational.excel-table-freeze td:nth-child(5) {
    left: 462px;
}

.excel-table-operational.excel-table-freeze th:nth-child(6),
.excel-table-operational.excel-table-freeze td:nth-child(6) {
    left: 552px;
    box-shadow: 8px 0 18px -16px rgba(15, 23, 42, 0.7);
}

.excel-table-operational .view-cell {
    min-width: 74px;
}

.excel-table-operational .action-group {
    padding: 3px;
}

.excel-table-operational .view-trigger {
    width: 34px;
    height: 34px;
}

@media (max-width: 1180px) {
    .credit-layout {
        grid-template-columns: 1fr;
    }

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

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

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

@media (max-width: 900px) {
    .customer-panel-grid,
    .credit-panel-grid,
    .modal-references {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-grid,
    .observation-management-grid,
    .observation-promise-grid,
    .observation-promise-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 680px) {
    .customer-panel-grid,
    .credit-panel-grid,
    .modal-grid,
    .modal-references,
    .observation-management-grid,
    .observation-promise-grid,
    .observation-promise-grid-compact {
        grid-template-columns: 1fr;
    }

}

.observation-entry-chip-promise {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.18);
}

.observation-entry-promise {
    margin-bottom: 0 !important;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--theme-text-muted);
    font-size: 0.84rem;
}

.observation-entry-note-empty {
    color: var(--theme-text-muted);
    font-style: italic;
}

.credit-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.credit-metric-card {
    display: grid;
    gap: 8px;
    padding: 18px 18px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(18, 21, 27, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.credit-metric-label {
    color: #98a2b3;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.credit-metric-card strong {
    font-size: 1rem;
    color: #f8fafc;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.credit-placeholder {
    padding: 16px 18px;
    border: 1px dashed #fdba74;
    border-radius: 12px;
    background: #fff7ed;
    color: #7c2d12;
}

.credit-placeholder p {
    margin: 0;
}

.credit-placeholder p + p {
    margin-top: 8px;
}

.notes-list {
    margin: 12px 0 0;
    padding-left: 18px;
    color: #98a2b3;
}

.notes-list li + li {
    margin-top: 6px;
}

.flash-list {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.flash-message {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.error-text {
    color: #b91c1c;
}

.panel-job {
    display: grid;
}

.job-status {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.job-status-spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 4px solid rgba(234, 88, 12, 0.18);
    border-top-color: var(--brand);
    animation: loading-spin 0.85s linear infinite;
}

.job-status-copy {
    display: grid;
    gap: 4px;
}

.job-status-copy h3 {
    margin: 0;
}

.job-status-metrics {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.job-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 700;
}

.audit-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.audit-load-grid,
.audit-summary-grid,
.audit-meta-grid {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.audit-load-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.audit-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.audit-summary-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.audit-meta-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.audit-placeholder-card {
    display: grid;
    gap: 10px;
    min-height: 170px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(18, 21, 27, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.audit-load-card {
    display: grid;
    gap: 10px;
    min-height: 170px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0%, rgba(18, 21, 27, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    color: #f8fafc;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.audit-load-card:hover {
    text-decoration: none;
    border-color: rgba(255, 122, 0, 0.26);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.audit-load-card-active {
    border-color: rgba(255, 122, 0, 0.38);
    background: linear-gradient(180deg, rgba(45, 28, 11, 0.98) 0%, rgba(24, 20, 16, 0.98) 100%);
}

.audit-load-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.audit-load-card h4 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.35;
    color: #f8fafc;
    overflow-wrap: anywhere;
}

.audit-load-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.audit-load-metrics span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
}

.audit-summary-card {
    min-height: auto;
    padding: 18px;
}

.audit-summary-card h4 {
    font-size: 1.5rem;
}

.audit-summary-card-success {
    border-color: rgba(34, 197, 94, 0.2);
}

.audit-summary-card-info {
    border-color: rgba(59, 130, 246, 0.2);
}

.audit-summary-card-warning {
    border-color: rgba(251, 191, 36, 0.2);
}

.audit-summary-card-danger {
    border-color: rgba(239, 68, 68, 0.2);
}

.audit-panel {
    margin-top: 18px;
}

.audit-detail-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.audit-detail-copy {
    display: grid;
    gap: 4px;
}

.audit-detail-copy h3 {
    margin: 0;
}

.audit-detail-copy .subtle {
    margin: 0;
    max-width: 720px;
}

.audit-browser-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.audit-browser-controls {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.audit-table-switcher {
    display: flex;
    align-items: end;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.audit-table-browser {
    display: grid;
    gap: 12px;
}

.audit-table-browser .table-browser-toolbar {
    align-items: end;
}

.audit-table-browser .table-browser-summary {
    margin: -2px 2px 0;
}

.audit-filter-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.audit-filter-form-primary {
    margin-left: 0;
}

.audit-primary-filter {
    min-width: 260px;
}

.audit-primary-filter select {
    min-width: 260px;
    font-weight: 700;
}

.audit-browser-controls .audit-primary-filter {
    min-width: 220px;
}

.audit-browser-controls .audit-primary-filter select {
    min-width: 220px;
}

.audit-table-browser .table-browser-search {
    min-width: min(420px, 100%);
}

.audit-page-size-inline {
    min-width: 140px;
}

.audit-table-browser .table-browser-toolbar {
    justify-content: flex-start;
}

.audit-table-browser .table-browser-controls {
    display: none;
}

body.modal-open {
    overflow: hidden;
}

.payjoy-metrics-shell {
    display: grid;
    gap: 18px;
    position: relative;
    overflow: visible;
}

.payjoy-metrics-topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: stretch;
    position: relative;
    z-index: 20;
    overflow: visible;
}

.payjoy-metric-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.payjoy-metric-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(17, 20, 25, 0.98) 0%, rgba(12, 15, 19, 0.98) 100%);
    color: #f8fafc;
    box-shadow: 0 22px 40px -34px rgba(15, 23, 42, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.payjoy-metric-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.payjoy-metric-card-head h4 {
    margin: 0;
    font-size: 1rem;
}

.payjoy-metric-card-head span {
    font-size: 0.96rem;
    font-weight: 800;
    color: #bef264;
}

.payjoy-metric-card p,
.payjoy-metric-card small {
    margin: 0;
    display: block;
}

.payjoy-metric-card p {
    line-height: 1.45;
    font-size: 0.92rem;
}

.payjoy-metric-card small {
    margin-top: 6px;
    font-size: 0.82rem;
    color: #cbd5e1;
}

.payjoy-metric-card-warning {
    border-color: rgba(251, 191, 36, 0.34);
}

.payjoy-metric-card-warning .payjoy-metric-card-head span {
    color: #fbbf24;
}

.payjoy-metric-card-danger {
    border-color: rgba(248, 113, 113, 0.34);
}

.payjoy-metric-card-danger .payjoy-metric-card-head span {
    color: #f87171;
}

.payjoy-metric-card-success {
    border-color: rgba(74, 222, 128, 0.34);
}

.payjoy-metric-card-success .payjoy-metric-card-head span {
    color: #4ade80;
}

.payjoy-metrics-controls {
    display: block;
    position: relative;
    z-index: 30;
}

.payjoy-control-panel {
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 22, 27, 0.98) 0%, rgba(12, 15, 19, 0.98) 100%);
    box-shadow: 0 22px 40px -34px rgba(15, 23, 42, 0.88);
    position: relative;
    z-index: 30;
    overflow: visible;
}

.payjoy-control-panel .section-head {
    margin-bottom: 12px;
}

.payjoy-control-panel .section-head h3 {
    font-size: 1.05rem;
}

.payjoy-control-stack {
    display: grid;
    gap: 12px;
}

.payjoy-control-group {
    display: grid;
    gap: 8px;
}

.payjoy-control-label {
    margin: 0;
    color: #dbe2ea;
    font-size: 0.88rem;
    font-weight: 700;
}

.payjoy-control-help {
    margin: -2px 0 0;
    font-size: 0.84rem;
}

.payjoy-cutoff-selector {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
}

.payjoy-cutoff-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.payjoy-cutoff-chip:hover {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: rgba(255, 122, 0, 0.24);
    box-shadow: 0 12px 24px -22px rgba(255, 122, 0, 0.6);
}

.payjoy-cutoff-chip-active {
    background: linear-gradient(180deg, #ff8a3d 0%, #ea580c 100%);
    border-color: rgba(255, 138, 61, 0.8);
    color: #ffffff;
    box-shadow: 0 18px 26px -22px rgba(234, 88, 12, 0.78);
}

.payjoy-store-form {
    display: flex;
    justify-content: center;
    align-items: end;
    margin-top: 14px;
    height: auto;
    position: relative;
    z-index: 40;
}

.payjoy-store-filter {
    display: grid;
    position: relative;
    gap: 8px;
    width: min(360px, 100%);
    z-index: 40;
}

.payjoy-store-filter-label {
    color: #dbe2ea;
    font-size: 0.88rem;
    font-weight: 700;
}

.payjoy-store-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    width: 100%;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.payjoy-store-trigger:hover,
.payjoy-store-trigger[aria-expanded="true"] {
    border-color: rgba(255, 122, 0, 0.3);
    box-shadow: 0 18px 32px -28px rgba(255, 122, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.payjoy-store-trigger-icon {
    font-size: 0.86rem;
    opacity: 0.75;
}

.payjoy-store-menu[hidden] {
    display: none !important;
}

.payjoy-store-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(24, 27, 34, 0.99) 0%, rgba(17, 20, 25, 0.99) 100%);
    box-shadow: 0 24px 40px -28px rgba(15, 23, 42, 0.9);
}

.payjoy-store-menu-search input {
    min-height: 40px;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #f8fafc;
    font: inherit;
}

.payjoy-store-options {
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.payjoy-store-option {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #e2e8f0;
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.payjoy-store-option:hover {
    background: rgba(255, 122, 0, 0.08);
    border-color: rgba(255, 122, 0, 0.24);
}

.payjoy-store-option-active {
    background: rgba(255, 122, 0, 0.14);
    border-color: rgba(255, 122, 0, 0.32);
    color: #ffd08a;
}

.payjoy-store-empty {
    margin: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.payjoy-metric-table-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

.payjoy-metric-table-grid > * {
    min-width: 0;
}

.payjoy-conflict-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--theme-border-soft);
    border-radius: 16px;
    background: var(--theme-card-bg);
    box-shadow: var(--theme-shadow-card);
}

.payjoy-conflict-notice-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 122, 0, 0.14);
    color: var(--brand);
    font-weight: 900;
    line-height: 1;
}

.payjoy-conflict-notice-copy {
    display: grid;
    gap: 4px;
}

.payjoy-conflict-notice-copy strong {
    color: var(--theme-heading);
    font-size: 0.95rem;
    line-height: 1.35;
}

.payjoy-conflict-notice-copy p {
    margin: 0;
    color: var(--theme-text-muted);
    line-height: 1.5;
    font-size: 0.9rem;
}

.payjoy-metric-table-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(18, 22, 27, 0.98) 0%, rgba(12, 15, 19, 0.98) 100%);
    box-shadow: 0 22px 40px -34px rgba(15, 23, 42, 0.88);
}

.payjoy-metric-table-head {
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(10, 12, 17, 0.98) 0%, rgba(14, 17, 22, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 122, 0, 0.22);
}

.payjoy-metric-table-head h3 {
    margin: 0;
    text-align: center;
    color: #f8fafc;
    font-size: 1rem;
}

.payjoy-metric-table-card > .subtle {
    padding: 16px 18px;
}

.payjoy-metric-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.payjoy-metric-table th,
.payjoy-metric-table td {
    padding: 9px 10px;
    font-size: 0.82rem;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    vertical-align: top;
}

.payjoy-metric-table th:nth-child(1),
.payjoy-metric-table td:nth-child(1) {
    width: 40%;
}

.payjoy-metric-table th:nth-child(2),
.payjoy-metric-table td:nth-child(2) {
    width: 20%;
}

.payjoy-metric-table th:nth-child(3),
.payjoy-metric-table td:nth-child(3) {
    width: 20%;
}

.payjoy-metric-table th:nth-child(4),
.payjoy-metric-table td:nth-child(4) {
    width: 20%;
}

.payjoy-metric-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding-top: 10px;
    padding-bottom: 10px;
    background: #171c24;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
    white-space: normal;
    line-height: 1.2;
    vertical-align: top;
}

.payjoy-metric-table tbody td:nth-child(2),
.payjoy-metric-table tbody td:nth-child(3),
.payjoy-metric-table tbody td:nth-child(4),
.payjoy-metric-table thead th:nth-child(2),
.payjoy-metric-table thead th:nth-child(3),
.payjoy-metric-table thead th:nth-child(4),
.payjoy-metric-table tfoot td:nth-child(2),
.payjoy-metric-table tfoot td:nth-child(3),
.payjoy-metric-table tfoot td:nth-child(4) {
    text-align: center;
}

.payjoy-metric-table tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: var(--theme-card-bg);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.payjoy-metric-table tfoot td,
.payjoy-metric-total td {
    font-weight: 800;
}

.table-wrap-payjoy {
    max-height: 432px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.table-wrap-payjoy .payjoy-metric-table tbody td {
    padding-top: 9px;
    padding-bottom: 9px;
}

.table-wrap-payjoy .payjoy-metric-table tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.01);
}

.table-wrap-payjoy .payjoy-metric-table tbody tr:hover td {
    background: rgba(255, 122, 0, 0.08);
}

.table-wrap-payjoy .payjoy-metric-table tbody tr:last-child td {
    border-bottom: 0;
}

.payjoy-metric-total-success td {
    color: #166534;
}

.payjoy-metric-total-danger td {
    color: #b91c1c;
}

.payjoy-metric-total-warning td {
    color: #92400e;
}

.payjoy-metric-total-info td {
    color: #1d4ed8;
}

.audit-result-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.audit-result-pill-insertado {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.audit-result-pill-actualizado {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.audit-result-pill-sin_cambios {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.24);
    color: #cbd5e1;
}

.audit-result-pill-conflicto {
    background: rgba(251, 191, 36, 0.16);
    border-color: rgba(251, 191, 36, 0.32);
    color: #fcd34d;
}

.audit-category-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.24);
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 800;
}

.audit-category-pill-key {
    background: rgba(255, 122, 0, 0.14);
    border-color: rgba(255, 122, 0, 0.28);
    color: #ffd08a;
}

.audit-chip-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.audit-change-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 122, 0, 0.14);
    border: 1px solid rgba(255, 122, 0, 0.24);
    color: #ffd08a;
    font-size: 0.8rem;
    font-weight: 800;
}

.audit-change-key-pill,
.audit-reason-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 122, 0, 0.22);
    background: rgba(255, 122, 0, 0.08);
    color: var(--theme-heading);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.1;
}

.audit-change-row {
    cursor: pointer;
}

.audit-change-row:focus-visible td {
    outline: 2px solid rgba(255, 122, 0, 0.42);
    outline-offset: -2px;
}

.audit-change-link {
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.audit-change-link:hover {
    text-decoration: underline;
}

.audit-change-link:focus-visible {
    outline: 2px solid rgba(255, 122, 0, 0.42);
    outline-offset: 4px;
    border-radius: 6px;
}

.audit-change-open-button {
    min-width: 110px;
}

.audit-change-modal-card {
    width: min(940px, calc(100vw - 32px));
    max-height: min(86vh, 920px);
    border-radius: 16px;
    padding: 18px 18px 16px;
}

.audit-change-modal-header {
    margin-bottom: 8px;
}

.audit-change-modal-body {
    gap: 10px;
}

.table-wrap-audit-change-modal {
    overflow: auto;
}

.audit-change-modal-meta-line {
    margin: 6px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.audit-change-modal-table {
    min-width: 720px;
}

.audit-change-modal-table th,
.audit-change-modal-table td {
    padding: 10px 12px;
    vertical-align: top;
}

.audit-change-modal-table td:nth-child(1) {
    width: 140px;
}

.audit-change-modal-table td:nth-child(2) {
    width: 180px;
}

.audit-change-modal-table td:nth-child(3),
.audit-change-modal-table td:nth-child(4) {
    width: 200px;
}

.audit-change-detail-row-key td {
    background: rgba(255, 122, 0, 0.03);
}

.audit-change-cell-before {
    color: var(--theme-text-muted);
    background: rgba(148, 163, 184, 0.06);
}

.audit-change-cell-after {
    color: var(--theme-heading);
    background: rgba(255, 122, 0, 0.08);
    font-weight: 700;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
    width: 92px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
    width: 190px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
    width: 120px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
    width: 130px;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
    width: 220px;
}

.audit-table th:nth-child(6),
.audit-table td:nth-child(6) {
    width: 220px;
}

.audit-table th:last-child,
.audit-table td:last-child {
    width: 140px;
}

.audit-table-processed th:nth-child(2),
.audit-table-processed td:nth-child(2) {
    width: 130px;
}

.audit-table-processed th:last-child,
.audit-table-processed td:last-child {
    width: 260px;
}

.table-wrap-audit {
    overflow-x: auto;
    overflow-y: hidden;
}

.table-wrap-promises {
    overflow-x: auto;
    overflow-y: hidden;
}

.promise-workspace-panel .section-head {
    margin-bottom: 1rem;
}

.promise-table-browser {
    margin-bottom: 1rem;
}

.promise-table-browser .table-browser-toolbar {
    margin-bottom: 0;
    align-items: end;
}

.promise-browser-search {
    min-width: 20rem;
}

.promise-browser-empty {
    margin-top: 1rem;
}

.promise-table {
    min-width: 1220px;
}

.promise-table th:nth-child(1),
.promise-table td:nth-child(1) {
    width: 160px;
}

.promise-table th:nth-child(2),
.promise-table td:nth-child(2) {
    width: 150px;
}

.promise-table th:nth-child(3),
.promise-table td:nth-child(3) {
    width: 150px;
}

.promise-table th:nth-child(4),
.promise-table td:nth-child(4) {
    width: 320px;
}

.promise-table th:nth-child(5),
.promise-table td:nth-child(5) {
    width: 150px;
    white-space: nowrap;
}

.promise-table th:nth-child(6),
.promise-table td:nth-child(6) {
    width: 140px;
}

.promise-table th:nth-child(7),
.promise-table td:nth-child(7) {
    width: 180px;
}

.promise-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.promise-status-pill-pending {
    color: #ffd84d;
    background: rgba(255, 210, 61, 0.14);
    border-color: rgba(255, 210, 61, 0.34);
}

.promise-status-pill-success {
    color: #17663f;
    background: rgba(44, 179, 99, 0.16);
    border-color: rgba(44, 179, 99, 0.3);
}

.promise-status-pill-danger {
    color: #a33131;
    background: rgba(227, 72, 72, 0.16);
    border-color: rgba(227, 72, 72, 0.3);
}

.promise-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: nowrap;
}

.promise-action-group .view-trigger {
    flex: 0 0 auto;
}

.promise-status-form {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.promise-workspace-panel .table-browser-filter,
.promise-workspace-panel .table-browser-search {
    margin-bottom: 0;
}

.promise-workspace-panel .table-browser-search input,
.promise-workspace-panel .table-browser-filter select {
    min-height: 2.65rem;
}

.promise-confirm-modal-card {
    width: min(25rem, calc(100vw - 2rem));
    border-radius: 16px;
}

.promise-confirm-modal-header {
    justify-content: center;
    text-align: center;
    padding-bottom: 0.85rem;
}

.promise-confirm-modal-body {
    padding-top: 0.9rem;
}

.promise-confirm-actions {
    justify-content: center;
}

.promise-confirm-submit {
    min-width: 8.75rem;
    color: #10141a;
    border-color: #ff7a00;
    background: linear-gradient(180deg, #ffc14d 0%, #ff7a00 100%);
}

.promise-confirm-submit:hover {
    border-color: #ff6a00;
    background: linear-gradient(180deg, #ffd470 0%, #ff7a00 100%);
}

.promise-action-group .view-trigger {
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
}

.promise-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.promise-action-button svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.promise-action-button:hover {
    transform: translateY(-1px);
}

.promise-action-button-success {
    color: #7dffb2;
    background: radial-gradient(circle at 50% 50%, rgba(56, 255, 138, 0.22) 0%, rgba(56, 255, 138, 0.12) 55%, rgba(56, 255, 138, 0.08) 100%);
    border-color: rgba(56, 255, 138, 0.48);
    box-shadow: 0 0 0 1px rgba(56, 255, 138, 0.12), 0 0 14px rgba(56, 255, 138, 0.22);
}

.promise-action-button-danger {
    color: #ff8f8f;
    background: radial-gradient(circle at 50% 50%, rgba(255, 87, 87, 0.2) 0%, rgba(255, 87, 87, 0.1) 55%, rgba(255, 87, 87, 0.07) 100%);
    border-color: rgba(255, 87, 87, 0.42);
    box-shadow: 0 0 0 1px rgba(255, 87, 87, 0.1), 0 0 14px rgba(255, 87, 87, 0.18);
}

.promise-action-button-current {
    transform: translateY(-1px);
}

.promise-action-button-success.promise-action-button-current {
    box-shadow: 0 0 0 2px rgba(56, 255, 138, 0.4), 0 0 20px rgba(56, 255, 138, 0.32);
}

.promise-action-button-danger.promise-action-button-current {
    box-shadow: 0 0 0 2px rgba(255, 87, 87, 0.36), 0 0 20px rgba(255, 87, 87, 0.28);
}

body[data-theme="light"] .promise-status-pill-pending {
    color: #9a6a00;
    background: rgba(255, 210, 61, 0.18);
    border-color: rgba(255, 210, 61, 0.34);
}

body[data-theme="light"] .promise-status-pill-success {
    color: #14653c;
    background: rgba(44, 179, 99, 0.14);
    border-color: rgba(44, 179, 99, 0.24);
}

body[data-theme="light"] .promise-status-pill-danger {
    color: #a42d2d;
    background: rgba(227, 72, 72, 0.12);
    border-color: rgba(227, 72, 72, 0.24);
}

body[data-theme="light"] .promise-action-button-current {
    transform: translateY(-1px);
}

body[data-theme="dark"] .promise-action-button-success,
body:not([data-theme]) .promise-action-button-success {
    box-shadow: 0 0 0 1px rgba(56, 255, 138, 0.14), 0 0 18px rgba(56, 255, 138, 0.26);
}

body[data-theme="dark"] .promise-action-button-danger,
body:not([data-theme]) .promise-action-button-danger {
    box-shadow: 0 0 0 1px rgba(255, 87, 87, 0.12), 0 0 18px rgba(255, 87, 87, 0.22);
}

body[data-theme="light"] .promise-action-button-success {
    color: #13834d;
    background: radial-gradient(circle at 50% 50%, rgba(56, 255, 138, 0.16) 0%, rgba(56, 255, 138, 0.08) 58%, rgba(56, 255, 138, 0.05) 100%);
    border-color: rgba(24, 175, 96, 0.32);
    box-shadow: 0 0 0 1px rgba(24, 175, 96, 0.08), 0 0 14px rgba(24, 175, 96, 0.14);
}

body[data-theme="light"] .promise-action-button-danger {
    color: #bf2f2f;
    background: radial-gradient(circle at 50% 50%, rgba(255, 87, 87, 0.14) 0%, rgba(255, 87, 87, 0.07) 58%, rgba(255, 87, 87, 0.04) 100%);
    border-color: rgba(215, 59, 59, 0.28);
    box-shadow: 0 0 0 1px rgba(215, 59, 59, 0.08), 0 0 14px rgba(215, 59, 59, 0.12);
}

body[data-theme="light"] .promise-action-button-success.promise-action-button-current {
    box-shadow: 0 0 0 2px rgba(24, 175, 96, 0.24), 0 0 16px rgba(24, 175, 96, 0.16);
}

body[data-theme="light"] .promise-action-button-danger.promise-action-button-current {
    box-shadow: 0 0 0 2px rgba(215, 59, 59, 0.22), 0 0 16px rgba(215, 59, 59, 0.14);
}

.audit-table {
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.audit-table th,
.audit-table td {
    padding: 10px 12px;
    font-size: 0.83rem;
    line-height: 1.4;
    vertical-align: top;
}

.audit-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    padding-top: 11px;
    padding-bottom: 11px;
    background: #1a1f27;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.audit-table .table-sort-button {
    width: 100%;
    justify-content: space-between;
    white-space: nowrap;
}

.audit-table tbody td {
    background: rgba(17, 21, 26, 0.94);
}

.audit-table tbody tr:nth-child(even) td {
    background: rgba(20, 24, 30, 0.96);
}

.audit-table tbody tr:hover td {
    background: rgba(255, 122, 0, 0.08);
}

.audit-table-processed th:nth-child(1),
.audit-table-processed td:nth-child(1) {
    width: 70px;
}

.audit-table-processed th:nth-child(3),
.audit-table-processed td:nth-child(3) {
    width: 130px;
}

.audit-table-processed th:nth-child(4),
.audit-table-processed td:nth-child(4) {
    width: 220px;
}

.audit-table-processed th:nth-child(5),
.audit-table-processed td:nth-child(5) {
    width: 140px;
}

.audit-table-processed th:nth-child(6),
.audit-table-processed td:nth-child(6) {
    width: 120px;
}

.audit-table-processed th:last-child,
.audit-table-processed td:last-child {
    width: 320px;
}

.audit-table-changes {
    min-width: 920px;
}

.audit-table-changes th:nth-child(1),
.audit-table-changes td:nth-child(1) {
    width: 120px;
}

.audit-table-changes th:nth-child(2),
.audit-table-changes td:nth-child(2) {
    width: 240px;
}

.audit-table-changes th:nth-child(3),
.audit-table-changes td:nth-child(3) {
    width: 160px;
}

.audit-table-changes th:nth-child(4),
.audit-table-changes td:nth-child(4) {
    width: 180px;
}

.audit-table-changes th:nth-child(5),
.audit-table-changes td:nth-child(5) {
    width: 150px;
}

.audit-table-changes th:nth-child(6),
.audit-table-changes td:nth-child(6) {
    width: 140px;
}

.audit-table-conflicts {
    min-width: 1120px;
}

.audit-table-conflicts th:nth-child(1),
.audit-table-conflicts td:nth-child(1) {
    width: 72px;
}

.audit-table-conflicts th:nth-child(2),
.audit-table-conflicts td:nth-child(2) {
    width: 150px;
}

.audit-table-conflicts th:nth-child(3),
.audit-table-conflicts td:nth-child(3) {
    width: 210px;
}

.audit-table-conflicts th:nth-child(4),
.audit-table-conflicts td:nth-child(4) {
    width: 130px;
}

.audit-table-conflicts th:nth-child(5),
.audit-table-conflicts td:nth-child(5) {
    width: 220px;
}

.audit-table-conflicts th:nth-child(6),
.audit-table-conflicts td:nth-child(6) {
    width: 130px;
}

.audit-table-conflicts th:last-child,
.audit-table-conflicts td:last-child {
    width: 360px;
}

.audit-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 14px;
}

.audit-pagination-summary {
    display: grid;
    gap: 3px;
}

.audit-pagination-summary span {
    color: var(--theme-heading);
    font-size: 0.9rem;
    font-weight: 700;
}

.audit-pagination-summary small {
    color: var(--theme-text-muted);
    font-size: 0.8rem;
}

.audit-pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.audit-pagination-pages {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.audit-pagination-button {
    min-height: 36px;
    padding: 0 12px;
}

.audit-pagination-button-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.audit-page-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    background: var(--theme-chip-bg);
    color: var(--theme-chip-text);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.audit-page-chip:hover {
    text-decoration: none;
    border-color: rgba(255, 122, 0, 0.32);
    background: rgba(255, 122, 0, 0.08);
}

.audit-page-chip-active {
    border-color: rgba(255, 122, 0, 0.38);
    background: rgba(255, 122, 0, 0.16);
    color: #ffd08a;
}

.audit-placeholder-kicker {
    margin: 0;
    color: #98a2b3;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.audit-placeholder-card h4 {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
    color: #f8fafc;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(3px);
}

.loading-card {
    width: min(280px, calc(100vw - 32px));
    padding: 12px;
    display: grid;
    gap: 18px;
    text-align: center;
}

.loading-card h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(15, 23, 42, 0.35);
}

.loading-spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 18px;
    border: 4px solid #fde7d8;
    border-top-color: var(--brand);
    border-radius: 999px;
    animation: loading-spin 0.85s linear infinite;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .page-shell {
        padding: 16px;
    }

    .page-shell-with-sidebar {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar {
        position: static;
        min-height: auto;
    }

    .app-topbar {
        padding-inline: 14px;
    }

    .app-topbar-copy small,
    .app-topbar-user-copy small {
        display: none;
    }

    .app-topbar-actions {
        gap: 8px;
    }

    .page-shell-sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .page-shell-sidebar-collapsed .workspace-sidebar-link {
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: start;
        padding: 14px;
    }

    .hero-panel {
        grid-template-columns: 1fr;
        padding: 22px 20px;
    }

    .workspace-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .upload-dropzone {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        padding: 16px 14px;
    }

    .upload-icon {
        grid-row: auto;
    }

    .upload-filename {
        justify-content: center;
        max-width: 100%;
    }

    .modal-card {
        padding: 18px;
        border-radius: 22px;
    }

    .table-browser-search input {
        width: 100%;
    }

    .table-browser-toolbar,
    .table-browser-controls,
    .table-browser-pagination,
    .table-browser-filters {
        justify-content: center;
    }

    .loading-card {
        padding: 24px 20px;
    }

    .modal-grid {
        grid-template-columns: 1fr;
    }

    .modal-references {
        grid-template-columns: 1fr;
    }

    .credit-layout,
    .credit-metrics {
        grid-template-columns: 1fr;
    }

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

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

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

    .observation-promise-grid {
        grid-template-columns: 1fr;
    }

    .observation-management-grid {
        grid-template-columns: 1fr;
    }

    .job-status {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .audit-placeholder-grid {
        grid-template-columns: 1fr;
    }

    .audit-table-switcher {
        align-items: stretch;
    }
}

@media (max-width: 960px) {
    .payjoy-metrics-topbar,
    .payjoy-metric-table-grid {
        grid-template-columns: 1fr;
    }

    .payjoy-metric-card-grid {
        grid-template-columns: 1fr;
    }

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

    .payjoy-store-filter {
        width: 100%;
    }

    .excel-table-freeze th:nth-child(1),
    .excel-table-freeze td:nth-child(1),
    .excel-table-freeze th:nth-child(2),
    .excel-table-freeze td:nth-child(2),
    .excel-table-freeze th:nth-child(3),
    .excel-table-freeze td:nth-child(3),
    .excel-table-freeze th:nth-child(4),
    .excel-table-freeze td:nth-child(4),
    .excel-table-freeze th:nth-child(5),
    .excel-table-freeze td:nth-child(5),
    .excel-table-freeze th:nth-child(6),
    .excel-table-freeze td:nth-child(6) {
        position: static;
        left: auto;
        box-shadow: none;
    }
}

@media (max-width: 720px) {
    .credit-panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .app-topbar {
        gap: 10px;
    }

    .payjoy-cutoff-selector {
        grid-template-columns: 1fr;
    }

    .credit-panel-grid {
        grid-template-columns: 1fr;
    }

    .observation-meta {
        grid-template-columns: 1fr;
    }

    .observation-meta-compact {
        grid-template-columns: 1fr;
    }

    .modal-field-double {
        grid-column: auto;
    }
}

/* Theme consistency layer */
body,
body[data-theme="dark"],
body:not([data-theme]) {
    --theme-page-bg:
        linear-gradient(180deg, rgba(24, 27, 34, 0.98) 0, rgba(24, 27, 34, 0.98) 68px, transparent 68px),
        radial-gradient(circle at top right, rgba(255, 122, 0, 0.08), transparent 18%),
        radial-gradient(circle at bottom left, rgba(249, 115, 22, 0.08), transparent 24%),
        var(--surface-page);
    --theme-surface: rgba(21, 24, 30, 0.96);
    --theme-surface-soft: #12161c;
    --theme-surface-strong: #171b22;
    --theme-topbar-bg: rgba(24, 27, 34, 0.96);
    --theme-sidebar-bg: linear-gradient(180deg, rgba(18, 21, 27, 0.98) 0%, rgba(13, 16, 21, 0.98) 100%);
    --theme-card-bg: rgba(21, 24, 30, 0.96);
    --theme-card-soft: #171b22;
    --theme-input-bg: linear-gradient(180deg, rgba(30, 35, 43, 0.96) 0%, rgba(21, 25, 31, 0.96) 100%);
    --theme-input-plain: rgba(255, 255, 255, 0.04);
    --theme-input-option-bg: #151a21;
    --theme-action-shell: rgba(255, 255, 255, 0.02);
    --theme-action-bg: rgba(255, 255, 255, 0.05);
    --theme-border-soft: rgba(255, 255, 255, 0.06);
    --theme-border: rgba(255, 255, 255, 0.12);
    --theme-text: #f8fafc;
    --theme-text-muted: #9ba6b8;
    --theme-heading: #ffffff;
    --theme-table-head: rgba(255, 255, 255, 0.04);
    --theme-table-even: rgba(255, 255, 255, 0.015);
    --theme-table-hover: rgba(255, 122, 0, 0.08);
    --theme-table-frozen: #171b22;
    --theme-chip-bg: rgba(255, 255, 255, 0.04);
    --theme-chip-pill-bg: rgba(255, 255, 255, 0.06);
    --theme-chip-text: #cbd5e1;
    --theme-shadow-card: 0 20px 40px rgba(0, 0, 0, 0.24);
    --theme-overlay: rgba(15, 23, 42, 0.52);
}

body[data-theme="light"] {
    color-scheme: light;
    --theme-page-bg:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0, rgba(255, 255, 255, 0.98) 68px, transparent 68px),
        radial-gradient(circle at top right, rgba(255, 122, 0, 0.08), transparent 18%),
        radial-gradient(circle at bottom left, rgba(249, 115, 22, 0.06), transparent 24%),
        #f6f7fb;
    --theme-surface: #ffffff;
    --theme-surface-soft: #ffffff;
    --theme-surface-strong: #ffffff;
    --theme-topbar-bg: rgba(255, 255, 255, 0.96);
    --theme-sidebar-bg: #ffffff;
    --theme-card-bg: #ffffff;
    --theme-card-soft: #ffffff;
    --theme-input-bg: #ffffff;
    --theme-input-plain: #ffffff;
    --theme-input-option-bg: #ffffff;
    --theme-action-shell: #f8fafc;
    --theme-action-bg: #ffffff;
    --theme-border-soft: rgba(15, 23, 42, 0.08);
    --theme-border: rgba(15, 23, 42, 0.14);
    --theme-text: #111827;
    --theme-text-muted: #4b5563;
    --theme-heading: #111827;
    --theme-table-head: #fffaf5;
    --theme-table-even: #fbfcfe;
    --theme-table-hover: #fff7ed;
    --theme-table-frozen: #ffffff;
    --theme-chip-bg: #ffffff;
    --theme-chip-pill-bg: #f8fafc;
    --theme-chip-text: #111827;
    --theme-shadow-card: 0 16px 34px -28px rgba(15, 23, 42, 0.18);
    --theme-overlay: rgba(15, 23, 42, 0.36);
    color: var(--theme-text);
    background: var(--theme-page-bg);
}

body[data-theme="dark"],
body:not([data-theme]) {
    color-scheme: dark;
    color: var(--theme-text);
    background: var(--theme-page-bg);
}

body[data-theme="dark"] .app-topbar,
body:not([data-theme]) .app-topbar,
body[data-theme="light"] .app-topbar {
    background: var(--theme-topbar-bg);
    border-bottom-color: var(--theme-border-soft);
}

body[data-theme="dark"] .workspace-sidebar,
body:not([data-theme]) .workspace-sidebar,
body[data-theme="light"] .workspace-sidebar {
    background: var(--theme-sidebar-bg);
    border-right-color: var(--theme-border-soft);
    box-shadow: var(--theme-shadow-card);
}

body[data-theme="dark"] .page-toolbar,
body:not([data-theme]) .page-toolbar,
body[data-theme="dark"] .panel,
body:not([data-theme]) .panel,
body[data-theme="dark"] .flash-message,
body:not([data-theme]) .flash-message,
body[data-theme="dark"] .modal-card,
body:not([data-theme]) .modal-card,
body[data-theme="dark"] .modal-field,
body:not([data-theme]) .modal-field,
body[data-theme="dark"] .reference-card,
body:not([data-theme]) .reference-card,
body[data-theme="dark"] .credit-panel,
body:not([data-theme]) .credit-panel,
body[data-theme="dark"] .credit-metric-card,
body:not([data-theme]) .credit-metric-card,
body[data-theme="dark"] .audit-load-card,
body:not([data-theme]) .audit-load-card,
body[data-theme="dark"] .audit-summary-card,
body:not([data-theme]) .audit-summary-card,
body[data-theme="dark"] .audit-placeholder-card,
body:not([data-theme]) .audit-placeholder-card,
body[data-theme="dark"] .table-wrap,
body:not([data-theme]) .table-wrap,
body[data-theme="dark"] .table-browser-toolbar,
body:not([data-theme]) .table-browser-toolbar,
body[data-theme="dark"] .upload-dropzone,
body:not([data-theme]) .upload-dropzone,
body[data-theme="dark"] .workspace-theme-toggle,
body:not([data-theme]) .workspace-theme-toggle,
body[data-theme="light"] .page-toolbar,
body[data-theme="light"] .panel,
body[data-theme="light"] .flash-message,
body[data-theme="light"] .modal-card,
body[data-theme="light"] .modal-field,
body[data-theme="light"] .reference-card,
body[data-theme="light"] .credit-panel,
body[data-theme="light"] .credit-metric-card,
body[data-theme="light"] .audit-load-card,
body[data-theme="light"] .audit-summary-card,
body[data-theme="light"] .audit-placeholder-card,
body[data-theme="light"] .table-wrap,
body[data-theme="light"] .table-browser-toolbar,
body[data-theme="light"] .upload-dropzone,
body[data-theme="light"] .workspace-theme-toggle {
    background: var(--theme-card-bg);
    border-color: var(--theme-border-soft);
    box-shadow: var(--theme-shadow-card);
}

body[data-theme="dark"] .workspace-sidebar-link,
body:not([data-theme]) .workspace-sidebar-link,
body[data-theme="dark"] .ui-button-secondary,
body:not([data-theme]) .ui-button-secondary,
body[data-theme="dark"] .cell-select,
body:not([data-theme]) .cell-select,
body[data-theme="dark"] .obser-input,
body:not([data-theme]) .obser-input,
body[data-theme="dark"] .table-browser-search input,
body:not([data-theme]) .table-browser-search input,
body[data-theme="dark"] .table-browser-page-size select,
body:not([data-theme]) .table-browser-page-size select,
body[data-theme="dark"] .table-browser-filter select,
body:not([data-theme]) .table-browser-filter select,
body[data-theme="dark"] .observation-field textarea,
body:not([data-theme]) .observation-field textarea,
body[data-theme="dark"] .observation-promise-grid input,
body:not([data-theme]) .observation-promise-grid input,
body[data-theme="dark"] .modal-close,
body:not([data-theme]) .modal-close,
body[data-theme="light"] .workspace-sidebar-link,
body[data-theme="light"] .ui-button-secondary,
body[data-theme="light"] .cell-select,
body[data-theme="light"] .obser-input,
body[data-theme="light"] .table-browser-search input,
body[data-theme="light"] .table-browser-page-size select,
body[data-theme="light"] .table-browser-filter select,
body[data-theme="light"] .observation-field textarea,
body[data-theme="light"] .observation-promise-grid input,
body[data-theme="light"] .modal-close {
    background: var(--theme-input-plain);
    border-color: var(--theme-border);
    color: var(--theme-text);
}

body[data-theme="dark"] .cell-select,
body:not([data-theme]) .cell-select,
body[data-theme="dark"] .obser-input,
body:not([data-theme]) .obser-input,
body[data-theme="light"] .cell-select,
body[data-theme="light"] .obser-input {
    background: var(--theme-input-bg);
}

body[data-theme="dark"] .cell-select option,
body:not([data-theme]) .cell-select option,
body[data-theme="light"] .cell-select option {
    background: var(--theme-input-option-bg);
    color: var(--theme-text);
}

body[data-theme="dark"] .app-topbar-copy strong,
body:not([data-theme]) .app-topbar-copy strong,
body[data-theme="dark"] .app-topbar-user-copy strong,
body:not([data-theme]) .app-topbar-user-copy strong,
body[data-theme="dark"] .page-toolbar-copy h1,
body:not([data-theme]) .page-toolbar-copy h1,
body[data-theme="dark"] .workspace-sidebar-link-copy strong,
body:not([data-theme]) .workspace-sidebar-link-copy strong,
body[data-theme="dark"] .panel h2,
body:not([data-theme]) .panel h2,
body[data-theme="dark"] .panel h3,
body:not([data-theme]) .panel h3,
body[data-theme="dark"] .panel h4,
body:not([data-theme]) .panel h4,
body[data-theme="dark"] .modal-header h3,
body:not([data-theme]) .modal-header h3,
body[data-theme="dark"] .modal-field strong,
body:not([data-theme]) .modal-field strong,
body[data-theme="dark"] .reference-title,
body:not([data-theme]) .reference-title,
body[data-theme="dark"] .credit-panel-head h4,
body:not([data-theme]) .credit-panel-head h4,
body[data-theme="dark"] .credit-metric-card strong,
body:not([data-theme]) .credit-metric-card strong,
body[data-theme="dark"] .audit-load-card h4,
body:not([data-theme]) .audit-load-card h4,
body[data-theme="dark"] .audit-summary-card h4,
body:not([data-theme]) .audit-summary-card h4,
body[data-theme="dark"] .audit-placeholder-card h4,
body:not([data-theme]) .audit-placeholder-card h4,
body[data-theme="dark"] .excel-table th,
body:not([data-theme]) .excel-table th,
body[data-theme="dark"] .excel-table td,
body:not([data-theme]) .excel-table td,
body[data-theme="light"] .app-topbar-copy strong,
body[data-theme="light"] .app-topbar-user-copy strong,
body[data-theme="light"] .page-toolbar-copy h1,
body[data-theme="light"] .workspace-sidebar-link-copy strong,
body[data-theme="light"] .panel h2,
body[data-theme="light"] .panel h3,
body[data-theme="light"] .panel h4,
body[data-theme="light"] .modal-header h3,
body[data-theme="light"] .modal-field strong,
body[data-theme="light"] .reference-title,
body[data-theme="light"] .credit-panel-head h4,
body[data-theme="light"] .credit-metric-card strong,
body[data-theme="light"] .audit-load-card h4,
body[data-theme="light"] .audit-summary-card h4,
body[data-theme="light"] .audit-placeholder-card h4,
body[data-theme="light"] .excel-table th,
body[data-theme="light"] .excel-table td {
    color: var(--theme-heading);
}

body[data-theme="dark"] .app-topbar-copy small,
body:not([data-theme]) .app-topbar-copy small,
body[data-theme="dark"] .app-topbar-user-copy small,
body:not([data-theme]) .app-topbar-user-copy small,
body[data-theme="dark"] .subtle,
body:not([data-theme]) .subtle,
body[data-theme="dark"] .workspace-sidebar-link-code,
body:not([data-theme]) .workspace-sidebar-link-code,
body[data-theme="dark"] .modal-label,
body:not([data-theme]) .modal-label,
body[data-theme="dark"] .credit-panel-kicker,
body:not([data-theme]) .credit-panel-kicker,
body[data-theme="dark"] .credit-metric-label,
body:not([data-theme]) .credit-metric-label,
body[data-theme="dark"] .audit-placeholder-kicker,
body:not([data-theme]) .audit-placeholder-kicker,
body[data-theme="dark"] .job-status-pill,
body:not([data-theme]) .job-status-pill,
body[data-theme="dark"] .table-browser-search span,
body:not([data-theme]) .table-browser-search span,
body[data-theme="dark"] .table-browser-page-size span,
body:not([data-theme]) .table-browser-page-size span,
body[data-theme="dark"] .table-browser-filter span,
body:not([data-theme]) .table-browser-filter span,
body[data-theme="dark"] .table-browser-page-label,
body:not([data-theme]) .table-browser-page-label,
body[data-theme="light"] .app-topbar-copy small,
body[data-theme="light"] .app-topbar-user-copy small,
body[data-theme="light"] .subtle,
body[data-theme="light"] .workspace-sidebar-link-code,
body[data-theme="light"] .modal-label,
body[data-theme="light"] .credit-panel-kicker,
body[data-theme="light"] .credit-metric-label,
body[data-theme="light"] .audit-placeholder-kicker,
body[data-theme="light"] .job-status-pill,
body[data-theme="light"] .table-browser-search span,
body[data-theme="light"] .table-browser-page-size span,
body[data-theme="light"] .table-browser-filter span,
body[data-theme="light"] .table-browser-page-label {
    color: var(--theme-text-muted);
}

body[data-theme="dark"] .table-filter-chip,
body:not([data-theme]) .table-filter-chip,
body[data-theme="light"] .table-filter-chip {
    background: var(--theme-chip-bg);
    border-color: var(--theme-border);
    color: var(--theme-chip-text);
}

body[data-theme="dark"] .table-filter-chip strong,
body:not([data-theme]) .table-filter-chip strong,
body[data-theme="dark"] .job-status-pill,
body:not([data-theme]) .job-status-pill,
body[data-theme="dark"] .audit-load-metrics span,
body:not([data-theme]) .audit-load-metrics span,
body[data-theme="light"] .table-filter-chip strong,
body[data-theme="light"] .job-status-pill,
body[data-theme="light"] .audit-load-metrics span {
    background: var(--theme-chip-pill-bg);
    border-color: var(--theme-border-soft);
    color: var(--theme-text-muted);
}

body[data-theme="dark"] .excel-table thead th,
body:not([data-theme]) .excel-table thead th,
body[data-theme="light"] .excel-table thead th {
    background: var(--theme-table-head);
    color: var(--theme-heading);
}

body[data-theme="dark"] .excel-table th,
body:not([data-theme]) .excel-table th,
body[data-theme="dark"] .excel-table td,
body:not([data-theme]) .excel-table td,
body[data-theme="light"] .excel-table th,
body[data-theme="light"] .excel-table td {
    border-color: var(--theme-border-soft);
}

body[data-theme="dark"] .excel-table tbody tr:nth-child(even) td,
body:not([data-theme]) .excel-table tbody tr:nth-child(even) td,
body[data-theme="light"] .excel-table tbody tr:nth-child(even) td {
    background: var(--theme-table-even);
}

body[data-theme="dark"] .excel-table tbody tr:hover td,
body:not([data-theme]) .excel-table tbody tr:hover td,
body[data-theme="light"] .excel-table tbody tr:hover td {
    background: var(--theme-table-hover);
}

body[data-theme="dark"] .excel-table-freeze tbody td:nth-child(1),
body:not([data-theme]) .excel-table-freeze tbody td:nth-child(1),
body[data-theme="dark"] .excel-table-freeze tbody td:nth-child(2),
body:not([data-theme]) .excel-table-freeze tbody td:nth-child(2),
body[data-theme="dark"] .excel-table-freeze tbody td:nth-child(3),
body:not([data-theme]) .excel-table-freeze tbody td:nth-child(3),
body[data-theme="dark"] .excel-table-freeze tbody td:nth-child(4),
body:not([data-theme]) .excel-table-freeze tbody td:nth-child(4),
body[data-theme="dark"] .excel-table-freeze tbody td:nth-child(5),
body:not([data-theme]) .excel-table-freeze tbody td:nth-child(5),
body[data-theme="dark"] .excel-table-freeze tbody td:nth-child(6),
body:not([data-theme]) .excel-table-freeze tbody td:nth-child(6),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(1),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(2),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(3),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(4),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(5),
body[data-theme="light"] .excel-table-freeze tbody td:nth-child(6) {
    background: var(--theme-table-frozen);
}

body[data-theme="dark"] .action-group,
body:not([data-theme]) .action-group,
body[data-theme="light"] .action-group {
    background: var(--theme-action-shell);
    border-color: var(--theme-border-soft);
}

body[data-theme="dark"] .view-trigger,
body:not([data-theme]) .view-trigger,
body[data-theme="light"] .view-trigger {
    background: var(--theme-action-bg);
}

body[data-theme="dark"] .view-trigger svg,
body:not([data-theme]) .view-trigger svg,
body[data-theme="light"] .view-trigger svg {
    fill: currentColor;
}

body[data-theme="dark"] .modal-backdrop,
body:not([data-theme]) .modal-backdrop,
body[data-theme="light"] .modal-backdrop {
    background: var(--theme-overlay);
}

body[data-theme="dark"] .modal-header,
body:not([data-theme]) .modal-header,
body[data-theme="light"] .modal-header,
body[data-theme="dark"] .workspace-sidebar-footer,
body:not([data-theme]) .workspace-sidebar-footer,
body[data-theme="light"] .workspace-sidebar-footer,
body[data-theme="dark"] .observation-entry,
body:not([data-theme]) .observation-entry,
body[data-theme="light"] .observation-entry {
    border-color: var(--theme-border-soft);
}

body[data-theme="dark"] .observation-entry,
body:not([data-theme]) .observation-entry,
body[data-theme="light"] .observation-entry {
    background: var(--theme-card-soft);
}

body[data-theme="dark"] .observation-entry-head,
body:not([data-theme]) .observation-entry-head {
    color: #94a3b8;
}

body[data-theme="dark"] .observation-entry-head strong,
body:not([data-theme]) .observation-entry-head strong {
    color: #f8fafc;
}

body[data-theme="dark"] .observation-entry-chip-type,
body:not([data-theme]) .observation-entry-chip-type {
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.18);
}

body[data-theme="dark"] .observation-entry-promise,
body:not([data-theme]) .observation-entry-promise {
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}

body[data-theme="light"] .observation-entry-head {
    color: #64748b;
}

body[data-theme="light"] .observation-entry-head strong {
    color: #0f172a;
}

body[data-theme="light"] .observation-entry-promise {
    background: rgba(148, 163, 184, 0.08);
    color: #475569;
}

body[data-theme="light"] .table-filter-chip-active,
body[data-theme="light"] .workspace-sidebar-link-active,
body[data-theme="light"] .ui-button-primary,
body[data-theme="light"] .app-topbar-logo,
body[data-theme="light"] .upload-icon {
    color: #ffffff;
}

body[data-theme="light"] .workspace-sidebar-link-active .workspace-sidebar-link-copy strong,
body[data-theme="light"] .table-filter-chip-active {
    color: #9a3412;
}

body[data-theme="light"] .audit-load-card,
body[data-theme="light"] .audit-summary-card,
body[data-theme="light"] .audit-placeholder-card,
body[data-theme="light"] .audit-panel {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 38px -34px rgba(15, 23, 42, 0.18);
}

body[data-theme="light"] .audit-load-card-active {
    background: linear-gradient(180deg, #fff6ec 0%, #ffe8d2 100%);
    border-color: rgba(234, 88, 12, 0.24);
    box-shadow: 0 24px 40px -32px rgba(234, 88, 12, 0.22);
}

body[data-theme="light"] .audit-load-metrics span,
body[data-theme="light"] .job-status-pill {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #5b6472;
}

body[data-theme="light"] .audit-result-pill {
    font-weight: 700;
}

body[data-theme="light"] .audit-result-pill-insertado {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

body[data-theme="light"] .audit-result-pill-actualizado {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

body[data-theme="light"] .audit-result-pill-sin_cambios {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

body[data-theme="light"] .audit-result-pill-conflicto {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

body[data-theme="light"] .audit-category-pill {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

body[data-theme="light"] .audit-category-pill-key {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

body[data-theme="light"] .audit-change-count-pill {
    background: #fff7ed;
    border-color: #fdba74;
    color: #c2410c;
}

body[data-theme="light"] .audit-change-key-pill,
body[data-theme="light"] .audit-reason-pill {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

body[data-theme="light"] .audit-change-link {
    color: #0f172a;
}

body[data-theme="light"] .audit-change-modal-table tbody td {
    background: rgba(255, 255, 255, 0.94);
}

body[data-theme="light"] .audit-change-detail-row-key td {
    background: #fffaf5;
}

body[data-theme="light"] .audit-change-cell-before {
    background: #f8fafc;
    color: #64748b;
}

body[data-theme="light"] .audit-change-cell-after {
    background: #fff7ed;
    color: #9a3412;
}

body[data-theme="light"] .audit-change-modal-table thead th {
    background: linear-gradient(180deg, #fffaf5 0%, #f8efe6 100%);
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .audit-table tbody td {
    background: rgba(255, 255, 255, 0.94);
}

body[data-theme="light"] .audit-table tbody tr:hover td {
    background: #fff7ed;
}

body[data-theme="light"] .audit-table thead th {
    background: linear-gradient(180deg, #fffaf5 0%, #f8efe6 100%);
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .audit-filter-form .table-browser-filter span,
body[data-theme="light"] .audit-panel .section-kicker,
body[data-theme="light"] .audit-panel .subtle {
    color: #5b6472;
}

body[data-theme="light"] .audit-page-chip {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    color: #334155;
}

body[data-theme="light"] .audit-page-chip:hover {
    background: #fff7ed;
    border-color: rgba(234, 88, 12, 0.24);
}

body[data-theme="light"] .audit-page-chip-active {
    background: linear-gradient(180deg, #fff3e7 0%, #ffe0c2 100%);
    border-color: rgba(234, 88, 12, 0.28);
    color: #9a3412;
}

body[data-theme="light"] .payjoy-metric-card,
body[data-theme="light"] .payjoy-control-panel,
body[data-theme="light"] .payjoy-metric-table-card {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 20px 38px -34px rgba(15, 23, 42, 0.18);
    color: #0f172a;
}

body[data-theme="light"] .payjoy-metric-card {
    border-color: rgba(234, 88, 12, 0.2);
}

body[data-theme="light"] .payjoy-metric-card-head span {
    color: #c2410c;
}

body[data-theme="light"] .payjoy-metric-card p,
body[data-theme="light"] .payjoy-metric-card small,
body[data-theme="light"] .payjoy-control-panel .subtle,
body[data-theme="light"] .payjoy-control-label {
    color: #5b6472;
}

body[data-theme="light"] .payjoy-metric-card-warning {
    border-color: rgba(245, 158, 11, 0.3);
}

body[data-theme="light"] .payjoy-metric-card-warning .payjoy-metric-card-head span {
    color: #b45309;
}

body[data-theme="light"] .payjoy-metric-card-danger {
    border-color: rgba(239, 68, 68, 0.3);
}

body[data-theme="light"] .payjoy-metric-card-danger .payjoy-metric-card-head span {
    color: #b91c1c;
}

body[data-theme="light"] .payjoy-metric-card-success {
    border-color: rgba(34, 197, 94, 0.28);
}

body[data-theme="light"] .payjoy-metric-card-success .payjoy-metric-card-head span {
    color: #15803d;
}

body[data-theme="light"] .payjoy-cutoff-chip {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

body[data-theme="light"] .payjoy-cutoff-chip:hover {
    background: #fff7ed;
    border-color: rgba(234, 88, 12, 0.2);
}

body[data-theme="light"] .payjoy-cutoff-chip-active {
    background: linear-gradient(180deg, #ff8a3d 0%, #ea580c 100%);
    border-color: rgba(234, 88, 12, 0.48);
    color: #ffffff;
}

body[data-theme="light"] .payjoy-store-filter-label {
    color: #334155;
}

body[data-theme="light"] .payjoy-store-trigger,
body[data-theme="light"] .payjoy-store-menu-search input {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

body[data-theme="light"] .payjoy-store-trigger:hover,
body[data-theme="light"] .payjoy-store-trigger[aria-expanded="true"] {
    border-color: rgba(234, 88, 12, 0.26);
    box-shadow: 0 18px 32px -28px rgba(234, 88, 12, 0.28);
}

body[data-theme="light"] .payjoy-store-menu {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 40px -30px rgba(15, 23, 42, 0.2);
}

body[data-theme="light"] .payjoy-store-option {
    background: rgba(248, 250, 252, 0.9);
    color: #334155;
}

body[data-theme="light"] .payjoy-store-option:hover {
    background: #fff7ed;
    border-color: rgba(234, 88, 12, 0.2);
}

body[data-theme="light"] .payjoy-store-option-active {
    background: linear-gradient(180deg, #fff3e7 0%, #ffe0c2 100%);
    border-color: rgba(234, 88, 12, 0.24);
    color: #9a3412;
}

body[data-theme="light"] .payjoy-metric-table-head {
    background: linear-gradient(180deg, #fff7ed 0%, #ffedd5 100%);
    border-bottom-color: rgba(234, 88, 12, 0.22);
}

body[data-theme="light"] .payjoy-metric-table-head h3 {
    color: #9a3412;
}

body[data-theme="light"] .payjoy-metric-table thead th {
    background: linear-gradient(180deg, #fffaf5 0%, #f8efe6 100%);
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.08);
}

body[data-theme="light"] .payjoy-metric-table tbody td {
    background: rgba(255, 255, 255, 0.96);
}

body[data-theme="light"] .table-wrap-payjoy .payjoy-metric-table tbody tr:nth-child(even) td {
    background: #fffcf9;
}

body[data-theme="light"] .payjoy-metric-table tbody tr:hover td {
    background: #fff7ed;
}

body[data-theme="light"] .payjoy-metric-table tfoot td {
    background: #fffdf9;
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.08);
}
