/*
   EVENTS CONFIG - Tracking v2.0
   Vista de configuracion de eventos: mapeos, codigos, diagnostico.
 */

/* LAYOUT */
.ecfg-app-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 58px);
    overflow: hidden;
    padding: 0.75rem;
    gap: 0.75rem;
}

/* TABS */
.ecfg-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    flex-shrink: 0;
}

.ecfg-tab {
    padding: 0.5rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    font-family: var(--font-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.ecfg-tab:hover {
    color: var(--text-primary);
    background: var(--hover-color);
}

.ecfg-tab.active {
    color: var(--green-primary);
    border-bottom-color: var(--green-primary);
}

/* TAB CONTENT */
.ecfg-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    gap: 0.75rem;
}

.ecfg-tab-content.active {
    display: flex;
}

/* SECTION HEADER */
.ecfg-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 1rem;
}

.ecfg-section-header h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.ecfg-section-header p {
    font-size: var(--font-size-xs);
}

/* TABLE */
.ecfg-table-scroll {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.ecfg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.ecfg-table thead {
    background: var(--table-header);
    position: sticky;
    top: 0;
    z-index: 2;
}

.ecfg-table th {
    padding: 0.55rem 0.65rem;
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.ecfg-table td {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.ecfg-table tbody tr {
    transition: background 0.15s;
}

.ecfg-table tbody tr:hover {
    background: var(--hover-color);
}

.ecfg-table tbody tr:last-child td {
    border-bottom: none;
}

/* CELDAS ESPECIALES */
.ecfg-code {
    font-family: monospace;
    font-size: var(--font-size-xs);
    background: var(--hover-color);
    padding: 2px 6px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.ecfg-count {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ecfg-date {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
}

.ecfg-desc {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ecfg-notes {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* BADGES */
.ecfg-badge-store {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.ecfg-badge-store.yes {
    background: rgba(22,163,74,0.12);
    color: var(--status-success);
}

.ecfg-badge-store.no {
    background: rgba(220,53,69,0.12);
    color: var(--status-error);
}

.ecfg-badge-active {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.ecfg-badge-active.yes {
    background: rgba(22,163,74,0.12);
    color: var(--status-success);
}

.ecfg-badge-active.no {
    background: rgba(148,163,184,0.15);
    color: var(--text-secondary);
}

/* Reutilizar badges de severidad */
.ecfg-sev-critical { background: rgba(220,38,38,0.12); color: #dc2626; }
.ecfg-sev-high     { background: rgba(234,88,12,0.12); color: #ea580c; }
.ecfg-sev-medium   { background: rgba(217,119,6,0.12); color: #d97706; }
.ecfg-sev-low      { background: rgba(37,99,235,0.12); color: #2563eb; }
.ecfg-sev-info     { background: rgba(148,163,184,0.15); color: var(--text-secondary); }

.ecfg-sev {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

/* ACTIONS */
.ecfg-actions {
    display: flex;
    gap: 0.35rem;
    white-space: nowrap;
}

.ecfg-actions .btn {
    padding: 3px 8px;
    font-size: var(--font-size-xs);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .ecfg-section-header {
        flex-direction: column;
    }
    .ecfg-tabs {
        overflow-x: auto;
    }
}

/* GROUP HEADERS (NO MAPEADOS) */
.ecfg-group-header td {
    padding: 0.4rem 0.65rem;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.ecfg-group-provider td {
    background: rgba(22, 163, 74, 0.06);
    color: var(--status-success);
}

.ecfg-group-no-provider td {
    background: rgba(220, 53, 69, 0.06);
    color: var(--status-error);
}

.ecfg-no-provider {
    font-style: italic;
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}

/* OCCURRENCES (MAPEOS) */
.ecfg-occ-high {
    font-weight: 700;
    color: var(--status-error);
}

.ecfg-occ-med {
    font-weight: 600;
    color: #d97706;
}

.ecfg-occ-low {
    color: var(--text-secondary);
}

.btn-warning {
    background: #d97706;
    color: #fff;
    border: none;
}
