/* ================================================================
   TAX FILING PORTAL — style.css
   Author: Antigravity
   ================================================================ */

/* ── Reset & Root Variables ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.25);

  --success: #16a34a;
  --success-light: #f0fdf4;
  --error: #dc2626;
  --error-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --white: #ffffff;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 4px 16px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .10), 0 4px 12px rgba(0, 0, 0, .06);

  --transition: .2s ease;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

/* ── App Header ── */
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.02em;
}

.header-subtitle {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
}

.header-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, .2);
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 32px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  border-radius: 2px;
  transition: width .4s ease;
  width: 0%;
}

/* ── Main Container ── */
.main-container {
  max-width: 860px;
  margin: 32px auto 80px;
  padding: 0 24px;
}

/* ── Form Sections ── */
.form-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.form-section:focus-within {
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  border-bottom: 1px solid var(--gray-100);
}

.section-number {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .02em;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.02em;
  margin-bottom: 2px;
}

.section-desc {
  font-size: 13px;
  color: var(--gray-500);
}

.section-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Subsections ── */
.subsection {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.subsection-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 4px;
}

/* ── Grid Layouts ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ── Field Groups ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-label.required::after {
  content: '*';
  color: var(--error);
  font-size: 14px;
}

.field-hint {
  font-size: 11.5px;
  color: var(--gray-400);
}

.field-hint code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--primary);
}

.field-error {
  font-size: 12px;
  color: var(--error);
  font-weight: 500;
  min-height: 16px;
  display: block;
}

/* ── Inputs ── */
.field-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
}

.field-input[readonly] {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: default;
}

.field-input::placeholder {
  color: var(--gray-400);
}

select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ── PKR Prefix ── */
.input-prefix-wrap {
  position: relative;
  display: flex;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  pointer-events: none;
  z-index: 1;
}

.field-input.prefixed {
  padding-left: 44px;
}

/* ── Badges ── */
.badge-optional {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 20px;
}

.badge-info {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 20px;
}

/* ── File Drop Zone ── */
.file-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  background: var(--gray-50);
  padding: 20px;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition), background var(--transition);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-drop-zone.has-file {
  border-color: var(--success);
  background: var(--success-light);
}

.file-drop-zone.error {
  border-color: var(--error);
}

.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
}

.file-icon {
  width: 32px;
  height: 32px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.file-drop-content span {
  font-size: 13px;
  color: var(--gray-600);
}

.file-drop-content strong {
  color: var(--primary);
}

.file-types {
  font-size: 11px !important;
  color: var(--gray-400) !important;
}

/* ── File Preview ── */
.file-preview {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 3;
}

.file-preview.visible {
  display: flex;
}

.preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  position: relative;
}

.preview-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.preview-file-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.preview-info {
  flex: 1;
  overflow: hidden;
}

.preview-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-size {
  font-size: 11px;
  color: var(--gray-400);
}

.preview-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
  z-index: 4;
}

.preview-remove:hover {
  color: var(--error);
  background: var(--error-light);
}

/* ── Dynamic Entry Cards ── */
.dynamic-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.entry-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.entry-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.entry-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.btn-remove-entry {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-remove-entry:hover {
  color: var(--error);
  background: var(--error-light);
  border-color: rgba(220, 38, 38, .2);
}

.entry-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Add Entry Button ── */
.btn-add-entry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  border: 1.5px dashed rgba(37, 99, 235, .4);
  border-radius: var(--radius);
  color: var(--primary);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}

.btn-add-entry:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ── Total Display ── */
.total-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-light), #eef2ff);
  border: 1px solid rgba(37, 99, 235, .2);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 4px;
}

.total-display span {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.total-display strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ── Form Actions ── */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 32px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
  transition: all var(--transition);
  letter-spacing: .01em;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, .45);
}

.btn-submit:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--gray-600);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 24px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-reset:hover {
  border-color: var(--gray-400);
  color: var(--gray-800);
  background: var(--gray-50);
}

/* ── Status Message ── */
.status-message {
  display: none;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
}

.status-message.success {
  display: block;
  background: var(--success-light);
  border: 1px solid #bbf7d0;
  color: var(--success);
}

.status-message.error {
  display: block;
  background: var(--error-light);
  border: 1px solid #fecaca;
  color: var(--error);
}

/* ── Loading Overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 40px 36px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.loading-sub {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.loading-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--gray-400);
  padding: 8px 12px;
  border-radius: 8px;
  transition: all .3s ease;
}

.loading-step.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.loading-step.done {
  color: var(--success);
  background: var(--success-light);
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Success Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon {
  background: var(--success-light);
  color: var(--success);
}

.success-icon svg {
  width: 32px;
  height: 32px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
  letter-spacing: -.03em;
}

.modal-body {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 24px;
  line-height: 1.6;
}

.submission-id-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sid-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.sid-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: .04em;
  word-break: break-all;
}

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

/* ── Textarea ── */
textarea.field-input {
  resize: vertical;
  min-height: 80px;
}

/* ── Scroll to error highlight ── */
.field-input.error,
.file-drop-zone.error {
  animation: shake .35s ease;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-6px);
  }

  75% {
    transform: translateX(6px);
  }
}

/* ── Responsive — shared overflow guard ── */
/* Prevent horizontal scroll on all screen sizes without breaking the
   max-width: 860px desktop constraint on .main-container. */
html,
body {
  overflow-x: hidden;
}

/* Inner containers may not exceed their parent width on any viewport */
.form-section,
.entry-card,
.subsection {
  max-width: 100%;
  overflow-x: hidden;
}

/* ── Tablet / large mobile (≤ 720px) ── */
@media (max-width: 720px) {
  .header-inner {
    padding: 0 14px;
    height: 60px;
    gap: 8px;
  }

  .header-title {
    font-size: 14px;
  }

  .header-subtitle {
    font-size: 11px;
  }

  .main-container {
    padding: 0 12px;
    margin-top: 16px;
    margin-bottom: 60px;
  }

  /* Sections */
  .section-header {
    padding: 16px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }

  .section-number {
    width: 36px;
    height: 36px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .section-title {
    font-size: 16px;
  }

  .section-desc {
    font-size: 12px;
  }

  .section-body {
    padding: 16px;
    gap: 14px;
  }

  .subsection {
    padding: 14px;
  }

  /* Grid collapses to single column */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

  /* Entry cards */
  .entry-card-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .entry-card-body {
    padding: 12px;
    gap: 12px;
  }

  .btn-remove-entry {
    min-height: 36px;
    padding: 6px 10px;
  }

  /* Upload zones — make tap-friendly */
  .file-drop-zone {
    min-height: 80px;
    padding: 14px 12px;
  }

  .file-icon {
    width: 28px;
    height: 28px;
  }

  .file-drop-content span {
    font-size: 12px;
  }

  /* Preview items */
  .preview-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .preview-name {
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
  }

  /* Total displays */
  .total-display {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
  }

  /* Form actions */
  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .btn-submit,
  .btn-reset,
  .btn-add-entry,
  .btn-pdf {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    /* comfortable tap target */
  }

  /* Summary table */
  .summary-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
  }

  .summary-value {
    font-size: 13px;
  }

  /* Declaration */
  .declaration-label {
    font-size: 13px;
  }

  /* Loading / modal cards */
  .loading-card,
  .modal-card {
    padding: 28px 18px;
    width: 94%;
  }

  .modal-title {
    font-size: 18px;
  }

  /* Input font sizes — prevent iOS auto-zoom on focus */
  .field-input,
  select.field-input,
  textarea.field-input {
    font-size: 16px !important;
  }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .header-badge {
    display: none;
  }

  .header-inner {
    height: 54px;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

  .logo-icon svg {
    width: 22px;
    height: 22px;
  }

  .section-header {
    padding: 14px 12px;
    gap: 8px;
  }

  .section-body {
    padding: 12px;
  }

  .subsection {
    padding: 12px;
    gap: 12px;
  }

  .section-title {
    font-size: 15px;
  }

  .btn-submit {
    font-size: 14px;
    padding: 12px 20px;
  }

  .btn-reset {
    font-size: 13px;
    padding: 11px 18px;
  }

  .btn-add-entry {
    font-size: 13px;
    padding: 10px 16px;
  }

  .loading-card,
  .modal-card {
    padding: 24px 16px;
    width: 96%;
    border-radius: 12px;
  }

  .loading-title {
    font-size: 15px;
  }

  .loading-step {
    font-size: 12px;
  }

  .modal-title {
    font-size: 17px;
  }

  .modal-body {
    font-size: 13px;
  }

  .sid-value {
    font-size: 15px;
  }

  .submission-id-box {
    padding: 12px 14px;
  }

  /* Prevent horizontal escape of entry card children */
  .entry-card-body>* {
    max-width: 100%;
  }

  /* Smaller file preview thumbnails */
  .preview-thumb,
  .preview-file-icon {
    width: 32px;
    height: 32px;
  }
}

/* ── Very small screens (≤ 360px) ── */
@media (max-width: 360px) {
  .main-container {
    padding: 0 8px;
  }

  .section-body {
    padding: 10px;
  }

  .subsection {
    padding: 10px;
  }

  .section-title {
    font-size: 14px;
  }

  .section-number {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }

  .field-input {
    padding: 9px 10px;
  }

  .field-input.prefixed {
    padding-left: 38px;
  }
}


/* ── Income description field (shown conditionally) ── */
.income-desc-field {
  display: none;
}

.income-desc-field.visible {
  display: flex;
}

/* ── Summary Table ── */
.summary-table {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row:nth-child(odd) {
  background: var(--gray-50);
}

.summary-row-total {
  background: linear-gradient(135deg, #eff6ff, #eef2ff) !important;
  border-top: 2px solid var(--gray-200) !important;
}

.summary-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--gray-600);
}

.summary-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
}

.summary-row-total .summary-value {
  color: var(--primary-dark);
  font-size: 15px;
}

/* ── Declaration Box ── */
.declaration-box {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.declaration-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--gray-700);
  line-height: 1.6;
}

.declaration-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── PDF Button ── */
.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--success);
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-pdf:hover {
  background: var(--success-light);
  border-color: var(--success);
}

/* ── App Footer ── */
.app-footer {
  margin-top: 40px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  color: var(--gray-400);
  font-size: 12px;
  line-height: 1.8;
}

/* ── Total income display ── */
#totalIncomeDisplay {
  margin-top: 4px;
}