/* ==============================
   TICKETS PAGE SPECIFIC STYLES
   ============================== */

/* --- General Layout & Reusable Components --- */

/* Dashboard Styles */
.dashboard-header {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    background: #f5f0eb;
    padding: 8px 20px;
    margin-left: -20px;
    margin-right: -20px;
    border-bottom: 1px solid #e5ddd5;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

#welcomeMessage {
    display: none;
}

.header-actions {
  width: 100%;
}

/* Search bar grows to fill remaining space */
.header-actions .search-container-global {
    flex: 1;
    min-width: 100px;
}

/* Space below sticky toolbar so first ticket isn't hidden */
.tickets-list {
    margin-top: 16px;
}

/* Tickets List */
.tickets-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* Empty state */
.empty-tickets {
    text-align: center;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.empty-tickets h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Ticket Card Styles */
.ticket-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
    box-shadow: var(--box-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    padding: 16px;
}

.ticket-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.ticket-card:active {
    cursor: grabbing;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.ticket-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    padding-right: 10px;
}

.ticket-creator {
    font-size: 12px;
    color: #777;
    margin-bottom: 10px;
}

.ticket-due-date {
    font-size: 12px;
    color: var(--primary-color);
    margin-top: 5px;
}

/* Status Items */
.ticket-status-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 15px;
}

.status-item {
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.status-item.completed {
    background-color: #7e7465;
    color: white;
}

.status-item.pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
    opacity: 0.7;
}

.status-bullet {
    margin-right: 5px;
    font-size: 14px;
}

/* Ticket Notes */
.ticket-notes {
    background-color: var(--light-bg);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.ticket-notes-title {
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 5px;
}

.ticket-notes-content {
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Ticket Actions */
.ticket-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ticket-actions button {
    background-color: #7e7465;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.ticket-actions button:hover {
    background-color: var(--primary-color);
    color: white;
}

.delete-btn {
    background-color: #d32f2f !important;
}

.delete-btn:hover {
    background-color: #b71c1c !important;
}

/* Drag and Drop Styles */
.sortable-ghost {
    opacity: 0.4;
    transform: scale(0.95);
}

.sortable-chosen {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.color-btn {
    background-color: #f0f0f0;
    color: #333;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.color-btn:hover {
    background-color: #e0e0e0;
}

.bank-btn {
    background-color: #9c27b0;  /* Purple color to distinguish from other buttons */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bank-btn:hover {
    background-color: #7b1fa2;  /* Darker purple on hover */
}

.ticket-card.color-1 {
    background-color: #b9c5c5;
}

.ticket-card.color-2 {
    background-color: #dcb6af;
}

.ticket-card.color-3 {
    background-color: #f9efe0;
}

.ticket-card.color-4 {
    background-color: #8e8e8e;
}

.ticket-card.color-5 {
    background-color: #8fac8f;
}

/* --- Modal & Form Styles --- */

/* Common form-group styles */
.form-group {
    margin-bottom: 6px; /* Default value */
}

.form-group label {
    display: block;
    margin-bottom: 2px; /* Default value */
    font-size: 10px;
}

/* Form input and textarea styles */
#ticketTitle,
#dueDate,
#ticketNotes {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
}

#ticketTitle {
    height: 44px;
    font-size: 16px;
}

#dueDate {
    height: 44px;
    font-size: 16px;
}

#ticketNotes {
    min-height: 150px;
    font-size: 16px;
    line-height: 1.4;
    resize: vertical;
}

/* Checkbox Container Setup */
.checkboxes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    min-width: 12px;
    min-height: 12px;
}

.checkbox-group label {
    font-size: 13px;
}

/* Notes Container */
.notes-container {
    grid-column: 1 / -1; /* Span full width */
    width: 100%;
    box-sizing: border-box;
    margin-top: 0px;
    margin-bottom: 0px;
}

/* Color swatch picker (ticket edit modal + calendar ticket modal) */
/* Namespaced with tk- prefix to avoid clashing with the unrelated .color-swatch
   class used by the sticky-note color picker in board.css */
.tk-color-swatch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.tk-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
    transition: transform 0.12s ease, border-color 0.12s ease;
}

.tk-color-swatch:hover {
    transform: scale(1.12);
}

.tk-color-swatch.selected {
    border-color: #7a6855;
    box-shadow: 0 0 0 2px rgba(122,104,85,0.28);
}

.tk-color-swatch.tk-swatch-none {
    background-color: #fff;
    background-image: linear-gradient(45deg, transparent 47%, #cc3333 47%, #cc3333 53%, transparent 53%);
}

.tk-color-swatch[data-color="color-1"] { background-color: #b9c5c5; }
.tk-color-swatch[data-color="color-2"] { background-color: #dcb6af; }
.tk-color-swatch[data-color="color-3"] { background-color: #f9efe0; }
.tk-color-swatch[data-color="color-4"] { background-color: #8e8e8e; }
.tk-color-swatch[data-color="color-5"] { background-color: #8fac8f; }

/* Modal Form Tweaks */
.ticket-form {
    /* No nested scroll — modal-content handles scrolling */
    padding: 0 5px;
}

/* Modal content sizing */
.modal {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 50px;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    padding: 20px;
    max-height: 85vh; /* regular ticket modal; broadcast-modal overrides this to none */
    position: relative;
}

/* Cancel Button */
.cancel-btn {
    background-color: #f0f0f0;
    color: #333;
}

.cancel-btn:hover {
    background-color: #e0e0e0;
}

/* Form actions (e.g., submit, cancel) */
.form-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    justify-content: space-between; /* Added for better spacing */
}

.form-actions button {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

/* --- Specific Targeting (using :has() where appropriate) --- */

/* Target form-group containing specific input types */
.form-group:has(#ticketTitle),
.form-group:has(#dueDate) {
    width: 100%;
    margin-bottom: 20px; /* Consistent margin for these groups */
}

/* --- Responsive Styles --- */

/* General responsiveness */
/* 1200px breakpoint removed — auto-fill handles this naturally */

@media (max-width: 768px) {
    /* --- General Layout Adjustments --- */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }

    #welcomeMessage {
        font-size: 20px;
    }

    .tickets-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ticket-card {
        padding: 12px;
    }

    .ticket-title {
        font-size: 14px;
    }

    .status-item {
        padding: 4px 6px;
        font-size: 11px;
    }

    .ticket-actions button {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* --- Modal & Form Adjustments --- */
    .modal {
        padding-top: 20px;
        align-items: flex-start;
    }

    .modal-content {
        width: 95%;
        max-width: none;
        padding: 12px;
        /* No max-height on mobile — overlay scrolls */
        max-height: none;
    }

    .ticket-form {
        /* No max-height / overflow on mobile — the modal overlay scrolls */
        max-height: none;
        overflow-y: visible;
        padding: 0;
    }

    /* More compact form elements */
    .form-group {
        margin-bottom: 8px; /* Reduced spacing */
    }

    .form-group label {
        margin-bottom: 2px; /* Tighter label spacing */
        font-size: 14px;
    }

    #ticketTitle,
    #dueDate,
    #ticketNotes {
        width: 100%;
        padding: 8px;
    }

    #ticketTitle {
        height: 36px;
        font-size: 16px;
        margin-bottom: 15px; /* Spacing for bigger field */
    }

    #ticketNotes {
        min-height: 150px;
        font-size: 16px;
        line-height: 1.4;
    }

    .checkboxes-container {
        margin: 5px 0;
        gap: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .checkbox-group {
        margin-bottom: 4px;
        height: 24px;
    }

    .checkbox-group label {
        font-size: 13px;
    }

    .notes-container {
        margin-top: 0px;
        grid-column: span 2; /* Full width */
    }

    .form-actions {
        margin-top: 10px;
        padding-top: 8px;
        display: flex;
        justify-content: space-between;
        gap: 10px;
        background-color: white;
        /* position: static — overlay scrolls as one unit, no sticky overlap */
    }

    .form-actions button {
        flex: 1;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .ticket-card {
        padding: 10px;
    }
}

/* iPhone specific styles */
@media only screen and (min-width: 390px) and (max-width: 440px) {
    .tickets-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .ticket-title {
        font-size: 13px;
    }

    .ticket-creator {
        font-size: 11px;
    }

    .ticket-notes-content {
        font-size: 11px;
    }

    .status-item {
        padding: 3px 5px;
        font-size: 10px;
    }

    #ticketTitle {
        height: 48px;
    }

    #ticketNotes {
        min-height: 100px; /* Adjusted for iPhone */
    }

    .modal {
        padding-top: 10px;
    }

    .modal-content {
        padding: 10px;
        max-height: none;
    }

    h2#modalTitle {
        font-size: 20px;
        margin-top: 0;
        margin-bottom: 12px;
    }

    .form-group label {
        margin-bottom: 2px;
    }
}

.edit-btn {
  background-color: #32495b !important; /*steel blue */
  color: white !important;
}

.edit-btn:hover {
  background-color: #32526c !important; /* Darker blue on hover */
}

.edit-btn:active {
  background-color: #1a4264 !important; /* Even darker when pressed */
}

/* New CSS styles for the ticket redesign */

/* Fixed height ticket cards */
.ticket-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: white;
  box-shadow: var(--box-shadow);
  padding: 16px;
  height: 420px; /* Fixed height for all tickets */
}

@media (max-width: 768px) {
  .ticket-card {
    height: 210px;
    padding: 10px;
  }
}
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.ticket-title {
  font-size: 14px;
  font-weight: 500;
  height: 44px; /* Fixed height for two lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}

.ticket-created {
  font-size: 14px;
  color: #777;
  height: 20px; /* Fixed height for one line */
  margin-bottom: 12px;
}

/* Category dropdown styling */
.ticket-categories {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  height: 60px; /* Fixed height for this section */
}

.category-item {
  flex: 1;
  min-width: 0;
}

.category-item label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.dropdown-value {
  padding: 6px 8px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 11px;
  height: 32px;
  display: flex;
  align-items: center;
}

/* Checkbox styling */
.ticket-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 30px; /* Minimum height for checkbox area */
}

.checkbox-item {
  background-color: #f0e9e2;
  color: #7a6855;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
}

.checkbox-item.checked {
  background-color: #7a6855;
  color: white;
}

.checkbox-item.checked::before {
  content: "✓";
  margin-right: 4px;
}

/* Notes section with scrollable content */
.ticket-notes-container {
  flex-grow: 1; /* Takes up remaining space */
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
  overflow: hidden; /* Ensure no content spills out */
}

.ticket-notes-header {
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid #ddd;
  background-color: #f5f5f5;
}

.ticket-notes-content {
  padding: 8px 10px;
  font-size: 14px;
  overflow-y: auto; /* Make content scrollable */
  height: 100%; /* Fill container */
  white-space: pre-wrap;
  word-break: break-word;
}

.ticket-notes-content a {
  color: #7a6855;
  text-decoration: underline;
}

/* Action buttons */
.ticket-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  height: 32px; /* Fixed height */
  margin-top: auto; /* Push to bottom if needed */
}

/* Custom scrollbar for notes */
.ticket-notes-content::-webkit-scrollbar {
  width: 6px;
}

.ticket-notes-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.ticket-notes-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.ticket-notes-content::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Modal form updates */
.form-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.form-categories .form-group {
  margin-bottom: 0;
}

.form-categories select {
  width: 100%;
  height: 44px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ticket-card {
    height: 4200px; /* Slightly shorter on mobile */
    padding: 12px;
  }
  
  .ticket-title {
    font-size: 14px;
    height: 40px;
    margin-bottom: 6px;
  }
  
  .ticket-created {
    font-size: 12px;
    margin-bottom: 8px;
  }
  
  .ticket-categories {
    height: 50px;
    margin-bottom: 8px;
  }
  
  .dropdown-value {
    padding: 4px 6px;
    font-size: 12px;
    height: 28px;
  }
  
  .checkbox-item {
    padding: 2px 6px;
    font-size: 11px;
  }
  
  .ticket-notes-header {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .ticket-notes-content {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .ticket-actions button {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .form-categories {
    gap: 10px;
  }
  
  .form-categories select {
    height: 40px;
    padding: 8px;
    font-size: 14px;
  }
}


/* Style for unchecked checkbox items */
.checkbox-item.unchecked {
  background-color: rgba(240, 233, 226, 0.5); /* Lighter/transparent version of checked */
  color: #a09589; /* Lighter gray-brown */
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  opacity: 0.7; /* Slightly transparent */
}

/* Add a disabled-looking checkmark for unchecked items */
.checkbox-item.unchecked::before {
  content: "○"; /* Empty circle */
  margin-right: 4px;
  opacity: 0.6;
}

/* Make unchecked items more interactive with hover */
.checkbox-item.unchecked:hover {
  opacity: 0.9;
  cursor: pointer;
  background-color: rgba(240, 233, 226, 0.8);
}

/* Make checked items interactive too */
.checkbox-item.checked {
  cursor: pointer;
}

.checkbox-item.checked:hover {
  background-color: #6a5a49; /* Slightly darker when hovered */
}
/* Styled dropdowns for ticket cards */
.ticket-dropdown {
  width: 100%;
  padding: 6px 8px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  height: 32px;
  appearance: none; /* Remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23999' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 12px;
  cursor: pointer;
  color: #555;
}

/* Make it look better on hover */
.ticket-dropdown:hover {
  border-color: #bbb;
  background-color: #f5f5f5;
}

/* Add focus style */
.ticket-dropdown:focus {
  outline: none;
  border-color: #7a6855;
  box-shadow: 0 0 0 2px rgba(122, 104, 85, 0.2);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .ticket-dropdown {
    padding: 4px 6px;
    font-size: 11px;
    height: 28px;
    background-size: 10px;
  }
}

/* Header container with relative positioning */
.ticket-header-container {
  position: relative;
  margin-bottom: 8px;
  min-height: 44px; /* Match existing ticket title height */
}

/* Serial number styling - positioned in upper right */
.ticket-serial {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  background-color: #f0e9e2;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  z-index: 1;
}

/* Update title to wrap around serial number */
.ticket-title {
  font-size: 14px;
  font-weight: 500;
  height: auto;
  min-height: 44px; /* Keep minimum height for consistency */
  padding-right: 45px; /* Make room for serial number */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 0; /* Remove margin since container has margin */
}

/* No need to adjust ticket card height since we're using a container */

/* Serial number display in modal */
.ticket-serial-display {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  background-color: #f0e9e2;
  padding: 5px 10px;
  border-radius: 4px;
  display: inline-block;
}

/* Add this to your tickets.css file */
/* Ensure serial numbers are visible on archive and bank pages */
.archive-header .ticket-serial,
.bank-header .ticket-serial,
body.archive .ticket-serial,
body.bank .ticket-serial,
#ticketsDashboard .ticket-serial {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  background-color: #f0e9e2;
  padding: 2px 6px;
  border-radius: 4px;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 5;
}

/* Ensure ticket cards have proper positioning */
.tickets-list .ticket-card {
  position: relative !important;
}

/* Updated Ticket Card Design - Notes-Focused */

/* Remove fixed height and allow dynamic sizing based on content */
.ticket-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: white;
  box-shadow: var(--box-shadow);
  padding: 12px;
  min-height: 200px; /* Minimum height instead of fixed */
  max-height: 600px; /* Maximum height to prevent overly tall cards */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  position: relative;
}

.ticket-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* Compact header with serial number badge */
.ticket-header-minimal {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  min-height: 24px;
}

/* Serial number badge - small and positioned top-right */
.ticket-serial-badge {
  background-color: #f0e9e2;
  color: #333;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.ticket-serial-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.ticket-copy-serial-btn {
  background: #e8ddd0;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: #7a6855;
  display: flex;
  align-items: center;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.ticket-copy-serial-btn:hover {
  background: #c4b5a0;
  color: #2c1a10;
}

/* Thin strip for title and date */
.ticket-info-strip {
  flex: 1;
  margin-right: 8px;
}

.ticket-title-minimal {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 0 0 2px 0;
  line-height: 1.2;
  word-wrap: break-word;
}

.ticket-date-minimal {
  font-size: 10px;
  color: #666;
  margin: 0;
  line-height: 1.1;
}

/* NOTES SECTION - 80% of card height */
.ticket-notes-expanded {
  flex: 1; /* Takes up all remaining space */
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fafafa;
  min-height: 150px; /* Ensure minimum size for notes */
}

/* Notes header - minimal */
.ticket-notes-header-minimal {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  background-color: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  color: #666;
  border-radius: 3px 3px 0 0;
}

/* Notes content area - main focus */
.ticket-notes-content-expanded {
  flex: 1;
  padding: 8px;
  font-size: 14px;
  line-height: 1.4;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  cursor: text;
  min-height: 120px; /* Ensure adequate space for content */
}

/* Notes content when empty */
.ticket-notes-content-expanded:empty::before {
  content: "Click to add notes...";
  color: #999;
  font-style: italic;
}

/* Notes content when in edit mode */
.ticket-notes-content-expanded.editing {
  outline: 2px solid #7a6855;
  background-color: white;
}

/* Links in notes */
.ticket-notes-content-expanded a {
  color: #7a6855;
  text-decoration: underline;
  word-break: break-all;
}

.ticket-notes-content-expanded a:hover {
  color: #5d4c3c;
}

/* Custom scrollbar for notes */
.ticket-notes-content-expanded::-webkit-scrollbar {
  width: 6px;
}

.ticket-notes-content-expanded::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.ticket-notes-content-expanded::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.ticket-notes-content-expanded::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Action buttons - kept at bottom but made more compact */
.ticket-actions-minimal {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: auto; /* Push to bottom */
  padding-top: 4px;
  border-top: 1px solid #f0f0f0;
}

.ticket-actions-minimal button {
  background-color: #7e7465;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.ticket-actions-minimal button:hover {
  background-color: var(--primary-color);
}

/* Specific button colors */
.ticket-actions-minimal .color-btn {
  background-color: #6c757d;
}

.ticket-actions-minimal .archive-btn {
  background-color: #8e4a52;
}

.ticket-actions-minimal .bank-btn {
  background-color: #9c27b0;
}

.ticket-actions-minimal .edit-btn {
  background-color: #32495b;
}

.ticket-actions-minimal .delete-btn {
  background-color: #d32f2f;
}

.ticket-actions-minimal .drive-btn {
  background-color: #1a6b3a;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.2s;
}

.ticket-actions-minimal .drive-btn:hover {
  background-color: #145530;
}

.ticket-actions-minimal .drive-btn--pending {
  background-color: #7a6855;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 7px;
}
.ticket-actions-minimal .drive-btn--pending:hover { background-color: #4a3728; }
.ticket-actions-minimal .drive-btn--pending:disabled { opacity: 0.5; cursor: wait; }

/* Hover states for specific buttons */
.ticket-actions-minimal .color-btn:hover {
  background-color: #5a6268;
}

.ticket-actions-minimal .archive-btn:hover {
  background-color: #723a40;
}

.ticket-actions-minimal .bank-btn:hover {
  background-color: #7b1fa2;
}

.ticket-actions-minimal .edit-btn:hover {
  background-color: #2c4051;
}

.ticket-actions-minimal .delete-btn:hover {
  background-color: #b71c1c;
}

/* Color classes for cards */
.ticket-card.color-1 {
  background-color: #b9c5c5;
}

.ticket-card.color-2 {
  background-color: #dcb6af;
}

.ticket-card.color-3 {
  background-color: #f9efe0;
}

.ticket-card.color-4 {
  background-color: #8e8e8e;
}

.ticket-card.color-5 {
  background-color: #8fac8f;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ticket-card {
    padding: 10px;
    min-height: 180px;
    max-height: 500px;
  }
  
  .ticket-title-minimal {
    font-size: 12px;
  }
  
  .ticket-date-minimal {
    font-size: 9px;
  }
  
  .ticket-notes-content-expanded {
    font-size: 13px;
    min-height: 100px;
  }
  
  .ticket-actions-minimal button {
    padding: 3px 6px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .ticket-card {
    padding: 8px;
    min-height: 160px;
  }
  
  .ticket-notes-content-expanded {
    min-height: 80px;
    font-size: 12px;
  }
}

/* Global Search Bar Styles */

/* Search container positioning */
.search-container-global {
  position: relative;
  margin-right: 15px;
  min-width: 250px;
}

/* Search input styling */
.global-search-input {
  width: 100%;
  padding: 8px 35px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: white;
}

.global-search-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(122, 104, 85, 0.2);
}

.global-search-input::placeholder {
  color: #999;
}

/* Search icon */
.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 16px;
  pointer-events: none;
}

/* Clear search button */
.search-clear {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.search-clear:hover {
  background-color: #f0f0f0;
  color: #666;
}

.search-clear.visible {
  display: flex;
}

/* Results dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

.search-results-dropdown.visible {
  display: block;
}

/* Search results sections */
.search-section {
  border-bottom: 1px solid #f0f0f0;
}

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

.search-section-header {
  padding: 8px 12px;
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e9ecef;
}

.search-section-header .count {
  float: right;
  background-color: #6c757d;
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: normal;
}

/* Individual search result items */
.search-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

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

.search-result-title {
  font-weight: 500;
  font-size: 13px;
  color: #333;
  margin-bottom: 3px;
  line-height: 1.3;
}

.search-result-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}

.search-result-snippet {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  max-height: 40px;
  overflow: hidden;
  position: relative;
}

/* Highlight matching text */
.search-highlight {
  background-color: #fff3cd;
  color: #856404;
  font-weight: 500;
  padding: 1px 2px;
  border-radius: 2px;
}

/* No results message */
.search-no-results {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Loading indicator */
.search-loading {
  padding: 15px;
  text-align: center;
  color: #666;
}

.search-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Section-specific styling */
.search-section.active-tickets .search-section-header {
  background-color: #e8f5e8;
  color: #2d5a2d;
}

.search-section.archived-tickets .search-section-header {
  background-color: #fff3e0;
  color: #bf6900;
}

.search-section.banked-tickets .search-section-header {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.search-section.active-tickets .search-section-header .count {
  background-color: #4caf50;
}

.search-section.archived-tickets .search-section-header .count {
  background-color: #ff9800;
}

.search-section.banked-tickets .search-section-header .count {
  background-color: #9c27b0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-container-global {
    min-width: 200px;
    margin-right: 10px;
  }
  
  .global-search-input {
    font-size: 13px;
    padding: 7px 30px 7px 10px;
  }
  
  .search-results-dropdown {
    max-height: 300px;
  }
  
  .search-result-title {
    font-size: 12px;
  }
  
  .search-result-meta,
  .search-result-snippet {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .search-container-global {
    min-width: 150px;
    margin-right: 8px;
  }
  
  .global-search-input {
    padding: 6px 25px 6px 8px;
    font-size: 12px;
  }
  
  .search-results-dropdown {
    max-height: 250px;
  }
}

/* Global Search Bar Styles */

/* Search container positioning */
.search-container-global {
  position: relative;
  margin-right: 15px;
  min-width: 350px;
  width: 350px;
}

/* Search input styling */
.global-search-input {
  width: 100%;
  padding: 8px 35px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: white;
}

.global-search-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(122, 104, 85, 0.2);
}

.global-search-input::placeholder {
  color: #999;
}

/* Search icon */
.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 16px;
  pointer-events: none;
}

/* Clear search button */
.search-clear {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.search-clear:hover {
  background-color: #f0f0f0;
  color: #666;
}

.search-clear.visible {
  display: flex;
}

/* Results dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
}

.search-results-dropdown.visible {
  display: block;
}

/* Search results sections */
.search-section {
  border-bottom: 1px solid #f0f0f0;
}

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

.search-section-header {
  padding: 8px 12px;
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 12px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e9ecef;
}

.search-section-header .count {
  float: right;
  background-color: #6c757d;
  color: white;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: normal;
}

/* Individual search result items */
.search-result-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

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

.search-result-title {
  font-weight: 500;
  font-size: 13px;
  color: #333;
  margin-bottom: 3px;
  line-height: 1.3;
}

.search-result-meta {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}

.search-result-snippet {
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  max-height: 40px;
  overflow: hidden;
  position: relative;
}

/* Highlight matching text */
.search-highlight {
  background-color: #fff3cd;
  color: #856404;
  font-weight: 500;
  padding: 1px 2px;
  border-radius: 2px;
}

/* No results message */
.search-no-results {
  padding: 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

/* Loading indicator */
.search-loading {
  padding: 15px;
  text-align: center;
  color: #666;
}

.search-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Section-specific styling */
.search-section.active-tickets .search-section-header {
  background-color: #e8f5e8;
  color: #2d5a2d;
}

.search-section.archived-tickets .search-section-header {
  background-color: #fff3e0;
  color: #bf6900;
}

.search-section.banked-tickets .search-section-header {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

.search-section.active-tickets .search-section-header .count {
  background-color: #4caf50;
}

.search-section.archived-tickets .search-section-header .count {
  background-color: #ff9800;
}

.search-section.banked-tickets .search-section-header .count {
  background-color: #9c27b0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-container-global {
    min-width: 280px;
    width: 280px;
    margin-right: 10px;
  }
  
  .global-search-input {
    font-size: 13px;
    padding: 7px 30px 7px 10px;
  }
  
  .search-results-dropdown {
    max-height: 400px;
  }
  
  .search-result-title {
    font-size: 12px;
  }
  
  .search-result-meta,
  .search-result-snippet {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .search-container-global {
    min-width: 200px;
    width: 200px;
    margin-right: 8px;
  }
  
  .global-search-input {
    padding: 6px 25px 6px 8px;
    font-size: 12px;
  }
  
  .search-results-dropdown {
    max-height: 350px;
  }
}

/* Add this to your tickets.css file for search highlighting */

/* Search highlight animation for found tickets */
.ticket-card.search-highlighted {
  animation: searchHighlight 2s ease-in-out;
  border: 2px solid var(--primary-color);
  box-shadow: 0 0 20px rgba(122, 104, 85, 0.3);
}

@keyframes searchHighlight {
  0% {
    background-color: rgba(122, 104, 85, 0.1);
    transform: scale(1);
  }
  50% {
    background-color: rgba(122, 104, 85, 0.2);
    transform: scale(1.02);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

/* Toolbar layout handled by inline <style> in tickets.html */

/* Basic Camera Integration Styles - Add to your tickets.css */

/* Floating Camera Button */
.floating-camera-btn {
  position: fixed;
  bottom: 80px; /* Above bottom nav on mobile */
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-camera-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.floating-camera-btn:active {
  transform: scale(0.95);
}

/* Camera Modal */
.camera-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 10px;
  box-sizing: border-box;
}

.camera-container {
  width: 100%;
  max-width: 400px;
  height: 90vh;
  max-height: 600px;
  background-color: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Camera Header */
.camera-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #1a1a1a;
  color: white;
  border-bottom: 1px solid #333;
}

.camera-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}

.close-camera {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.close-camera:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Camera Viewport */
.camera-viewport {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  overflow: hidden;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Camera Fallback */
.camera-fallback {
  text-align: center;
  color: white;
  padding: 40px 20px;
}

.fallback-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.camera-fallback p {
  margin: 0 0 20px 0;
  font-size: 16px;
}

/* Camera Controls */
.camera-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #1a1a1a;
  border-top: 1px solid #333;
}

.capture-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: white;
  border: 4px solid #333;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.capture-button:hover {
  transform: scale(1.05);
  background-color: #f8f8f8;
}

.capture-button:active {
  transform: scale(0.95);
  background-color: #e0e0e0;
}

.gallery-button,
.flash-button {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-button:hover,
.flash-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Preview Section */
.preview-section {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

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

.captured-preview {
  flex: 1;
  width: 100%;
  object-fit: contain;
  background-color: #000;
}

.preview-controls {
  display: flex;
  justify-content: space-around;
  padding: 20px;
  background-color: #1a1a1a;
  border-top: 1px solid #333;
  gap: 15px;
}

.preview-controls button {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn {
  background-color: #6c757d;
  color: white;
}

.secondary-btn:hover {
  background-color: #5a6268;
}

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

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

/* Quick Edit Modal */
.quick-edit-modal .modal-content {
  width: 90%;
  max-width: 500px;
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
}

.quick-edit-modal h3 {
  margin: 0 0 20px 0;
  color: var(--primary-color);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.photo-preview {
  text-align: center;
  margin-bottom: 20px;
}

.edit-photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quick-edit-modal .form-group {
  margin-bottom: 15px;
}

.quick-edit-modal label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.quick-edit-modal input,
.quick-edit-modal textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
}

.quick-edit-modal input:focus,
.quick-edit-modal textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(122, 104, 85, 0.2);
}

.quick-edit-modal textarea {
  resize: vertical;
  min-height: 80px;
}

.quick-edit-modal .form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.quick-edit-modal .form-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

/* Photo Thumbnail in Ticket Cards */
.ticket-photo-thumbnail {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.2s;
}

.ticket-photo-thumbnail:hover {
  transform: scale(1.02);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .floating-camera-btn {
    bottom: 70px; /* Adjust for mobile bottom nav */
    right: 15px;
    width: 55px;
    height: 55px;
    font-size: 22px;
  }
  
  .camera-container {
    width: 95%;
    height: 95vh;
    border-radius: 8px;
  }
  
  .camera-header {
    padding: 12px 15px;
  }
  
  .camera-header h3 {
    font-size: 16px;
  }
  
  .camera-controls {
    padding: 15px;
  }
  
  .capture-button {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }
  
  .gallery-button,
  .flash-button {
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
  
  .preview-controls {
    padding: 15px;
    gap: 10px;
  }
  
  .preview-controls button {
    padding: 10px 15px;
    font-size: 13px;
  }
  
  .quick-edit-modal .modal-content {
    width: 95%;
    padding: 15px;
    margin: 10px;
  }
  
  .edit-photo-preview {
    max-height: 150px;
  }
}

@media (max-width: 480px) {
  .floating-camera-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 65px;
    right: 12px;
  }
  
  .camera-controls {
    padding: 12px;
  }
  
  .capture-button {
    width: 55px;
    height: 55px;
    font-size: 18px;
  }
  
  .gallery-button,
  .flash-button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .quick-edit-modal .form-actions {
    flex-direction: column;
  }
  
  .quick-edit-modal .form-actions button {
    width: 100%;
  }
}

/* iOS Specific Adjustments */
@supports (-webkit-overflow-scrolling: touch) {
  .camera-modal {
    -webkit-overflow-scrolling: touch;
  }
  
  .camera-viewport {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  #camera-video {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Loading states */
.camera-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.camera-loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }

  .floating-camera-btn {
  display: flex !important;
}

/* Enhanced drag handle styles */
.ticket-card {
    cursor: grab; /* Show grab cursor on hover */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ticket-card:active {
    cursor: grabbing; /* Show grabbing cursor when dragging */
}

/* Visual feedback during drag */
.sortable-chosen {
    transform: scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    z-index: 1000 !important;
    opacity: 0.9 !important;
}

.sortable-drag {
    transform: rotate(5deg) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    opacity: 0.8 !important;
}

.sortable-ghost {
    opacity: 0.3 !important;
    background-color: #f0f0f0 !important;
    border: 2px dashed #ccc !important;
}

/* Add a subtle drag indicator */
.ticket-card::before {
    content: "⋮⋮";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    font-family: monospace;
}

.ticket-card:hover::before {
    opacity: 0.6;
}

/* Adjust card padding to make room for drag indicator */
.ticket-card {
    padding-left: 28px;
    position: relative;
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    .ticket-card {
        min-height: 120px; /* Larger touch target */
        margin-bottom: 12px; /* More space between cards */
    }
    
    .ticket-card::before {
        font-size: 16px; /* Larger drag indicator on mobile */
        left: 10px;
    }
    
    .ticket-card {
        padding-left: 35px;
    }
}

/* Enhanced hover effects */
.ticket-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Smooth transitions for better UX */
.tickets-list {
    transition: all 0.3s ease;
}

.ticket-card {
    transition: all 0.2s ease;
}

/* Visual feedback when dragging over valid drop zones */
.tickets-list.sortable-drag-over {
    background-color: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
}
/* ── Star Feature ───────────────────────────────── */
.star-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  color: #aaa;
  transition: color 0.2s, border-color 0.2s;
}

.star-btn:hover {
  color: #f5a623;
  border-color: #f5a623;
}

.ticket-card.starred .star-btn {
  color: #f5a623;
  border-color: #f5a623;
}

.ticket-card.starred {
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.4), var(--box-shadow);
}

/* Star filter toggle button */
.star-icon-btn {
  padding: 0;
  width: 34px;
  height: 34px;
  border: 1px solid #d4b96a;
  border-radius: 6px;
  background: #fdf6d8;
  font-size: 20px;
  cursor: pointer;
  color: #f5f0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
  line-height: 1;
}

.star-icon-btn:hover {
  background: #faedb8;
  border-color: #c4a445;
  color: #fff8e7;
}

.star-icon-btn.active-filter {
  color: #fff8e7;
  border-color: #c4a445;
  background: #f5d96b;
}

/* Archived ticket badge shown on tickets tab when starred filter is active */
.archived-inline-badge {
  font-size: 11px;
  color: #9e8e80;
  background: #f0ebe4;
  border: 1px solid #e5ded5;
  border-radius: 4px;
  padding: 2px 7px;
  margin: 0 12px 4px;
  display: inline-block;
  font-weight: 500;
}

/* Archive ticket cards - match tickets page style */
.archived-ticket-card .ticket-notes-content-expanded {
  cursor: default !important;
  user-select: text;
}

/* Broadcast product images are only rendered inside the broadcast edit modal */


/* ── Mobile ticket card height override (must be last) ── */
@media (max-width: 768px) {
    .ticket-card {
        height: 210px !important;
        min-height: 210px !important;
        max-height: 210px !important;
        overflow: hidden;
    }
}

/* ── Mobile ticket card height override v2 (truly last) ── */
@media (max-width: 768px) {
    .ticket-card {
        height: 210px !important;
        min-height: 210px !important;
        max-height: 210px !important;
        overflow: hidden !important;
    }
    .ticket-notes-expanded {
        min-height: 0 !important;
        flex: 1 !important;
    }
    .ticket-notes-content-expanded {
        min-height: 0 !important;
        overflow: hidden !important;
    }
}

/* Reset native iOS search-field chrome now that #globalSearchInput is
   type="search" - a custom clear button is already provided in the markup,
   so the native decorations/cancel button are hidden. */
.global-search-input {
  -webkit-appearance: none;
  appearance: none;
}
.global-search-input::-webkit-search-decoration,
.global-search-input::-webkit-search-cancel-button,
.global-search-input::-webkit-search-results-button,
.global-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}
