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

/* Demo site watermark - shown only on demo.vehicletitletracker.com */
.demo-watermark {
    display: none;
    position: fixed;
    top: 30px;
    right: 30px;
    font-size: 36px;
    font-weight: bold;
    color: rgba(200, 50, 50, 0.95);
    background: rgba(255, 255, 255, 0.97);
    padding: 16px 36px;
    border: 4px solid rgba(200, 50, 50, 0.7);
    border-radius: 10px;
    z-index: 99999;
    pointer-events: none;
    letter-spacing: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* Auth gate overlay – shown when auth is required and user is not signed in */
/* When sign-in is shown, app stays visible but blurred behind the overlay */
body.auth-gate-active .container,
body.dashboard-page.auth-gate-active .dashboard-wrap {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
}

/* Read-only / guest view: show only View & Search; hide other tabs including Dashboard */
body.read-only-mode .tab-btn[data-tab="submit"],
body.read-only-mode .tab-btn[data-tab="process"],
body.read-only-mode .tab-btn[data-tab="dashboard"] {
    display: none !important;
}
body.read-only-mode #submit-tab,
body.read-only-mode #process-tab,
body.read-only-mode #dashboard-tab {
    display: none !important;
}

.auth-gate {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-gate-box {
    background: #fff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 380px;
    width: 100%;
}
.auth-gate-box h2 {
    margin-bottom: 8px;
    font-size: 1.5rem;
}
.auth-gate-hint {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.auth-gate-box .form-group {
    margin-bottom: 16px;
}
.auth-gate-box label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}
.auth-gate-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input-wrap input {
    padding-right: 4rem;
}
.password-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    background: none;
    color: #0066cc;
    cursor: pointer;
    border-radius: 4px;
}
.password-toggle-btn:hover {
    background: #f0f0f0;
    color: #004494;
}
.auth-error {
    color: #c00;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.auth-gate-box .btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
}
.auth-gate-divider {
    text-align: center;
    color: #888;
    margin: 16px 0 12px;
    font-size: 0.9rem;
}
.btn-guest {
    display: block;
    text-align: center;
    padding: 12px 20px;
    margin-bottom: 16px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    font-size: 1rem;
}
.btn-guest:hover {
    background: #e5e5e5;
    color: #000;
}
.auth-gate-guest {
    margin-top: 4px;
}
.auth-gate-guest .btn-guest {
    margin-bottom: 8px;
}
.auth-gate-guest-hint {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
}
.auth-forgot-link {
    display: inline-block;
    font-size: 0.9rem;
    color: #0066cc;
    margin-top: 6px;
    text-decoration: none;
}
.auth-forgot-link:hover {
    text-decoration: underline;
}
.auth-forgot-panel .auth-forgot-title {
    font-size: 1.25rem;
    margin-bottom: 8px;
}
.auth-success {
    color: #0a6b0a;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.auth-forgot-panel .form-actions-inline {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.auth-forgot-panel .form-actions-inline .btn {
    flex: 1;
}

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: 120px;
    width: auto;
    max-width: 220px;
    min-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

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

.header-text {
    flex: 1;
}
.header-actions {
    margin-top: 8px;
}
.header-link {
    font-size: 14px;
    color: #0066cc;
    text-decoration: none;
}
.header-link:hover {
    text-decoration: underline;
    color: #004494;
}

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;
}

.help-link {
    margin-left: auto;
    padding: 14px 24px;
    color: #0066cc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.help-link:hover {
    background: #f0f0f0;
    color: #004494;
}

.nav-right-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.nav-guest-view-link,
.nav-signin-link {
    padding: 14px 24px;
    color: #0066cc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}
.nav-guest-view-link:hover,
.nav-signin-link:hover {
    background: #f0f0f0;
    color: #004494;
}

#auth-signout-wrap.auth-user-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    position: relative;
}
.auth-profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border: none;
    background: none;
    color: #555;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
}
.auth-profile-btn:hover {
    background: #f0f0f0;
    color: #333;
}
.profile-gear-icon {
    display: block;
    flex-shrink: 0;
}
.auth-profile-btn-text {
    white-space: nowrap;
}
.auth-profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 220px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: 8px 0;
    z-index: 1000;
}
.auth-profile-email {
    font-size: 12px;
    color: #666;
    padding: 10px 14px 6px;
    border-bottom: 1px solid #eee;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.auth-profile-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 14px;
    text-align: left;
    color: #333;
    cursor: pointer;
}
.auth-profile-item:hover {
    background: #f5f5f5;
}
.auth-profile-link {
    text-decoration: none;
    color: inherit;
}
.auth-profile-link:hover {
    color: #0066cc;
}
.auth-signout-item:hover {
    color: #c00;
}
.auth-signout-btn {
    background: none;
    border: none;
    padding: 14px 16px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
}
.auth-signout-btn:hover {
    color: #c00;
}
.change-password-modal .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.change-password-modal .form-actions .btn {
    flex: 1;
}

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

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

.tab-content {
    padding: 30px;
}

#dashboard-tab.tab-content {
    padding: 30px;
}

.dashboard-iframe {
    width: 100%;
    min-height: calc(100vh - 200px);
    border: none;
    display: block;
}

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

.customer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.customer-rows-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}
.customer-rows-header .customer-row-label.name { min-width: 120px; flex: 1 1 0; }
.customer-rows-header .customer-row-label.num { width: 28px; min-width: 28px; flex-shrink: 0; }
#customers-container .customer-row-number {
    display: inline-block;
    width: 28px;
    min-width: 28px;
    flex-shrink: 0;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}
.customer-rows-header .customer-row-label.desc { min-width: 120px; flex: 1 1 0; }
.customer-rows-header .customer-row-label.type { min-width: 160px; }
.customer-rows-header .customer-row-label.status { min-width: 120px; }
.customer-rows-header .customer-row-label.processor { min-width: 100px; }
.customer-rows-header .customer-row-label.action { flex-shrink: 0; width: 36px; }
#customers-container .customer-last-update { display: none; }
#customers-container .customer-row {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 10px;
}
#customers-container .customer-row:focus-within {
    background: #fff;
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}
#customers-container input.customer-name,
#customers-container textarea.customer-description,
#customers-container select.customer-document-type,
#customers-container select.customer-status {
    pointer-events: auto;
    background: #fff;
}
#customers-container .customer-name,
.customer-row .customer-name,
.edit-customer-row .edit-customer-name,
.processor-customer-row .processor-customer-name {
    min-width: 120px;
    flex: 1 1 0;
    padding: 8px 10px;
    font-size: 1rem;
}
.customer-row .customer-description,
.edit-customer-row .edit-customer-description,
.processor-customer-row .processor-customer-description {
    min-width: 120px;
    flex: 1 1 0;
    padding: 8px 10px;
    font-size: 1rem;
    min-height: 2.8em;
    resize: vertical;
    font-family: inherit;
    vertical-align: middle;
}
.customer-row .customer-description {
    height: 2.8em;
}
.edit-customer-row .edit-customer-description,
.processor-customer-row .processor-customer-description {
    min-height: 2.8em;
}
.customer-row .customer-document-type,
.edit-customer-row .edit-customer-document-type,
.processor-customer-row .processor-customer-document-type {
    min-width: 160px;
}
.customer-row .customer-last-update,
.edit-customer-row .edit-customer-processor,
.processor-customer-row .processor-customer-processor,
.edit-customer-row .edit-customer-last-update,
.processor-customer-row .processor-customer-last-update {
    font-size: 0.9em;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
}
.edit-customer-row .edit-customer-processor,
.processor-customer-row .processor-customer-processor {
    min-width: 100px;
}
.edit-customer-row .edit-customer-processor .customer-cell-label,
.processor-customer-row .processor-customer-processor .customer-cell-label,
.edit-customer-row .edit-customer-last-update .customer-cell-label,
.processor-customer-row .processor-customer-last-update .customer-cell-label {
    font-weight: 600;
    color: #333;
    margin-right: 4px;
}
.customer-cell-label-inline {
    font-weight: 600;
    color: #333;
    font-size: 0.9em;
    margin-right: 4px;
    flex-shrink: 0;
}
#edit-customers-container .edit-customer-row .edit-customer-processor,
#edit-customers-container .edit-customer-row .edit-customer-last-update,
#processor-customers-container .processor-customer-row .processor-customer-processor,
#processor-customers-container .processor-customer-row .processor-customer-last-update {
    pointer-events: auto !important;
    background: #fff;
}
#edit-customers-container .edit-customer-row input.edit-customer-last-update,
#processor-customers-container .processor-customer-row input.processor-customer-last-update {
    min-width: 130px;
}
.customer-row .remove-customer,
.edit-customer-row .remove-edit-customer,
.processor-customer-row .remove-processor-customer {
    flex-shrink: 0;
}
.customer-row:only-child .remove-customer {
    visibility: hidden;
}

.edit-customers-header.customer-rows-header .customer-row-label.processor { min-width: 100px; }
.edit-customers-header.customer-rows-header .customer-row-label.last-update { min-width: 80px; }
#edit-customers-container .edit-customer-row {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 10px;
}
#edit-customers-container .edit-customer-row:focus-within {
    background: #fff;
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}
#edit-customers-container .edit-customer-name,
#edit-customers-container .edit-customer-description,
#edit-customers-container .edit-customer-document-type,
#edit-customers-container .edit-customer-status {
    pointer-events: auto;
    background: #fff;
}
#edit-customers-container .edit-row-number {
    display: inline-block;
    width: 28px;
    min-width: 28px;
    flex-shrink: 0;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

/* Processor Log: editable customer rows */
#processor-customers-container .processor-customer-row {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 10px;
}
#processor-customers-container .processor-customer-row:focus-within {
    background: #fff;
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}
#processor-customers-container .processor-customer-name,
#processor-customers-container .processor-customer-description,
#processor-customers-container .processor-customer-document-type,
#processor-customers-container .processor-customer-status {
    pointer-events: auto !important;
    background: #fff;
}
#processor-customers-container .processor-row-number {
    display: inline-block;
    width: 28px;
    min-width: 28px;
    flex-shrink: 0;
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}
.processor-customers-header.customer-rows-header .customer-row-label.processor { min-width: 100px; }
.processor-customers-header.customer-rows-header .customer-row-label.last-update { min-width: 80px; }

/* Ensure all customer row fields are always editable (no parent can block) */
#customers-container .customer-row input,
#customers-container .customer-row textarea,
#customers-container .customer-row select,
#edit-customers-container .edit-customer-row input,
#edit-customers-container .edit-customer-row textarea,
#edit-customers-container .edit-customer-row select,
#processor-customers-container .processor-customer-row input,
#processor-customers-container .processor-customer-row textarea,
#processor-customers-container .processor-customer-row select {
    pointer-events: auto !important;
}

.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 .form-hint {
    font-size: 0.9em;
    color: #555;
    margin: -2px 0 10px 0;
}

.submission-bag-count {
    margin-top: 8px;
    font-size: 0.95em;
    color: #333;
}

.submission-bag-count span {
    color: #0066cc;
}

.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;
}

.view-readonly-banner {
    padding: 10px 14px;
    margin-bottom: 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
    color: #856404;
}
.view-readonly-banner a {
    color: #0066cc;
    font-weight: 600;
}

.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;
}

/* Subrows for multi-customer bags - visually group under parent record */
tr.customer-subrow td {
    background: #fafbfc;
    border-top: none;
}
tr.customer-subrow td.customer-cell {
    padding-left: 28px;
    color: #555;
}

/* Collapsed by default: hide extra customer rows until expand is clicked */
#records-table tr.bag-subrow-hidden {
    display: none;
}

/* Expand/collapse control */
#records-table .expand-col {
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}
#records-table td.expand-cell {
    padding: 4px 8px;
    text-align: center;
    vertical-align: middle;
}
.btn-expand-bag {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    color: #555;
    border-radius: 4px;
}
.btn-expand-bag:hover {
    background: #e8e8e8;
    color: #1a1a1a;
}
.expand-placeholder {
    display: inline-block;
    width: 20px;
    height: 1em;
}

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;
}

.status-CHECKED {
    background: #e2d5f1;
    color: #4a148c;
}

.status-PICKED-UP-BY-CUSTOMER {
    background: #c8e6c9;
    color: #1b5e20;
}

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

/* Keep Actions column visible when table is scrolled horizontally */
#records-table th:last-child,
#records-table td.actions {
    position: sticky;
    right: 0;
    background: white;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.06);
    min-width: 140px;
    white-space: nowrap;
    z-index: 1;
}
#records-table thead th:last-child {
    background: #f8f9fa;
    z-index: 2;
}
#records-table tbody tr:hover td.actions {
    background: #f8f9fa;
}
#records-table tr.customer-subrow td.actions {
    background: #fafbfc;
}
#records-table tr.customer-subrow:hover td.actions {
    background: #f8f9fa;
}

.actions {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
}

.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);
    pointer-events: auto;
}

.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;
    pointer-events: auto;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
    pointer-events: auto !important;
    cursor: text;
}
.modal-body select {
    cursor: pointer;
}

.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: 90px;
        max-width: 170px;
    }
    
    .portrait-image {
        height: 90px;
        max-width: 90px;
        min-width: 75px;
        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;
    }
}

/* Dashboard page (embedded in iframe) - matches Processor Log / View & Search */
body.dashboard-page {
    background: #fff;
    font-size: 14px;
}
.dashboard-wrap {
    max-width: 100%;
    margin: 0;
    padding: 0;
}
.dashboard-wrap .card {
    padding: 30px;
}
.dashboard-wrap h2 {
    margin: 0 0 20px 0;
    font-size: 1.35em;
}
.dashboard-loading {
    padding: 14px;
    font-size: 14px;
    color: #0d47a1;
    background: #e3f2fd;
}
.dashboard-error {
    padding: 14px;
    font-size: 14px;
    color: #b71c1c;
    background: #ffebee;
}
.dashboard-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.dashboard-top-row .dashboard-cards {
    flex: 1 1 auto;
    min-width: 0;
}
.dashboard-top-row .dashboard-filter-row {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.dashboard-filter-row label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}
.dashboard-filter-row select {
    padding: 8px 12px;
    border: 1px solid #d0d4d9;
    border-radius: 4px;
    font-size: 14px;
    min-width: 140px;
}
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.dashboard-card {
    padding: 20px 28px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dashboard-card-highlight {
    background: linear-gradient(135deg, #e8f4fc 0%, #d4ebf7 100%);
    border-color: #0066cc33;
}
.dashboard-card h4 {
    margin: 0 0 6px 0;
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dashboard-value-hint {
    margin: 4px 0 0 0;
    font-size: 0.7em;
    color: #888;
    font-weight: normal;
}

.dashboard-value-lg {
    margin: 0;
    font-size: 1.6em;
    font-weight: 700;
    color: #1a1a1a;
}
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
@media (max-width: 900px) {
    .dashboard-charts-grid {
        grid-template-columns: 1fr;
    }
}
.dashboard-chart-card {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dashboard-chart-card h3 {
    margin: 0 0 14px 0;
    font-size: 1.05em;
    color: #333;
}
.dashboard-bar-chart {
    min-height: 180px;
}
.dashboard-bar-svg {
    width: 100%;
    height: auto;
    display: block;
}
.dashboard-no-data {
    margin: 0;
    padding: 28px;
    font-size: 14px;
    color: #888;
    text-align: center;
}
.dashboard-pie-chart {
    min-height: 260px;
}
.dashboard-pie-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.dashboard-pie-wrap .dashboard-pie-svg {
    flex: 0 0 auto;
    width: 220px;
    height: 220px;
}
.dashboard-pie-legend {
    flex: 1;
    font-size: 13px;
    color: #444;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dashboard-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.dashboard-pie-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dashboard-bar-clickable .dashboard-bar-group[data-drill-type],
.dashboard-pie-clickable .dashboard-pie-slice[data-drill-type],
.dashboard-legend-clickable {
    cursor: pointer;
}
.dashboard-bar-clickable .dashboard-bar-group[data-drill-type]:hover rect,
.dashboard-pie-clickable .dashboard-pie-slice[data-drill-type]:hover {
    opacity: 0.85;
}

.dashboard-drill-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.dashboard-drill-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 85vh;
    width: 800px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}
.dashboard-drill-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}
.dashboard-drill-modal-header h3 {
    margin: 0;
    font-size: 1.1em;
}
.dashboard-drill-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.dashboard-drill-modal-close:hover {
    color: #333;
}
.dashboard-drill-modal-body {
    padding: 20px;
    overflow-y: auto;
}
.dashboard-drill-modal-body table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}
.dashboard-drill-modal-body th,
.dashboard-drill-modal-body td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.dashboard-drill-modal-body th {
    background: #f8f9fa;
    font-weight: 600;
}
.dashboard-drill-modal-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}
