:root {
    --bg: #ffffff;
    --bg-subtle: #f6f8fa;
    --surface: #ffffff;
    --surface-strong: #f6f8fa;
    --text: #1f2328;
    --muted: #656d76;
    --line: #d0d7de;
    --line-strong: #afb8c1;
    --accent: #2da44e;
    --accent-soft: #dafbe1;
    --accent-dark: #1a7f37;
    --warn: #d44c47;
    --warn-soft: #fff1ef;
    --shadow: 0 1px 0 rgba(31, 35, 40, 0.04);
    --radius: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 8% 14%, rgba(47, 111, 235, 0.24), transparent 42%),
        radial-gradient(circle at 92% 88%, rgba(30, 122, 96, 0.2), transparent 36%),
        linear-gradient(160deg, #f2f7ff 0%, #f8fbf8 48%, #ffffff 100%);
}

.auth-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.5) 12%, rgba(255, 255, 255, 0.06) 60%),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 24px,
            rgba(25, 41, 72, 0.035) 24px,
            rgba(25, 41, 72, 0.035) 25px
        );
    pointer-events: none;
}

.auth-stage {
    width: min(1100px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

.auth-brand {
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.7);
    background:
        linear-gradient(140deg, rgba(24, 66, 152, 0.9), rgba(23, 41, 89, 0.95)),
        linear-gradient(180deg, #1f55b7 0%, #102f69 100%);
    color: #f2f7ff;
    padding: 34px 30px;
    box-shadow: 0 20px 56px rgba(16, 39, 83, 0.3);
    display: grid;
    gap: 16px;
    align-content: center;
}

.auth-brand .eyebrow {
    color: rgba(234, 244, 255, 0.82);
    margin: 0;
}

.auth-brand h1 {
    margin: 0;
    font-family: "Sora", "Manrope", "Segoe UI", sans-serif;
    font-size: clamp(1.8rem, 3.4vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.auth-brand-copy {
    margin: 0;
    color: rgba(238, 246, 255, 0.92);
    font-size: 1rem;
    line-height: 1.6;
}

.auth-brand-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-brand-points span {
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    border: 1px solid rgba(214, 230, 255, 0.28);
    background: rgba(211, 226, 250, 0.12);
}

.auth-card {
    width: min(520px, 100%);
    padding: 28px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    box-shadow:
        0 24px 80px rgba(22, 43, 86, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.auth-card h1,
.auth-card h2 {
    font-family: "Sora", "Manrope", "Segoe UI", sans-serif;
    font-size: clamp(1.55rem, 2.5vw, 2rem);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    margin-top: 0;
}

.auth-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 14px;
}

.auth-tabs .ghost-button {
    border-color: rgba(31, 85, 183, 0.22);
    background: rgba(255, 255, 255, 0.75);
}

.auth-tabs .ghost-button.active {
    border-color: rgba(31, 85, 183, 0.5);
    color: #153f8f;
    background: linear-gradient(180deg, #f4f8ff 0%, #e6efff 100%);
    box-shadow: 0 6px 14px rgba(47, 111, 235, 0.16);
}

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

.auth-form label {
    display: grid;
    gap: 7px;
    color: #5b6270;
    font-size: 0.84rem;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #d7deec;
    background: rgba(255, 255, 255, 0.9);
    transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.auth-form input:focus {
    outline: none;
    border-color: rgba(47, 111, 235, 0.58);
    box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.14);
    transform: translateY(-1px);
}

.auth-form .primary-button {
    margin-top: 2px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1d63dc 0%, #2f6feb 68%, #4982f5 100%);
}

.auth-message {
    margin: 16px 0 0;
    color: #566172;
    word-break: break-word;
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(33, 70, 142, 0.06);
    border: 1px solid rgba(33, 70, 142, 0.12);
}

.auth-message.error {
    color: #a23d38;
    background: rgba(212, 76, 71, 0.08);
    border-color: rgba(212, 76, 71, 0.22);
}

body {
    margin: 0;
    font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(247, 246, 243, 0.92) 0, rgba(247, 246, 243, 0.92) 84px, transparent 84px),
        linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    transition: grid-template-columns 220ms ease;
}

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

.sidebar {
    padding: 16px 12px;
    background: var(--bg-subtle);
    color: var(--text);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--line);
    gap: 12px;
    transition: padding 220ms ease;
}

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

.sidebar-header {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: start;
    gap: 10px;
}

.sidebar-brand {
    min-width: 0;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    padding: 0;
}

.sidebar-nav {
    display: grid;
    gap: 2px;
}

.sidebar-nav-group {
    display: grid;
    gap: 2px;
    position: relative;
}

.sidebar-nav-button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    justify-items: start;
}

.sidebar-nav-button:hover {
    background: #e9edf2 !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none;
}

.sidebar-nav-button:focus-visible {
    outline: none;
    background: #e9edf2 !important;
    border: 0 !important;
    box-shadow: none !important;
    transform: none;
}

.app-shell:not(.sidebar-collapsed) .sidebar-nav-button {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 10px;
    justify-content: flex-start;
    justify-items: start;
    text-align: left;
}

.sidebar-nav-panel {
    display: grid;
    gap: 2px;
    background: #ffffff;
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: max-height 220ms ease, opacity 200ms ease, transform 200ms ease, padding 180ms ease;
}

.sidebar-nav-panel.is-open {
    max-height: 280px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    border: 1px solid var(--line);
    padding: 6px;
    box-shadow: 0 6px 14px rgba(140, 149, 159, 0.15);
}

.sidebar-label {
    white-space: nowrap;
}

.app-shell.sidebar-collapsed .sidebar {
    padding-inline: 8px;
}

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

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 120ms ease;
}

.app-shell.sidebar-collapsed .sidebar-toggle,
.app-shell.sidebar-collapsed .sidebar-nav-button {
    justify-content: center;
}

.app-shell.sidebar-collapsed .sidebar-nav-button {
    display: inline-flex;
}

.app-shell.sidebar-collapsed .sidebar-nav-group {
    align-items: center;
}

.app-shell.sidebar-collapsed .sidebar-nav-panel {
    position: absolute;
    left: calc(100% + 8px);
    top: 0;
    width: 240px;
    z-index: 70;
    transform: translateX(-6px);
}

.app-shell.sidebar-collapsed .sidebar-nav-panel.is-open {
    transform: translateX(0);
}

.sidebar h1,
.hero h2,
.dropzone h3,
.modal-header h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.sidebar-copy {
    color: var(--muted);
    line-height: 1.6;
}

.version-badge {
    margin: 8px 0 12px;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.76rem;
    letter-spacing: 0.01em;
}

.sidebar-card {
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface);
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.sidebar-card span {
    color: var(--muted);
    font-size: 0.85rem;
}

.sidebar-card strong {
    font-size: 0.95rem;
    line-height: 1.5;
}

.content {
    padding: 28px;
    display: grid;
    gap: 16px;
    min-width: 0;
}

.hero,
.panel,
.modal-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero,
.dropzone,
.table-panel {
    padding: 20px;
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eyebrow {
    margin: 0 0 10px;
    letter-spacing: 0.01em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
}

.hero p:last-child,
.dropzone p:last-child,
.sidebar p:last-child {
    margin-bottom: 0;
}

.user-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.84rem;
    color: var(--muted);
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.summary-card {
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--surface-strong);
    border: 1px solid var(--line);
}

.summary-card span {
    color: var(--muted);
    font-size: 0.85rem;
}

.summary-card strong {
    display: block;
    font-size: 1.45rem;
    margin-top: 8px;
    font-weight: 700;
}

.filter-row,
.modal-footer,
.modal-header,
.hero-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.hero-actions {
    justify-content: flex-end;
}

.tools-menu-item {
    border: 0;
    background: transparent;
    color: #24292f;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.92rem;
    cursor: pointer;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    column-gap: 10px;
    align-items: center;
    justify-items: start;
    width: 100%;
}

.tools-menu-item:hover {
    background: #eef1f4;
}

.tools-menu-item:focus-visible {
    outline: none;
    background: #eef1f4;
}

.filter-row input,
.filter-row select,
.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.filter-row input:focus,
.filter-row select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.lookup-create-form input:focus {
    outline: none;
    border-color: rgba(47, 111, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.12);
}

.filter-row > * {
    flex: 1 1 0;
    min-width: 0;
}

.filter-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: visible;
    padding-bottom: 0;
    align-items: flex-end;
}

.filter-field {
    display: grid;
    gap: 4px;
    flex: 1 1 132px;
    min-width: 0;
}

.filter-field > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.filter-search-field {
    flex: 1.7 1 220px;
}

.filter-date-field {
    flex: 1 1 132px;
}

.filter-row .filter-field input,
.filter-row .filter-field select {
    min-width: 0;
}

.filter-row .filter-field:focus-within > span {
    color: #234fa8;
}

.filter-reset-button {
    flex: 0 0 auto;
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.delete-button {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 500;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.delete-button:hover {
    transform: translateY(-1px);
}

.primary-button {
    background: var(--accent-dark);
    border-color: rgba(31, 136, 61, 0.4);
    color: white;
}

.secondary-button {
    background: #f6f8fa;
    color: var(--text);
}

.ghost-button,
.icon-button {
    background: #f6f8fa;
    border: 1px solid var(--line);
    color: var(--text);
}

.github-button {
    background: #f6f8fa;
    border: 1px solid rgba(27, 31, 36, 0.15);
    box-shadow: 0 1px 0 rgba(27, 31, 36, 0.04);
}

.github-button:hover {
    background: #f3f4f6;
}

.delete-button {
    background: var(--warn-soft);
    color: var(--warn);
    padding: 8px 12px;
}

.dropzone {
    border: 1px dashed var(--line-strong);
    background:
        linear-gradient(180deg, rgba(247, 246, 243, 0.6), rgba(255, 255, 255, 0.9));
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dropzone.active {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.dropzone.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

.table-toolbar-title .eyebrow {
    margin-bottom: 4px;
}

.table-toolbar-title h3 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.table-wrapper {
    overflow-x: hidden;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.95rem;
}

th,
td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    background: #f6f8fa;
    position: sticky;
    top: 0;
}

.numeric-cell {
    text-align: right;
}

.actions-cell {
    text-align: center;
    width: 72px;
}

th.actions-cell {
    cursor: default;
}

.editable-cell {
    cursor: pointer;
}

.inline-editor {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
}

.inline-editor:focus {
    outline: none;
    border-color: rgba(47, 111, 235, 0.45);
    box-shadow: 0 0 0 3px rgba(47, 111, 235, 0.12);
}

.form-grid input.ocr-prefill-field,
.form-grid select.ocr-prefill-field,
.form-grid textarea.ocr-prefill-field {
    border-color: #9ac5ef;
    background: #eef7ff;
    box-shadow: 0 0 0 2px rgba(118, 175, 232, 0.2);
}

.form-grid input.ocr-prefill-field:focus,
.form-grid select.ocr-prefill-field:focus,
.form-grid textarea.ocr-prefill-field:focus {
    border-color: #7cb0e5;
    box-shadow: 0 0 0 3px rgba(124, 176, 229, 0.24);
}

tbody tr:hover {
    background: #f7f6f3;
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.income {
    background: #eef9f1;
    color: #2e7d32;
}

.badge.expense {
    background: var(--warn-soft);
    color: var(--warn);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.32);
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal.hidden {
    display: none;
}

.modal-card {
    width: min(760px, 100%);
    padding: 24px;
}

.modal-card.large {
    width: min(980px, 100%);
}

.ocr-prefill-note {
    margin: 10px 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #b9d6f3;
    background: #eef7ff;
    color: #34597f;
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-grid label:nth-child(3) {
    grid-column: 1 / -1;
}

.lookup-create-form,
.lookup-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.lookup-create-form {
    margin-bottom: 16px;
}

.lookup-create-form input {
    flex: 1;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.lookup-list {
    display: grid;
    gap: 12px;
    max-height: 320px;
    overflow: auto;
}

.import-report-meta {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.import-sheet-picker {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #f7f4ec;
}

.import-sheet-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.import-sheet-controls select {
    flex: 1;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
}

.import-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    gap: 10px;
}

.confirm-text {
    margin: 6px 0 0;
    color: var(--text);
    line-height: 1.6;
}

.upload-progress {
    min-width: 280px;
    max-width: 420px;
    flex: 1;
    display: grid;
    gap: 7px;
}

.download-progress {
    max-width: 560px;
}

.upload-progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e8edf8;
    overflow: hidden;
    position: relative;
}

.upload-progress-indicator {
    position: absolute;
    inset: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(120deg, #1f55b7 0%, #2f6feb 45%, #72a1ff 100%);
    animation: booking-upload-slide 1.2s ease-in-out infinite;
    box-shadow: 0 0 0 1px rgba(31, 85, 183, 0.12) inset;
}

.download-progress .upload-progress-indicator {
    animation: none;
    width: var(--download-progress-width, 0%);
    transition: width 120ms ease;
}

.download-progress.is-indeterminate .upload-progress-indicator {
    width: 42%;
    animation: booking-upload-slide 1.2s ease-in-out infinite;
}

#booking-upload-status {
    margin: 0;
    color: #334565;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#receipt-download-status {
    margin: 0;
    color: #334565;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

#receipt-download-current-file {
    margin: -1px 0 0;
    color: #5f6b81;
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-progress.is-error #receipt-download-status {
    color: var(--warn);
}

.download-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#receipt-download-cancel {
    padding: 4px 10px;
    font-size: 0.8rem;
}

.toast-root {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2200;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: min(460px, calc(100vw - 36px));
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid #c8dfcc;
    background: #f1faf3;
    color: #1f5f2e;
    box-shadow: 0 10px 26px rgba(25, 59, 34, 0.18);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    animation: toast-in 160ms ease-out;
    pointer-events: auto;
    cursor: pointer;
}

.toast.toast-error {
    border-color: #efcbc9;
    background: #fff4f3;
    color: #9a2f2a;
    box-shadow: 0 10px 26px rgba(92, 26, 22, 0.18);
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

#booking-form.is-submitting .primary-button[type="submit"] {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

.import-report-list {
    display: grid;
    gap: 10px;
    max-height: 420px;
    overflow: auto;
}

.receipt-failures-text {
    width: 100%;
    min-height: 260px;
    max-height: min(58vh, 520px);
    resize: vertical;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    padding: 12px 14px;
    font-size: 0.88rem;
    line-height: 1.4;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    color: #243248;
    background: #fbfcff;
}

@keyframes booking-upload-slide {
    0% {
        transform: translateX(-120%);
    }
    50% {
        transform: translateX(90%);
    }
    100% {
        transform: translateX(240%);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.import-report-step {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfbfa;
}

.import-report-step.success {
    border-color: #cfe6d3;
    background: #f3fbf4;
}

.import-report-step.error {
    border-color: #f1c9c5;
    background: #fff4f2;
}

.import-report-step.info {
    border-color: #d8e2f7;
    background: #f7faff;
}

.import-report-step strong {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.lookup-item {
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--line);
}

.lookup-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.lookup-meta-vertical {
    flex-direction: column;
    align-items: flex-start;
}

.permissions-editor {
    justify-content: flex-end;
}

.inline-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.inline-label select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
}

.receipt-link {
    color: var(--accent-dark);
    text-decoration: none;
}

.receipt-attach-body {
    display: grid;
    gap: 10px;
}

.receipt-attach-dropzone {
    min-height: 150px;
    display: grid;
    place-items: center;
    gap: 4px;
    text-align: center;
    cursor: pointer;
    padding: 18px;
}

.receipt-attach-dropzone p {
    margin: 0;
    color: var(--muted);
}

.receipt-attach-dropzone .secondary-button {
    margin-top: 4px;
}

.receipt-attach-dropzone.disabled {
    cursor: not-allowed;
}

.receipt-attach-file-name {
    margin: 0;
    word-break: break-word;
}

.receipt-cell {
    max-width: none;
}

.receipt-cell .receipt-link,
.receipt-cell .muted-text {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.receipt-content {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    max-width: 100%;
    width: 100%;
    min-width: 0;
}

.receipt-name {
    display: block;
    width: 100%;
    min-width: 0;
}

.receipt-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    row-gap: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-2px);
    transition: opacity 130ms ease, max-height 130ms ease, transform 130ms ease;
    flex: 0 0 auto;
    width: 100%;
}

.receipt-cell:hover .receipt-actions,
.receipt-cell:focus-within .receipt-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 88px;
    transform: translateY(0);
}

.receipt-action {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    flex: 0 0 auto;
    text-decoration: none;
}

.receipt-action:hover {
    border-color: #c6ccc2;
    color: var(--text);
}

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

.amount-expense {
    color: var(--warn);
    font-weight: 600;
}

.receipt-link:hover {
    text-decoration: underline;
}

.row-delete-button {
    border: 1px solid #f2c6c1;
    background: #fff6f5;
    color: #bd3a34;
    border-radius: 10px;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.row-delete-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.row-delete-button:hover {
    background: #ffe9e6;
    border-color: #e7a8a1;
    transform: translateY(-1px);
}

.row-delete-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        gap: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}

@media (max-width: 720px) {
    .auth-shell {
        padding: 14px;
    }

    .auth-stage {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .auth-brand {
        padding: 22px 18px;
    }

    .auth-card {
        padding: 20px;
    }

    .auth-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .auth-tabs .ghost-button {
        width: 100%;
    }

    .content {
        padding: 18px;
    }

    .hero {
        align-items: flex-start;
    }

    .hero,
    .modal-header,
    .modal-footer,
    .lookup-create-form,
    .lookup-item {
        flex-direction: column;
        align-items: stretch;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 0.86rem;
    }

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