/* --- Modern Form Layout (Theme Agnostic) --- */
.lol-referral-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: inherit;
}
.lol-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.lol-col-half {
    display: flex;
    flex-direction: column;
}
.lol-col-full {
    grid-column: 1 / -1;
}
.lol-flex-row {
    display: flex;
    gap: 10px;
}
.lol-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}
.lol-input:focus {
    border-color: #007bff;
    outline: none;
}
.lol-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}
.lol-btn-primary {
    background-color: #007bff;
    color: white;
}
.lol-btn-primary:hover {
    background-color: #0056b3;
}
.lol-btn-small {
    padding: 5px 10px;
    font-size: 0.85rem;
    background-color: #6c757d;
    color: white;
}
.lol-alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}
.lol-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.lol-alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Modern Table Styling --- */
.lol-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.lol-table th, .lol-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.lol-table th {
    background-color: #f8f9fa;
}
/* --- Fix Bootstrap checkboxes/radios overlapping in WP Admin --- */
.form-check {
    position: relative;
    display: block;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.form-check-input {
    position: absolute !important;
    margin-top: 0.25rem !important;
    margin-left: -1.5rem !important;
}
.form-check-label {
    margin-bottom: 0;
    font-weight: normal;
}


/* --- Modern Legal-Tech UI Makeover --- */

/* 1. Futuristic but Professional Typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.container, .wrap, .modal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    color: #334155;
}

.container h3 {
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.025em;
}

.container .lead {
    color: #64748b;
    font-weight: 500;
    font-size: 1.1rem;
}

/* 2. Fix Checkbox & Radio Alignment (The Red Arrows) */
.container .form-check {
    padding-left: 1.75rem !important; 
    margin-bottom: 1.25rem !important; 
}

.container .form-check-input {
    /* Rely on WP's native radio dot, just fix the alignment */
    margin-left: -1.75rem !important;
    margin-top: 0.25rem !important;
    cursor: pointer;
}

/* 3. Modern Inputs & Selects (COMPRESSED) */
.container .form-control {
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    padding: 0.25rem 0.5rem !important; /* Tighter inner padding */
    font-size: 0.85rem; /* Slightly smaller text */
    color: #1e293b;
    background-color: #f8fafc;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: all 0.2s ease;
    box-sizing: border-box !important;
    height: 32px !important; /* Reduced from 38px */
    line-height: 1.5 !important;
}

.container select.form-control {
    appearance: none !important; 
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important; /* Shifted arrow for smaller box */
    background-size: 14px 10px !important; 
    padding-right: 1.75rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.container .form-control:focus {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    outline: none;
}

/* 4. Sleek Tables (COMPRESSED) */
.container .table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.container .table thead th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem; /* Smaller, crisp headers */
    letter-spacing: 0.02em;
    padding: 8px 10px; /* Highly compressed header height */
    border-bottom: 2px solid #e2e8f0;
    border-top: none;
}

.container .table td {
    vertical-align: middle;
    color: #334155;
    padding: 6px 10px; /* Highly compressed row height */
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

.container .table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* 5. Futuristic Buttons (COMPRESSED) */
.container .btn {
    border-radius: 4px; /* Matched to input boxes */
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0 1rem !important; /* Tighter horizontal padding */
    font-size: 0.85rem !important; /* Matched to input text */
    height: 32px !important; /* Exactly matches the input boxes */
    line-height: 32px !important; /* perfectly centers text vertically */
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: none;
    display: inline-block;
    vertical-align: middle;
}

/* Micro-Buttons specifically for the tables (View, Edit, Delete) */
.container .btn-sm {
    padding: 0 0.6rem !important;
    font-size: 0.75rem !important; /* Even smaller text */
    height: 26px !important; /* Super compressed for table rows */
    line-height: 26px !important;
    border-radius: 4px;
}

/* Primary Action Blue */
.container .btn-primary { 
    background-color: #2563eb; 
    color: #ffffff;
}
.container .btn-primary:hover { 
    background-color: #1d4ed8; 
    box-shadow: 0 3px 5px rgba(37, 99, 235, 0.3);
}

/* Edit Warning Amber */
.container .btn-warning { 
    background-color: #f59e0b; 
    color: #ffffff; 
}
.container .btn-warning:hover { 
    background-color: #d97706; 
    color: #ffffff;
    box-shadow: 0 3px 5px rgba(245, 158, 11, 0.3);
}

/* Delete/Cancel Danger Red */
.container .btn-danger { 
    background-color: #ef4444; 
    color: #ffffff;
}
.container .btn-danger:hover { 
    background-color: #dc2626; 
    box-shadow: 0 3px 5px rgba(239, 68, 68, 0.3);
}

/* 6. Form & Layout Spacing (COMPRESSED) */
.container .form-group {
    margin-bottom: 0.75rem !important; /* Shrink vertical gap between form fields (default is 1rem) */
}

.container label {
    margin-bottom: 0.2rem !important; /* Shrink gap between label and input */
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

/* Compress the expanded 'View/Edit' drawer specifically */
.container .row.mb-1 {
    margin-bottom: 0.25rem !important; /* Pull the read-only rows tight together */
}

.container .my-3 {
    margin-top: 0.75rem !important; /* Pull the whole drawer tighter */
    margin-bottom: 0.75rem !important;
}

/* Compress Textareas */
.container textarea.form-control {
    height: auto !important; /* Let textareas expand past the 32px limit */
    min-height: 60px; /* But keep them relatively short */
}

/* ==========================================================
   FRONT-END SEARCH MAKEOVER (Customized for lol- classes)
   ========================================================== */

.lol-referral-container, 
.lol-results-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    max-width: 100%;
    margin: 2rem 0;
}

/* 1. Alerts & Notifications */
.lol-alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}
.lol-alert-danger { background-color: #fef2f2; color: #b91c1c; border: 1px solid #f87171; }
.lol-alert-success { background-color: #f0fdf4; color: #15803d; border: 1px solid #4ade80; }

/* 2. Form Grid Layout */
.lol-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Automatically creates responsive columns */
    gap: 20px;
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    align-items: end;
}

/* Span full width for the button container */
.lol-col-full {
    grid-column: 1 / -1; 
}

/* Flex row for side-by-side Date pickers */
.lol-flex-row {
    display: flex;
    gap: 10px;
}
.lol-flex-row input {
    width: 100%; 
}

/* 3. Typography & Inputs */
.lol-referral-container label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 6px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.lol-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #ffffff;
    box-sizing: border-box;
    width: 100%;
    height: 38px;
    color: #1e293b;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.lol-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    outline: none;
}

select.lol-input {
    appearance: none; 
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 14px 10px;
    padding-right: 2rem;
}

/* 4. Buttons */
.lol-btn {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 0 24px;
    height: 38px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.lol-btn:hover {
    background-color: #1d4ed8;
    box-shadow: 0 3px 5px rgba(37, 99, 235, 0.2);
}

.lol-btn-small {
    background-color: #ffffff;
    color: #2563eb;
    border: 1px solid #cbd5e1;
    padding: 4px 12px;
    height: 30px;
    font-size: 0.75rem;
}

.lol-btn-small:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    box-shadow: none;
}

/* 5. Results Table */
.lol-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    font-size: 0.85rem;
    overflow: hidden;
}

.lol-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.lol-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #334155;
}

.lol-table tbody tr:hover { background-color: #f8fafc; }

/* Expanded View Drawer Style */
.lol-table tr[id^="lawyer-detail-view-"] td {
    background-color: #f8fafc;
    border-left: 4px solid #2563eb;
    padding: 15px 20px;
    color: #475569;
    line-height: 1.6;
}

/* ==========================================================
   FRONT-END SEARCH TWEAKS (Spacing Fixes)
   ========================================================== */

/* 1. Give the Date Periods double the space on desktop so they don't squish */
@media (min-width: 768px) {
    .lol-form-grid > div:nth-child(3),
    .lol-form-grid > div:nth-child(4) {
        grid-column: span 2; /* Tells the grid to stretch these across 2 columns */
    }
}

/* 2. Polish the "All Reports" checkbox above the grid */
.lol-referral-container .lol-form-group {
    margin-bottom: 15px;
    padding-left: 5px;
}

.lol-referral-container .lol-form-group label {
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.lol-referral-container .lol-form-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #2563eb; /* Matches your blue buttons */
}