/**
 * Client Portal Manager - Portal Stylesheet
 * Green gradient color scheme matching payment portal
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --primary-green: #2c5530;
    --primary-green-light: #3a6e3f;
    --success-green: #059669;
    --success-green-light: #10b981;
    --warning-orange: #f59e0b;
    --warning-orange-light: #fbbf24;
    --danger-red: #dc2626;
    --danger-red-light: #ef4444;
    --info-blue: #0891b2;
    --info-blue-light: #06b6d4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* {
    box-sizing: border-box;
}

/* ========================================
   MAIN CONTAINER
   ======================================== */
#cpm-portal-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

/* ========================================
   HEADER
   ======================================== */
.cpm-portal-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: white;
    padding: 24px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cpm-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cpm-logo-section h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.cpm-tagline {
    font-size: 14px;
    opacity: 0.9;
    margin-left: 10px;
    font-weight: 400;
}

.cpm-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.cpm-community-name {
    font-weight: 600;
}

.cpm-separator {
    opacity: 0.5;
}

.cpm-logout-btn {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transition: background 0.2s;
    font-weight: 500;
}

.cpm-logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   DATE SELECTOR
   ======================================== */
.cpm-date-selector {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 0;
}

.cpm-date-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cpm-date-content label {
    font-weight: 600;
    color: var(--gray-700);
}

.cpm-quick-dates {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cpm-quick-btn {
    padding: 8px 16px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
}

.cpm-quick-btn:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.cpm-quick-btn.active {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    border-color: var(--primary-green);
    color: white;
}

.cpm-custom-dates {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpm-custom-dates input[type="date"] {
    padding: 8px 12px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
}

/* ========================================
   NAVIGATION TABS
   ======================================== */
.cpm-nav-tabs {
    background: white;
    display: flex;
    gap: 4px;
    padding: 0 24px;
    max-width: 1400px;
    margin: 0 auto;
    border-bottom: 2px solid var(--gray-200);
}

.cpm-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.cpm-tab svg {
    opacity: 0.7;
}

.cpm-tab:hover {
    color: var(--primary-green);
    background: var(--gray-50);
}

.cpm-tab.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.cpm-tab.active svg {
    opacity: 1;
}

/* ========================================
   TAB CONTENT
   ======================================== */
.cpm-tab-content {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

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

/* ========================================
   SECTION HEADERS
   ======================================== */
.cpm-section-header {
    margin-bottom: 32px;
}

.cpm-section-header h2 {
    margin: 0 0 8px 0;
    font-size: 28px;
    color: var(--gray-900);
}

.cpm-section-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: 16px;
}

/* ========================================
   METRICS GRID
   ======================================== */
.cpm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.cpm-metric-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cpm-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cpm-metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cpm-metric-content {
    flex: 1;
}

.cpm-metric-label {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-weight: 500;
}

.cpm-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.cpm-metric-subtext {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ========================================
   BUTTONS
   ======================================== */
.cpm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.cpm-btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(44, 85, 48, 0.2);
}

.cpm-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 85, 48, 0.3);
}

.cpm-btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.cpm-btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

/* ========================================
   DATA TABLES
   ======================================== */
.cpm-table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.cpm-data-table {
    width: 100%;
    border-collapse: collapse;
}

.cpm-data-table thead {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    color: white;
}

.cpm-data-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpm-data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 14px;
}

.cpm-data-table tbody tr:hover {
    background: var(--gray-50);
}

.cpm-data-table tbody tr:last-child td {
    border-bottom: none;
}

.cpm-loading {
    text-align: center;
    color: var(--gray-400);
    font-style: italic;
    padding: 40px !important;
}

/* ========================================
   OFFENDER TABS
   ======================================== */
.cpm-offender-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.cpm-offender-tab {
    padding: 12px 24px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
}

.cpm-offender-tab:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.cpm-offender-tab.active {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    border-color: var(--primary-green);
    color: white;
}

/* ========================================
   REPORT CARDS
   ======================================== */
.cpm-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.cpm-report-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cpm-report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.cpm-report-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.cpm-report-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: var(--gray-900);
}

.cpm-report-content p {
    margin: 0 0 16px 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
}

.cpm-report-count {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-green);
    margin: 16px 0;
}

.cpm-report-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ========================================
   COMMITTEE SECTION
   ======================================== */
.cpm-committee-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.cpm-summary-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 16px;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cpm-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cpm-summary-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cpm-summary-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
    font-weight: 500;
}

.cpm-summary-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-900);
}

.cpm-meeting-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.cpm-meeting-section h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: var(--gray-900);
}

.cpm-meeting-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.cpm-date-input {
    padding: 10px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.cpm-meeting-info {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 14px;
}

.cpm-committee-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.cpm-committee-tab {
    padding: 12px 24px;
    border: 2px solid var(--gray-300);
    background: white;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-700);
}

.cpm-committee-tab:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.cpm-committee-tab.active {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 100%);
    border-color: var(--primary-green);
    color: white;
}

/* ========================================
   MODAL
   ======================================== */
.cpm-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.cpm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpm-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.cpm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 2px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.cpm-modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--gray-900);
}

.cpm-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.cpm-modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.cpm-modal-body {
    padding: 24px;
}

.cpm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.cpm-form-group {
    margin-bottom: 20px;
}

.cpm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}

.cpm-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.cpm-textarea:focus {
    outline: none;
    border-color: var(--primary-green);
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
.cpm-loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.cpm-loading-overlay.active {
    display: flex;
}

.cpm-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cpm-loading-overlay p {
    margin-top: 16px;
    color: var(--gray-700);
    font-size: 16px;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .cpm-header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .cpm-date-content {
        flex-direction: column;
        align-items: stretch;
    }

    .cpm-nav-tabs {
        overflow-x: auto;
        white-space: nowrap;
    }

    .cpm-metrics-grid {
        grid-template-columns: 1fr;
    }

    .cpm-reports-grid {
        grid-template-columns: 1fr;
    }

    .cpm-modal-content {
        width: 95%;
        max-height: 95vh;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.cpm-error {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    color: var(--danger-red);
}
/**
 * DOC-CHANGE: 2025-10-04 - Claude - Added styles for preview citation and plate image modals
 *
 * Add this CSS to the END of portal.css file
 */

/* ============================================
   MODAL STYLES FOR PREVIEW & PLATE IMAGE
   ============================================ */

.cpm-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.2s ease-in;
}

.cpm-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpm-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.cpm-modal-large {
    width: 90%;
    max-width: 1200px;
}

.cpm-modal-medium {
    width: 80%;
    max-width: 800px;
}

.cpm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #2c5530 0%, #3a6e3f 100%);
}

.cpm-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.cpm-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.cpm-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.cpm-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.cpm-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Action buttons in search results */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 12px;
    border: 2px solid;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    /* ALWAYS VISIBLE: Buttons have colored backgrounds by default */
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    /* Reduced hover effect - less dramatic */
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Icon styling - always visible */
.btn-icon {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
}

.btn-text {
    font-size: 13px;
    line-height: 1;
}

/* Individual button colors - ALL GREEN THEME */
.preview-btn,
.plate-btn,
.download-btn,
.history-btn {
    background: linear-gradient(135deg, #2c5530 0%, #3a6e3f 100%);
    border-color: #2c5530;
    color: #ffffff;
}

.preview-btn:hover,
.plate-btn:hover,
.download-btn:hover,
.history-btn:hover {
    background: linear-gradient(135deg, #1e3a22 0%, #2c5530 100%);
    border-color: #1e3a22;
    color: #ffffff;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5 !important;
    color: #999 !important;
    border-color: #ddd !important;
}

.action-btn:disabled:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .action-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .btn-icon {
        font-size: 14px;
    }

    .btn-text {
        font-size: 11px;
    }
}

/* ============================================
   ACTIONS COLUMN LAYOUT
   ============================================ */

.cpm-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
    min-width: 280px;
}

.cpm-offense-badge {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media screen and (max-width: 768px) {
    .cpm-modal-large,
    .cpm-modal-medium {
        width: 95%;
        max-height: 95vh;
    }

    .cpm-modal-header {
        padding: 16px;
    }

    .cpm-modal-body {
        padding: 16px;
    }

    .cpm-actions-cell {
        flex-direction: column;
        align-items: flex-start;
        min-width: auto;
    }

    .cpm-btn-small {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   PLATE IMAGE SPECIFIC STYLES
   ============================================ */

#plate-image-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   IFRAME PREVIEW SPECIFIC STYLES
   ============================================ */

#citation-preview-iframe {
    background: white;
    border-radius: 4px;
}

/* Loading spinner for iframe */
.cpm-modal-body::before {
    content: '';
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2c5530;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/**
 * ========================================================================
 * PHASE 4: SEARCH TAB - CSS STYLES
 * ========================================================================
 *
 * ADD THIS CODE to portal.css
 *
 * Location: At the end of the file (after all existing styles)
 *
 * These styles provide:
 * 1. Search filters bar layout
 * 2. Search results table styling
 * 3. Action buttons styling
 * 4. History modal styling
 * 5. Pagination controls
 * 6. Mobile responsive breakpoints
 *
 * DOC-CHANGE: 2025-10-05 - Claude - Added Phase 4 search tab styles
 * ========================================================================
 */

/* ========================================================================
   SEARCH FILTERS BAR
   ======================================================================== */

.cpm-search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.cpm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cpm-filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpm-filter-select,
.cpm-filter-input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 140px;
    background: white;
    transition: border-color 0.2s;
}

.cpm-filter-select:focus,
.cpm-filter-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.cpm-search-input-group {
    flex-grow: 1;
    min-width: 200px;
}

.cpm-search-input-group .cpm-filter-input {
    width: 100%;
}

#search-button {
    padding: 8px 20px;
    height: 38px;
    align-self: flex-end;
}

#search-button svg {
    margin-right: 5px;
}

/* Search Results Info Bar */
.cpm-search-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #495057;
}

#search-results-count {
    font-weight: 600;
}

#clear-search {
    padding: 6px 12px;
}


/* ========================================================================
   SEARCH RESULTS TABLE
   ======================================================================== */

.cpm-table tbody td {
    vertical-align: middle;
}

/* Badge Styling */
.cpm-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpm-badge-success {
    background: #d4edda;
    color: #155724;
}

.cpm-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.cpm-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.cpm-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.cpm-badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* Actions Column */
.cpm-actions {
    white-space: nowrap;
}

.cpm-actions .cpm-btn {
    margin-right: 5px;
}

.cpm-actions .cpm-btn:last-child {
    margin-right: 0;
}

/* Action Button Colors */
.cpm-btn-info {
    background: var(--primary-blue);
    color: white;
}

.cpm-btn-info:hover {
    background: #1e40af;
}

.cpm-btn-success {
    background: #10b981;
    color: white;
}

.cpm-btn-success:hover {
    background: #059669;
}

.cpm-btn-warning {
    background: #f59e0b;
    color: white;
}

.cpm-btn-warning:hover {
    background: #d97706;
}


/* ========================================================================
   PAGINATION CONTROLS
   ======================================================================== */

.cpm-pagination {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cpm-pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.cpm-pagination-info {
    font-size: 14px;
    color: #495057;
    font-weight: 600;
}

.cpm-pagination .cpm-btn {
    min-width: 100px;
}


/* ========================================================================
   LICENSE PLATE HISTORY MODAL
   ======================================================================== */

.cpm-modal-wide {
    max-width: 800px;
    width: 90%;
}

.cpm-history-table {
    margin-bottom: 0;
}

.cpm-history-table thead th {
    background: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.cpm-history-table tbody tr:hover {
    background: #f8f9fa;
}

#history-modal-title {
    margin: 0;
    font-size: 18px;
    color: #212529;
}

#history-modal-title #history-plate {
    color: var(--primary-blue);
    font-weight: 700;
}

#history-loading {
    padding: 40px;
}

#history-empty {
    padding: 40px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Spinner for loading states */
.cpm-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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


/* ========================================================================
   MOBILE RESPONSIVE BREAKPOINTS
   ======================================================================== */

/* Tablets and smaller (max-width: 1024px) */
@media (max-width: 1024px) {
    .cpm-search-filters {
        gap: 10px;
    }

    .cpm-filter-group {
        flex: 1 1 calc(50% - 10px);
        min-width: 150px;
    }

    .cpm-search-input-group {
        flex: 1 1 100%;
    }

    #search-button {
        width: 100%;
    }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    .cpm-search-filters {
        flex-direction: column;
        gap: 12px;
    }

    .cpm-filter-group {
        width: 100%;
    }

    .cpm-filter-select,
    .cpm-filter-input {
        width: 100%;
        min-width: 100%;
    }

    .cpm-search-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Make table scrollable horizontally */
    .cpm-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cpm-table {
        min-width: 800px; /* Force horizontal scroll */
    }

    /* Stack action buttons on mobile */
    .cpm-actions {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .cpm-actions .cpm-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 5px;
    }

    .cpm-actions .cpm-btn:last-child {
        margin-bottom: 0;
    }

    /* Pagination controls */
    .cpm-pagination-controls {
        flex-direction: column;
        gap: 10px;
    }

    .cpm-pagination .cpm-btn {
        width: 100%;
    }

    /* History modal */
    .cpm-modal-wide {
        width: 95%;
        max-width: none;
    }

    .cpm-history-table {
        font-size: 12px;
    }

    .cpm-history-table th,
    .cpm-history-table td {
        padding: 8px 6px;
    }
}

/* Extra small devices (max-width: 480px) */
@media (max-width: 480px) {
    .cpm-search-filters {
        padding: 15px;
    }

    .cpm-filter-group label {
        font-size: 11px;
    }

    .cpm-filter-select,
    .cpm-filter-input {
        font-size: 13px;
        padding: 6px 10px;
    }

    #search-button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .cpm-table {
        font-size: 12px;
    }

    .cpm-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .cpm-btn-small {
        padding: 5px 8px;
    }

    .cpm-btn-small svg {
        width: 14px;
        height: 14px;
    }

    #history-modal-title {
        font-size: 16px;
    }

    .cpm-history-table {
        font-size: 11px;
    }
}


/* ========================================================================
   ACCESSIBILITY & POLISH
   ======================================================================== */

/* Focus states for keyboard navigation */
.cpm-filter-select:focus,
.cpm-filter-input:focus,
.cpm-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Loading state for table */
.cpm-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Empty state styling */
.cpm-table tbody tr td[colspan] {
    text-align: center;
    color: #6c757d;
}

/* Hover effects for better UX */
.cpm-table tbody tr:hover {
    background: #f8f9fa;
    transition: background-color 0.2s;
}

/* Smooth transitions */
.cpm-btn,
.cpm-filter-select,
.cpm-filter-input {
    transition: all 0.2s ease-in-out;
}

/* Print styles (hide interactive elements when printing) */
@media print {
    .cpm-search-filters,
    .cpm-search-info,
    .cpm-pagination,
    .cpm-actions,
    .cpm-modal {
        display: none !important;
    }

    .cpm-table {
        border: 1px solid #000;
    }
}


/* ========================================================================
   DARK MODE SUPPORT - COMPREHENSIVE FIX
   ======================================================================== */

@media (prefers-color-scheme: dark) {
    /* Container and backgrounds */
    #cpm-portal-container {
        background: #1a202c;
        color: #e2e8f0;
    }

    /* Headers stay with gradient - good contrast */
    .cpm-portal-header {
        /* Keep existing gradient - it works in dark mode */
    }

    /* Date Selector */
    .cpm-date-selector {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }

    .cpm-date-content label {
        color: #e2e8f0;
    }

    .cpm-quick-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .cpm-quick-btn:hover {
        border-color: var(--primary-green-light);
        color: var(--success-green-light);
        background: #374151;
    }

    .cpm-quick-btn.active {
        /* Keep existing gradient - good contrast */
    }

    .cpm-custom-dates input[type="date"] {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
        color-scheme: dark; /* This makes the date picker dark */
    }

    /* Navigation Tabs */
    .cpm-nav-tabs {
        background: #2d3748;
        border-bottom-color: #4a5568;
    }

    .cpm-tab {
        color: #9ca3af;
    }

    .cpm-tab:hover {
        color: var(--success-green-light);
        background: #374151;
    }

    .cpm-tab.active {
        color: var(--success-green-light);
        border-bottom-color: var(--success-green-light);
    }

    /* Tab Content */
    .cpm-tab-content {
        background: #1a202c;
    }

    /* Section Headers */
    .cpm-section-header h2 {
        color: #f3f4f6;
    }

    .cpm-section-header p {
        color: #9ca3af;
    }

    /* Metric Cards */
    .cpm-metric-card {
        background: #2d3748;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .cpm-metric-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    }

    .cpm-metric-label {
        color: #9ca3af;
    }

    .cpm-metric-value {
        color: #f3f4f6;
    }

    .cpm-metric-subtext {
        color: #6b7280;
    }

    /* Tables */
    .cpm-table-container {
        background: #2d3748;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .cpm-data-table {
        color: #e2e8f0;
    }

    .cpm-data-table td {
        border-bottom-color: #4a5568;
        color: #e2e8f0;
    }

    .cpm-data-table tbody tr:hover {
        background: #374151;
    }

    /* Cards */
    .cpm-report-card,
    .cpm-summary-card,
    .cpm-meeting-section {
        background: #2d3748;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .cpm-report-card:hover,
    .cpm-summary-card:hover {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    }

    .cpm-report-content h3,
    .cpm-meeting-section h3 {
        color: #f3f4f6;
    }

    .cpm-report-content p {
        color: #9ca3af;
    }

    .cpm-summary-label {
        color: #9ca3af;
    }

    .cpm-summary-value {
        color: #f3f4f6;
    }

    /* Search Filters */
    .cpm-search-filters {
        background: #2d3748;
    }

    .cpm-filter-group label {
        color: #e2e8f0;
    }

    .cpm-filter-select,
    .cpm-filter-input {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .cpm-search-info {
        background: #374151;
        color: #e2e8f0;
    }

    /* Pagination */
    .cpm-pagination {
        background: #2d3748;
    }

    .cpm-pagination-info {
        color: #e2e8f0;
    }

    /* Buttons - CRITICAL FIX */
    .cpm-btn-secondary {
        background: #374151;
        color: #e2e8f0;
        border-color: #4a5568;
    }

    .cpm-btn-secondary:hover {
        background: #4b5563;
        border-color: var(--success-green-light);
        color: var(--success-green-light);
    }

    /* Action Buttons - ALWAYS VISIBLE */
    .action-btn {
        border: 2px solid #374151;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    }

    /* Action buttons - ALL GREEN in dark mode */
    .preview-btn,
    .plate-btn,
    .download-btn,
    .history-btn {
        background: linear-gradient(135deg, #15803d 0%, #22c55e 100%) !important;
        border-color: #15803d !important;
        color: #ffffff !important;
    }

    .preview-btn:hover,
    .plate-btn:hover,
    .download-btn:hover,
    .history-btn:hover {
        background: linear-gradient(135deg, #166534 0%, #16a34a 100%) !important;
        border-color: #166534 !important;
        color: #ffffff !important;
    }

    /* Modals */
    .cpm-modal {
        background-color: rgba(0, 0, 0, 0.85);
    }

    .cpm-modal-content {
        background-color: #2d3748;
        color: #e2e8f0;
    }

    .cpm-modal-header {
        border-bottom-color: #4a5568;
        /* Keep gradient - it works */
    }

    .cpm-modal-body {
        background: #2d3748;
    }

    .cpm-modal-footer {
        border-top-color: #4a5568;
        background: #2d3748;
    }

    /* Form Elements */
    .cpm-date-input,
    .cpm-textarea {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .cpm-textarea:focus,
    .cpm-date-input:focus {
        border-color: var(--success-green-light);
    }

    .cpm-meeting-info {
        background: #374151;
        color: #e2e8f0;
    }

    /* Tabs (offender/committee) */
    .cpm-offender-tab,
    .cpm-committee-tab {
        background: #374151;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .cpm-offender-tab:hover,
    .cpm-committee-tab:hover {
        border-color: var(--success-green-light);
        color: var(--success-green-light);
    }

    /* Error messages */
    .cpm-error {
        background: #2d3748;
        color: #f87171;
    }

    /* Loading states */
    .cpm-loading {
        color: #9ca3af;
    }

    /* Badges */
    .cpm-badge-success {
        background: #064e3b;
        color: #6ee7b7;
    }

    .cpm-badge-info {
        background: #164e63;
        color: #67e8f9;
    }

    .cpm-badge-warning {
        background: #78350f;
        color: #fcd34d;
    }

    .cpm-badge-danger {
        background: #7f1d1d;
        color: #fca5a5;
    }

    .cpm-badge-secondary {
        background: #374151;
        color: #9ca3af;
    }

    .cpm-offense-badge {
        /* Keep gradient - works well */
    }
}

/**
 * ========================================================================
 * END OF PHASE 4 SEARCH TAB STYLES
 * ========================================================================
 */

/* Clear filters button */
#clear-search {
    margin-left: 10px;
}

/* Search pagination positioning */
.results-info,
.search-pagination {
    text-align: right;
    margin: 15px 0;
}

.search-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

/* ========================================================================
   COMMITTEE REVIEW PAGE - ALL GREEN BUTTON THEME
   ======================================================================== */

/* Committee decision select dropdowns - ALWAYS VISIBLE */
.decision-select {
    padding: 6px 10px !important;
    border: 2px solid #4a5568 !important;
    background: #ffffff !important;
    color: #1f2937 !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    min-width: 120px !important;
}

.decision-select:focus {
    border-color: var(--primary-green) !important;
    outline: 2px solid rgba(44, 85, 48, 0.2) !important;
    outline-offset: 0 !important;
}

/* ALL buttons in committee review - GREEN THEME */
#committee-review-wrap .button,
#committee-review-wrap .button-primary,
#committee-review-wrap .button-secondary,
.wp-list-table .button,
.wp-list-table .button-primary,
.wp-list-table .button-secondary {
    background: linear-gradient(135deg, #2c5530 0%, #3a6e3f 100%) !important;
    border: 2px solid #2c5530 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    margin: 4px 4px 4px 0 !important;
}

#committee-review-wrap .button:hover,
#committee-review-wrap .button-primary:hover,
#committee-review-wrap .button-secondary:hover,
.wp-list-table .button:hover,
.wp-list-table .button-primary:hover,
.wp-list-table .button-secondary:hover {
    background: linear-gradient(135deg, #1e3a22 0%, #2c5530 100%) !important;
    border-color: #1e3a22 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* DARK MODE: Committee Review Page */
@media (prefers-color-scheme: dark) {
    #committee-review-wrap {
        background: #1a202c !important;
        color: #e2e8f0 !important;
    }

    #committee-review-wrap .wrap {
        background: #1a202c;
    }

    #committee-review-wrap h1 {
        color: #f3f4f6 !important;
    }

    .decision-select {
        background: #374151 !important;
        color: #e2e8f0 !important;
        border-color: #4a5568 !important;
    }

    #committee-review-wrap .button {
        background: #374151 !important;
        border-color: #22c55e !important;
        color: #22c55e !important;
    }

    #committee-review-wrap .button:hover {
        background: #4b5563 !important;
        border-color: #4ade80 !important;
        color: #4ade80 !important;
    }

    #committee-review-wrap .button-secondary {
        background: #374151 !important;
        border-color: #9ca3af !important;
        color: #e2e8f0 !important;
    }

    #committee-review-wrap .button-secondary:hover {
        background: #4b5563 !important;
        border-color: #d1d5db !important;
        color: #f3f4f6 !important;
    }

    .wp-list-table {
        background: #2d3748 !important;
        color: #e2e8f0 !important;
    }

    .wp-list-table th {
        background: #374151 !important;
        color: #f3f4f6 !important;
        border-color: #4a5568 !important;
    }

    .wp-list-table td {
        background: #2d3748 !important;
        color: #e2e8f0 !important;
        border-color: #4a5568 !important;
    }

    .wp-list-table tr:hover td {
        background: #374151 !important;
    }

    .wp-list-table textarea {
        background: #374151 !important;
        color: #e2e8f0 !important;
        border-color: #4a5568 !important;
    }
}
