/**
 * SECOP Suite - Frontend Styles
 *
 * @package SecopSuite
 * @version 4.1.0
 *
 * ═══════════════════════════════════════════════════════════════════════
 * CSS REFERENCE — Variables, Classes & IDs
 * ═══════════════════════════════════════════════════════════════════════
 *
 * ── CSS Custom Properties (Variables) ─────────────────────────────────
 *   --ss-primary           #0082c6   Main brand color
 *   --ss-primary-hover     #006ba3   Hover state
 *   --ss-secondary         #6c757d   Secondary actions
 *   --ss-success           #28a745   Success states
 *   --ss-gray-100..900     Grayscale (100=lightest, 900=darkest)
 *   --ss-white             #ffffff
 *   --ss-shadow            Default box shadow
 *   --ss-shadow-lg         Large shadow (modals)
 *   --ss-radius            4px  Small border radius
 *   --ss-radius-lg         8px  Large border radius
 *   --ss-transition        Default transition
 *   --ss-font              System font stack
 *
 *   Filter-specific:
 *   --ss-filter-accent     Accent color for filter container (default: --ss-primary)
 *   --ss-filter-border     Border color for filter container
 *   --ss-filter-radius     Border radius for filter container
 *
 * ── Chart Module Classes ──────────────────────────────────────────────
 *   .ss-chart-container    Main chart wrapper (id="ss-chart-{id}-{uid}")
 *   .ss-toolbar            Toolbar row
 *   .ss-toolbar-btn        Toolbar button (data-action)
 *   .ss-chart-wrapper      Chart area wrapper
 *   .ss-chart-render       D3plus render target (id="{uid}-render")
 *   .ss-loading            Loading overlay
 *   .ss-spinner            CSS spinner
 *   .ss-loaded             Applied when chart renders (hides loading)
 *   .ss-error-message      Error display
 *   .ss-error              Inline error paragraph
 *
 * ── Modal Classes ─────────────────────────────────────────────────────
 *   .ss-modal              Modal wrapper
 *   .ss-modal-overlay      Backdrop
 *   .ss-modal-content      Content box
 *   .ss-modal-small        Small modal variant
 *   .ss-modal-header       Header with title + close
 *   .ss-modal-body         Scrollable body
 *   .ss-modal-footer       Footer with buttons
 *   .ss-modal-close        Close X button
 *   .ss-modal-close-btn    Close text button
 *
 * ── Data Table ────────────────────────────────────────────────────────
 *   .ss-data-table-wrapper Scrollable wrapper
 *   .ss-data-table         Table element
 *
 * ── Detail Table ──────────────────────────────────────────────────────
 *   .ss-detail-table       Key-value table in detail modal
 *
 * ── Share Modal ───────────────────────────────────────────────────────
 *   .ss-share-buttons      Social buttons container
 *   .ss-share-btn          Share button (circle)
 *   .ss-share-facebook     Facebook variant
 *   .ss-share-twitter      Twitter/X variant
 *   .ss-share-linkedin     LinkedIn variant
 *   .ss-share-whatsapp     WhatsApp variant
 *   .ss-share-copy         Copy link button
 *   .ss-share-link         Link input wrapper
 *
 * ── Buttons ───────────────────────────────────────────────────────────
 *   .ss-btn                Base button
 *   .ss-btn-primary        Primary (accent) button
 *   .ss-btn-secondary      Secondary (gray) button
 *
 * ── Toast ─────────────────────────────────────────────────────────────
 *   .ss-toast              Toast notification
 *
 * ── Filter Module Classes ─────────────────────────────────────────────
 *   (See detailed reference above the Filter Module section)
 *
 * ── Dynamic IDs ───────────────────────────────────────────────────────
 *   #ss-chart-{id}-{uid}              Chart container
 *   #ss-chart-{id}-{uid}-render       Chart render area
 *   #ss-chart-{id}-{uid}-config       JSON config
 *   #ss-chart-{id}-{uid}-data-modal   Data modal
 *   #ss-chart-{id}-{uid}-share-modal  Share modal
 *   #ss-chart-{id}-{uid}-detail-modal Detail modal
 *   #ss-filter-{id}-{uid}             Filter container
 *   #ss-filter-{id}-{uid}-config      Filter JSON config
 *
 * ═══════════════════════════════════════════════════════════════════════
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --ss-primary: #0082c6;
    --ss-primary-hover: #006ba3;
    --ss-secondary: #6c757d;
    --ss-success: #28a745;
    --ss-gray-100: #f8f9fa;
    --ss-gray-200: #e9ecef;
    --ss-gray-300: #dee2e6;
    --ss-gray-500: #adb5bd;
    --ss-gray-600: #6c757d;
    --ss-gray-700: #495057;
    --ss-gray-800: #343a40;
    --ss-gray-900: #212529;
    --ss-white: #ffffff;
    --ss-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --ss-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.2);
    --ss-radius: 4px;
    --ss-radius-lg: 8px;
    --ss-transition: all 0.2s ease;
    --ss-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Container
   ========================================================================== */
.ss-chart-container {
    position: relative;
    background: var(--ss-white);
    border-radius: var(--ss-radius-lg);
    box-shadow: var(--ss-shadow);
    margin: 20px 0;
    font-family: var(--ss-font);
}

/* ==========================================================================
   Toolbar - Minimalista como en las imágenes de referencia
   ========================================================================== */
.ss-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ss-gray-200);
}

.ss-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--ss-gray-600);
    font-size: 13px;
    font-family: var(--ss-font);
    cursor: pointer;
    border-radius: var(--ss-radius);
    transition: var(--ss-transition);
}

.ss-toolbar-btn:hover {
    background: var(--ss-gray-100);
    color: var(--ss-primary);
}

.ss-toolbar-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.ss-toolbar-btn span {
    white-space: nowrap;
}

/* Responsive toolbar */
@media (max-width: 600px) {
    .ss-toolbar-btn span {
        display: none;
    }
    
    .ss-toolbar-btn {
        padding: 8px;
    }
}

/* ==========================================================================
   Chart Wrapper
   ========================================================================== */
.ss-chart-wrapper {
    position: relative;
    min-height: 300px;
    padding: 20px;
}

.ss-chart-render {
    width: 100%;
    height: 100%;
}

/* D3plus overrides */
.ss-chart-render svg {
    font-family: var(--ss-font) !important;
}

.ss-chart-render .d3plus-viz {
    font-family: var(--ss-font) !important;
}

/* ==========================================================================
   Loading State
   ========================================================================== */
.ss-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

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

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

.ss-loading p {
    margin-top: 15px;
    color: var(--ss-gray-600);
    font-size: 14px;
}

/* Ocultar loading cuando se carga */
.ss-chart-container.ss-loaded .ss-loading {
    display: none;
}

/* ==========================================================================
   Error State
   ========================================================================== */
.ss-error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--ss-gray-600);
}

.ss-error-message svg {
    width: 48px;
    height: 48px;
    color: var(--ss-gray-400);
    margin-bottom: 10px;
}

.ss-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--ss-radius);
    color: #856404;
    text-align: center;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */
.ss-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ss-font);
}

.ss-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.ss-modal-content {
    position: relative;
    background: var(--ss-white);
    border-radius: var(--ss-radius-lg);
    box-shadow: var(--ss-shadow-lg);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: ss-modal-in 0.2s ease;
}

.ss-modal-small {
    max-width: 450px;
}

@keyframes ss-modal-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.ss-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ss-gray-800);
}

.ss-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--ss-gray-500);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: var(--ss-transition);
}

.ss-modal-close:hover {
    color: var(--ss-gray-800);
}

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

.ss-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--ss-gray-200);
}

/* ==========================================================================
   Data Table in Modal
   ========================================================================== */
.ss-data-table-wrapper {
    overflow-x: auto;
    max-height: 60vh;
}

.ss-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ss-data-table th,
.ss-data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--ss-gray-200);
}

.ss-data-table th {
    background: var(--ss-gray-100);
    font-weight: 600;
    color: var(--ss-gray-700);
    position: sticky;
    top: 0;
    z-index: 1;
}

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

/* ==========================================================================
   Detail Table
   ========================================================================== */
.ss-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.ss-detail-table th,
.ss-detail-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--ss-gray-200);
}

.ss-detail-table th {
    width: 40%;
    text-align: left;
    font-weight: 600;
    color: var(--ss-gray-600);
}

.ss-detail-table td {
    color: var(--ss-gray-800);
}

/* ==========================================================================
   Share Modal
   ========================================================================== */
.ss-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.ss-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ss-gray-100);
    color: var(--ss-gray-700);
    text-decoration: none;
    transition: var(--ss-transition);
    border: none;
    cursor: pointer;
}

.ss-share-btn svg {
    width: 22px;
    height: 22px;
}

.ss-share-btn:hover {
    transform: translateY(-2px);
}

.ss-share-facebook:hover {
    background: #1877f2;
    color: white;
}

.ss-share-twitter:hover {
    background: #000000;
    color: white;
}

.ss-share-linkedin:hover {
    background: #0a66c2;
    color: white;
}

.ss-share-whatsapp:hover {
    background: #25d366;
    color: white;
}

.ss-share-copy:hover {
    background: var(--ss-primary);
    color: white;
}

.ss-share-link {
    margin-top: 15px;
}

.ss-share-link input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ss-gray-300);
    border-radius: var(--ss-radius);
    font-size: 13px;
    color: var(--ss-gray-600);
    background: var(--ss-gray-100);
}

.ss-share-link input:focus {
    outline: none;
    border-color: var(--ss-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.ss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--ss-radius);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ss-font);
    cursor: pointer;
    transition: var(--ss-transition);
}

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

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

.ss-btn-secondary {
    background: var(--ss-gray-200);
    color: var(--ss-gray-700);
}

.ss-btn-secondary:hover {
    background: var(--ss-gray-300);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.ss-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--ss-gray-800);
    color: white;
    border-radius: var(--ss-radius);
    font-size: 14px;
    z-index: 100001;
    animation: ss-toast-in 0.3s ease;
}

@keyframes ss-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ==========================================================================
   D3plus Timeline Override
   ========================================================================== */
.ss-chart-render .d3plus-Timeline {
    margin-top: 20px;
}

.ss-chart-render .d3plus-Timeline .d3plus-Button {
    fill: var(--ss-primary) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .ss-chart-container {
        margin: 10px 0;
        border-radius: var(--ss-radius);
    }

    .ss-chart-wrapper {
        padding: 10px;
        min-height: 250px;
    }

    .ss-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    .ss-toolbar {
        padding: 8px 12px;
    }
}

/* ==========================================================================
   Filter Module
   ==========================================================================

   CSS Reference — Filter Module (Frontend)

   Variables:
     --ss-filter-accent       Custom accent color for the filter container
     --ss-filter-border       Border color for the filter container
     --ss-filter-radius       Border radius for the filter container

   Container:
     .ss-filter-container     Main wrapper (data-filter-id attribute)
     .ss-filter-form-wrapper  Form area with background

   Form Fields:
     .ss-filter-fields        Grid layout for filter fields
     .ss-filter-field-group   Individual field wrapper (data-field-type attribute)
     .ss-filter-label         Field label
     .ss-filter-input         Text input field
     .ss-filter-select        Dropdown select
     .ss-filter-range         Range wrapper (from-to)
     .ss-filter-range-from    Range start input
     .ss-filter-range-to      Range end input
     .ss-filter-range-sep     Range separator text
     .ss-filter-checkboxes    Checkbox group wrapper (data-column attribute)
     .ss-filter-checkbox-label  Individual checkbox label

   Actions:
     .ss-filter-actions       Button row
     .ss-filter-search-btn    Search button
     .ss-filter-clear-btn     Clear button

   Results:
     .ss-filter-results             Results wrapper
     .ss-filter-results-header      Header with count
     .ss-filter-results-count       Count text
     .ss-filter-results-table-wrapper  Scrollable table wrapper
     .ss-filter-results-table       Results table
     .ss-filter-url-cell            URL column cell
     .ss-filter-url-link            External link icon

   Pagination:
     .ss-filter-pagination          Pagination wrapper
     .ss-filter-pagination-nav      Nav element
     .ss-filter-page-btn            Page button
     .ss-filter-page-num            Page number
     .ss-filter-page-active         Active page

   States:
     .ss-filter-loading             Loading spinner
     .ss-filter-no-results          Empty state
     .ss-filter-loading-options     Loading text for options

   IDs (per-instance, dynamic):
     #ss-filter-{id}-{uid}         Container ID
     #ss-filter-{id}-{uid}-config  JSON config script
   ========================================================================== */

.ss-filter-container {
    --ss-filter-accent: var(--ss-primary);
    --ss-filter-border: var(--ss-gray-200);
    --ss-filter-radius: var(--ss-radius-lg);
    background: var(--ss-white);
    border-radius: var(--ss-filter-radius);
    box-shadow: var(--ss-shadow);
    margin: 20px 0;
    font-family: var(--ss-font);
    overflow: hidden;
    border: 1px solid var(--ss-filter-border);
    border-top: 3px solid var(--ss-filter-accent);
}

.ss-filter-form-wrapper {
    padding: 24px;
    background: linear-gradient(180deg, #f8fbff 0%, var(--ss-gray-100) 100%);
    border-bottom: 1px solid var(--ss-filter-border);
}

.ss-filter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ss-filter-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--ss-white);
    padding: 14px 16px;
    border-radius: 6px;
    border: 1px solid var(--ss-gray-200);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: var(--ss-transition);
}

.ss-filter-field-group:hover {
    border-color: var(--ss-filter-accent);
    box-shadow: 0 2px 8px rgba(0, 130, 198, 0.08);
}

.ss-filter-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ss-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ss-filter-input,
.ss-filter-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--ss-gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--ss-font);
    color: var(--ss-gray-800);
    background: var(--ss-white);
    transition: var(--ss-transition);
}

.ss-filter-input:focus,
.ss-filter-select:focus {
    outline: none;
    border-color: var(--ss-filter-accent);
    box-shadow: 0 0 0 3px rgba(0, 130, 198, 0.12);
}

.ss-filter-input::placeholder {
    color: var(--ss-gray-500);
    font-style: italic;
}

.ss-filter-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ss-filter-range-sep {
    color: var(--ss-gray-500);
    font-weight: 600;
    font-size: 16px;
}

.ss-filter-range .ss-filter-input {
    flex: 1;
}

.ss-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: var(--ss-white);
    border: 1.5px solid var(--ss-gray-300);
    border-radius: 6px;
}

.ss-filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--ss-gray-700);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: var(--ss-transition);
}

.ss-filter-checkbox-label:hover {
    background: #f0f6fc;
    border-color: var(--ss-filter-accent);
}

.ss-filter-checkbox-label input:checked + span {
    color: var(--ss-filter-accent);
    font-weight: 600;
}

.ss-filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    padding-top: 4px;
}

.ss-filter-search-btn {
    background: var(--ss-filter-accent) !important;
    border-color: var(--ss-filter-accent) !important;
    min-width: 120px;
}

.ss-filter-search-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 130, 198, 0.3);
}

.ss-filter-actions .ss-btn svg {
    vertical-align: middle;
    margin-right: 4px;
}

/* Filter Results */
.ss-filter-results {
    padding: 0;
}

.ss-filter-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--ss-gray-100);
    border-bottom: 1px solid var(--ss-gray-200);
}

.ss-filter-results-count {
    font-size: 13px;
    color: var(--ss-gray-600);
    font-weight: 500;
}

.ss-filter-results-table-wrapper {
    overflow-x: auto;
}

.ss-filter-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ss-filter-results-table th,
.ss-filter-results-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--ss-gray-200);
    white-space: nowrap;
}

.ss-filter-results-table th {
    background: var(--ss-gray-100);
    font-weight: 600;
    color: var(--ss-gray-700);
    position: sticky;
    top: 0;
    z-index: 1;
    text-transform: capitalize;
}

.ss-filter-results-table tbody tr {
    transition: var(--ss-transition);
}

.ss-filter-results-table tbody tr:hover {
    background: #f0f6fc;
}

.ss-filter-results-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.ss-filter-results-table tbody tr:nth-child(even):hover {
    background: #f0f6fc;
}

.ss-filter-results-table td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ss-gray-800);
}

/* URL Link */
.ss-filter-url-cell {
    text-align: center !important;
    width: 50px !important;
    padding: 6px !important;
}

.ss-filter-url-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--ss-filter-accent, var(--ss-primary));
    background: rgba(0, 130, 198, 0.08);
    transition: var(--ss-transition);
    text-decoration: none;
    border: 1.5px solid transparent;
}

.ss-filter-url-link:hover {
    background: var(--ss-filter-accent, var(--ss-primary));
    color: var(--ss-white);
    border-color: var(--ss-filter-accent, var(--ss-primary));
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 130, 198, 0.3);
}

/* Pagination */
.ss-filter-pagination {
    padding: 16px 20px;
    border-top: 1px solid var(--ss-gray-200);
}

.ss-filter-pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.ss-filter-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ss-radius);
    text-decoration: none;
    font-size: 14px;
    color: var(--ss-gray-600);
    transition: var(--ss-transition);
}

.ss-filter-page-num:hover {
    background: var(--ss-gray-100);
    color: var(--ss-primary);
}

.ss-filter-page-active {
    background: var(--ss-filter-accent, var(--ss-primary)) !important;
    color: var(--ss-white) !important;
    border: 1px solid var(--ss-filter-accent, var(--ss-primary));
    box-shadow: 0 1px 4px rgba(0, 130, 198, 0.25);
}

.ss-filter-pagination-nav .ss-btn {
    font-size: 13px;
    padding: 6px 14px;
}

/* Filter Loading / No Results */
.ss-filter-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.ss-filter-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--ss-gray-500);
}

.ss-filter-no-results svg {
    margin-bottom: 10px;
}

.ss-filter-loading-options {
    font-size: 12px;
    color: var(--ss-gray-500);
    font-style: italic;
}

@media (max-width: 768px) {
    .ss-filter-fields {
        grid-template-columns: 1fr;
    }

    .ss-filter-results-table th,
    .ss-filter-results-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}

/* ==========================================================================
   Export Module
   ========================================================================== */
.ss-export-container {
    background: var(--ss-white);
    border-radius: var(--ss-radius-lg);
    box-shadow: var(--ss-shadow);
    margin: 20px 0;
    font-family: var(--ss-font);
    overflow: hidden;
    border: 1px solid var(--ss-gray-200);
}

.ss-export-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #1a3a5c 0%, #2271b1 100%);
    color: #fff;
}

.ss-export-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ss-export-icon svg {
    color: #fff;
}

.ss-export-info h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
}

.ss-export-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.ss-export-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 24px;
}

.ss-export-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ss-gray-800);
    border: 1.5px solid var(--ss-gray-200);
    transition: all 0.2s ease;
    background: var(--ss-white);
}

.ss-export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ss-export-csv:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.ss-export-txt:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.ss-export-json:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.ss-export-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ss-export-csv .ss-export-btn-icon {
    background: #dcfce7;
    color: #16a34a;
}

.ss-export-txt .ss-export-btn-icon {
    background: #dbeafe;
    color: #2563eb;
}

.ss-export-json .ss-export-btn-icon {
    background: #fef3c7;
    color: #d97706;
}

.ss-export-btn-text {
    display: flex;
    flex-direction: column;
}

.ss-export-btn-text strong {
    font-size: 15px;
    font-weight: 700;
}

.ss-export-btn-text small {
    font-size: 12px;
    color: var(--ss-gray-500);
}

.ss-export-api {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--ss-gray-200);
    background: var(--ss-gray-100);
}

.ss-export-api-label {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ss-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ss-export-api-url {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--ss-white);
    border: 1px solid var(--ss-gray-300);
    border-radius: 6px;
    margin-bottom: 10px;
}

.ss-export-api-url code {
    flex: 1;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
    color: var(--ss-primary);
    word-break: break-all;
    background: none;
    padding: 0;
}

.ss-export-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ss-gray-500);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}

.ss-export-copy-btn:hover {
    color: var(--ss-primary);
    background: var(--ss-gray-100);
}

.ss-export-api-params {
    margin: 0;
    font-size: 12px;
    color: var(--ss-gray-600);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ss-export-api-params code {
    font-size: 11px;
    padding: 2px 6px;
    background: var(--ss-white);
    border: 1px solid var(--ss-gray-300);
    border-radius: 3px;
    color: var(--ss-gray-700);
}

@media (max-width: 768px) {
    .ss-export-buttons {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .ss-toolbar,
    .ss-modal {
        display: none !important;
    }

    .ss-chart-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Módulo Seguimiento de Dependencias
   ========================================================================== */
.ss-dep-chart-wrapper { margin: 1.5rem 0; }
.ss-dep-help { font-size: .8rem; color: #666; margin-top: .5rem; }
.ss-dep-analisis { line-height: 1.6; margin: .75rem 0; }
.ss-dep-prediccion { font-style: italic; }

/* ==========================================================================
   Click-to-drill modal (v5.1.9)
   Reutiliza .ss-modal / .ss-modal-content / .ss-data-table. Se inyecta por JS
   (sin display:none inline) por lo que .ss-modal (display:flex) lo muestra.
   ========================================================================== */
.ss-drill-modal { cursor: default; }
.ss-drill-modal .ss-modal-content { max-width: 1000px; }
.ss-drill-modal .ss-modal-body { max-height: 70vh; overflow: auto; }
.ss-drill-empty { color: var(--ss-gray-500, #666); text-align: center; padding: 1.5rem 0; margin: 0; }

/* ==========================================================================
   Red de contratación (v5.4.0) — grafo de fuerza [secop_dep_red]
   ========================================================================== */
.ss-red-module { margin: 1.5rem 0; }
.ss-red-controls { margin-bottom: .75rem; }
.ss-red-controls select { margin-left: .4rem; }
.ss-red-wrapper { position: relative; width: 100%; }
.ss-red-svg svg { width: 100%; height: auto; display: block; }
.ss-red-link { stroke: #d6d8db; stroke-opacity: .8; stroke-width: 1px; }
.ss-red-node { stroke: #fff; stroke-width: 1px; cursor: pointer; }
.ss-red-label { font-size: 11px; font-weight: 600; fill: #1d2327; pointer-events: none; }
.ss-red-hover-label { font-size: 11px; fill: #1d2327; pointer-events: none; }
.ss-red-tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 6px 9px;
    font-size: 12px;
    line-height: 1.4;
    color: #1d2327;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    pointer-events: none;
    z-index: 20;
    max-width: 280px;
}
.ss-red-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: .6rem;
    font-size: 12px;
    color: #50575e;
}
.ss-red-legend-item { display: inline-flex; align-items: center; gap: 5px; }
.ss-red-legend-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.ss-red-loading, .ss-rings-loading {
    padding: 2rem 0;
    text-align: center;
    color: #50575e;
    font-size: 13px;
}
.ss-red-caption {
    margin-top: .35rem;
    font-size: 12px;
    color: #50575e;
    font-weight: 600;
}

/* v5.4.1: Red ego (Rings d3plus). */
.ss-rings-module { margin: 1.5rem 0; }
.ss-rings-controls { margin-bottom: .75rem; }
.ss-rings-controls select { margin-left: .4rem; }
.ss-rings-wrapper { position: relative; width: 100%; }
.ss-rings-chart { width: 100%; }

/* v5.12.0: selector de filtro composable [secop_dep_selector]. */
.ss-dep-selector { margin: 0 0 .75rem; }
.ss-dep-selector label { font-weight: 600; }
.ss-dep-selector-coord { margin-left: .4rem; max-width: 100%; padding: .25rem .4rem; }

/* ==========================================================================
   Explorador interactivo (v5.6.0) — [secop_dep_explora]
   Treemap de dependencias + panel inferior (modalidades + acordeón de
   contratistas con sus contratos). Todo dinámico por AJAX.
   ========================================================================== */
.ss-explora-wrapper { margin: 1.5rem 0; }
.ss-explora-header { margin-bottom: .75rem; }
.ss-explora-download {
    display: inline-block;
    padding: .45rem .9rem;
    background: #0080c3;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.ss-explora-download:hover { background: #006699; color: #fff; }
.ss-explora-tree { width: 100%; position: relative; }
.ss-explora-loading,
.ss-explora-acc-loading,
.ss-explora-mod-loading {
    padding: 1.5rem 0;
    text-align: center;
    color: #50575e;
    font-size: 13px;
}
.ss-explora-panel {
    margin-top: 1rem;
    border-top: 2px solid #e0e0e0;
    padding-top: 1rem;
}
.ss-explora-dep-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1d2327;
    margin-bottom: .75rem;
}
.ss-explora-cols {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: flex-start;
}
.ss-explora-modalidades,
.ss-explora-contratistas {
    flex: 1 1 280px;
    min-width: 240px;
    max-height: 520px;
    overflow: auto;
}
.ss-explora-modalidades h4,
.ss-explora-contratistas h4 {
    margin: 0 0 .5rem;
    font-size: 14px;
    color: #1d2327;
}
.ss-explora-mod-list { list-style: none; margin: 0; padding: 0; }
.ss-explora-mod-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    padding: .45rem .6rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid transparent;
    margin-bottom: 3px;
    font-size: 13px;
    transition: background .12s ease;
}
.ss-explora-mod-item:hover { background: #f0f6fb; }
.ss-explora-mod-item.active {
    background: #e6f2fa;
    border-color: #0080c3;
    font-weight: 600;
}
.ss-explora-mod-name { flex: 1 1 auto; }
.ss-explora-mod-meta { flex: 0 0 auto; color: #50575e; font-size: 12px; }
.ss-explora-acc-item {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}
.ss-explora-acc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    width: 100%;
    text-align: left;
    padding: .6rem .8rem;
    background: #f6f7f7;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    color: #1d2327;
}
.ss-explora-acc-head:hover { background: #eef0f1; }
.ss-explora-acc-name { font-weight: 600; flex: 1 1 auto; }
.ss-explora-acc-meta { flex: 0 0 auto; color: #50575e; font-size: 12px; white-space: nowrap; }
.ss-explora-acc-body { display: none; padding: .5rem .8rem; background: #fff; overflow-x: auto; }
.ss-explora-acc-item.open .ss-explora-acc-body { display: block; }
.ss-explora-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ss-explora-table th {
    text-align: left;
    padding: .35rem .5rem;
    border-bottom: 2px solid #dcdcde;
    color: #50575e;
    font-weight: 600;
    white-space: nowrap;
}
.ss-explora-row1 td {
    padding: .35rem .5rem;
    border-top: 1px solid #f0f0f1;
    vertical-align: top;
}
.ss-explora-objeto {
    padding: .25rem .5rem .6rem;
    color: #50575e;
    font-style: italic;
    line-height: 1.45;
}
.ss-explora-empty { color: #50575e; text-align: center; padding: 1rem 0; margin: 0; }

@media (max-width: 600px) {
    .ss-explora-cols { flex-direction: column; }
    .ss-explora-modalidades,
    .ss-explora-contratistas { max-height: none; flex-basis: auto; }
}

/* ==========================================================================
   v5.8.0: Listas composables [secop_dep_lista]
   Listas independientes (dependencias / modalidades / tipos / contratistas)
   que coordinan un estado de filtro compartido en la misma página. Reutiliza
   la estética de .ss-explora-*.
   ========================================================================== */
.ss-lista { margin: 1rem 0; }
.ss-lista-title { margin: 0 0 .5rem; font-size: 14px; color: #1d2327; }
.ss-lista-body { overflow: auto; }
.ss-lista-loading,
.ss-lista-empty {
    padding: 1rem 0;
    text-align: center;
    color: #50575e;
    font-size: 13px;
    margin: 0;
}
.ss-lista-ul { list-style: none; margin: 0; padding: 0; }
.ss-lista-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    padding: .45rem .6rem;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid transparent;
    margin-bottom: 3px;
    font-size: 13px;
    transition: background .12s ease;
}
.ss-lista-item:hover { background: #f0f6fb; }
.ss-lista-item.active {
    background: #e6f2fa;
    border-color: #0080c3;
    font-weight: 600;
}
.ss-lista-name { flex: 1 1 auto; }
.ss-lista-meta { flex: 0 0 auto; color: #50575e; font-size: 12px; }
.ss-lista-acc-item {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    margin-bottom: 6px;
    overflow: hidden;
}
.ss-lista-acc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    width: 100%;
    text-align: left;
    padding: .6rem .8rem;
    background: #f6f7f7;
    border: 0;
    cursor: pointer;
    font-size: 13px;
    color: #1d2327;
}
.ss-lista-acc-head:hover { background: #eef0f1; }
.ss-lista-acc-name { font-weight: 600; flex: 1 1 auto; }
.ss-lista-acc-meta { flex: 0 0 auto; color: #50575e; font-size: 12px; white-space: nowrap; }
.ss-lista-acc-body { display: none; padding: .5rem .8rem; background: #fff; overflow-x: auto; }
.ss-lista-acc-item.open .ss-lista-acc-body { display: block; }
.ss-lista-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ss-lista-table th {
    text-align: left;
    padding: .35rem .5rem;
    border-bottom: 2px solid #dcdcde;
    color: #50575e;
    font-weight: 600;
    white-space: nowrap;
}
.ss-lista-row1 td {
    padding: .35rem .5rem;
    border-top: 1px solid #f0f0f1;
    vertical-align: top;
}
.ss-lista-objeto {
    padding: .25rem .5rem .6rem;
    color: #50575e;
    font-style: italic;
    line-height: 1.45;
}
.ss-rings-chart svg { width: 100%; height: auto; display: block; }

/* v5.7.0: Predicción de contratación (LinePlot + proyección punteada) */
.ss-pred-module { margin: 1rem 0; }
.ss-pred-controls { margin-bottom: .6rem; }
.ss-pred-controls label { font-weight: 600; }
.ss-pred-controls select { margin-left: .4rem; max-width: 100%; }
.ss-pred-wrapper { position: relative; }
.ss-pred-chart svg { width: 100%; height: auto; display: block; }
.ss-pred-loading { color: #50575e; text-align: center; padding: 1.5rem 0; }
.ss-pred-meta { margin-top: .6rem; color: #50575e; font-size: 13px; line-height: 1.5; }

/* Rings ego-network (d3 radial) — tooltip y leyenda (v5.7.1) */
.ss-rings-chart { position: relative; }
.ss-rings-tooltip { position: absolute; pointer-events: none; background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 6px 8px; font-size: 12px; box-shadow: 0 2px 6px rgba(0,0,0,.15); z-index: 10; max-width: 260px; }
.ss-rings-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 12px; align-items: center; }
.ss-rings-leg-item { display: inline-flex; align-items: center; gap: 4px; }
.ss-rings-leg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

/* ==========================================================================
   v5.10.0: Treemap composable [secop_dep_treemap] (filtrado cruzado + toolbar)
   Reutiliza .ss-toolbar / .ss-toolbar-btn del stack de gráficas (chart.php).
   ========================================================================== */
.ss-ctree-wrapper { margin: 1.5rem 0; }
.ss-ctree-chart { width: 100%; position: relative; }
.ss-ctree-chart svg { width: 100%; height: auto; display: block; }
.ss-ctree-loading {
    color: #50575e;
    text-align: center;
    padding: 1.5rem 0;
}
.ss-ctree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: .6rem;
    font-size: 12px;
    align-items: center;
}
.ss-ctree-leg-item { display: inline-flex; align-items: center; gap: 5px; }
.ss-ctree-leg-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    flex: 0 0 auto;
}
.ss-ctree-leg-label { color: #50575e; }
.ss-rings-caption { color: #666; margin-left: auto; }
