/* Dashboard Layout Styles */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --sidebar-width: 280px;
  --header-height: 64px;
}

body { 
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  margin: 0;
  overflow-x: hidden;
}

.main-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #1e293b 0%, #334155 100%);
  color: white;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 1000;
  overflow-y: auto;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.header {
  background: white;
  height: var(--header-height);
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.content-area {
  padding: 2rem;
  max-width: none;
  width: 100%;
}

/* Appointment Form Styles */
.appointment-layout {
  width: 100%;
  max-width: none;
}

.appointment-form-column {
  flex: 0 0 35%;
  max-width: 500px;
  min-width: 350px;
}

.calendar-column {
  flex: 1;
  min-width: 0;
}

.calendar-iframe {
  width: 100%;
  height: 800px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

/* Appointments Index Layout */
.appointment-index-layout {
  display: flex;
  gap: 1.5rem;
  width: 100%;
}

.appointment-main-content {
  flex: 1;
  min-width: 0;
  transition: all 0.3s ease;
}

.appointment-calendar-sidebar {
  width: 50%;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.appointment-calendar-sidebar.hidden {
  display: none;
}

/* Quick Filter Buttons - Override Tailwind */
a.quick-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 20px !important;
  background-color: #ffffff !important;
  color: #374151 !important;
  border: 2px solid #d1d5db !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  margin: 0 !important;
}

a.quick-filter-btn:hover {
  background-color: #f9fafb !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
  transform: translateY(-1px) !important;
}

a.quick-filter-btn.active {
  background-color: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 4px 0 rgba(59, 130, 246, 0.3) !important;
}

a.quick-filter-btn.active:hover {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: white !important;
  box-shadow: 0 2px 4px 0 rgba(37, 99, 235, 0.4) !important;
}

/* Action Button Styles - Override Tailwind reset with maximum specificity */
form button[type="submit"].bg-purple-600,
button[type="submit"].bg-purple-600,
button.bg-purple-600,
form[action*="convert_to_representative"] button,
form[action*="convert_to_representative"] button[type="submit"],
form[action*="convert_to_representative"] input[type="submit"] {
  background-color: #9333ea !important;
  color: #000000 !important;
  border-color: #9333ea !important;
  opacity: 1 !important;
}

form button[type="submit"].bg-purple-600:hover,
button[type="submit"].bg-purple-600:hover,
button.bg-purple-600:hover,
form[action*="convert_to_representative"] button:hover,
form[action*="convert_to_representative"] button[type="submit"]:hover,
form[action*="convert_to_representative"] input[type="submit"]:hover {
  background-color: #7e22ce !important;
  color: #000000 !important;
  border-color: #7e22ce !important;
}

/* Mobile Menu Styles (hidden by default for desktop-first) */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  color: #6b7280;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.mobile-menu-button:hover {
  background-color: #f3f4f6;
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Responsive Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Truly Responsive Table Styles */
.responsive-table {
  width: 100%;
  table-layout: auto;
  word-wrap: break-word;
  word-break: break-word;
}

.responsive-table th,
.responsive-table td {
  padding: 12px 8px;
  vertical-align: top;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

.responsive-table .col-checkbox {
  width: 40px;
  min-width: 40px;
  flex-shrink: 0;
}

.responsive-table .col-date {
  width: 120px;
  min-width: 100px;
}

.responsive-table .col-client {
  width: 200px;
  min-width: 150px;
}

.responsive-table .col-entity {
  width: 80px;
  min-width: 60px;
}

.responsive-table .col-price {
  width: 80px;
  min-width: 70px;
}

.responsive-table .col-status {
  width: 100px;
  min-width: 80px;
}

.responsive-table .col-invoice {
  width: 120px;
  min-width: 100px;
}

.responsive-table .col-actions {
  width: 80px;
  min-width: 70px;
}

/* Text wrapping utilities */
.text-wrap {
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
}

.text-truncate-responsive {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}

/* Flexible container */
.table-container {
  width: 100%;
  overflow: visible;
  margin: 0;
  padding: 0;
}

/* Entity Color System - CSP Compliant */
.entity-card {
  border-left-color: var(--entity-color, #3B82F6) !important;
}

.entity-color-indicator {
  background-color: var(--entity-color, #3B82F6) !important;
}

.entity-color-preview {
  background-color: var(--entity-color, #3B82F6) !important;
}

.entity-color-badge {
  background-color: rgba(var(--entity-color-rgb, 59, 130, 246), 0.1) !important;
  color: var(--entity-color, #3B82F6) !important;
}

.entity-border-accent {
  border-left: 4px solid var(--entity-color, #3B82F6) !important;
}

/* Standard Tailwind Responsive Tables - No custom CSS needed */

/* Responsive design */
@media (max-width: 1024px) {
  .appointment-index-layout {
    flex-direction: column;
  }

  .appointment-calendar-sidebar {
    width: 100%;
  }

  .calendar-iframe {
    height: 400px;
  }
}

/* Tablet and smaller screens */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  .mobile-menu-button {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    transition: margin-left 0.3s ease-in-out;
  }

  .content-area {
    padding: 1rem;
  }

  .header {
    padding: 0 1rem;
  }

  /* Table adjustments for mobile */
  table {
    font-size: 14px;
  }

  .table-fixed {
    table-layout: auto;
    min-width: 600px; /* Ensure horizontal scroll on very small screens */
  }

  td, th {
    padding: 12px 8px !important;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include
 * the files in this directory.
 *


 */

/* Reset and base styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
}

/* Appointments Index Layout */
.appointment-index-layout {
  display: flex;
  gap: 1.5rem;
  width: 100%;
}

.appointment-main-content {
  flex: 1;
  min-width: 0;
}

.appointment-calendar-sidebar {
  width: 400px;
  flex-shrink: 0;
}

/* Quick Filter Buttons */
a.quick-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.625rem 1.25rem !important;
  background-color: #ffffff !important;
  color: #374151 !important;
  border: 2px solid #d1d5db !important;
  border-radius: 0.5rem !important;
  text-decoration: none !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

a.quick-filter-btn:hover {
  background-color: #f9fafb !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

a.quick-filter-btn.active {
  background-color: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 4px 0 rgba(59, 130, 246, 0.3) !important;
}

a.quick-filter-btn.active:hover {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  color: white !important;
  box-shadow: 0 2px 4px 0 rgba(37, 99, 235, 0.4) !important;
}

/* Calendar iframe */
.calendar-iframe {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 0.5rem;
}

/* Responsive design */
@media (max-width: 1024px) {
  .appointment-index-layout {
    flex-direction: column;
  }
  
  .appointment-calendar-sidebar {
    width: 100%;
  }
  
  .calendar-iframe {
    height: 400px;
  }
}
