* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 0;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
}

header {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 30px;
    margin-bottom: 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.county-logo {
    height: 80px;
    width: auto;
    max-width: 150px;
    min-width: 80px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.portrait-image {
    height: 80px;
    width: auto;
    max-width: 80px;
    min-width: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
}

header h1 {
    font-size: 1.8em;
    margin-bottom: 5px;
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: none;
}

header p {
    font-size: 0.95em;
    color: #666;
    opacity: 1;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 30px;
}

.tab-btn {
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    border-radius: 0;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-btn.active {
    background: transparent;
    color: #0066cc;
    border-bottom-color: #0066cc;
    font-weight: 600;
}

.tab-content {
    display: none;
    background: #ffffff;
}

.tab-content.active {
    display: block;
}

.tab-content {
    padding: 30px;
}

.card {
    background: white;
    border-radius: 4px;
    padding: 30px;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

.card h2 {
    margin-bottom: 25px;
    color: #1a1a1a;
    font-size: 1.5em;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group.inline {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 15px;
    vertical-align: top;
}

.form-group.inline label {
    display: block;
    margin-bottom: 6px;
    width: auto;
}

.form-group.inline input,
.form-group.inline select {
    width: auto;
    min-width: 150px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

.btn-primary:active {
    background: #004080;
}

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

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

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    font-size: 13px;
}

.btn-danger:hover {
    background: #c82333;
}

.search-filters {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.bag-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.bag-info h3 {
    margin-bottom: 15px;
    color: #1a1a1a;
    font-size: 1.2em;
    font-weight: 600;
}

.bag-info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.bag-info-item {
    padding: 8px;
    background: white;
    border-radius: 4px;
}

.bag-info-item strong {
    color: #0066cc;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

thead {
    background: #f8f9fa;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #666;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

th.sortable:hover {
    background-color: #e8e8e8;
}

th .sort-indicator {
    margin-left: 5px;
    font-size: 12px;
    color: #0066cc;
    font-weight: bold;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-RECEIVED {
    background: #fff3cd;
    color: #856404;
}

.status-PROCESSED {
    background: #d4edda;
    color: #155724;
}

.status-RETURNED {
    background: #f8d7da;
    color: #721c24;
}

.status-PENDING {
    background: #d1ecf1;
    color: #0c5460;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.actions {
    display: flex;
    gap: 5px;
}

.status-select {
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.status-select:hover {
    border-color: #0066cc;
}

.status-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.processor-select {
    min-width: 120px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .county-logo {
        height: 60px;
        max-width: 120px;
    }
    
    .portrait-image {
        height: 60px;
        max-width: 60px;
        min-width: 50px;
        align-self: flex-end;
    }
    
    .form-group.inline {
        display: block;
        width: 100%;
    }
    
    .form-group.inline input,
    .form-group.inline select {
        width: 100%;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 8px;
    }
}
