/**
 * Dialog System CSS - Responsive Modal Component
 * 
 * Features:
 * - Fully responsive (mobile to 4K)
 * - Zoom-resilient (150%+ zoom support)
 * - Scrollable content area
 * - Accessible focus states
 * - Print-friendly
 * 
 * Uses rem units for all sizing to respect browser zoom/accessibility settings.
 */

/* ============================================================================
   Backdrop / Overlay
   ============================================================================ */

.dialog-system-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dialog-system-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================================================
   Modal Container (Main Dialog)
   ============================================================================ */

.dialog-system-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.15);
  
  /* Sizing - respects zoom via rem units */
  width: 90vw;
  max-width: 90rem;
  height: auto;
  max-height: 90vh;
  
  /* Flex layout for header/content/footer structure */
  display: flex;
  flex-direction: column;
  
  z-index: 10201;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.dialog-system-modal.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* Tablet/small screens: reduce padding, adjust width */
@media (max-width: 48rem) {
  .dialog-system-modal {
    width: 95vw;
    max-height: 95vh;
    border-radius: 0.5rem;
  }
}

/* Mobile: full width with safe area padding */
@media (max-width: 25rem) {
  .dialog-system-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    top: 50%;
    left: 50%;
    border-radius: 0.375rem;
  }
}

/* ============================================================================
   Modal Header
   ============================================================================ */

.dialog-system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  /* Fixed height header prevents content shift */
  flex-shrink: 0;
  
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  
  /* Gradient background for visual hierarchy */
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Header icon (optional) */
.dialog-system-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.dialog-system-header-icon svg {
  width: 2rem;
  height: 2rem;
  color: #ffffff;
}

/* Header text container */
.dialog-system-header-text {
  flex: 1;
  min-width: 0; /* Allows text truncation */
}

/* Header title */
.dialog-system-title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  word-wrap: break-word;
  line-height: 1.2;
}

/* Header subtitle */
.dialog-system-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 1.3125rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

/* Close button */
.dialog-system-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 2.25rem;
  cursor: pointer;
  padding: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.375rem;
  margin-left: 1rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dialog-system-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.dialog-system-close:active {
  background-color: rgba(255, 255, 255, 0.3);
}

.dialog-system-close:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

/* Responsive header padding */
@media (max-width: 48rem) {
  .dialog-system-header {
    padding: 1rem;
  }

  .dialog-system-title {
    font-size: 1.875rem;
  }

  .dialog-system-close {
    width: 2rem;
    height: 2rem;
  }
}

/* ============================================================================
   Modal Content Area (Scrollable)
   ============================================================================ */

.dialog-system-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  
  /* Smooth scrolling */
  scroll-behavior: smooth;
  
  /* Scrollbar styling (modern browsers) */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}
.dialog-system-content h1, 
.dialog-system-content h2, 
.dialog-system-content h3 {
  margin: 0 0 1rem 0;
}

/* Firefox scrollbar */
.dialog-system-content::-webkit-scrollbar {
  width: 0.5rem;
}

.dialog-system-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0.25rem;
}

.dialog-system-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 0.25rem;
}

.dialog-system-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive content padding */
@media (max-width: 48rem) {
  .dialog-system-content {
    padding: 1rem;
  }
}

/* ============================================================================
   Modal Footer
   ============================================================================ */

.dialog-system-footer {
  flex-shrink: 0;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
  
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Responsive footer */
@media (max-width: 48rem) {
  .dialog-system-footer {
    padding: 1rem;
    justify-content: space-between;
  }
}

/* ============================================================================
   Content Sections
   ============================================================================ */

.dialog-system-section {
  margin-bottom: 1.5rem;
}

.dialog-system-section:last-child {
  margin-bottom: 0;
}

/* Section heading */
.dialog-system-section-title {
  display: flex;
  align-items: center;
  font-size: 1.6875rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.dialog-system-section-title svg {
  width: 1.875rem;
  height: 1.875rem;
  color: #2563eb;
  flex-shrink: 0;
}

/* ============================================================================
   Grid Layouts
   ============================================================================ */

/* 2-column grid for info cards */
.dialog-system-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 48rem) {
  .dialog-system-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* 3-column grid for more items */
.dialog-system-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 48rem) {
  .dialog-system-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Info Cards
   ============================================================================ */

.dialog-system-card {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.dialog-system-card.info {
  background-color: #f0f9ff;
  border-color: #bfdbfe;
  margin-bottom: 0.75rem;
}

.dialog-system-card.warning {
  background-color: #fffbeb;
  border-color: #fde68a;
  margin-bottom: 0.75rem;
}

.dialog-system-card.success {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  margin-bottom: 0.75rem;
}

.dialog-system-card.danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  margin-bottom: 0.75rem;
}

/* Card label */
.dialog-system-card-label {
  font-size: 1.125rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.dialog-system-card.info .dialog-system-card-label {
  color: #0369a1;
}

.dialog-system-card.warning .dialog-system-card-label {
  color: #92400e;
}

.dialog-system-card.success .dialog-system-card-label {
  color: #166534;
}

.dialog-system-card.danger .dialog-system-card-label {
  color: #991b1b;
}

/* Card value */
.dialog-system-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  word-break: break-word;
}

.dialog-system-card.info .dialog-system-card-value {
  color: #0c4a6e;
}

.dialog-system-card.warning .dialog-system-card-value {
  color: #78350f;
}

.dialog-system-card.success .dialog-system-card-value {
  color: #15803d;
}

.dialog-system-card.danger .dialog-system-card-value {
  color: #7f1d1d;
}

/* Card description (long text) */
.dialog-system-card-description {
  font-size: 1.3rem;
  color: #4b5563;
  line-height: 1.5;
  word-break: break-word;
}

.dialog-system-card.warning .dialog-system-card-description {
  color: #92400e;
}

.dialog-system-card.danger .dialog-system-card-description {
  color: #991b1b;
}

.dialog-system-card.info .dialog-system-card-description {
  color: #0555a3;
}

/* ============================================================================
   Tables (for cost breakdown, options, etc.)
   ============================================================================ */

.dialog-system-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.dialog-system-table thead {
  background-color: #f3f4f6;
  border-bottom: 2px solid #e5e7eb;
}

.dialog-system-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
}

.dialog-system-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.dialog-system-table tbody tr:last-child {
  border-bottom: none;
}

.dialog-system-table tbody tr:hover {
  background-color: #f9fafb;
}

.dialog-system-table td {
  font-size: 1.5rem;
  padding: 0.75rem;
  color: #1f2937;
  word-break: break-word;
}

.dialog-vat-total, .dialog-net-total, .dialog-summary {
  font-size: 1.5rem;
}
.dialog-total-amount {
  font-size: 1.75rem;
  font-weight: 700;
}

/* Table section header (like "Position", "Options", "Articles") */
.dialog-system-table tbody tr.table-section {
  background-color: #eff6ff;
  border: none;
  font-weight: 600;
  color: #0369a1;
}

.dialog-system-table tbody tr.table-section td {
  padding: 0.5rem 0.75rem;
}

/* Right-aligned columns (prices, amounts) */
.dialog-system-table th.text-right,
.dialog-system-table td.text-right {
  text-align: right;
}

/* Center-aligned columns */
.dialog-system-table th.text-center,
.dialog-system-table td.text-center {
  text-align: center;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.dialog-system-button {
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 1.3rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  user-select: none;
}

/* Primary button (confirm, submit) */
.dialog-system-button.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #1d4ed8;
}

.dialog-system-button.primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 0.25rem 0.75rem rgba(37, 99, 235, 0.3);
}

.dialog-system-button.primary:active {
  transform: translateY(1px);
  box-shadow: 0 0.125rem 0.375rem rgba(37, 99, 235, 0.2);
}

.dialog-system-button.primary:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

/* Secondary button (cancel, back) */
.dialog-system-button.secondary {
  background-color: #ffffff;
  color: #374151;
  border-color: #d1d5db;
}

.dialog-system-button.secondary:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

.dialog-system-button.secondary:active {
  background-color: #e5e7eb;
}

.dialog-system-button.secondary:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Danger button (delete) */
.dialog-system-button.danger {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.dialog-system-button.danger:hover {
  background-color: #fecaca;
  border-color: #f87171;
}

.dialog-system-button.danger:active {
  background-color: #f87171;
}

/* Disabled state */
.dialog-system-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================================
   Tags / Badges
   ============================================================================ */

.dialog-system-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.dialog-system-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: #dbeafe;
  color: #0369a1;
  border-radius: 9999px;
  font-size: 1.3rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ============================================================================
   Mobile Bottom Sheet
   ============================================================================ */

/* Convert to bottom sheet on mobile for better UX and safe area support */
@media (max-width: 768px) {
  .dialog-system-modal {
    /* Bottom sheet positioning */
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    
    /* Slide up animation instead of scale */
    transform: translateY(100%) !important;
    
    /* Full width with rounded top corners */
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0;
    
    /* Max height with safe area support */
    max-height: calc(90vh - var(--safe-bottom, 0px));
    
    /* Safe area support - extend background into bottom safe area */
    padding-bottom: var(--safe-bottom, 0px);
    
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
  
  .dialog-system-modal.visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
  }
  
  /* Add mobile pull indicator */
  .dialog-system-modal .dialog-system-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
  }
  
  .dialog-system-header {
    padding-top: 24px; /* Extra space for pull indicator */
  }
  
  /* Adjust content height for safe area */
  .dialog-system-content {
    max-height: calc(90vh - 200px - var(--safe-bottom, 0px));
    font-size: 16px; /* Prevent zoom on iOS */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  /* Ensure form inputs don't trigger zoom */
  .dialog-system-content input,
  .dialog-system-content textarea,
  .dialog-system-content select {
    font-size: 16px; /* Prevent zoom on iOS */
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Stack footer buttons vertically on mobile */
  .dialog-system-footer {
    flex-direction: column;
    align-items: stretch;
  }
  
  .dialog-system-footer button {
    width: 100%;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .dialog-system-backdrop {
    display: none;
  }

  .dialog-system-modal {
    position: static;
    transform: none;
    width: 100%;
    max-width: 100%;
    max-height: none;
    box-shadow: none;
    border-radius: 0;
    opacity: 1;
    visibility: visible;
  }

  .dialog-system-header {
    background: #ffffff;
    border-bottom: 2px solid #000;
  }

  .dialog-system-close {
    display: none;
  }

  .dialog-system-footer {
    display: none;
  }
}

/* ============================================================================
   Accessibility
   ============================================================================ */

/* High contrast mode support */
@media (prefers-contrast: more) {
  .dialog-system-backdrop {
    background-color: rgba(0, 0, 0, 0.8);
  }

  .dialog-system-modal {
    border: 2px solid #000;
  }

  .dialog-system-header {
    border-bottom: 2px solid #000;
  }

  .dialog-system-footer {
    border-top: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .dialog-system-backdrop,
  .dialog-system-modal,
  .dialog-system-close,
  .dialog-system-button {
    transition: none;
  }

  .dialog-system-content {
    scroll-behavior: auto;
  }
}

/* Dark mode support (optional)
@media (prefers-color-scheme: dark) {
  .dialog-system-modal {
    background-color: #1f2937;
    color: #f3f4f6;
  }

  .dialog-system-header {
    border-bottom-color: #374151;
  }

  .dialog-system-title {
    color: #f3f4f6;
  }

  .dialog-system-footer {
    background-color: #111827;
    border-top-color: #374151;
  }

  .dialog-system-card {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
  }

  .dialog-system-table {
    border-color: #4b5563;
  }

  .dialog-system-table thead {
    background-color: #374151;
    border-bottom-color: #4b5563;
  }

  .dialog-system-table tbody tr:hover {
    background-color: #1f2937;
  }

  .dialog-system-table tbody tr.table-section {
    background-color: #1f2937;
  }
}
*/

/* ============================================================================
   Form Styling
   ============================================================================ */

.dialog-system-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.dialog-system-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 48rem) {
  .dialog-system-form-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Labels */
.dialog-system-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
  font-size: 1.425rem;
  margin-top:1.5rem;
}

.required {
  color: #ef4444;
  margin-left: 0.25rem;
}

/* Input Fields */
.dialog-system-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1.5rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.dialog-system-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dialog-system-input[type="textarea"],
textarea.dialog-system-input {
  resize: vertical;
  min-height: 6rem;
}

.dialog-system-input:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Input Error State */
.dialog-system-form-group.has-error .dialog-system-input {
  border-color: #ef4444;
  background-color: #fef2f2;
}

/* Subsections (for extended items) */
.dialog-system-subsection {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.375rem;
  border-left: 3px solid #3b82f6;
}

.dialog-system-subsection-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Checkbox Groups */
.dialog-system-checkbox-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
}

.dialog-system-checkbox-group:hover {
  background-color: #f9fafb;
}

.dialog-system-checkbox-group.dialog-system-checkbox-clickable {
  cursor: pointer;
}

.dialog-system-checkbox-group.dialog-system-checkbox-clickable:hover {
  background-color: #f3f4f6;
}

.dialog-system-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex: 1;
  margin: 0;
  font-weight: 400;
  color: #1f2937;
}

.dialog-system-checkbox-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.dialog-system-option-price {
  font-weight: 600;
  color: #059669;
  font-size: 1.3rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* Options List */
.dialog-system-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 20rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Articles List */
.dialog-system-articles-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.dialog-system-article-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
}

.article-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.article-meta {
  font-size: 1.15rem;
  color: #6b7280;
}

.article-total {
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
}

/* Cost Breakdown Table */
.cost-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.cost-breakdown-table thead {
  background-color: #f3f4f6;
}

.cost-breakdown-table thead th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 1.35rem;
  color: #374151;
  border-bottom: 2px solid #d1d5db;
}

.cost-breakdown-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1.425rem;
}

.cost-breakdown-table tbody tr.table-section {
  background-color: #f9fafb;
  font-weight: 500;
}

.cost-breakdown-table tbody tr:hover {
  background-color: #f9fafb;
}

.cost-breakdown-table tfoot {
  background-color: #f3f4f6;
}

.cost-breakdown-table tfoot tr {
  border-top: 1px solid #d1d5db;
}

.cost-breakdown-table .totals-row {
  padding: 0.5rem 0.75rem;
}

.cost-breakdown-table .grand-total-row {
  border-top: 2px solid #3b82f6;
  font-weight: 700;
  color: #1f2937;
  background-color: #eff6ff;
}

.cost-breakdown-table .grand-total-row td {
  padding: 1rem 0.75rem;
}

/* Form Error States */
.dialog-system-form-group.has-error {
  position: relative;
}

.dialog-system-form-group.has-error .dialog-system-input,
.dialog-system-form-group.has-error .dialog-system-textarea,
.dialog-system-form-group.has-error .dialog-system-select {
  border-color: #ef4444;
  background-color: #fef2f2;
}

.dialog-system-form-group.has-error .dialog-system-input:focus,
.dialog-system-form-group.has-error .dialog-system-textarea:focus,
.dialog-system-form-group.has-error .dialog-system-select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error {
  display: none;
  color: #dc2626;
  font-size: 1.25rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
  font-weight: 500;
}

.dialog-system-form-group.has-error .form-error {
  display: block;
}

/* Form Submission States */
[data-action="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Responsive Table */
@media (max-width: 48rem) {
  .cost-breakdown-table {
    font-size: 0.85rem;
  }
  
  .cost-breakdown-table thead th,
  .cost-breakdown-table tbody td {
    padding: 0.5rem;
  }
}

/* ============================================================================
   Booking Type Header Color Variants
   ============================================================================ */

/* Booking (Red) */
.dialog-system-modal.booking-type-booking .dialog-system-header {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Reservation (Blue) */
.dialog-system-modal.booking-type-reservation .dialog-system-header {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

/* Cloned Reservation (Purple) */
.dialog-system-modal.booking-type-cloned-reservation .dialog-system-header {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

/* Deleted Cloned Reservation (Purple) */
.dialog-system-modal.booking-type-deleted-cloned-reservation .dialog-system-header {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

/* Preliminary Booking (Orange) */
.dialog-system-modal.booking-type-preliminary .dialog-system-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Preliminary Booking - Alternative format (Orange) */
.dialog-system-modal.booking-type-preliminary-booking .dialog-system-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Inactive Preliminary Booking (Gray) */
.dialog-system-modal.booking-type-inactive-preliminary .dialog-system-header {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

/* Deleted Preliminary Booking (Orange) */
.dialog-system-modal.booking-type-deleted-preliminary .dialog-system-header {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Deleted Booking (Red) */
.dialog-system-modal.booking-type-deleted-booking .dialog-system-header {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Registration (Green) */
.dialog-system-modal.booking-type-registration .dialog-system-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Deleted Registration (Green) */
.dialog-system-modal.booking-type-deleted-registration .dialog-system-header {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* ============================================================================
   Message Icon Styles
   ============================================================================ */

.message-icon {
  display: inline-block;
  width: 2.5rem;
  height: 2.5rem;
  color: #2563eb;
  cursor: pointer;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.message-icon:hover {
  color: #1d4ed8;
  transform: scale(1.1);
}

.message-icon:active {
  transform: scale(0.95);
}

.open-arranger-message {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.open-arranger-message:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

.open-arranger-message:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ============================================================================
   User Search Results Dropdown
   ============================================================================ */

.user-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
  max-height: 15rem;
  overflow-y: auto;
  z-index: 1000;
  margin-top: -0.0625rem;
}

.user-search-result {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.15s ease;
  color: #1f2937;
  font-size: 1.5rem;
}

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

.user-search-result:hover {
  background-color: #f3f4f6;
}

.user-search-result:active {
  background-color: #e5e7eb;
}

/* Position input container for user search */
.dialog-system-form-group {
  position: relative;
}