/* BOE Simplificado - Main Styles */

/* ==========================================
   VARIABLES
   ========================================== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-sm: 4px;
    --border-radius-lg: 12px;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --sidebar-width: 220px;

    --transition-fast: 150ms ease;
    --transition: 200ms ease;
}

/* ==========================================
   RESET
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================
   UTILITIES
   ========================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ==========================================
   LOGIN SCREEN
   ========================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -1px;
}

.login-subtitle {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 12px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    text-align: center;
}

/* ==========================================
   APP LAYOUT
   ========================================== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    overflow: hidden;
}

.user-info .icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-secondary);
}

.view-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   PAGE HEADER
   ========================================== */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ==========================================
   LOADING STATES
   ========================================== */
.loading-initial {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

.loading-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    padding: 20px;
}

.loading-inline .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: 0;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
}

.btn .icon {
    width: 16px;
    height: 16px;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
}

/* ==========================================
   SEARCH BOX
   ========================================== */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
}

.search-box .form-input {
    padding-left: 42px;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================
   TAGS / BADGES
   ========================================== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tag-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.tag-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.tag-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.tag-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ==========================================
   STATS GRID
   ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==========================================
   TABLES
   ========================================== */
.table-container {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
}

.table tr:hover td {
    background: var(--bg-secondary);
}

.table td {
    font-size: 0.875rem;
}

/* ==========================================
   MODAL
   ========================================== */
.modal-container {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
}

.toast-close {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
}

.toast-close:hover {
    background: var(--bg-tertiary);
}

/* ==========================================
   PAGINATION
   ========================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
}

.pagination-btn {
    padding: 8px 16px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .view-container {
        padding: 16px;
    }

    .login-container {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   SEARCH PANEL
   ========================================== */
.search-panel {
    margin-bottom: 24px;
}

.search-main {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    align-items: center;
}

.search-box-lg {
    flex: 1;
}

.search-box-lg .form-input {
    padding: 12px 14px 12px 44px;
    font-size: 1rem;
}

.btn-filters-toggle {
    flex-shrink: 0;
}

.btn-filters-toggle.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.search-filters {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    padding-top: 16px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.filter-group {
    margin-bottom: 0;
}

.filters-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   RESULTS
   ========================================== */
.results-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.results-counter {
    font-weight: 500;
    color: var(--text-primary);
}

.selection-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.selection-counter {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.selection-counter.has-selection {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.results-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.results-per-page-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.form-select-sm {
    padding: 6px 32px 6px 10px;
    font-size: 0.8125rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ==========================================
   RESULT CARDS
   ========================================== */
.result-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.result-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
}

.result-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.02);
}

.result-checkbox {
    padding-top: 4px;
}

.result-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.result-rango {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.result-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.result-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.result-dept {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-id {
    font-family: monospace;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
}

.result-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--danger);
    color: white;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.result-pdf-link:hover {
    background: #c0392b;
    color: white;
}

.result-pdf-link .icon-small {
    width: 12px;
    height: 12px;
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ==========================================
   PAGINATION ENHANCED
   ========================================== */
.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-num {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-num:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.pagination-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--text-muted);
}

/* ==========================================
   MODAL WIDE
   ========================================== */
.modal-wide {
    max-width: 700px;
}

.modal-narrow {
    max-width: 400px;
}

/* ==========================================
   NORMA DETAIL MODAL
   ========================================== */
.norma-detail-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-section {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-section h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meta-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.detail-text-preview {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

/* ==========================================
   EXPORT MODAL
   ========================================== */
.export-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.radio-option:hover,
.checkbox-option:hover {
    background: var(--bg-tertiary);
}

.radio-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.radio-option input,
.checkbox-option input {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* ==========================================
   FILTER TAGS
   ========================================== */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    font-size: 0.8125rem;
}

.filter-tag-label {
    color: var(--text-muted);
}

.filter-tag-value {
    color: var(--text-primary);
    font-weight: 500;
}

.filter-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.filter-tag-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.clear-all-filters {
    margin-left: 8px;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */
@media (max-width: 768px) {
    .search-main {
        flex-wrap: wrap;
    }

    .search-box-lg {
        width: 100%;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .selection-controls {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .result-card {
        flex-direction: column;
    }

    .result-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .pagination-numbers {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 12px;
    }
}

/* ==========================================
   BOE BUTTON
   ========================================== */
.btn-boe {
    background: var(--primary);
    color: white;
    text-decoration: none;
}

.btn-boe:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-boe .icon {
    width: 14px;
    height: 14px;
}
