/* Account Loader UI - Styles */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--card-bg);
  padding: 1rem 2rem;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.5rem;
  color: var(--primary);
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Steps */
.step {
  display: none;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.step.active {
  display: block;
}

.step h2 {
  margin-bottom: 1.5rem;
  color: var(--text);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-large {
  padding: 1.25rem 2rem;
  font-size: 1.25rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

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

/* Client Type Buttons */
.client-type-buttons {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
}

.client-type-buttons .btn {
  flex: 1;
  max-width: 250px;
  flex-direction: column;
  padding: 2rem;
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-box input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.125rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-result-item:hover {
  background: var(--bg);
}

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

.selected-client {
  background: #dbeafe;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-weight: 500;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

/* Drop Zone */
.drop-zone {
  border: 3px dashed var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: #dbeafe;
}

.drop-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.drop-zone .small {
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Entry Methods */
.entry-methods {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}

.entry-methods .drop-zone {
  flex: 1;
}

.or-divider {
  font-weight: bold;
  color: var(--text-light);
}

/* Analysis Results */
.analysis-results {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.analysis-results h3 {
  margin-bottom: 1rem;
  color: #166534;
}

/* Accounts List */
.accounts-list {
  margin-top: 1.5rem;
}

.accounts-list h3 {
  margin-bottom: 1rem;
}

.account-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.account-card .account-info {
  flex: 1;
}

.account-card .account-name {
  font-weight: 600;
  font-size: 1.125rem;
}

.account-card .account-details {
  color: var(--text-light);
  font-size: 0.875rem;
}

.account-card .account-amount {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary);
}

.account-card .account-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

/* Step Actions */
.step-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content.modal-large {
  max-width: 700px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
}

.modal-content .form-grid {
  padding: 1.5rem;
}

.modal-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* History List */
.history-list {
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.history-item .history-date {
  font-size: 0.875rem;
  color: var(--text-light);
}

.history-item .history-client {
  font-weight: 600;
}

.history-item .history-summary {
  color: var(--text-light);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

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

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-secondary { color: var(--text-light); }

/* Client Display */
.client-display {
  background: #dbeafe;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

/* Extraction Cards */
.extraction-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.extraction-card.confidence-high {
  border-color: var(--success);
}

.extraction-card.confidence-medium {
  border-color: var(--warning);
}

.extraction-card.confidence-low {
  border-color: var(--danger);
}

.extraction-card.extraction-error {
  border-color: var(--danger);
  background: #fef2f2;
}

.extraction-header {
  background: var(--bg);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.extraction-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.extraction-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #e0e7ff;
  color: #3730a3;
}

.extraction-badge.confidence-high {
  background: #d1fae5;
  color: #065f46;
}

.extraction-badge.confidence-medium {
  background: #fef3c7;
  color: #92400e;
}

.extraction-badge.confidence-low {
  background: #fee2e2;
  color: #991b1b;
}

.extraction-body {
  padding: 1rem;
}

.extraction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.extraction-row:last-child {
  margin-bottom: 0;
}

.extraction-field {
  flex: 1;
  min-width: 150px;
}

.field-label {
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.85rem;
}

.field-label.field-missing {
  color: #f97316; /* orange for optional missing */
}

.field-label.field-missing-required {
  color: var(--danger); /* red for required missing */
  font-weight: 600;
}

.field-value {
  color: var(--text);
}

.field-value.field-empty {
  color: #9ca3af; /* gray dash for optional */
  font-style: italic;
}

.extraction-issues {
  margin-top: 0.75rem;
  padding: 0.5rem;
  background: #fef3c7;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #92400e;
}

.extraction-footer {
  background: var(--bg);
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.extraction-source {
  font-size: 0.8rem;
  color: var(--text-light);
}

.btn-copy {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-copy:hover {
  background: #475569;
}

/* AI Chat Section */
.ai-chat-section {
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.ai-chat-section h3 {
  margin-bottom: 0.5rem;
  color: #0369a1;
}

.ai-chat-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.ai-chat-messages {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 100px;
  max-height: 250px;
  overflow-y: auto;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.chat-message {
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

.chat-message:last-child {
  margin-bottom: 0;
}

.user-message {
  background: #dbeafe;
  margin-left: 1rem;
}

.ai-message {
  background: #f0fdf4;
  margin-right: 1rem;
}

.ai-message.error {
  background: #fef2f2;
  color: var(--danger);
}

.ai-message.thinking {
  background: #fefce8;
  color: #854d0e;
  font-style: italic;
}

.ai-chat-input-row {
  display: flex;
  gap: 0.5rem;
}

.ai-chat-input-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.ai-chat-input-row input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
  
  .client-type-buttons {
    flex-direction: column;
  }
  
  .entry-methods {
    flex-direction: column;
  }
}

/* Queued Job Styles */
.queued-summary {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.queued-summary h3 {
  color: #92400e;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.queue-info {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  text-align: left;
}

.queue-info p {
  margin: 0.5rem 0;
}

.queue-note {
  color: var(--text-light);
  font-size: 0.9rem;
  font-style: italic;
  margin-top: 1rem !important;
}

.queue-countdown {
  font-size: 1.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
}

.queue-countdown strong {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  color: var(--primary);
}

/* AI Chat Header */
.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ai-chat-header h3 {
  margin: 0;
}

/* Danger/Reset Button */
.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

/* AI Chat Sidebar - Right Panel */
.ai-chat-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  height: 100vh;
  background: var(--card-bg);
  border-left: 2px solid var(--border);
  box-shadow: -4px 0 15px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 1rem;
}

.ai-chat-sidebar.hidden {
  display: none;
}

.ai-chat-sidebar .ai-chat-header {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.ai-chat-sidebar .ai-chat-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.ai-chat-sidebar .ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  min-height: 200px;
}

.ai-chat-sidebar .ai-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.ai-chat-sidebar .ai-chat-input-row input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.ai-chat-sidebar .ai-chat-input-row button {
  padding: 0.5rem 1rem;
}

/* Adjust main content when sidebar is visible */
body.chat-open .app {
  margin-right: 350px;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .ai-chat-sidebar {
    width: 100%;
    height: 50vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 2px solid var(--border);
  }
  
  body.chat-open .app {
    margin-right: 0;
    margin-bottom: 50vh;
  }
}

/* Fix sidebar to not cover header */
.ai-chat-sidebar {
  top: 70px; /* Below header */
  height: calc(100vh - 70px);
}

/* Ensure header is above sidebar */
.header {
  position: relative;
  z-index: 200;
}

/* Toggle type button */
.btn-tiny {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #ddd;
  background: #f5f5f5;
  margin-right: 8px;
}
.btn-tiny:hover {
  background: #e0e0e0;
}
.toggle-type {
  font-weight: bold;
}

/* Uploaded files section */
.uploaded-files-section {
  margin-top: 20px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.pending-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
}

.pending-file .file-icon {
  font-size: 20px;
}

.pending-file .file-name {
  flex: 1;
  font-weight: 500;
}

.pending-file .file-size {
  color: #666;
  font-size: 12px;
}

/* Override notes */
.override-notes-section {
  margin-top: 20px;
}

.override-notes-section label {
  display: block;
  margin-bottom: 5px;
}

.override-notes-section textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}

.override-notes-section textarea:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#analyzeBtn {
  margin-top: 20px;
  width: 100%;
}

/* Skip trace section */
.skip-trace-section {
  margin-top: 15px;
  padding: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.checkbox-label span {
  flex: 1;
}

/* Account warning styles */
.account-card.account-warning {
  border: 2px solid #f59e0b;
  background: #fffbeb;
}

.warning-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

.account-details {
  font-size: 12px;
  color: #666;
}

/* ============================================================
   PENDING ACCOUNTS PANEL (Left Sidebar)
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.pending-panel {
  width: 250px;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.pending-header {
  padding: 1rem;
  background: #495057;
  color: white;
}

.pending-header h3 {
  margin: 0;
  font-size: 1rem;
}

.pending-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.pending-list .empty-state {
  color: #6c757d;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

.pending-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.pending-item:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.pending-item-client {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
}

.pending-item-count {
  font-size: 0.85rem;
  color: #6c757d;
}

.pending-item-date {
  font-size: 0.75rem;
  color: #adb5bd;
}

.pending-item-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.pending-item-actions .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
  border: none;
}

.btn-warning:hover {
  background-color: #e0a800;
}

/* Adjust main app to work with sidebar */
.app-wrapper .app {
  flex: 1;
  min-width: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
  }
  
  .pending-panel {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
  }
}

/* ============================================
   Auto-Fill Section
   ============================================ */

.autofill-section {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.autofill-section label {
  display: block;
  margin-bottom: 0.5rem;
}

.autofill-section .label-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: normal;
}

.autofill-section textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #7dd3fc;
  border-radius: 6px;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.autofill-section textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.autofill-status {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.autofill-status.loading {
  background: #fef3c7;
  color: #92400e;
}

.autofill-status.success {
  background: #d1fae5;
  color: #065f46;
}

.autofill-status.error {
  background: #fee2e2;
  color: #991b1b;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ============================================
   Expandable Fields
   ============================================ */

.expandable-triggers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-outline {
  background: transparent;
  border: 1px dashed var(--secondary);
  color: var(--secondary);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline.active {
  background: #e0f2fe;
  border-color: var(--primary);
  border-style: solid;
  color: var(--primary);
}

.expandable-section {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  margin-top: 0.5rem;
}

.expandable-section.hidden {
  display: none;
}

.expandable-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.extra-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.extra-field-row input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9rem;
}

.extra-field-row input:focus {
  outline: none;
  border-color: var(--primary);
}

.extra-contact-row {
  flex-wrap: wrap;
}

.extra-contact-row input {
  min-width: 120px;
}

.remove-field {
  flex-shrink: 0;
  padding: 0.25rem 0.5rem !important;
}

.add-more-field {
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* Make expandable sections span full width in grid */
.form-grid .expandable-triggers,
.form-grid .expandable-section {
  grid-column: 1 / -1;
}

/* ============================================
   Tiny button variant
   ============================================ */

.btn-tiny {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* ============================================
   Review Panel (Left Sidebar)
   ============================================ */

.review-panel {
  width: 280px;
  min-width: 280px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.review-header {
  padding: 1rem;
  background: var(--primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.review-header h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.review-count {
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: bold;
}

.review-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.review-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.review-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.review-item-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  word-break: break-word;
}

.review-item-amount {
  font-weight: 600;
  color: var(--success);
  font-size: 0.85rem;
  white-space: nowrap;
}

.review-item-client {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.review-item-meta {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.review-item-actions {
  display: flex;
  gap: 0.5rem;
}

.review-item-actions .btn {
  flex: 1;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
}

.btn-success {
  background: var(--success);
  color: white;
  border: none;
}

.btn-success:hover {
  background: #059669;
}

.btn-info {
  background: #3b82f6;
  color: white;
  border: none;
}

.btn-info:hover {
  background: #2563eb;
}

/* ============================================
   Account Detail Modal
   ============================================ */

.account-detail-content {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h4 {
  color: var(--primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.detail-row {
  display: flex;
  flex-direction: column;
}

.detail-row.full-width {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.detail-value.highlight {
  color: var(--success);
  font-size: 1.1rem;
  font-weight: 700;
}

.detail-value.muted {
  color: var(--text-secondary);
  font-style: italic;
}

.detail-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.detail-badge.commercial {
  background: #dbeafe;
  color: #1d4ed8;
}

.detail-badge.consumer {
  background: #fef3c7;
  color: #d97706;
}

/* Simplicity link */
.simplicity-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.simplicity-link:hover {
  text-decoration: underline;
}
