/* Finance app: one shell, four tabs. Each tab's rules are scoped under its panel id so
   the formerly separate apps' class names (.controls, .badge, .expense-item, .notes-edit ...)
   cannot collide. Body-level modals (.manual-edit-*, .paid-method-*) are unique and stay global. */

.container { max-width: 1600px; }

#loading-screen, #auth-screen { text-align: center; }
#loading-screen p { color: #666; font-size: 16px; margin-top: 20px; }

#main-screen { text-align: left; }

.finance-subtitle { color: #666; margin: 0 0 16px; }

/* Tab bar */
.finance-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 2px solid #e0e0e0;
  margin: 0 0 20px;
}
.finance-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.finance-tab:hover { color: var(--navy, #02133e); }
.finance-tab.active {
  color: var(--navy, #02133e);
  border-bottom-color: var(--navy, #02133e);
}
.finance-panel { display: none; }
.finance-panel.active { display: block; }
.panel-denied { text-align: center; color: #d32f2f; padding: 30px; }

/* Transient error toast (shared error-banner.js, #error-message) */
.error-message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  background: #d32f2f;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  max-width: 400px;
}

/* ===== Zelle tab ===== */
/* Toolbar */
#panel-zelle .controls {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  align-items: center;
}

#panel-zelle .search-box {
  flex: 1;
  min-width: 250px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1em;
}

#panel-zelle .date-filter,
#panel-zelle .checkbox-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92em;
  color: #333;
  white-space: nowrap;
}

#panel-zelle .date-filter input[type="date"] {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

#panel-zelle .status-info {
  margin-bottom: 15px;
  padding: 10px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 0.9em;
  color: #333;
}

#panel-zelle .summary-breakdown {
  margin: -8px 0 15px;
  font-size: 0.85em;
  color: #555;
  line-height: 1.8;
}

#panel-zelle .breakdown-label {
  font-weight: 700;
  color: #333;
  margin-right: 4px;
}

#panel-zelle .breakdown-item {
  display: inline-block;
  padding: 2px 10px;
  margin: 2px 4px 2px 0;
  background: #f0f0f0;
  border-radius: 10px;
  white-space: nowrap;
  cursor: pointer;
}

#panel-zelle .breakdown-item:hover { background: #e0e0e0; }

#panel-zelle .breakdown-item.active {
  background: var(--navy, #02133e);
  color: #fff;
}

/* Table: bounded scroll region so the sticky header row + frozen columns have
   something to position against (same technique as activity-roster). */
#panel-zelle .table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 260px);
  margin-bottom: 20px;
}

#panel-zelle #zelle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#panel-zelle #zelle-table th {
  background: #f8f9fa;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
  cursor: pointer;
  position: relative; /* containing block for .resize-handle (theme.css) */
  min-width: 90px;
  white-space: nowrap;
}

#panel-zelle #zelle-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

#panel-zelle .mono {
  font-family: 'Courier New', monospace;
}

#panel-zelle .muted {
  color: #999;
  font-size: 0.9em;
}

#panel-zelle .empty-message {
  text-align: center;
  color: #666;
  padding: 30px !important;
}

/* Status badges */
#panel-zelle .badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#panel-zelle .badge-ok { background: #d4edda; color: #155724; }
#panel-zelle .badge-warn { background: #fff3cd; color: #856404; }
#panel-zelle .badge-bad { background: #f8d7da; color: #721c24; }

/* Status badge doubles as the "Matched" toggle — click to flip manually_matched */
#panel-zelle .status-toggle {
  cursor: pointer;
}
#panel-zelle .status-toggle:hover {
  opacity: 0.75;
}

/* Editable notes cell */
#panel-zelle .col-notes { min-width: 180px; }

#panel-zelle .notes-edit {
  cursor: pointer;
  display: inline-block;
  min-width: 100px;
  min-height: 1.2em;
}

#panel-zelle .notes-input {
  width: 100%;
  min-height: 40px;
  padding: 4px 6px;
  border: 1px solid #02133e;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  resize: vertical;
}

#panel-zelle .reconciled-cell {
  text-align: center;
}

#panel-zelle .reconciled-toggle {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Editable Payer/Covered/What-it-paid-for cells (open the manual-edit modal) */
.manual-edit-cell {
  cursor: pointer;
  display: inline-block;
  min-width: 60px;
  min-height: 1.2em;
}
.manual-edit-cell:hover {
  text-decoration: underline dotted;
}

/* Manual edit modal */
.manual-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 19, 62, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
}

.manual-edit-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 480px;
  width: 100%;
  margin: 2rem auto;
  padding: 1.5rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.manual-edit-modal h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  color: #02133e;
}

.manual-edit-sub {
  margin: 0 0 1rem;
  color: #666;
  font-size: 0.9em;
}

.manual-edit-label {
  display: block;
  font-weight: 700;
  color: #02133e;
  margin: 1rem 0 0.35rem;
}

.manual-edit-select,
.manual-edit-input,
.manual-edit-filter {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95em;
  margin-bottom: 6px;
}

.manual-edit-type-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.manual-edit-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.manual-edit-conditional {
  margin-top: 4px;
}

.manual-edit-checklist {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 6px 10px;
}

.covered-option {
  display: block;
  padding: 3px 0;
  cursor: pointer;
}

.manual-edit-error {
  color: #d32f2f;
  font-weight: 600;
  margin-top: 0.75rem;
}

.manual-edit-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.25rem;
}

/* ==========================================================================
   Freeze panes: keep the header row and the Date/Time + Payer columns visible
   while scrolling the wide table. Sticky positions against the bounded
   .table-wrapper scroll region.
   ========================================================================== */

#panel-zelle #zelle-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Frozen first two columns (Date/Time, Payer). The second column's left offset
   tracks the resizable first column's width via --freeze-2-left (set in
   updateFreezeOffsets); the fallback covers the moment before JS runs. */
#panel-zelle #zelle-table th:nth-child(1),
#panel-zelle #zelle-table td:nth-child(1),
#panel-zelle #zelle-table th:nth-child(2),
#panel-zelle #zelle-table td:nth-child(2) {
  position: sticky;
  z-index: 1;
}
#panel-zelle #zelle-table th:nth-child(1),
#panel-zelle #zelle-table td:nth-child(1) { left: 0; }
#panel-zelle #zelle-table th:nth-child(2),
#panel-zelle #zelle-table td:nth-child(2) { left: var(--freeze-2-left, 140px); }

/* Body cells in the frozen columns need an opaque background so other columns
   don't bleed through when scrolled horizontally. */
#panel-zelle #zelle-table td:nth-child(1),
#panel-zelle #zelle-table td:nth-child(2) {
  background: #fff;
}

/* The two header corner cells are frozen on BOTH axes — keep them above every
   other sticky cell. */
#panel-zelle #zelle-table thead th:nth-child(1),
#panel-zelle #zelle-table thead th:nth-child(2) {
  z-index: 3;
}

/* Phones: don't pin Date/Time + Payer (they'd eat most of the screen);
   the header row stays sticky. */
@media (max-width: 768px) {
  #panel-zelle #zelle-table td:nth-child(-n+2) { position: static; }
  #panel-zelle #zelle-table th:nth-child(-n+2) { left: auto; }
  #panel-zelle #zelle-table thead th:nth-child(-n+2) { z-index: 2; }
}


/* ===== Payment Info tab ===== */
/* Toolbar */
#panel-payment-info .controls {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  flex-wrap: wrap;
  align-items: center;
}

#panel-payment-info .search-box {
  flex: 1;
  min-width: 250px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1em;
}

#panel-payment-info .checkbox-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.92em;
  color: #333;
  white-space: nowrap;
}

#panel-payment-info .status-info {
  margin-bottom: 15px;
  padding: 10px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 0.9em;
  color: #333;
}

/* Table: bounded scroll region so the sticky header row has something to
   position against (same technique as the other table apps). */
#panel-payment-info .table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 260px);
  margin-bottom: 20px;
}

#panel-payment-info #prefs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#panel-payment-info #prefs-table th {
  background: #f8f9fa;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid #e0e0e0;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 2;
  min-width: 90px;
  white-space: nowrap;
}

#panel-payment-info #prefs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

#panel-payment-info .col-destination {
  min-width: 220px;
}

#panel-payment-info .muted {
  color: #999;
  font-size: 0.9em;
}

#panel-payment-info .empty-message {
  text-align: center;
  color: #666;
  padding: 30px !important;
}

/* Status badges */
#panel-payment-info .badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#panel-payment-info .badge-ok { background: #d4edda; color: #155724; }
#panel-payment-info .badge-warn { background: #fff3cd; color: #856404; }
#panel-payment-info .badge-neutral { background: #e2e3e5; color: #383d41; }

#panel-payment-info .cell-sub {
  font-size: 0.85em;
  color: #666;
  margin-top: 2px;
}

/* Destination cells (Mailing Address / Zelle Contact) + their Copy buttons */
#panel-payment-info .destination-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

#panel-payment-info .copy-btn {
  margin-top: 4px;
  padding: 2px 8px;
  border: 1px solid #02133e;
  border-radius: 6px;
  background: #fff;
  color: #02133e;
  font-size: 0.8em;
  font-weight: 600;
  cursor: pointer;
}

#panel-payment-info .copy-btn:hover {
  background: #02133e;
  color: #fff;
}



/* ===== Reimbursements tab ===== */
#panel-reimbursements .page-subtitle {
  color: #666;
  margin-bottom: 20px;
}

#panel-reimbursements .focus-banner {
  background: #e7f0ff;
  border: 1px solid #b3d1ff;
  color: #02133e;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
}

#panel-reimbursements .focus-banner a {
  color: #02133e;
  text-decoration: underline;
}

#panel-reimbursements .controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

#panel-reimbursements .submit-link {
  margin-left: auto;
  color: #02133e;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

#panel-reimbursements .submit-link:hover {
  text-decoration: underline;
}

#panel-reimbursements .search-box {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
}

#panel-reimbursements .filter-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

#panel-reimbursements .filter-label {
  font-weight: 500;
  color: #666;
}

#panel-reimbursements .filter-select {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95em;
  cursor: pointer;
}

#panel-reimbursements .table-container {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

#panel-reimbursements table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

#panel-reimbursements thead {
  background: #f5f5f5;
  position: sticky;
  top: 0;
}

#panel-reimbursements th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #ddd;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative; /* containing block for the .resize-handle (theme.css) */
}

#panel-reimbursements th:hover {
  background: #ebebeb;
}

/* Sort-direction arrows + .resize-handle now live in the shared theme.css. */

#panel-reimbursements td {
  padding: 10px 8px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

#panel-reimbursements tr:hover {
  background: #f9f9f9;
}

#panel-reimbursements .status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
}

#panel-reimbursements .status-pending {
  background: #fff3cd;
  color: #856404;
}

#panel-reimbursements .status-approved {
  background: #d4edda;
  color: #155724;
}

#panel-reimbursements .status-denied {
  background: #f8d7da;
  color: #721c24;
}

#panel-reimbursements .status-completed {
  background: #d4edda;
  color: #155724;
}

#panel-reimbursements .status-approval-pending {
  background: #fff3cd;
  color: #856404;
}

#panel-reimbursements .status-select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  background: white;
}

#panel-reimbursements .status-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#panel-reimbursements .notes-cell {
  max-width: 300px;
  white-space: pre-wrap;
  font-size: 0.85em;
  color: #555;
}

#panel-reimbursements .notes-edit {
  width: 100%;
  min-height: 60px;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85em;
  resize: vertical;
}

#panel-reimbursements .notes-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

#panel-reimbursements .btn-small {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.85em;
  cursor: pointer;
  transition: opacity 0.2s;
}

#panel-reimbursements .btn-save {
  background: #28a745;
  color: white;
}

#panel-reimbursements .btn-cancel {
  background: #6c757d;
  color: white;
}

#panel-reimbursements .btn-small:hover {
  opacity: 0.8;
}

#panel-reimbursements .amount {
  text-align: right;
  font-family: 'Courier New', monospace;
  white-space: nowrap;
}

#panel-reimbursements .clickable-notes {
  cursor: pointer;
  color: #02133e;
  text-decoration: underline;
}

#panel-reimbursements .clickable-notes:hover {
  color: #0a3161;
}

#panel-reimbursements .empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

#panel-reimbursements .loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

#panel-reimbursements .error {
  background: #f8d7da;
  color: #721c24;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

#panel-reimbursements .details-toggle {
  cursor: pointer;
  color: #02133e;
  text-decoration: underline;
  font-size: 0.85em;
}

#panel-reimbursements .details-toggle:hover {
  color: #0a3161;
}

#panel-reimbursements .copy-link {
  cursor: pointer;
  color: #02133e;
  text-decoration: underline;
  font-size: 0.85em;
  margin-left: 10px;
}

#panel-reimbursements .copy-link:hover {
  color: #0a3161;
}

#panel-reimbursements .expense-details {
  margin-top: 8px;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
  font-size: 0.85em;
}

#panel-reimbursements .expense-item {
  padding: 6px 0;
  border-bottom: 1px solid #e0e0e0;
}

#panel-reimbursements .expense-item:last-child {
  border-bottom: none;
}

#panel-reimbursements .expense-label {
  font-weight: 500;
  color: #333;
}

#panel-reimbursements .receipt-link {
  color: #02133e;
  text-decoration: none;
}

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

#panel-reimbursements .edit-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.85em;
  color: #02133e;
  text-decoration: underline;
}

#panel-reimbursements .edit-link:hover {
  color: #0a3161;
}

/* "How was this paid?" prompt shown when finance marks a request Completed */
.paid-method-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.paid-method-modal { background: #fff; border-radius: 6px; padding: 24px; max-width: 420px; width: calc(100% - 32px); }
.paid-method-modal h3 { margin: 0 0 8px; }
.paid-method-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }


/* ===== Submit tab ===== */
#panel-submit .btn-large { padding: 16px 32px; font-size: 18px; }
#panel-submit .btn-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: finance-spin 0.8s linear infinite;
}
@keyframes finance-spin { to { transform: rotate(360deg); } }
#panel-submit .form-wrap { max-width: 900px; margin: 0 auto; }
/* Form Card */
#panel-submit .form-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 20px;
}

#panel-submit .form-card h2 {
  color: #333;
  font-size: 24px;
  margin-bottom: 20px;
}

#panel-submit .form-card .subtitle {
  margin-bottom: 20px;
}

/* Edit-mode warning banner */
#panel-submit .edit-warning {
  background: #fff3cd;
  border-left: 4px solid #ff9800;
  padding: 12px 15px;
  margin-bottom: 20px;
  color: #663c00;
  font-size: 14px;
  border-radius: 4px;
}

/* Denied-request notice (0145) — same shape as .edit-warning, red instead of amber */
#panel-submit .denied-notice {
  background: #f8d7da;
  border-left-color: #dc3545;
  color: #721c24;
}

/* Existing-receipt note shown when editing an expense */
#panel-submit .existing-receipt {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: #555;
}

/* A preserved receipt row (edit mode): the link plus a "remove this receipt" × */
#panel-submit .existing-receipt-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#panel-submit .existing-receipt-row .existing-receipt {
  flex: 1;
}

#panel-submit .remove-receipt-btn {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

#panel-submit .remove-receipt-btn:hover {
  color: #922b21;
}

/* Mileage Note */
#panel-submit .mileage-note {
  background: #e7f3ff;
  border-left: 4px solid #02133e;
  padding: 12px 15px;
  margin-bottom: 20px;
  color: #333;
  font-size: 14px;
  border-radius: 4px;
}

/* Form Groups */
#panel-submit .form-group {
  margin-bottom: 20px;
}

#panel-submit .form-group label {
  display: block;
  color: #333;
  font-weight: 500;
  margin-bottom: 8px;
  font-size: 14px;
}

#panel-submit .form-group small {
  display: block;
  color: #6c757d;
  font-size: 12px;
  margin-top: 4px;
}

#panel-submit .receipt-note {
  display: block;
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  padding: 8px 12px;
  margin-bottom: 10px;
  color: #856404;
  font-size: 12px;
  border-radius: 4px;
  font-weight: 500;
}

#panel-submit .form-control {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

#panel-submit .form-control:focus {
  outline: none;
  border-color: #02133e;
}

#panel-submit .form-control:disabled,
#panel-submit .form-control:read-only {
  background: #f1f3f5;
  cursor: not-allowed;
}

#panel-submit textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Radio Groups */
#panel-submit .radio-group {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

#panel-submit .radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

/* Inline checkbox label (e.g. "Save my payment info for next time") */
#panel-submit .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}

/* Informational note about payment method (mailing address as Zelle fallback) */
#panel-submit .payment-note {
  background: #e7f3ff;
  border-left: 4px solid #02133e;
  padding: 10px 14px;
  margin-top: 10px;
  color: #333;
  font-size: 14px;
  border-radius: 4px;
}

/* Dim the Zelle option when it's disabled (total at/above the Zelle cap) */
#panel-submit .radio-group label:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Non-blocking warning when a Zelle contact matches nobody in the household */
#panel-submit .household-warning {
  background: #fff3cd;
  border-left: 4px solid #ff9800;
  padding: 10px 14px;
  margin-top: 8px;
  color: #663c00;
  font-size: 14px;
  border-radius: 4px;
}

/* Remove the up/down spinner arrows on number inputs — they're easy to click by
   accident and cause amount mistakes. */
#panel-submit input[type="number"]::-webkit-inner-spin-button,
#panel-submit input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#panel-submit input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Expense Item */
#panel-submit .expense-item {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  position: relative;
}

#panel-submit .expense-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

#panel-submit .expense-item-header h3 {
  color: #02133e;
  font-size: 16px;
  margin: 0;
}

#panel-submit .remove-expense-btn {
  background: none;
  border: none;
  color: #dc3545;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

#panel-submit .remove-expense-btn:hover {
  background: #f8d7da;
}

#panel-submit .expense-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

#panel-submit .file-input-wrapper {
  position: relative;
}

#panel-submit .file-input-label {
  display: block;
  padding: 10px 15px;
  background: #f8f9fa;
  border: 2px dashed #02133e;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

#panel-submit .file-input-label:hover {
  background: #e7f3ff;
  border-color: #0a3161;
}

#panel-submit .file-input-label.has-file {
  background: #d4edda;
  border-color: #28a745;
  border-style: solid;
}

#panel-submit input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

#panel-submit .file-name {
  display: block;
  font-size: 13px;
  color: #666;
  margin-top: 5px;
  word-break: break-all;
}

/* Total Card */
#panel-submit .total-card {
  background: linear-gradient(135deg, #02133e 0%, #0a3161 100%);
  color: white;
  position: sticky;
  top: 20px;
  z-index: 100;
}

#panel-submit .total-card h2 {
  color: white;
}

#panel-submit .total-breakdown {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
}

#panel-submit .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 16px;
}

#panel-submit .total-row.total-final {
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  margin-top: 10px;
  padding-top: 15px;
  font-size: 20px;
}

#panel-submit .total-row .amount {
  font-family: 'Courier New', monospace;
  font-size: 18px;
}

#panel-submit .total-final .amount {
  font-size: 24px;
}

/* Form Actions */
#panel-submit .form-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

/* Success Card */
#panel-submit .success-card {
  background: #d4edda;
  border: 2px solid #28a745;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
}

#panel-submit .success-card h2 {
  color: #28a745;
  font-size: 28px;
  margin-bottom: 15px;
}

#panel-submit .success-card p {
  color: #333;
  font-size: 16px;
  margin-bottom: 10px;
}

#panel-submit .success-card strong {
  color: #02133e;
  font-family: 'Courier New', monospace;
}


@media (max-width: 768px) {
  #panel-submit .expense-row { grid-template-columns: 1fr; }
  #panel-submit .radio-group { flex-direction: column; gap: 10px; }
  #panel-submit .form-actions { flex-direction: column; }
  #panel-submit .total-card { position: static; }
}

.form-title { color: var(--navy, #02133e); margin: 0 0 16px; }
