/* Bright Star Solutions - Travel Expense Report */
/* Brand Colors:
   Primary Blue: #22277a
   Dark Navy: #080942
   Orange Accent: #fda432
   Light Purple: #e3e5ff
   Off White: #fafaff
*/

:root {
  --bs-primary: #22277a;
  --bs-primary-dark: #1a1d5c;
  --bs-navy: #080942;
  --bs-orange: #fda432;
  --bs-orange-dark: #e8931d;
  --bs-light-purple: #e3e5ff;
  --bs-off-white: #fafaff;
  --bs-text: #333;
  --bs-text-light: #6b7280;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bs-light-purple);
  color: var(--bs-text);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Header with Logo */
header {
  background: white;
  padding: 15px 25px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(8, 9, 66, 0.1);
}

.header-brand {
  display: flex;
  align-items: center;
}

.logo {
  height: 55px;
  width: auto;
}

.header-title h1 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  color: var(--bs-primary);
}

.app-version {
  font-size: 11px;
  color: var(--bs-text-light);
  font-weight: normal;
  display: block;
  margin-top: 2px;
}

/* Section Cards */
.card {
  background: var(--bs-off-white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(8, 9, 66, 0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  background: var(--bs-primary);
  color: white;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
}

.card-body {
  padding: 20px;
}

/* Form Elements */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 15px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--bs-text-light);
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(34, 39, 122, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

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

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

.btn-success {
  background: var(--bs-orange);
  color: var(--bs-navy);
}

.btn-success:hover {
  background: var(--bs-orange-dark);
}

.btn-danger {
  background: #dc2626;
  color: white;
}

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

.btn-secondary {
  background: #9ca3af;
  color: white;
}

.btn-secondary:hover {
  background: #6b7280;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-outline {
  background: transparent;
  color: var(--bs-primary);
  border: 2px solid var(--bs-primary);
}

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

/* Expense Table */
.expense-table {
  width: 100%;
  border-collapse: collapse;
}

.expense-table th,
.expense-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.expense-table th {
  background: var(--bs-light-purple);
  font-weight: 500;
  color: var(--bs-primary);
  font-size: 13px;
}

.expense-table tr:hover {
  background: rgba(227, 229, 255, 0.5);
}

.expense-table .amount {
  font-family: 'Consolas', 'Monaco', monospace;
  text-align: right;
}

.expense-table .actions {
  text-align: center;
  white-space: nowrap;
}

.expense-table .actions .btn {
  margin: 0 2px;
}

.receipt-badge {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bs-light-purple);
  color: var(--bs-primary);
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 500;
}

.receipt-badge:hover {
  background: var(--bs-primary);
  color: white;
}

.no-receipt {
  color: #9ca3af;
  font-size: 12px;
}

/* Summary */
.summary-row {
  display: flex;
  justify-content: flex-end;
  padding: 15px 20px;
  background: var(--bs-light-purple);
  border-top: 2px solid var(--bs-primary);
}

.summary-total {
  font-size: 18px;
  font-weight: 600;
  color: var(--bs-navy);
}

.summary-total span {
  color: var(--bs-primary);
  margin-left: 10px;
  font-family: 'Consolas', 'Monaco', monospace;
}

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(8, 9, 66, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(8, 9, 66, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bs-primary);
  color: white;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--bs-light-purple);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  background: var(--bs-light-purple);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop-zone:hover {
  border-color: var(--bs-primary);
  background: var(--bs-light-purple);
}

.drop-zone.dragover {
  border-color: var(--bs-orange);
  background: rgba(253, 164, 50, 0.1);
}

.drop-zone-text {
  color: var(--bs-text-light);
  font-size: 14px;
}

.drop-zone-text strong {
  color: var(--bs-primary);
}

/* Receipt Preview */
.receipt-preview {
  margin-top: 15px;
  padding: 15px;
  background: var(--bs-light-purple);
  border-radius: 4px;
  display: none;
}

.receipt-preview.active {
  display: block;
}

.receipt-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.receipt-preview-name {
  font-size: 13px;
  color: var(--bs-primary);
  font-weight: 500;
}

.receipt-thumbnail {
  max-width: 200px;
  max-height: 150px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--bs-text-light);
}

.empty-state p {
  margin-bottom: 15px;
}

/* Report Section */
.report-section {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 20px;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  background: var(--bs-navy);
  color: white;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(8, 9, 66, 0.3);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--bs-primary);
}

.toast.error {
  background: #dc2626;
}

.toast.info {
  background: var(--bs-navy);
}

/* Receipt Viewer Modal */
.receipt-viewer {
  max-width: 800px;
}

.receipt-viewer img {
  max-width: 100%;
  height: auto;
}

/* Currency Input */
.currency-input {
  position: relative;
}

.currency-input::before {
  content: '$';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-text-light);
}

.currency-input input {
  padding-left: 25px;
}

/* Mileage Display */
.mileage-rate-display,
.mileage-cost-display {
  background: var(--bs-light-purple);
  padding: 10px 15px;
  border-radius: 4px;
  font-weight: 600;
  color: var(--bs-primary);
  text-align: center;
}

.mileage-cost-display {
  font-size: 18px;
  background: var(--bs-primary);
  color: white;
}

.mileage-note {
  margin-top: 12px;
  padding: 12px 15px;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: 4px;
  font-size: 13px;
  color: #92400e;
}

.mileage-note strong {
  color: #78350f;
}

.mileage-note.mileage-receipt-required {
  background: #fef2f2;
  border-left-color: #ef4444;
  color: #991b1b;
}

.mileage-note.mileage-receipt-required strong {
  color: #7f1d1d;
}

.mileage-receipt-warning {
  margin-top: 10px;
  padding: 10px 15px;
  background: #fef2f2;
  border: 1px solid #ef4444;
  border-radius: 4px;
  font-size: 13px;
  color: #dc2626;
  font-weight: 500;
}

/* Apply receipt checkbox */
.apply-receipt-checkbox {
  margin-top: 12px;
  padding: 10px 15px;
  background: var(--bs-light-purple);
  border-radius: 4px;
  font-size: 13px;
}

.apply-receipt-checkbox label {
  margin: 0;
}

.apply-receipt-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Trip Management Bar */
.trip-management-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bs-off-white);
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(8, 9, 66, 0.1);
}

.trip-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trip-selector label {
  font-weight: 500;
  color: var(--bs-text);
}

.trip-selector select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 14px;
  min-width: 250px;
}

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

/* Locked Banner */
.locked-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.locked-banner::before {
  content: "🔒";
  font-size: 16px;
}

/* Approval Banner */
.approval-banner {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.approval-banner.approved {
  background: #d1fae5;
  border: 1px solid #059669;
  color: #065f46;
}

.approval-banner.rejected {
  background: #fee2e2;
  border: 1px solid #dc2626;
  color: #991b1b;
}

.approval-banner.returned {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
}

.approval-banner-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approval-status {
  font-weight: 600;
  font-size: 16px;
}

.approval-details {
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.approval-details span {
  display: inline-block;
}

/* Status Badge Updates */
.status-badge.approved {
  background: #d1fae5;
  color: #059669;
}

.status-badge.rejected {
  background: #fee2e2;
  color: #dc2626;
}

/* SharePoint Field Placeholder */
.sharepoint-field {
  padding: 10px 12px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 4px;
  color: var(--bs-text-light);
  font-size: 14px;
}

.sharepoint-placeholder {
  font-style: italic;
}

/* Trip Code Display */
.trip-code-display {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--bs-primary);
  background: var(--bs-light-purple);
  padding: 10px 12px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Status Badge */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.status-badge.draft {
  background: #e3e5ff;
  color: var(--bs-primary);
}

.status-badge.submitted {
  background: #d1fae5;
  color: #065f46;
}

/* Locked state for cards */
.card.locked .card-body {
  opacity: 0.7;
  pointer-events: none;
}

/* Allow receipt badge to be clickable even when locked */
.card.locked .receipt-badge {
  pointer-events: auto;
  cursor: pointer;
  opacity: 1;
}

.card.locked input,
.card.locked select,
.card.locked textarea,
.card.locked button {
  pointer-events: none;
  opacity: 0.6;
}

/* Location Entries */
.location-entry {
  padding: 15px;
  background: var(--bs-light-purple);
  border-radius: 6px;
  margin-bottom: 15px;
}

.location-header {
  font-weight: 600;
  color: var(--bs-primary);
  margin-bottom: 12px;
  font-size: 14px;
}

.location-entry .form-row {
  margin-bottom: 10px;
}

.location-entry .form-row:last-child {
  margin-bottom: 0;
}

/* Summary Detail */
.summary-detail {
  display: block;
  font-size: 13px;
  color: var(--bs-text-light);
  font-weight: normal;
  margin-top: 5px;
}

/* Location Lookup Button */
.location-lookup-btn {
  padding: 8px 12px;
  font-size: 12px;
  background: var(--bs-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 22px;
  white-space: nowrap;
}

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

/* Date Validation Error */
.date-validation-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 13px;
  display: none;
}

.date-validation-error.show {
  display: block;
}

/* Input Validation States */
input.invalid,
select.invalid {
  border-color: #dc2626 !important;
  background-color: #fef2f2;
}

input.invalid:focus,
select.invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.validation-message {
  color: #dc2626;
  font-size: 11px;
  margin-top: 4px;
}

/* Checkbox styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--bs-primary);
}

/* Auto-Populate Buttons */
.auto-populate-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.auto-populate-buttons .btn {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 20px;
  text-align: center;
}

.auto-populate-buttons .btn-subtitle {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 4px;
}

/* Validation Warning */
.validation-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 8px;
}

.validation-warning.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.validation-warning .dismiss-btn {
  background: none;
  border: none;
  color: #92400e;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  margin-left: 10px;
}

.validation-warning .dismiss-btn:hover {
  color: #78350f;
}

/* Receipt Upload Widget */
.receipt-upload-zone {
  border: 2px dashed var(--bs-primary);
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bs-light-purple);
}

.receipt-upload-zone:hover {
  background: white;
  border-color: var(--bs-orange);
}

.receipt-upload-zone.dragover {
  background: rgba(253, 164, 50, 0.1);
  border-color: var(--bs-orange);
}

.upload-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.upload-icon {
  font-size: 32px;
}

.upload-hint {
  font-size: 12px;
  color: var(--bs-text-light);
}

.uploaded-receipts-list {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.uploaded-receipt-item {
  position: relative;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px;
  background: white;
  text-align: center;
}

.uploaded-receipt-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 5px;
}

.uploaded-receipt-item .receipt-name {
  font-size: 11px;
  color: var(--bs-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-receipt-item .delete-receipt {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.uploaded-receipt-item .delete-receipt:hover {
  background: #b91c1c;
}

/* Receipt Source Tabs */
.receipt-source-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

.receipt-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--bs-text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.receipt-tab:hover {
  color: var(--bs-primary);
}

.receipt-tab.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
  font-weight: 500;
}

.receipt-tab-content {
  display: none;
}

.receipt-tab-content.active {
  display: block;
}

.receipt-select-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 10px;
}

.receipt-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.receipt-select-item:hover {
  background: var(--bs-light-purple);
  border-color: var(--bs-primary);
}

.receipt-select-item.selected {
  background: var(--bs-light-purple);
  border-color: var(--bs-primary);
}

.receipt-select-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.receipt-select-item .receipt-info {
  flex: 1;
  min-width: 0;
}

.receipt-select-item .receipt-info .name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-select-item .receipt-info .size {
  font-size: 11px;
  color: var(--bs-text-light);
}

.no-receipts-msg {
  color: var(--bs-text-light);
  font-size: 13px;
  text-align: center;
  padding: 15px;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    flex-direction: column;
  }

  header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .logo {
    height: 45px;
  }

  .header-title h1 {
    font-size: 16px;
  }

  .report-section {
    flex-direction: column;
  }

  .auto-populate-buttons {
    flex-direction: column;
  }

  .auto-populate-buttons .btn {
    min-width: 100%;
  }
}

/* ============================================
   ENVIRONMENT BANNER STYLES
   ============================================ */

.environment-banner {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
  color: white;
  text-align: center;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  position: sticky;
  top: 0;
  z-index: 9999;
}

.environment-banner.prod {
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.environment-banner .env-banner-note {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.9;
}

/* ============================================
   SIGN-IN & USER AUTHENTICATION STYLES
   ============================================ */

/* Sign-in Overlay */
.sign-in-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-navy) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.sign-in-overlay.hidden {
  display: none;
}

.sign-in-card {
  background: white;
  padding: 50px 60px;
  border-radius: 16px;
  text-align: center;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.sign-in-logo {
  height: 60px;
  margin-bottom: 20px;
}

.sign-in-card h1 {
  color: var(--bs-primary);
  font-size: 24px;
  margin-bottom: 15px;
}

.sign-in-card p {
  color: var(--bs-text-light);
  margin-bottom: 25px;
  font-size: 14px;
}

.sign-in-card .btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sign-in-hint {
  font-size: 12px !important;
  color: #999 !important;
  margin-top: 20px !important;
  margin-bottom: 0 !important;
}

/* Header User Section */
.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

#userName {
  font-weight: 500;
  color: var(--bs-primary);
}

.connection-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  text-transform: uppercase;
}

.connection-badge.online {
  background: #d1fae5;
  color: #059669;
}

.connection-badge.offline {
  background: #fef3c7;
  color: #d97706;
}

.connection-badge.syncing {
  background: #dbeafe;
  color: #2563eb;
}

#signOutBtn {
  margin-left: 8px;
}

/* Admin Dashboard Button */
#adminDashboardBtn {
  background: var(--bs-orange);
  border-color: var(--bs-orange);
  color: white;
}

#adminDashboardBtn:hover {
  background: var(--bs-orange-dark);
  border-color: var(--bs-orange-dark);
}

/* Loading State */
.app-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Sync Indicator */
.sync-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bs-primary);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.sync-indicator.active {
  display: flex;
}

.sync-indicator .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive adjustments for header */
@media (max-width: 768px) {
  .header-user {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  #userName {
    width: 100%;
    text-align: center;
  }

  .sign-in-card {
    margin: 20px;
    padding: 30px;
  }
}

/* ============================================
   AI Receipt Scanner Styles
   ============================================ */

#aiScannerCard .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-badge {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ai-scanner-dropzone {
  border: 2px dashed #c4b5fd;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(180deg, #faf5ff 0%, #f5f3ff 100%);
}

.ai-scanner-dropzone:hover {
  border-color: #8b5cf6;
  background: linear-gradient(180deg, #f5f3ff 0%, #ede9fe 100%);
}

.ai-scanner-dropzone.drag-over {
  border-color: #8b5cf6;
  background: #ede9fe;
  transform: scale(1.01);
}

.ai-dropzone-icon {
  color: #8b5cf6;
  margin-bottom: 15px;
}

.ai-dropzone-text {
  font-size: 16px;
  font-weight: 500;
  color: #5b21b6;
  margin-bottom: 5px;
}

.ai-dropzone-hint {
  font-size: 13px;
  color: #7c3aed;
  opacity: 0.8;
}

.ai-receipt-previews {
  margin-top: 20px;
}

.ai-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9d5ff;
}

.ai-preview-header span {
  font-weight: 600;
  color: #5b21b6;
}

.ai-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  max-height: 200px;
  overflow-y: auto;
  padding: 5px;
}

.ai-preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f3ff;
  border: 1px solid #e9d5ff;
}

.ai-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.ai-preview-item .remove-btn:hover {
  background: #ef4444;
}

.ai-preview-item .pdf-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #7c3aed;
}

.ai-preview-item .pdf-icon svg {
  margin-bottom: 5px;
}

.ai-preview-item .file-name {
  font-size: 9px;
  text-align: center;
  padding: 0 5px;
  word-break: break-all;
  color: #6b7280;
}

#aiAnalyzeBtn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  padding: 15px 30px;
  transition: all 0.2s ease;
}

#aiAnalyzeBtn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

#aiAnalyzeBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ai-btn-icon {
  display: flex;
  align-items: center;
}

.ai-processing {
  text-align: center;
  padding: 40px 20px;
}

.ai-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e9d5ff;
  border-top-color: #8b5cf6;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: ai-spin 1s linear infinite;
}

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

.ai-processing p {
  color: #5b21b6;
  font-weight: 500;
}

.ai-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 15px;
  color: #dc2626;
  margin-top: 15px;
}

/* AI Scanner Controls (in Upload Receipts section) */
.ai-scanner-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e5e7eb;
}

.ai-scanner-controls #aiAnalyzeBtn {
  padding: 10px 20px;
  font-size: 14px;
}

.ai-hint {
  font-size: 13px;
  color: #6b7280;
}

.ai-results-summary {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #c4b5fd;
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.ai-results-summary h4 {
  color: #5b21b6;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-results-summary .success-icon {
  color: #22c55e;
}

.ai-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.ai-result-item {
  background: white;
  padding: 12px;
  border-radius: 8px;
}

.ai-result-item label {
  font-size: 11px;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.ai-result-item .value {
  font-weight: 600;
  color: #1e1b4b;
}

.ai-confidence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.ai-confidence.high {
  background: #d1fae5;
  color: #059669;
}

.ai-confidence.medium {
  background: #fef3c7;
  color: #d97706;
}

.ai-confidence.low {
  background: #fee2e2;
  color: #dc2626;
}

.ai-warnings {
  margin-top: 15px;
  padding: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.ai-warnings h5 {
  color: #b45309;
  font-size: 13px;
  margin-bottom: 8px;
}

.ai-warnings ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #92400e;
}

.ai-apply-btn {
  background: #22c55e;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
  width: 100%;
  transition: all 0.2s ease;
}

.ai-apply-btn:hover {
  background: #16a34a;
}

/* ============================================
   HELP MODAL STYLES
   ============================================ */

.help-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.help-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.help-section h4 {
  color: var(--bs-primary);
  font-size: 15px;
  margin-bottom: 12px;
  font-weight: 600;
}

.help-section ol,
.help-section ul {
  margin: 0;
  padding-left: 22px;
  color: var(--bs-text);
  font-size: 14px;
  line-height: 1.7;
}

.help-section li {
  margin-bottom: 6px;
}

.help-section li:last-child {
  margin-bottom: 0;
}

.help-section strong {
  color: var(--bs-primary);
}
