.sidebar-link,
.sidebar-icon,
.button-icon,
.card-title-row,
.card-title-icon,
.history-file,
.history-badge,
.history-download,
.toast-check {
  display: flex;
  align-items: center;
}
.sidebar-icon,
.button-icon,
.card-title-icon,
.toast-check {
  width: 14px;
  height: 14px;
  justify-content: center;
}

.sidebar-icon svg,
.button-icon svg,
.card-title-icon svg,
.toast-check svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.app-sidebar {
  width: 200px;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  padding: 20px 12px;
}

.sidebar-section-label {
  padding: 12px 8px 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink3);
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink2);
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--surface2);
  color: var(--ink);
}

.sidebar-link.is-active {
  background: var(--accent-light);
  color: var(--accent2);
}

.sidebar-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.sidebar-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #e24b4a;
}

.exports-content {
  flex: 1;
  padding: 24px;
  background: var(--surface2);
}

.exports-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 500;
  color: var(--ink);
}

.page-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink3);
}

.page-context-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent2);
  font-weight: 500;
}

.exports-hero-actions {
  display: flex;
  gap: 10px;
}

.export-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.export-btn-secondary {
  border: 1.5px solid var(--accent2);
  color: var(--accent2);
  background: transparent;
}

.export-btn-primary {
  gap: 6px;
  border: none;
  color: #fff;
  background: var(--accent2);
}

.button-badge {
  margin-left: 4px;
  padding: 2px 7px;
  border-radius: 20px;
  background: #e8f0fb;
  color: #1a3a5c;
  font-size: 10px;
  font-weight: 500;
}

.exports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.exports-card,
.history-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
}

.exports-card {
  padding: 20px 22px;
}

.card-title-row {
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.field-label {
  display: block;
  margin-top: 14px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink3);
  text-transform: uppercase;
}

.card-title-row + .field-label,
.form-field:first-of-type .field-label {
  margin-top: 0;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.preset-chip {
  padding: 5px 11px;
  border: 0.5px solid var(--border2);
  border-radius: 20px;
  font-size: 12px;
  color: var(--ink2);
  background: var(--surface);
  cursor: pointer;
}

.preset-chip.is-active {
  background: var(--accent-light);
  border-color: var(--accent2);
  color: var(--accent2);
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.exports-card input,
.exports-card select {
  width: 100%;
  padding: 8px 10px;
  border: 0.5px solid var(--border2);
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface2);
}

.helper-text,
.small-note,
.error-text {
  font-size: 11px;
  color: var(--ink3);
}

.helper-text {
  margin-top: 5px;
}

.tax-id-row,
.summary-row,
.history-columns,
.history-item {
  display: grid;
}

.tax-id-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
}

.tax-id-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.tax-id-value {
  font-size: 13px;
  color: var(--ink2);
}

.tax-id-note {
  font-size: 11px;
  color: var(--ink3);
}

.tax-id-link {
  font-size: 11px;
  color: var(--accent2);
  text-decoration: underline;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink2);
}

.checkbox-row input {
  width: 14px;
  height: 14px;
}

.export-inline-taxid {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface2);
}

.summary-panel {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface2);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink2);
  line-height: 1.8;
}

.summary-row {
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.summary-row strong {
  color: var(--ink);
}

.summary-income {
  color: var(--green) !important;
}

.summary-expense {
  color: var(--red) !important;
}

.summary-net {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 0.5px solid var(--border);
}

.error-text {
  min-height: 16px;
  margin-top: 12px;
  color: var(--red);
}

.history-card {
  overflow: hidden;
}

.history-card-head {
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--border);
}

.history-card-head h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.history-card-head p {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ink3);
}

.history-columns,
.history-item {
  grid-template-columns: 200px 1fr 90px 90px 90px;
  align-items: center;
}

.history-columns {
  padding: 8px 20px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface2);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--ink3);
  text-transform: uppercase;
}

.history-item {
  padding: 12px 20px;
  border-bottom: 0.5px solid var(--border);
  font-size: 13px;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: var(--surface2);
}

.history-file {
  gap: 7px;
}

.history-badge {
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
}

.history-badge.pdf {
  background: #fef2f2;
  color: #b91c1c;
}

.history-badge.csv {
  background: #eaf5ef;
  color: #1a7a4a;
}

.history-file-name {
  font-weight: 500;
  color: var(--ink);
}

.history-meta,
.history-size {
  font-size: 12px;
  color: var(--ink2);
}

.history-period {
  font-size: 12px;
  color: var(--ink2);
}

.history-download-cell {
  display: flex;
  justify-content: flex-end;
}

.history-download {
  gap: 4px;
  padding: 5px 10px;
  border: 0.5px solid var(--border2);
  border-radius: 6px;
  font-size: 11px;
  color: var(--accent2);
  background: var(--surface);
  cursor: pointer;
}

.history-download svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-empty {
  padding: 20px;
  font-size: 13px;
  color: var(--ink3);
}

.settings-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  gap: 10px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  min-width: 240px;
  box-shadow: 0 4px 16px rgba(15, 25, 35, 0.18);
}

.settings-toast.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .history-columns,
  .history-item {
    grid-template-columns: 180px 1fr 90px 80px 100px;
  }
}

@media (max-width: 1024px) {
  .exports-grid {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }
}

@media (max-width: 720px) {
  .exports-content {
    padding: 16px;
  }

  .exports-page-header {
    flex-direction: column;
    gap: 12px;
  }

  .exports-hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .export-btn {
    width: 100%;
    justify-content: center;
  }

  .date-grid,
  .tax-id-row,
  .history-columns,
  .history-item {
    grid-template-columns: 1fr;
  }

  .exports-card,
  .history-card {
    border-radius: 16px;
  }

  .exports-card {
    padding: 18px 16px;
  }

  .preset-row {
    gap: 8px;
  }

  .preset-chip {
    min-height: 34px;
  }

  .history-columns {
    display: none;
  }

  .history-item {
    gap: 8px;
  }

  .history-download-cell {
    justify-content: flex-start;
  }
}

.exports-cross-border-note {
  margin-top: 12px;
  padding: 8px 10px;
  background: var(--surface2, #f8f9fa);
  border-left: 3px solid var(--warning, #d97706);
  border-radius: 4px;
  color: var(--ink2, #555);
  line-height: 1.5;
}

.exports-cross-border-note a {
  color: var(--accent, #2563eb);
}

/* ─── Modal overlay (shared) ─────────────────────────────── */

.transaction-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.transaction-modal.hidden {
  display: none;
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-cancel {
  padding: 8px 16px;
  border: 0.5px solid var(--border2);
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink2);
  background: var(--surface);
  cursor: pointer;
}

/* ─── Secure Export Modal ─────────────────────────────────── */

.secure-export-modal-content {
  width: min(480px, 92vw);
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.secure-export-modal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.secure-export-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.secure-export-lock-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.secure-export-ephemeral-note {
  font-size: 12px;
  color: var(--success, #16a34a);
  margin-bottom: 14px;
  font-weight: 500;
}

.secure-export-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.secure-export-tax-input {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--border-soft, #cbd5e1);
  border-radius: 8px;
  background: var(--input-bg, #f8fafc);
  color: var(--text-primary, #1e293b);
  outline: none;
  font-family: monospace;
  letter-spacing: 0.1em;
}

.secure-export-tax-input:focus {
  border-color: var(--accent2, #2563eb);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.secure-export-toggle-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-soft, #cbd5e1);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--accent2, #2563eb);
  cursor: pointer;
  white-space: nowrap;
}

.secure-export-toggle-btn:hover {
  background: var(--accent-light, #eff6ff);
}

.secure-export-legal {
  background: var(--surface2, #f8f9fa);
  border: 1px solid var(--border-soft, #e2e8f0);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.secure-export-legal-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3, #64748b);
  margin: 0 0 6px;
}

.secure-export-legal-body {
  font-size: 12px;
  color: var(--ink2, #475569);
  line-height: 1.55;
  margin: 0;
}

.secure-export-legal-body + .secure-export-legal-body {
  margin-top: 8px;
}

.secure-export-canada-text {
  padding-top: 8px;
  border-top: 1px solid var(--border-soft, #e2e8f0);
  margin-top: 8px;
}

.secure-export-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 14px;
}

.secure-export-checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent2, #2563eb);
}

.secure-export-checkbox-row span {
  font-size: 12px;
  color: var(--ink2, #475569);
  line-height: 1.5;
}

.secure-export-error {
  font-size: 12px;
  color: var(--danger, #dc2626);
  margin-bottom: 10px;
  padding: 6px 10px;
  background: rgba(220, 38, 38, 0.06);
  border-radius: 6px;
}

.secure-export-error.hidden {
  display: none;
}

.secure-export-canada-text.hidden {
  display: none;
}

.secure-export-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.secure-export-checkbox-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  width: 100%;
}

.secure-export-checkbox-row input[type="checkbox"] {
  margin-top: 2px;
}

.secure-export-checkbox-row span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
