:root {
    --bg: #0f1419;
    --surface: #1a2332;
    --surface-hover: #243044;
    --border: #2d3a4f;
    --text: #e8edf4;
    --text-muted: #8b9cb3;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    --warning-bg: rgba(245, 158, 11, 0.18);
    --warning-border: rgba(245, 158, 11, 0.45);
    --warning-text: #fbbf24;
    --radius: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --dashboard-header-height: 4.6875rem;
    --dashboard-header-padding-y: 12px;
    --sidebar-width: 240px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.auth-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: -8px 0 16px;
}

.env-badge-host {
    display: flex;
    align-items: center;
}

.env-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.env-badge-sandbox {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.env-badge-live {
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.status-badge-active {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.status-badge-inactive {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.status-badge-archived {
    background: rgba(139, 156, 179, 0.16);
    border: 1px solid rgba(139, 156, 179, 0.45);
    color: var(--text-muted);
}

.lang-switcher {
    display: flex;
    align-items: center;
}

.lang-select {
    padding: 6px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    min-width: 9rem;
}

.topbar .lang-switcher {
    display: flex;
    align-items: center;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.required-mark {
    color: #ef4444;
    font-weight: 600;
}

.field-invalid {
    border-color: rgba(239, 68, 68, 0.85) !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.secret-field {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.secret-field input {
    flex: 1;
}

.secret-field .btn {
    width: auto;
    margin-top: 0;
    white-space: nowrap;
}

.field-hint {
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.configuration-translation-lead {
    margin: 0 0 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--text);
}

.editor-notice {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--warning-border);
    border-radius: var(--radius);
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: 0.9rem;
}

.editor-notice-warning {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
}

.field-readonly-value {
    padding: 10px 0 0;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input:disabled,
.form-group input[readonly],
.form-group select:disabled,
.form-group textarea:disabled,
.form-group textarea[readonly] {
    opacity: 0.85;
    background: rgba(128, 128, 128, 0.12);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.28);
}

.editor-actions .btn-danger {
    margin-right: auto;
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-top: 8px;
}

.btn-secondary:hover {
    background: var(--surface-hover);
}

.form-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.alert {
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.hidden {
    display: none !important;
}

/* Dashboard layout */
.dashboard {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar main";
    min-height: 100vh;
}

.sidebar {
    grid-area: sidebar;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 0 0 24px;
}

.sidebar-brand {
    display: none;
    align-items: center;
    min-height: var(--dashboard-header-height);
    padding: var(--dashboard-header-padding-y) 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    box-sizing: border-box;
}

.sidebar-nav a {
    display: block;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

@media (min-width: 769px) {
    .sidebar-nav {
        padding-top: 16px;
    }
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--text);
    background: var(--surface-hover);
    border-left-color: var(--accent);
    text-decoration: none;
}

.main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    grid-area: topbar;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    align-items: stretch;
    min-height: var(--dashboard-header-height);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    box-sizing: border-box;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--dashboard-header-padding-y) 20px;
    border-right: 1px solid var(--border);
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    box-sizing: border-box;
}

.topbar-brand-logo {
    display: block;
    flex-shrink: 0;
}

.topbar-body {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    row-gap: 8px;
    padding: var(--dashboard-header-padding-y) 24px;
    min-width: 0;
    box-sizing: border-box;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: min-content;
    flex-wrap: nowrap;
}

.topbar-start > * {
    flex-shrink: 0;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.topbar-end .lang-select,
.topbar-end .topbar-logout {
    height: 2rem;
    box-sizing: border-box;
    line-height: 1.25;
}

.topbar-username {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
}

.topbar-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topbar-email {
    color: var(--text);
}

.topbar-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.merchant-as-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.topbar-merchant-select {
    padding: 4px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    width: auto;
    min-width: 10rem;
    max-width: 18rem;
}

.topbar-merchant-select:disabled {
    opacity: 1;
    cursor: default;
}

.section-switcher {
    display: none;
    width: calc(100% - 40px);
    margin: 0 20px 16px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9rem;
}

.btn-sm {
    width: auto;
    padding: 6px 14px;
    font-size: 0.85rem;
}

.content {
    padding: 24px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

#content-host {
    min-width: 0;
    max-width: 100%;
}

.content h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

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

.welcome-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 640px;
}

.browse {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.translations-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.translations-section-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.translations-section-label {
    font-weight: 600;
    color: var(--text-muted);
}

.translations-section-select {
    min-width: 280px;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
}

.browse-header {
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
    align-items: start;
    gap: 12px 16px;
}

.browse-toolbar {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    grid-column: 2;
    grid-row: 1;
}

.browse-controls {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

.browse-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px 16px;
    flex: 1 1 auto;
    min-width: 0;
}

.browse-field-filters {
    display: contents;
}

.browse-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.browse-field-filter {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 1 10rem;
    min-width: 7rem;
    max-width: 12rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.browse-field-filter-label {
    line-height: 1.2;
}

.browse-field-filter-input {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.browse-field-filter-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.localized-date-field {
    display: inline-flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.localized-date-field .localized-date-display {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.localized-date-picker-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.localized-date-picker-btn:hover {
    color: var(--text);
    background: var(--surface);
}

.localized-date-picker-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.localized-date-popup {
    position: fixed;
    z-index: 1100;
    width: 280px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.localized-date-popup.hidden {
    display: none;
}

.localized-date-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.localized-date-popup-title {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.localized-date-popup-nav {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    line-height: 1;
}

.localized-date-popup-nav:hover {
    background: var(--surface);
}

.localized-date-popup-weekdays,
.localized-date-popup-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.localized-date-popup-weekdays {
    margin-bottom: 4px;
}

.localized-date-popup-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 0;
}

.localized-date-popup-day,
.localized-date-popup-day-empty {
    aspect-ratio: 1;
    min-height: 32px;
}

.localized-date-popup-day {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.localized-date-popup-day:hover {
    background: var(--bg);
}

.localized-date-popup-day-today {
    font-weight: 700;
}

.localized-date-popup-day-selected {
    background: var(--primary);
    color: #fff;
}

.localized-date-popup-day-selected:hover {
    background: var(--primary);
    filter: brightness(0.95);
}

.audit-changes-wrap {
    max-height: 320px;
    overflow: auto;
}

.audit-changes-list {
    margin: 0;
    padding-left: 1.25rem;
}

.audit-change-item {
    margin: 0.35rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    word-break: break-word;
}

.browse-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
}

.browse-header-main .btn {
    width: auto;
}

.browse-title {
    font-size: 1.25rem;
    white-space: nowrap;
}

.browse-search {
    flex: 0 1 15rem;
    width: 15rem;
    max-width: 100%;
    min-width: 7rem;
}

.browse-search-input {
    width: 100%;
    padding: 6px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    font-size: 0.85rem;
}

.browse-search-input:focus {
    outline: none;
    border-color: var(--accent);
}

.browse-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}

.browse-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.browse-table th,
.browse-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.browse-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.02);
}

.browse-table tbody tr:last-child td {
    border-bottom: none;
}

.browse-row-clickable {
    cursor: pointer;
}

.browse-row-clickable:hover {
    background: var(--surface-hover);
}

.browse-loading,
.browse-empty {
    color: var(--text-muted);
    padding: 24px;
    text-align: center;
}

.browse-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.browse-summary,
.browse-page-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.browse-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.browse-context-alert {
    margin-bottom: 16px;
}

.editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.editor-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.editor-panel {
    position: relative;
    width: min(560px, calc(100% - 32px));
    margin: 48px auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}

.editor-panel-wide {
    width: min(920px, calc(100% - 32px));
}

.editor-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.editor-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: -1px;
    padding: 8px 12px;
}

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

.editor-tab.active {
    border-bottom-color: var(--accent);
    color: var(--text);
}

.editor-tab-panel.hidden {
    display: none;
}

.detail-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.detail-table {
    border-collapse: collapse;
    font-size: 0.85rem;
    width: 100%;
}

.detail-table th,
.detail-table td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

.detail-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font-weight: 500;
}

.detail-table-empty {
    color: var(--text-muted);
    padding: 16px 0;
    text-align: center;
}

.role-assignments-section {
    margin-top: 16px;
}

.role-assignments-header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.role-assignments-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.role-assignments-table select {
    width: 100%;
}

.role-assignments-actions {
    text-align: center;
    white-space: nowrap;
    width: 72px;
}

.role-assignments-table .role-assignment-remove {
    min-width: 32px;
    padding-inline: 8px;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.editor-title {
    font-size: 1.1rem;
}

.editor-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.editor-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.editor-loading {
    color: var(--text-muted);
    padding: 8px 0;
}

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

.form-group-inline label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group-inline input[type="checkbox"] {
    width: auto;
}

.translation-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.translation-table .translation-row-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    vertical-align: top;
    background: rgba(255, 255, 255, 0.02);
}

.translation-language-group {
    text-align: center;
}

.translation-field-header {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.translation-cell-description {
    min-width: 180px;
}

.translation-cell-locked {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
}

.translation-cell-locked .translation-cell-display {
    color: var(--text-muted);
}

.translation-cell {
    min-width: 10rem;
    max-width: 18rem;
    vertical-align: top;
    position: relative;
}

.translation-cell-display {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.4rem;
}

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

.translation-cell-editable {
    cursor: text;
}

.translation-cell-editable:hover {
    background: var(--surface-hover);
}

.translation-cell-editing {
    padding: 0;
    background: var(--bg);
}

.translation-cell-input {
    width: 100%;
    min-height: 4.5rem;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.translation-cell-saving {
    opacity: 0.65;
}

.translation-cell-saved {
    background: rgba(34, 197, 94, 0.12);
}

.translation-cell-error {
    background: rgba(239, 68, 68, 0.12);
}

.role-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #93c5fd;
}

.provider-account-reference-fields {
    margin-top: 1.25rem;
}

.provider-account-lent-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 4px;
    font-size: 0.8rem;
    color: #fbbf24;
    vertical-align: middle;
}

.tx-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.tx-status-success {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.tx-status-failure {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.tx-status-in_progress {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
}

.detail-table-row-current td {
    background: rgba(59, 130, 246, 0.08);
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        grid-template-areas:
            "sidebar"
            "topbar"
            "main";
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 0;
    }

    .sidebar-brand {
        display: flex;
        margin-bottom: 12px;
    }

    .section-switcher:not(.hidden) {
        display: block;
    }

    .sidebar-nav {
        display: none;
    }

    .topbar {
        grid-template-columns: 1fr;
        min-height: unset;
    }

    .topbar-brand {
        display: none;
    }

    .topbar-body {
        padding: var(--dashboard-header-padding-y) 16px;
        gap: 8px;
        row-gap: 8px;
        align-content: flex-start;
    }

    .topbar-start {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: wrap;
        overflow: visible;
    }

    .topbar-username {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-merchant-select {
        min-width: 0;
        max-width: 100%;
    }

    .topbar-end {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .content {
        padding: 16px;
    }

    .browse-header {
        grid-template-columns: 1fr;
    }

    .browse-header-main {
        grid-column: 1;
        grid-row: 1;
    }

    .browse-toolbar {
        grid-column: 1;
        grid-row: 2;
        justify-content: stretch;
    }

    .browse-filters {
        justify-content: stretch;
    }

    .browse-search {
        flex: 1 1 100%;
        width: auto;
    }
}
