/* ─── static/css/dgc_addons.css ─────────────────────────────────────────────
   Addon modular específico para DGC (Dirección General de Concesiones).
   Reglas usadas únicamente por DGC.html / static/js/DGC/*.js, extraídas del
   design system global (static/css/styles.css) para mantenerlo liviano. */

/* ─── Separador mapa ↔ tabla (common/panel-resizer.js) ──────────────────────
   Estilos del separador en styles.css; aquí solo la grilla de DGC, con el
   ancho de la tabla en --catlec-table-width. 500px: mínimo en que se ven las
   4 columnas de la tabla (también en pantallas < 1200px). */
.dashboard-grid.catlec-resizable-grid {
    grid-template-columns: 240px minmax(0, 1fr) var(--catlec-table-width, 500px);
}

@media (max-width: 1200px) {
    .dashboard-grid.catlec-resizable-grid {
        grid-template-columns: 220px minmax(0, 1fr) var(--catlec-table-width, 500px);
    }
}

/* ─── Íconos de proyecto en el mapa MapLibre ────────────────────────────────
   DGC usa íconos de 24 px (EFE y Metro: 26 px, en .catlec-gl-marker de styles.css) */
.catlec-gl-marker {
    width: 24px;
    height: 24px;
}

/* ─── Company Participations Modal (Bidders View) ─────────────────────────── */
.company-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: modalFadeIn 0.2s ease-out;
}

.company-modal-container {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.22s ease-out;
}

.company-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.company-modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2563eb;
}

.company-modal-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-modal-subtitle {
    font-size: 0.73rem;
    color: #64748b;
    margin: 0.15rem 0 0 0;
}

.company-modal-close-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.company-modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #0f172a;
}

.company-modal-body {
    flex: 1;
    min-height: 180px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.85rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.company-concession-card {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    padding: 0.65rem 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.company-concession-card:hover {
    background: #f1f5f9;
    border-color: rgba(59, 130, 246, 0.35);
}

.company-btn-view-project {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.32rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.company-btn-view-project:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* ─── Icon size/color utilities ──────────────────────────────────────────────
   Extraídas de decenas de style="width:Npx;height:Npx" repetidos inline en
   DGC.html (íconos Lucide/SVG). Reduce a un solo lugar para cambiar tamaños
   o colores de ícono en vez de buscar y reemplazar en el HTML. */
.icon-10-block { width: 10px; height: 10px; display: block; }
.icon-11 { width: 11px; height: 11px; }
.icon-12 { width: 12px; height: 12px; }
.icon-13 { width: 13px; height: 13px; }
.icon-14 { width: 14px; height: 14px; }
.icon-15 { width: 15px; height: 15px; }
.icon-16 { width: 16px; height: 16px; }
.icon-17 { width: 17px; height: 17px; }
.icon-19 { width: 19px; height: 19px; }
.icon-20 { width: 20px; height: 20px; }
.icon-28 { width: 28px; height: 28px; }
.icon-chevron { width: 13px; height: 13px; margin-left: 0.35rem; }

.icon-color-primary { color: var(--primary); }
.icon-color-info { color: #0284c7; }
.icon-color-success { color: #059669; }
.icon-color-warning { color: #d97706; }
.icon-color-accent { color: #8b5cf6; }
.icon-color-muted { color: #64748b; }
.icon-color-violet { color: #7c3aed; }

/* Wrapper del canvas de gráfico de dona (Método de Licitación, etc.) */
.pie-canvas-wrap {
    width: 80px;
    height: 80px;
    min-width: 80px;
    flex-shrink: 0;
    position: relative;
}

/* ─── Ficha de proyecto (project-detail.js) ──────────────────────────────── */
.dgc-detail-head {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.dgc-detail-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.dgc-detail-title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

.dgc-detail-head-row .badge {
    flex-shrink: 0;
    margin-top: 2px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    white-space: nowrap;
}

.dgc-detail-subrow {
    display: flex;
    align-items: center;
    margin-top: 0.4rem;
}

.dgc-detail-subrow .btn svg {
    width: 13px;
    height: 13px;
}

/* Historial de licitaciones: control segmentado */
.dgc-relicit {
    gap: 0.35rem;
}

.dgc-section-caption {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.dgc-seg {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: #eef0f3;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.dgc-seg-btn {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.3rem 0.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.dgc-seg-btn:hover:not(.active) {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.6);
}

.dgc-seg-btn.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: default;
}

.dgc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-muted);
}

.dgc-status-dot--operacion { background: var(--success); }
.dgc-status-dot--construccion { background: var(--info); }
.dgc-status-dot--constr-op { background: var(--warning); }
.dgc-status-dot--licitacion { background: var(--accent); }

/* Avisos (callout) dentro de la ficha */
.dgc-detail-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem;
    border-left: 3px solid;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.dgc-detail-notice svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.dgc-detail-notice--licitacion {
    border-left-color: var(--accent);
    background: var(--accent-glow);
}

.dgc-detail-notice--licitacion svg { color: var(--accent); }

.dgc-detail-notice--empty {
    border-left-color: #d1d5db;
    background: #f9fafb;
}

.dgc-detail-notice--empty svg { color: var(--text-muted); }

/* Lista de oferentes */
.dgc-bidder-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dgc-bidder-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.4rem 0.55rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.74rem;
}

.dgc-bidder-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dgc-bidder-name {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
    word-break: break-word;
}

.dgc-bidder-members {
    margin-top: 0.15rem;
    font-size: 0.65rem;
    line-height: 1.25;
    color: var(--text-muted);
}

.dgc-bidder-item .badge {
    flex-shrink: 0;
    gap: 0.2rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.62rem;
}

.dgc-bidder-item .badge svg {
    width: 10px;
    height: 10px;
}

.dgc-bidders-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.78rem;
    margin-bottom: 0.1rem;
}

.dgc-bidders-title > span:first-child {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dgc-bidders-title .badge {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
}
