/* ============================================================================
   INVOICE SYSTEM - DESKTOP STYLES
   Styles for screens 769px and wider
   Only loaded on desktop/tablet via: media="(min-width: 769px)"
   ============================================================================ */

/* ============================================================================
   TABLES - Desktop Only
   ============================================================================ */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}

.table-wrapper table {
    display: table;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    table-layout: fixed;
}

/* Column width hints for better alignment */
table th:first-child,
table td:first-child {
    width: 20%;
    max-width: 200px;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

table th:last-child,
table td:last-child {
    width: 120px;
    white-space: nowrap;
}

/* Ensure action buttons don't wrap badly */
table td:last-child {
    text-align: center;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: bold;
}

tr:hover {
    background: #f5f5f5;
}

/* ============================================================================
   HIDE MOBILE CARDS ON DESKTOP
   ============================================================================ */
.mobile-invoice-cards {
    display: none !important;
}

/* ============================================================================
   FILTER FORMS - Desktop Layout
   ============================================================================ */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 15px;
}

.filter-form .form-group {
    flex: 1 1 150px;
    min-width: 120px;
    margin-bottom: 0;
}

.filter-form label {
    font-size: 12px;
    font-weight: normal;
    color: #666;
}

/* ============================================================================
   ACTION BUTTONS IN TABLES
   ============================================================================ */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* ============================================================================
   TOOLTIPS - Desktop Only (hover)
   ============================================================================ */
.action-btn-wrapper {
    position: relative;
    display: inline-block;
}

.action-btn-wrapper .tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 5px;
}

.action-btn-wrapper:hover .tooltip {
    visibility: visible;
}

/* ============================================================================
   POTENTIAL DUPLICATE - Desktop Table Rows
   ============================================================================ */
tr.potential-duplicate {
    background-color: #fff3cd !important;
    border-left: 4px solid #ff9800;
}

tr.potential-duplicate:hover {
    background-color: #ffe8a1 !important;
}

/* ============================================================================
   PRINT STYLES - Desktop
   ============================================================================ */
@media print {
    table {
        display: table !important;
    }
    
    .mobile-invoice-cards {
        display: none !important;
    }
}