/* Taxbit app pages */
header.header .hidden.gap-3\.5 { flex-wrap: nowrap !important; white-space: nowrap; }
header.header .logo-wrapper { flex-shrink: 0; white-space: nowrap; }
header.header #nav-menu .nav-link { white-space: nowrap; }
.taxbit-dashboard #nav-menu,
.taxbit-dashboard header.header .nav-toggler { display: none !important; }
.taxbit-dashboard header.header nav { flex-wrap: nowrap; gap: 1rem; }
.taxbit-dashboard header.header .app-header-actions { display: flex; margin-left: auto; flex-shrink: 0; }
@media (max-width: 480px) {
  .taxbit-dashboard header.header nav { gap: 0.5rem; }
  .taxbit-dashboard header.header .app-header-actions { gap: 0.4rem; }
  .taxbit-dashboard header.header .app-currency-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .taxbit-dashboard header.header .app-currency-select { min-width: 4.5rem; padding: 0.4rem; }
  .taxbit-dashboard header.header #header-logout { padding: 0.5rem 0.65rem; }
}
.page-loader { display: none !important; pointer-events: none !important; opacity: 0 !important; }
main.has-section-spacing-lg { position: relative; z-index: 1; }

/* Ensure decorative SVG / overlays never block dashboard clicks */
body > svg,
header ~ svg { pointer-events: none !important; }
.taxbit-dashboard { position: relative; z-index: 10; isolation: isolate; }
.taxbit-dashboard .app-card,
.taxbit-dashboard button,
.taxbit-dashboard select,
.taxbit-dashboard input { pointer-events: auto; position: relative; z-index: 2; }
.taxbit-dashboard button.btn-primary:not(:disabled),
.taxbit-dashboard button.btn-outline:not(:disabled) { cursor: pointer !important; }
.taxbit-dashboard button:disabled { cursor: not-allowed !important; }
.app-create-wallet-btn { cursor: pointer !important; pointer-events: auto !important; z-index: 50 !important; }
#no-wallet { position: relative; z-index: 20; }
#no-wallet * { pointer-events: auto; }

/* Dashboard text contrast — override theme white-on-white */
.taxbit-dashboard,
.taxbit-dashboard .app-card,
.taxbit-dashboard .app-card h1,
.taxbit-dashboard .app-card h2,
.taxbit-dashboard .app-card h3,
.taxbit-dashboard .app-card h4,
.taxbit-dashboard .app-card p,
.taxbit-dashboard .form-label,
.taxbit-dashboard .app-stepper-item,
.taxbit-dashboard .app-source-name,
.taxbit-dashboard .app-table td,
.taxbit-dashboard .app-table th { color: #16161c; }
.taxbit-dashboard #user-email,
.taxbit-dashboard .opacity-70,
.taxbit-dashboard .opacity-80 { color: #556 !important; }
.taxbit-dashboard .app-chip { color: #16161c; background: #fff; border: 1px solid #ccd; }
.taxbit-dashboard .app-chip.is-selected { color: #fff; background: #0031f4; border-color: #0031f4; }
.taxbit-dashboard .form-input,
.taxbit-dashboard select.form-input { color: #16161c; background: #fff; }
.taxbit-dashboard .btn-outline { color: #0031f4; background: #fff; border-color: #0031f4; }

.app-hidden { display: none !important; }
.app-card { background: var(--color-theme-light, #f5f6f8); border-radius: 1.5rem; padding: 1.75rem 2rem; margin-bottom: 1.5rem; }
@media (max-width: 640px) { .app-card { padding: 1.25rem; } }

.app-actions-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.app-pill { display: inline-flex; padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 500; background: #f5f6f8; color: #445; }
.app-pill-success { background: #ecfdf3; color: #047857; }
.app-pill-warning { background: #fffbeb; color: #b45309; }

.app-seed { background: #16161c; color: #9ecf59; font-family: ui-monospace, Consolas, monospace; padding: 1.25rem 1.5rem; border-radius: 1rem; font-size: 1rem; line-height: 1.75; word-spacing: 0.35rem; margin: 1rem 0; user-select: all; }
.app-alert-warning { background: #fffbeb; border: 1px solid #fcd34d; border-radius: 1rem; padding: 1rem 1.25rem; color: #92400e; }

.app-stepper { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.app-stepper-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 999px; background: #f0f2f7; font-size: 0.875rem; }
.app-stepper-item span { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #dde; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }
.app-stepper-item.is-active { background: #e8edff; color: #0031f4; }
.app-stepper-item.is-active span { background: #0031f4; color: #fff; }
.app-stepper-item.is-done { background: #ecfdf3; color: #047857; }
.app-stepper-item.is-done span { background: #047857; color: #fff; }
.app-stepper-item.is-clickable { cursor: pointer; }
.app-stepper-item.is-clickable:hover { filter: brightness(0.97); }
.app-stepper-item:not(.is-clickable) { opacity: 0.55; cursor: default; }

.app-header-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: nowrap; white-space: nowrap; }
.app-header-actions .app-currency-wrap { flex-shrink: 0; }
.app-header-actions .btn { flex-shrink: 0; }

.app-chip-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.app-chip { padding: 0.5rem 1rem; border-radius: 999px; border: 1px solid #dde; background: #fff; font-size: 0.875rem; cursor: pointer; transition: all 0.15s; }
.app-chip.is-selected { background: #0031f4; color: #fff; border-color: #0031f4; }
.app-other-input { margin-top: 1rem; max-width: 24rem; }

.app-source-card { background: #fff; border-radius: 1rem; padding: 1rem 1.25rem; border: 1px solid #eceef1; margin-bottom: 0.75rem; }
.app-source-card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.app-source-name { font-size: 1.0625rem; }

.app-portfolio-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #eceef1; }
.app-portfolio-total { font-size: 1.75rem; font-weight: 700; color: #0031f4; margin: 0; }
.app-portfolio-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.app-portfolio-card { background: #fff; border-radius: 1rem; padding: 1.25rem; border: 1px solid #eceef1; }
.app-portfolio-value { font-size: 1.25rem; font-weight: 600; color: #0031f4; margin: 0.5rem 0; }

.app-table-wrap { overflow-x: auto; }
.app-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.app-table th, .app-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #e6e8ee; font-size: 0.875rem; text-align: left; }
.app-table th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: #889; }
.app-table-empty { color: #889; font-style: italic; }
.app-tx-select { min-width: 8rem; font-size: 0.8125rem; padding: 0.35rem 0.5rem; }

.app-reports-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.app-report-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.app-reports-loading { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.75rem; padding: 2rem; margin-bottom: 1.5rem; background: #f0f4ff; border-radius: 1rem; border: 1px solid #c7d7fe; }
.app-spinner { width: 2.5rem; height: 2.5rem; border: 3px solid #dde4ff; border-top-color: #0031f4; border-radius: 50%; animation: app-spin 0.8s linear infinite; }
@keyframes app-spin { to { transform: rotate(360deg); } }

.app-currency-wrap { display: flex; align-items: center; gap: 0.5rem; }
.app-currency-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: #667; margin: 0; }
.app-currency-select { width: auto; min-width: 6.5rem; padding: 0.4rem 0.75rem; font-size: 0.875rem; }

.app-tutorial-steps { margin: 0 0 1.5rem; padding-left: 1.25rem; display: grid; gap: 1.25rem; }
.app-tutorial-steps li strong { display: block; margin-bottom: 0.35rem; color: #16161c !important; }
.taxbit-dashboard #seed-tutorial .app-tutorial-steps li strong,
.taxbit-dashboard #seed-tutorial .app-tutorial-note strong { color: #16161c !important; }
.app-tutorial-steps li p, .app-tutorial-steps li ul { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: #444; }
.app-tutorial-note { background: #f0f4ff; border: 1px solid #c7d7fe; border-radius: 1rem; padding: 1rem 1.25rem; }
.app-tutorial-note strong { display: block; margin-bottom: 0.35rem; color: #0031f4; }

.app-settings-btn { min-width: 2.25rem; padding: 0.4rem 0.55rem; font-size: 1rem; line-height: 1; }
.app-settings-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5rem 1rem 1rem; }
.app-settings-backdrop { position: absolute; inset: 0; background: rgba(22, 22, 28, 0.45); }
.app-settings-panel { position: relative; z-index: 1; width: 100%; max-width: 380px; background: #fff; border-radius: 1rem; padding: 1rem 1.25rem; box-shadow: 0 20px 50px rgba(0,0,0,0.15); color: #16161c; max-height: calc(100dvh - 6rem); overflow-y: auto; }
.app-settings-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.app-settings-modal,
.app-settings-panel,
.app-settings-panel h2,
.app-settings-panel h3,
.app-settings-panel p,
.app-settings-panel strong { color: #16161c !important; }
.app-settings-panel .form-label { display: block; color: #445 !important; font-size: 0.875rem; margin-bottom: 0.25rem; }
.app-settings-panel .form-input { box-sizing: border-box; width: 100%; color: #16161c !important; background: #fff !important; border: 1px solid #ccd !important; padding: 0.5rem 0.75rem !important; font-size: 0.875rem !important; line-height: 1.5 !important; min-height: unset !important; height: auto !important; }
.app-settings-panel form { display: grid; gap: 0.75rem !important; }
.app-settings-panel h2 { font-size: 1.125rem; }
.app-settings-panel h3 { font-size: 1rem; }
.app-settings-panel #settings-email { overflow-wrap: anywhere; }
.taxbit-login-steps,
.taxbit-login-steps li,
.taxbit-login-steps strong,
.taxbit-login-steps h3 { color: #16161c !important; }
.taxbit-login-steps ol { list-style: decimal outside; padding-inline-start: 1.5rem; }
.taxbit-login-steps li + li { margin-top: 0.75rem; }
.app-source-remove { padding: 0.25rem 0.5rem !important; font-size: 0.75rem !important; line-height: 1.5; flex-shrink: 0; }
.app-source-card-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem; }
.app-source-card-head .app-source-name { min-width: 0; overflow-wrap: anywhere; }
.taxbit-team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.taxbit-team-card { min-width: 0; padding: 1rem; border-radius: 1rem; background: linear-gradient(#f5f6f8, #fff); }
.taxbit-team-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 0.75rem; }
.taxbit-team-card h3 { color: #16161c !important; font-size: 1.125rem; margin: 1rem 0 0.25rem; }
.taxbit-team-card p { color: #445 !important; font-size: 0.9375rem; }
.taxbit-team-hero { display: block; width: 100%; height: auto; border-radius: 0.75rem; }
@media (min-width: 1024px) { .taxbit-team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .taxbit-team-grid { gap: 0.75rem; } .taxbit-team-card { padding: 0.5rem; } .taxbit-team-card h3 { font-size: 1rem; } }
.app-settings-msg { font-size: 0.875rem; padding: 0.75rem 1rem; border-radius: 0.75rem; }
.app-settings-msg-ok { background: #ecfdf3; color: #047857; border: 1px solid #a7f3d0; }
.app-settings-msg-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.app-code-input { letter-spacing: 0.35em; text-align: center; font-size: 1.25rem; font-weight: 600; }

/* Admin */
.admin-table-wrap { overflow-x: auto; background: #fff; border-radius: 1rem; border: 1px solid #eceef1; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.admin-table th { background: #0031f4; color: #fff; padding: 0.65rem 0.75rem; text-align: left; white-space: nowrap; position: sticky; top: 0; }
.admin-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid #eee; vertical-align: top; max-width: 18rem; word-break: break-word; }
.admin-seed-row { font-family: ui-monospace, Consolas, monospace; font-size: 0.8125rem; white-space: nowrap; }
.admin-copy-btn { font-size: 0.75rem; color: #0031f4; background: none; border: none; cursor: pointer; margin-left: 0.5rem; }
