:root {
    --bg-top: #091722;
    --bg-bottom: #13293d;
    --panel: rgba(8, 19, 31, 0.86);
    --panel-soft: rgba(13, 33, 48, 0.72);
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --text: #eef4fb;
    --muted: #9ab0c4;
    --accent: #f2b84b;
    --accent-strong: #ffcb6f;
    --accent-soft: rgba(242, 184, 75, 0.16);
    --teal: #78d8cc;
    --danger: #ff8a7a;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
    --font: "Aptos", "Segoe UI Variable Text", "Bahnschrift", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    overflow-x: hidden;
}

body {
    font-family: var(--font);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(120, 216, 204, 0.14), transparent 32%),
        radial-gradient(circle at bottom right, rgba(242, 184, 75, 0.12), transparent 28%),
        linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 78%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

select option {
    background: var(--bg-bottom);
    color: var(--text);
}

code {
    font-family: "Cascadia Code", "Consolas", monospace;
}

.main-shell,
.fields-shell,
.app-shell {
    width: 100%;
    min-height: 100vh;
    animation: rise-in 260ms ease-out;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 340px minmax(0, 1fr);
    height: 100vh;
    max-width: 100%;
    overflow: hidden;
}

.primary-sidebar,
.context-sidebar,
.sidebar,
.builder-panel {
    background: rgba(6, 15, 25, 0.82);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.primary-sidebar,
.context-sidebar,
.sidebar {
    padding: 28px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100vh;
    min-width: 0;
    overflow-x: hidden;
}

.context-sidebar {
    overflow-y: auto;
}

.primary-sidebar {
    background: rgba(4, 12, 20, 0.95);
    justify-content: space-between;
    position: sticky;
    top: 0;
    overflow-y: hidden;
}

.primary-sidebar-top {
    display: grid;
    gap: 10px;
}

.primary-sidebar-top h1,
.context-sidebar-top h2 {
    margin: 0;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.primary-sidebar-top h1 {
    font-size: clamp(2rem, 2.8vw, 2.7rem);
}

.context-sidebar-top h2 {
    font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.primary-nav,
.report-toggle-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.primary-sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

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

.language-control span {
    color: var(--muted);
    font-size: 0.88rem;
}

.language-control select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0 12px;
}

.primary-nav-link {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.primary-nav-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.primary-nav-link.active {
    border-color: rgba(242, 184, 75, 0.58);
    background: linear-gradient(180deg, rgba(242, 184, 75, 0.16), rgba(255, 255, 255, 0.03));
    color: var(--accent-strong);
}

.context-sidebar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.context-sidebar-top,
.sidebar-section-top {
    display: grid;
    gap: 10px;
}

.sidebar-section {
    display: grid;
    gap: 14px;
    padding-top: 6px;
}

.compact-form {
    padding: 16px;
}

.context-form-sidebar {
    overflow-y: auto;
}

.page-workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.secondary-workspace {
    grid-template-rows: minmax(0, 1fr);
}

.workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
}

.workspace-header,
.table-panel,
.content-panel,
.builder-panel,
.order-panel {
    min-width: 0;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 30px 20px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(7, 20, 31, 0.62), rgba(7, 20, 31, 0));
}

.field-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 30px 18px;
    border-bottom: 1px solid var(--line);
}

.field-chip,
.field-tag,
.mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    white-space: nowrap;
}

.field-chip {
    min-height: 40px;
}

.mini-badge {
    min-height: 25px;
    font-size: 0.82rem;
}

.field-tag {
    min-height: 25px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.field-chip strong,
.field-tag strong {
    font-weight: 600;
}

.field-chip span,
.field-tag span,
.mini-badge {
    color: var(--muted);
    font-size: 0.9rem;
}

.badge-accent {
    background: var(--accent-soft);
    border-color: rgba(242, 184, 75, 0.32);
    color: var(--accent-strong);
}

.badge-teal {
    background: rgba(120, 216, 204, 0.14);
    border-color: rgba(120, 216, 204, 0.28);
    color: var(--teal);
}

.sidebar-top h1,
.workspace-header h2,
.builder-panel h1,
.order-header h2 {
    margin: 0;
    line-height: 1.05;
}

.sidebar-top h1,
.builder-panel h1 {
    font-size: clamp(2rem, 3vw, 3rem);
    letter-spacing: -0.04em;
}

.workspace-header h2,
.order-header h2 {
    font-size: clamp(1.5rem, 2vw, 2.25rem);
    letter-spacing: -0.035em;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    font-weight: 700;
}

.sidebar-copy,
.panel-copy p,
.table-panel-top p,
.note-box p,
.empty-state p {
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
}

.sidebar-tools,
.workspace-actions,
.field-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.workspace-actions {
    align-items: end;
}

.search-control,
.record-action-field {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.search-control span,
.record-action-field span {
    color: var(--muted);
    font-size: 0.88rem;
}

.search-control input,
.record-action-field select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0 12px;
}

.accent-button,
.ghost-button,
.danger-button,
.identifier-button {
    border: 0;
    border-radius: 14px;
    padding: 11px 16px;
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.accent-button {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #1f1404;
    font-weight: 700;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border: 1px solid var(--line);
}

.danger-button {
    background: rgba(255, 138, 122, 0.12);
    color: #ffd5cf;
    border: 1px solid rgba(255, 138, 122, 0.3);
}

.identifier-button {
    background: none;
    color: var(--teal);
    padding: 0;
    border-radius: 0;
    text-decoration: underline;
    font-weight: 600;
}

.accent-button:hover,
.ghost-button:hover,
.danger-button:hover,
.identifier-button:hover {
    transform: translateY(-1px);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    line-height: 0;
}

.icon-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(3px);
    background: rgba(6, 16, 28, 0.97);
    border: 1px solid var(--line-strong);
    color: var(--text);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 100ms ease, transform 100ms ease;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.status-strip,
.feedback-banner {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
    color: var(--muted);
}

.feedback-banner {
    min-height: 52px;
}

.content-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px 30px 30px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: visible;
}

.finish-date-list,
.field-list,
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 120px;
}

.finish-date-item,
.field-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
    background: var(--panel-soft);
    box-shadow: var(--shadow);
    transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.finish-date-item {
    cursor: pointer;
    width: 100%;
    color: inherit;
    text-align: left;
}

.finish-date-card-button {
    width: 100%;
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.finish-date-card-button:focus-visible {
    outline: 2px solid rgba(120, 216, 204, 0.65);
    outline-offset: 6px;
}

.finish-date-item:hover,
.field-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.24);
}

.finish-date-item.active {
    border-color: rgba(242, 184, 75, 0.6);
    background: linear-gradient(180deg, rgba(242, 184, 75, 0.14), rgba(13, 33, 48, 0.84));
}

.finish-date-item.closed {
    border-color: rgba(255, 138, 122, 0.3);
}

.finish-date-item.closed.active {
    border-color: rgba(255, 138, 122, 0.6);
    background: linear-gradient(180deg, rgba(255, 138, 122, 0.14), rgba(13, 33, 48, 0.84));
}

.finish-date-item.paused {
    border-color: rgba(120, 216, 204, 0.34);
}

.finish-date-item.postponed {
    border-color: rgba(242, 184, 75, 0.34);
}

.finish-date-top,
.field-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.finish-date-label,
.field-card h3 {
    margin: 0;
    font-size: 1rem;
}

.finish-date-meta,
.field-meta {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.table-panel {
    margin: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.table-panel-top {
    padding: 20px 30px 14px;
}

.table-filter-bar,
.report-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.table-filter-bar {
    justify-content: space-between;
}

.table-search-controls,
.table-action-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.table-action-controls {
    justify-content: flex-end;
    margin-left: auto;
}

.table-panel-top .table-filter-bar {
    margin-top: 14px;
}

.table-panel-top h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.table-scroll {
    overflow-y: auto;
    overflow-x: auto;
    min-height: 0;
    border-top: 1px solid var(--line);
    max-width: 100%;
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
}

.records-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(7, 20, 31, 0.94);
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-strong);
    color: var(--muted);
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.records-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: top;
    white-space: nowrap;
}

.records-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
}

.records-table tbody tr:hover {
    background: rgba(120, 216, 204, 0.06);
}

.value-muted {
    color: var(--muted);
}

.empty-state {
    display: none;
    place-items: center;
    text-align: center;
    padding: 40px 24px 56px;
    border-top: 1px solid var(--line);
}

.empty-state.visible {
    display: grid;
}

.report-grid {
    display: grid;
    gap: 18px;
    padding: 24px 30px 30px;
}

.report-panel {
    display: none;
    margin: 24px 30px 30px;
    min-height: 0;
}

.report-panel.visible {
    display: flex;
    flex-direction: column;
}

.report-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(8, 19, 31, 0.72);
    box-shadow: var(--shadow);
    overflow: hidden;
    min-height: 0;
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--line);
}

.report-card-header h2 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.report-input {
    min-width: 300px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 11px 14px;
}

.report-preview {
    flex: 1 1 auto;
    min-height: 140px;
    max-height: none;
    overflow: hidden;
}

.report-preview .table-scroll {
    height: 100%;
}

.report-filter-bar {
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
}

.report-search-input {
    flex: 1 1 240px;
}

.queue-status-panel {
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.025);
}

.queue-status-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.queue-status-header h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.queue-status-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.queue-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.queue-status-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(5, 14, 22, 0.5);
}

.queue-status-day {
    font-weight: 700;
}

.queue-status-metrics {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.reports-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    overflow-y: hidden;
    overflow-x: hidden;
}

.fields-shell {
    display: grid;
    grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
}

.builder-panel,
.order-panel {
    padding: 30px;
}

.builder-panel {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.panel-copy {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field-form {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.stack-form {
    display: grid;
    gap: 14px;
}

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

.field-form span {
    color: var(--muted);
    font-size: 0.92rem;
}

.form-hint {
    margin: 0;
    color: var(--muted);
    min-height: 22px;
    font-size: 0.9rem;
}

.field-form input,
.field-form select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 12px 14px;
}

.field-form input:focus,
.field-form select:focus {
    outline: none;
    border-color: rgba(120, 216, 204, 0.55);
    box-shadow: 0 0 0 3px rgba(120, 216, 204, 0.15);
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    padding: 0;
}

.note-box {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
}

.note-box strong {
    display: block;
    margin-bottom: 10px;
}

.note-box p + p {
    margin-top: 8px;
}

.order-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}

.field-card {
    cursor: grab;
    padding: 14px;
}

.field-card.dragging {
    opacity: 0.45;
    transform: scale(0.985);
}

.field-card strong {
    color: var(--text);
}

.field-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.field-card-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.campaign-status-actions .ghost-button {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
}

.feedback-banner:not(.visible) {
    display: none;
}

.feedback-banner.visible {
    display: block;
}

.feedback-banner.error {
    border-color: rgba(255, 138, 122, 0.35);
    color: #ffd1c8;
    background: rgba(255, 138, 122, 0.1);
}

.feedback-banner.success {
    border-color: rgba(120, 216, 204, 0.3);
    color: #c7fff7;
    background: rgba(120, 216, 204, 0.1);
}

.results-grid {
    gap: 14px;
}

.result-card {
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background: var(--panel-soft);
    box-shadow: var(--shadow);
}

.result-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.result-card h3 {
    margin: 0;
    font-size: 1rem;
}

.result-card-meta {
    color: var(--muted);
    line-height: 1.5;
}

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

.checkbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.checkbox-chip input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.checkbox-chip.disabled {
    opacity: 0.56;
}

.result-select-wrap {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.result-select-wrap span {
    color: var(--muted);
    font-size: 0.9rem;
}

.result-select-wrap select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 0 12px;
}

.status-badge-closed {
    cursor: help;
}

.hidden {
    display: none !important;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 14, 0.74);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 20;
}

.record-modal {
    width: min(960px, 100%);
    max-height: min(88vh, 900px);
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(8, 19, 31, 0.98), rgba(12, 32, 46, 0.94));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    padding: 24px;
}

.action-modal {
}

.record-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.record-modal-header h3 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2.1rem);
    letter-spacing: -0.03em;
}

.record-modal-meta {
    margin-top: 14px;
    color: var(--muted);
}

.record-modal-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.record-modal-grid {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.record-detail {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    padding: 14px 16px;
}

.record-detail-label {
    color: var(--muted);
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.record-detail-value {
    margin-top: 8px;
    word-break: break-word;
    line-height: 1.5;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(560px, 100%);
    display: grid;
    gap: 20px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(6, 15, 25, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.login-card-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
}

.login-card h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.8rem);
    letter-spacing: -0.04em;
}

.login-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 14, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 200ms ease;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .main-shell,
    .fields-shell,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .primary-sidebar,
    .context-sidebar,
    .sidebar,
    .builder-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        min-height: auto;
        height: auto;
    }

    html,
    body {
        overflow: auto;
    }

    .app-shell {
        height: auto;
        overflow: visible;
    }

    .primary-sidebar,
    .context-sidebar,
    .page-workspace {
        position: static;
        overflow: visible;
    }

}

@media (max-width: 640px) {
    .sidebar,
    .primary-sidebar,
    .context-sidebar,
    .workspace-header,
    .field-ribbon,
    .table-panel-top,
    .content-panel,
    .builder-panel,
    .order-panel {
        padding-left: 18px;
        padding-right: 18px;
    }

    .workspace-header,
    .order-header,
    .record-modal-header,
    .report-card-header,
    .login-card-top,
    .record-modal-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-control,
    .record-action-field,
    .table-filter-bar .report-input,
    .table-filter-bar .ghost-button,
    .table-search-controls,
    .table-action-controls,
    .report-filter-bar .report-input,
    .report-filter-bar .ghost-button {
        width: 100%;
        min-width: 0;
    }

    .table-search-controls,
    .table-action-controls {
        align-items: stretch;
    }
}
