/* ========================================================================
   REHABEST COLOR SCHEME SYSTEM
   ========================================================================
   TO SWITCH COLOR SCHEMES:
   1. Comment out the active scheme
   2. Uncomment the desired scheme
   3. Save the file - changes take effect immediately
   ======================================================================== */

/* ========== COLOR SCHEME VARIABLES ========== */
/* ACTIVE: Option #1 - Professional Finance */
:root {
  --primary: #1a365d;    /* Deep Navy */
  --secondary: #2c5282;  /* Medium Blue */
  --accent: #28a745;     /* Success Green */
  --light: #f8f9fa;      /* Light Gray */
  --text: #495057;       /* Dark Gray */
  --success: #28a745;    /* Success Green */
  --white: #ffffff;
}

/* BACKUP: Option #2 - Real Estate Modern (comment out to deactivate) */
/*
:root {
  --primary: #2d3748;
  --secondary: #4a5568;
  --accent: #ff6b35;
  --light: #edf2f7;
  --text: #2d3748;
  --success: #38a169;
  --white: #ffffff;
}
*/

body { font-family: system-ui, sans-serif; margin: 0; }
header { 
  padding: 12px; 
  background: var(--primary); 
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.message {
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  font-weight: bold;
  background-color: #fc0909;
  color: white;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand .logo {
  height: 90px;
  width: auto;
  background-color: white;
  padding: 8px;
  border-radius: 6px;
}

.header-brand h2 {
  margin: 0;
  font-size: 1.5em;
  font-weight: 600;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

nav button { 
  margin-right: 8px;
  padding: 8px 12px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

nav button:hover {
  background: rgba(255, 255, 255, 0.3);
}

nav button.active {
  background: var(--accent);
  color: var(--white);
}

/* Mobile responsive header */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px;
  }
  
  .header-brand {
    justify-content: center;
    margin-bottom: 8px;
  }
  
  .header-brand .logo {
    height: 60px;
    padding: 4px;
  }
  
  nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
  }
  
  nav button {
    margin: 2px;
    padding: 6px 10px;
    font-size: 12px;
    flex: 1;
    min-width: 80px;
    max-width: 120px;
  }
  
  /* Hide settings button on mobile */
  .mobile-hidden {
    display: none !important;
  }
  
  #btn-logout {
    margin-left: 0 !important;
    flex-basis: 100%;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  nav button {
    font-size: 11px;
    padding: 5px 8px;
    min-width: 70px;
    max-width: 100px;
  }
  
  .header-brand .logo {
    height: 50px;
  }
}
main { padding: 12px; }
.hidden { display:none; }
.row { display:flex; gap:8px; align-items:center; margin:8px 0; }
.item-row { display:grid; grid-template-columns: 2fr 100px 80px 100px 60px; gap:8px; padding:8px 0; border-bottom:1px solid #eee; align-items:center; }
.item-row span.name { font-weight: 500; }
.item-row input[type="number"] { width: 100%; padding: 4px; }
.item-row input[type="checkbox"] { justify-self: center; }
.item-row .line-total { font-weight: bold; text-align: right; }

/* Property info section */
.property-info {
  background: #f0f8ff;
  padding: 2px;
  border-radius: 6px;
  margin-bottom: 2px;
}

/* Sync status styling */
.estimate-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sync-status {
  font-size: 0.9em;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  align-self: flex-start;
  margin-top: 12px;
}

.sync-status.saved {
  background: #d4edda;
  color: #155724;
}

.sync-status.dirty {
  background: #fff3cd;
  color: #856404;
}

.sync-status.offline {
  background: #f8d7da;
  color: #721c24;
}

.sync-status.syncing {
  background: #cce5ff;
  color: #0056b3;
}

.sync-indicator::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.sync-status.saved .sync-indicator::before {
  background: #28a745;
}

.sync-status.dirty .sync-indicator::before {
  background: #ffc107;
}

.sync-status.offline .sync-indicator::before {
  background: #dc3545;
}

.sync-status.syncing .sync-indicator::before {
  background: var(--accent);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Tab styling */
#tabs {
  margin: 16px 0;
}
#tabs button {
  padding: 8px 16px;
  margin-right: 4px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  cursor: pointer;
}
#tabs button.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* Total section */
.total-section {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 6px;
  margin-top: 16px;
  border: 2px solid #ddd;
}

/* Line items header */
.lineitems-header {
  display: grid;
  grid-template-columns: 2fr 100px 80px 100px 60px;
  gap: 8px;
  padding: 8px 0;
  font-weight: bold;
  border-bottom: 2px solid #333;
  margin-bottom: 8px;
}

/* Save ARV button styling */
#save-arv {
  background: #28a745;
  color: white;
  padding: 8px 16px;
  font-weight: bold;
}
.msg { margin-top:8px; color:#006; }
input[type="number"] { width:100%; }
#comps-list .comp { display:flex; gap:8px; align-items:center; border-bottom:1px solid #eee; padding:6px 0; }

/* Properties list styles */
.properties-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  border: 1px solid #ddd;
}

.properties-table th,
.properties-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #ddd;
  vertical-align: top;
}

.properties-table th {
  background-color: #f5f5f5;
  font-weight: bold;
  word-wrap: break-word;
  white-space: normal;
}

.properties-table td {
  word-wrap: break-word;
  white-space: normal;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell button {
  margin-right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.properties-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.properties-table tbody tr:hover {
  background-color: #f0f8ff;
}

/* Line items table styling */
.category-selector {
  margin-bottom: 1rem;
  padding: 1rem;
  background-color: #f5f5f5;
  border-radius: 4px;
}

.category-selector label {
  font-weight: bold;
  margin-right: 0.5rem;
}

.category-selector select {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.line-items-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.line-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  min-width: 100%;
}

.line-items-table th,
.line-items-table td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid #ddd;
}

.line-items-table th {
  background-color: #f0f8ff;
  font-weight: bold;
}

/* Sub-category header styling */
.sub-category-header {
  background-color: #e8f4fd !important;
  cursor: pointer;
  user-select: none;
}

.sub-category-header:hover {
  background-color: #d4edda !important;
}

.sub-category-header.expanded {
  background-color: #d1ecf1 !important;
}

.sub-category-title {
  font-weight: bold;
  font-size: 1.1em;
  color: #495057;
}

.sub-category-toggle {
  font-family: monospace;
  font-size: 1.2em;
  color: #007bff;
  transition: transform 0.2s ease;
}

.sub-category-header.expanded .sub-category-toggle {
  transform: rotate(90deg);
}

.line-items-table .item-selected-cb {
  transform: scale(1.2);
}

.line-items-table .item-quantity-input {
  width: 80px;
  padding: 0.25rem;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.line-items-table .item-total {
  font-weight: bold;
  text-align: right;
}

.line-items-table .price-override-indicator {
  color: #007acc;
  font-weight: bold;
}

.category-total {
  margin-top: 1px;
  padding: 1rem;
  background-color: #e8f4fd;
  border-radius: 4px;
  text-align: right;
  font-size: 1.2rem;
}

.no-items {
  text-align: center;
  font-style: italic;
  color: #666;
}

/* Mobile responsive estimate table */
@media (max-width: 768px) {
  .line-items-table-container {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }
  
  .line-items-table {
    font-size: 0.9em;
    min-width: 100%;
    table-layout: auto;
  }
  
  .line-items-table th,
  .line-items-table td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
  }
  
  /* Ensure media column is always visible */
  .line-items-table .media-column {
    min-width: 50px !important;
    width: 50px !important;
    position: sticky;
    right: 0;
    background: white;
    z-index: 1;
  }
  
  .line-items-table th.media-column {
    min-width: 50px !important;
    width: 50px !important;
    position: sticky;
    right: 0;
    background: #f0f8ff;
    z-index: 2;
  }
  
  /* Hide price column on mobile */
  .line-items-table th.mobile-hidden,
  .line-items-table td.mobile-hidden {
    display: none;
  }
  
  .line-items-table .item-quantity-input {
    width: 60px;
    font-size: 0.9em;
  }
  
  .line-items-table .item-name {
    max-width: 150px;
    word-wrap: break-word;
  }
}

@media (max-width: 480px) {
  .line-items-table {
    font-size: 0.8em;
  }
  
  .line-items-table th,
  .line-items-table td {
    padding: 0.4rem 0.2rem;
  }
  
  .line-items-table .item-quantity-input {
    width: 50px;
  }
  
  .line-items-table .item-name {
    max-width: 120px;
    font-size: 0.85em;
  }
  
  .item-unit {
    font-size: 0.8em;
  }
}

/* Fallback: Property card styles for backwards compatibility */
.property-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  background: #f9f9f9;
}
.property-header {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 8px;
  color: #333;
}
.property-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.property-detail {
  text-align: center;
}
.property-detail label {
  display: block;
  font-size: 0.9em;
  color: #666;
  margin-bottom: 4px;
}
.property-detail span {
  font-weight: bold;
  font-size: 1.1em;
  color: #333;
}

/* Estimate totals styling */
.estimate-totals {
  background: #e8f4fd;
  border: 1px solid #cce7f0;
  border-radius: 6px;
  padding: 12px;
  margin-top: 12px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.total-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.total-label {
  font-weight: 500;
  color: #333;
  font-size: 0.95em;
}

.total-value {
  font-weight: bold;
  font-size: 1.1em;
  color: var(--secondary);
  min-width: 80px;
  text-align: right;
}

.grand-total-value {
  font-size: 1.2em;
  color: #1a365d;
  background: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #bee3f8;
}

/* Authentication page styling */
.form-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 24px;
}

.auth-buttons {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.auth-buttons button {
  flex: 1;
}

.subscription-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #ddd;
}

.subscription-section h3 {
  margin: 0 0 16px 0;
  color: #333;
  font-size: 1.1em;
}

.subscription-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Forgot password link styling */
.forgot-password-link {
  text-align: center;
  margin: 16px 0;
}

.forgot-password-link a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
}

.forgot-password-link a:hover {
  text-decoration: underline;
}

/* Step indicator styling */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin: 20px 0 30px 0;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: #e0e0e0;
  z-index: 1;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  background: var(--white);
  padding: 0 10px;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.step-text {
  font-size: 12px;
  color: #666;
  text-align: center;
  white-space: nowrap;
}

.step.active .step-number {
  background: var(--primary);
  color: var(--white);
}

.step.active .step-text {
  color: var(--primary);
  font-weight: bold;
}

.step.completed .step-number {
  background: var(--success);
  color: var(--white);
}

.step.completed .step-text {
  color: var(--success);
}

/* Forgot password steps */
.forgot-step {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.email-sent-message {
  text-align: center;
  padding: 20px;
}

.email-sent-message h3 {
  color: var(--success);
  margin-bottom: 16px;
}

.email-sent-message p {
  margin: 12px 0;
  line-height: 1.5;
}

.form-buttons {
  display: flex;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.form-buttons button {
  flex: 1;
  min-width: 120px;
}

/* Responsive adjustments for forgot password */
@media (max-width: 480px) {
  .step-indicator {
    flex-direction: column;
    gap: 15px;
  }
  
  .step-indicator::before {
    display: none;
  }
  
  .step {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0;
  }
  
  .step-number {
    margin-bottom: 0;
    margin-right: 12px;
  }
  
  .step-text {
    white-space: normal;
    text-align: left;
  }
  
  .form-buttons {
    flex-direction: column;
  }
  
  .form-buttons button {
    width: 100%;
  }
}

/* Pulse animation for highlighting elements */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 91, 255, 0.7); }\n  50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(99, 91, 255, 0.3); }\n  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 91, 255, 0); }
}
.stripe-button {
  background: #635bff;
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1em;
  transition: background-color 0.2s;
}

.stripe-button:hover {
  background: #5a52e8;
}

.stripe-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Comps table styling */
.comps-table-container {
  margin: 20px 0;
  overflow-x: auto;
}

.comps-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comps-table th {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
}

.comps-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #dee2e6;
}

.comps-table tbody tr:hover {
  background: #f8f9fa;
}

.comps-table .comp-address {
  font-weight: 500;
  color: #333;
}

.comps-table .comp-price,
.comps-table .comp-price-per-sqft {
  text-align: right;
  font-weight: 500;
  color: #28a745;
}

.comps-table .comp-sqft {
  text-align: right;
}

.comps-table .comp-beds-baths {
  text-align: center;
}

.comps-table .comp-date {
  text-align: center;
  font-size: 0.9em;
  color: #666;
}

/* Responsive table */
@media (max-width: 768px) {
  .comps-table {
    font-size: 0.9em;
  }
  
  .comps-table th,
  .comps-table td {
    padding: 8px 6px;
  }
}

/* Comp selection styling */
.comp-select {
  text-align: center;
  width: 60px;
}

.comp-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

/* Comp Average Section */
.comp-average-section {
  margin: 20px 0;
  padding: 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.comp-average-display {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 500;
}

.comp-average-display span:first-child {
  color: #495057;
}

.average-value {
  font-size: 18px;
  font-weight: 700;
  color: #2e7d32;
  background: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #c8e6c9;
}

.comp-average-display span:last-child {
  color: #6c757d;
  font-size: 14px;
  font-weight: 400;
}

/* Responsive adjustments for comp selection */
@media (max-width: 768px) {
  .comp-select {
    width: 50px;
  }
  
  .comp-checkbox {
    width: 16px;
    height: 16px;
  }
  
  .comp-average-display {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .average-value {
    font-size: 16px;
  }
}
/* Property actions */
.property-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.property-actions button {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: #f5f5f5;
  cursor: pointer;
  border-radius: 4px;
}

.property-actions button:hover {
  background: #e5e5e5;
}

/* Math section styles */
.math-row {
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.math-row label {
  min-width: 120px;
  font-weight: 500;
}
.math-row input {
  max-width: 100px;
  padding: 4px 8px;
}

/* Field validation styling for equations */
.input-group input.field-required-empty {
  background-color: #ff6b6b !important;
  border-color: #e74c3c !important;
}

.input-group input.field-optional-empty {
  background-color: #ffa07a !important;
  border-color: #ff7f50 !important;
}

.input-group input.field-filled {
  background-color: white !important;
  border-color: #ced4da !important;
}

.math-row input.field-required-empty {
  background-color: #ff6b6b !important;
  border-color: #e74c3c !important;
}

.math-row input.field-optional-empty {
  background-color: #ffa07a !important;
  border-color: #ff7f50 !important;
}

.math-row input.field-filled {
  background-color: white !important;
  border-color: #ddd !important;
}

#mao-result {
  font-size: 1.2em;
  color: #006600;
  font-weight: bold;
}

/* Equations Module Styling */
.equations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.equation-form {
  margin: 0;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  min-height: 400px;
}

.equation-form h3 {
  margin-top: 0;
  color: #495057;
  border-bottom: 2px solid #007bff;
  padding-bottom: 8px;
  font-size: 16px;
}

.equation-description {
  font-style: italic;
  color: #6c757d;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 4px;
  margin: 10px 0 20px 0;
  border-left: 4px solid #007bff;
  font-size: 14px;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.input-group label {
  flex-shrink: 0;
  min-width: 140px;
  font-weight: 500;
  color: #495057;
}

.input-group input {
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  padding: 6px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

.input-suffix {
  flex-shrink: 0;
  color: #6c757d;
  font-size: 14px;
  font-weight: 500;
}

.rental-sections {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 15px 0;
}

.rental-section {
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.rental-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #495057;
  font-size: 14px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 4px;
}

.calculation-display {
  margin: 15px 0;
  padding: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #dee2e6;
  font-size: 14px;
}

.calc-row:last-child {
  border-bottom: none;
}

.calc-row span:first-child {
  font-weight: 500;
  color: #495057;
}

.calc-row span:last-child {
  font-weight: 600;
  color: #28a745;
}

.total-row {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid #007bff;
  border-bottom: none;
}

.total-row span {
  font-size: 15px;
  font-weight: 700;
}

.total-row span:last-child {
  color: #007bff;
}

.final-mao-section {
  margin: 5px 0;
  padding: 15px;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-radius: 10px;
  text-align: center;
}

.mao-result-display {
  margin-bottom: 20px;
}

.mao-result-display span:first-child {
  font-size: 18px;
  font-weight: 600;
  margin-right: 15px;
}

.mao-value {
  font-size: 24px;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.3);
}

.mao-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.mao-actions button {
  min-width: 160px;
}

.mao-actions .primary {
  background: white;
  color: #007bff;
  border: 2px solid white;
}

.mao-actions .primary:hover {
  background: #f8f9fa;
}

.mao-actions .secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.mao-actions .secondary:hover {
  background: rgba(255,255,255,0.1);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .equations-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

@media (max-width: 768px) {
  .equations-grid {
    grid-template-columns: 1fr;
  }
  
  .equation-form {
    min-height: auto;
  }
  
  .mao-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .mao-actions button {
    width: 100%;
    max-width: 200px;
  }
  
  .calc-row {
    font-size: 13px;
  }
  
  .mao-result-display {
    flex-direction: column;
    gap: 10px;
  }
  
  .mao-value {
    font-size: 20px;
  }
  
  .rental-sections {
    gap: 10px;
  }
  
  .rental-section {
    padding: 10px;
  }
}

/* Reports Module Styling */
.report-options {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 15px 0;
}

.option-group h4 {
  margin: 0 0 10px 0;
  color: #495057;
  font-size: 16px;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: 5px;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.delivery-options {
  margin: 20px 0;
  padding: 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  background: #f8f9fa;
}

.radio-group input[type="radio"] {
  width: 16px;
  height: 16px;
}

.radio-group label:hover {
  background: #e9ecef;
}

.email-options {
  margin: 15px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.email-options .input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #495057;
}

.input-group input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.input-group .form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

.email-options label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #495057;
}

.email-options input,
.email-options textarea {
  width: 100% !important;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
}

.email-options input[type="email"],
.email-options input[type="text"],
.email-options textarea {
  width: 100% !important;
  display: block;
}

.email-options textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.4;
}

.report-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 30px 0;
  flex-wrap: wrap;
}

.report-actions button {
  min-width: 200px;
}

@media (max-width: 768px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
  
  .report-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .report-actions button {
    width: 100%;
    max-width: 300px;
  }
}

/* ===== PRICE OVERRIDES PAGE ===== */
.overrides-container {
  margin-top: 20px;
}

.overrides-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
}

.search-filter {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-filter input {
  width: 250px;
}

.search-filter select {
  width: 180px;
}

.override-actions {
  display: flex;
  gap: 10px;
}

.overrides-table-container {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 6px;
}

.line-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.line-items-table th {
  background: #f8f9fa;
  padding: 12px 8px;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
  position: sticky;
  top: 0;
  z-index: 10;
}

.line-items-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.line-items-table tr:hover {
  background: #f8f9fa;
}

.line-items-table tr.pending-change {
  background: #fff3cd;
}

.line-items-table tr.pending-change:hover {
  background: #ffeaa7;
}

.item-category {
  font-weight: 500;
  color: #6c757d;
  font-size: 12px;
  width: 120px;
}

.item-name {
  font-weight: 500;
  width: 300px;
}

.item-unit {
  color: #6c757d;
  font-size: 12px;
  width: 80px;
}

.item-default-price {
  font-family: monospace;
  color: #495057;
  width: 100px;
}

.item-override-price {
  width: 120px;
}

.override-price-input {
  width: 100px;
  padding: 4px 6px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: monospace;
}

.override-price-input:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.item-actions {
  width: 80px;
  text-align: center;
}

.clear-override-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.clear-override-btn:hover {
  background: #c82333;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  margin: 0;
}

@media (max-width: 768px) {
  .overrides-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-filter {
    flex-direction: column;
  }
  
  .search-filter input,
  .search-filter select {
    width: 100%;
  }
  
  .override-actions {
    justify-content: center;
  }
  
  .line-items-table {
    font-size: 12px;
  }
  
  .line-items-table th,
  .line-items-table td {
    padding: 8px 4px;
  }
  
  .item-name {
    width: auto;
    min-width: 200px;
  }
}

/* Category buttons styling */
.category-button-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.category-btn {
  padding: 10px 16px;
  border: 2px solid #ddd;
  background: #f8f9fa;
  color: #333;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.category-btn:hover {
  background: #e9ecef;
  border-color: #bbb;
}

.category-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.category-btn.selected:hover {
  background: #1e7e34; /* Darker shade of green accent */
  border-color: #1e7e34;
}

/* Sub-category header styling */
.sub-category-header {
  background: #f8f9fa !important;
}

.sub-category-title {
  font-weight: bold;
  color: #495057;
  background: #e9ecef;
  padding: 12px 8px !important;
  border-top: 2px solid #007bff;
  border-bottom: 1px solid #dee2e6;
  font-size: 1.1em;
}

/* Edit form styling */
.edit-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #495057;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row .form-group {
  margin-bottom: 16px;
}

.form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6c757d;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #dee2e6;
}

.form-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.form-actions .primary {
  background: var(--accent);
  color: var(--white);
}

.form-actions .primary:hover {
  background: #1e7e34; /* Darker green accent */
}

.form-actions .secondary {
  background: #6c757d;
  color: white;
}

.form-actions .secondary:hover {
  background: #545b62;
}
/* Settings Page Styling */
.settings-container {
  max-width: 800px;
  margin: 0 auto;
}

.settings-section {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.settings-section h3 {
  margin: 0 0 20px 0;
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
  border-bottom: 2px solid var(--light);
  padding-bottom: 8px;
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item:last-child {
  margin-bottom: 0;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.display-value {
  background: var(--light);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 16px;
  color: var(--text);
  font-family: 'Courier New', monospace;
  word-break: break-all;
}

.affiliate-code-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.affiliate-code-display .display-value {
  flex: 1;
  margin: 0;
}

.affiliate-link-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-link-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Courier New', monospace;
  background: var(--light);
  color: var(--text);
}

.copy-btn {
  background: var(--secondary);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  min-width: 40px;
  transition: background-color 0.2s;
}

.copy-btn:hover {
  background: var(--primary);
}

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #6c757d;
  font-style: italic;
}

/* Responsive form */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .edit-form {
    margin: 0 10px;
  }
}

/* Info popup button styling */
.info-popup-btn {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.1s ease;
  vertical-align: middle;
}

.info-popup-btn:hover {
  background-color: #0056b3;
  transform: scale(1.1);
}

.info-popup-btn:active {
  transform: scale(0.95);
}

.info-popup-btn:focus {
  outline: 2px solid #80bdff;
  outline-offset: 2px;
}

/* ========================================================================
   MEDIA FUNCTIONALITY STYLES
   ======================================================================== */

/* Media column styling */
.media-column {
  width: 60px;
  text-align: center;
  padding: 8px 4px;
}

.media-toggle-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.media-toggle-btn:hover {
  background: #f0f0f0;
  border-color: #007bff;
}

.media-toggle-btn.expanded {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.media-toggle-icon {
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.media-toggle-btn.expanded .media-toggle-icon {
  transform: rotate(180deg);
}

/* Media count badge */
.media-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #dc3545;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: bold;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Media toggle button with media */
.media-toggle-btn.has-media {
  background: #28a745;
  color: white;
  border-color: #28a745;
  position: relative;
}

.media-toggle-btn.has-media:hover {
  background: #218838;
  border-color: #1e7e34;
}

/* Media expansion content */
.media-expansion-content {
  padding: 16px;
  background: #f8f9fa;
  border-top: 2px solid #e9ecef;
}

.media-controls {
  max-width: 100%;
  font-size: 14px;
}

/* Media buttons row */
.media-buttons-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.media-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease;
}

.media-btn:hover {
  background: var(--secondary);
}

.media-btn span {
  font-size: 16px;
}

/* Voice controls */
.voice-controls {
  margin-top: 12px;
  padding: 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.voice-recording-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.record-btn, .stop-btn, .play-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.record-btn {
  background: #dc3545;
  color: white;
}

.record-btn:hover:not(:disabled) {
  background: #c82333;
}

.stop-btn {
  background: #6c757d;
  color: white;
}

.stop-btn:hover:not(:disabled) {
  background: #5a6268;
}

.play-btn {
  background: var(--accent);
  color: white;
}

.play-btn:hover:not(:disabled) {
  background: #218838;
}

.record-btn:disabled, .stop-btn:disabled, .play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.recording-time {
  font-weight: bold;
  font-family: 'Courier New', monospace;
  font-size: 16px;
  min-width: 50px;
}

.recording-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.recording-status.recording {
  background: #dc3545;
  color: white;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Transcription area */
.transcription-area {
  margin-top: 12px;
}

.transcription-area label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.transcription-text {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  resize: vertical;
}

/* Camera controls */
.camera-controls {
  margin-top: 12px;
  padding: 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.camera-area {
  text-align: center;
}

.camera-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.photo-canvas {
  display: none;
}

.camera-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.capture-btn, .start-video-btn, .stop-video-btn, .close-camera-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.capture-btn, .start-video-btn {
  background: var(--accent);
  color: white;
}

.capture-btn:hover, .start-video-btn:hover {
  background: #218838;
}

.stop-video-btn {
  background: #dc3545;
  color: white;
}

.stop-video-btn:hover {
  background: #c82333;
}

.close-camera-btn {
  background: #6c757d;
  color: white;
}

.close-camera-btn:hover {
  background: #5a6268;
}

/* Media gallery */
.media-gallery {
  margin-top: 16px;
  padding: 16px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.media-loading, .no-media, .media-error {
  text-align: center;
  padding: 20px;
  color: #6c757d;
  font-style: italic;
}

.upload-progress {
  text-align: center;
  padding: 20px;
  color: var(--primary);
  font-weight: bold;
}

.media-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.media-item {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  background: #f8f9fa;
  transition: box-shadow 0.2s ease;
}

.media-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.media-thumbnail {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.media-thumbnail.video-thumb::after {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.video-placeholder, .voice-placeholder {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: #e9ecef;
  border-radius: 4px;
  margin-bottom: 6px;
  color: #6c757d;
}

.media-info {
  font-size: 12px;
}

.media-name {
  font-weight: bold;
  margin-bottom: 4px;
  word-break: break-word;
}

.media-duration {
  color: #6c757d;
  margin-bottom: 4px;
}

.media-transcription {
  background: #fff;
  padding: 6px;
  border-radius: 3px;
  margin: 4px 0;
  font-style: italic;
  max-height: 60px;
  overflow-y: auto;
  font-size: 11px;
}

.media-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;
}

.media-play-btn, .media-delete-btn {
  padding: 3px 6px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.media-play-btn {
  background: var(--accent);
  color: white;
}

.media-play-btn:hover {
  background: #218838;
}

.media-delete-btn {
  background: #dc3545;
  color: white;
}

.media-delete-btn:hover {
  background: #c82333;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .media-column {
    width: 50px;
    padding: 6px 2px;
  }
  
  .media-toggle-btn {
    padding: 6px;
    font-size: 14px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .media-buttons-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .media-btn {
    justify-content: center;
  }
  
  .voice-recording-area {
    justify-content: center;
  }
  
  .camera-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .media-items {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .camera-preview {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .media-column {
    width: 45px;
    padding: 4px 1px;
  }
  
  .media-toggle-btn {
    padding: 4px;
    font-size: 16px;
    min-width: 36px;
    min-height: 36px;
  }
  
  .media-count {
    width: 16px;
    height: 16px;
    font-size: 9px;
    top: -4px;
    right: -4px;
  }
  
  /* Force media column to stay visible on phones */
  .line-items-table .media-column {
    min-width: 45px !important;
    width: 45px !important;
    position: sticky !important;
    right: 0 !important;
    background: white !important;
    z-index: 1 !important;
  }
  
  .line-items-table th.media-column {
    min-width: 45px !important;
    width: 45px !important;
    position: sticky !important;
    right: 0 !important;
    background: #f0f8ff !important;
    z-index: 2 !important;
  }
  
  .media-items {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
  }
  
  .media-expansion-content {
    padding: 12px;
  }
}
