/* ==========================================================================
   RTA DASHBOARD - CORPORATE PREMIUM (GERENCIA VALLE / BAVARIA STYLE)
   ========================================================================== */

:root {
    /* Paleta Corporativa Premium */
    --accent-gold: #d4af37;
    --corporate-red: #c41230;
    --deep-dark: #0f1113;
    --card-dark: #1a1d21;
    --bg-main: #0a0c0e;
    --text-primary: #f1f1f1;
    --text-muted: #9ca3af;
    --border-dark: #2d3139;
    --success: #10b981;
    --warning: #f59e0b;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Base Dark UI */
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header & Identity */
.main-header {
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.welcome-text h1 {
    color: var(--text-primary);
    letter-spacing: 1px;
}

.highlight {
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.sub-welcome {
    color: var(--text-muted);
    font-weight: 300;
}

/* Botón Nuevo RTA (Estilo Portal) */
.btn-cta {
    background: linear-gradient(135deg, var(--corporate-red) 0%, #8b0000 100%);
    color: white;
    border: 1px solid var(--accent-gold);
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #5a0000;
    transition: all 0.2s ease;
}

.btn-cta:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #5a0000;
}

/* Stats Cards - Executive Style */
.rta-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-dark);
    padding: 20px;
    border-left: 4px solid var(--border-dark);
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--accent-gold);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
}

.stat-value {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-pending { border-left-color: var(--warning); }
.stat-process { border-left-color: var(--accent-gold); }
.stat-closed { border-left-color: var(--success); }

/* Filter Section */
.filter-card {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    padding: 20px;
    margin-bottom: 30px;
}

.filter-card label {
    color: var(--accent-gold);
    font-weight: 600;
}

.input-field, .select-field {
    background: #252a2f;
    border: 1px solid var(--border-dark);
    color: white;
}

.input-field:focus, .select-field:focus {
    border-color: var(--accent-gold);
    outline: none;
}

/* Placeholder Analytics */
.chart-container {
    background: #14171a;
    border: 1px solid var(--border-dark);
    color: var(--accent-gold);
    padding: 50px;
}

/* Listado / Tabla - Premium Dark */
.card.list-card {
    background: var(--card-dark);
    border-radius: 0;
    border-top: 3px solid var(--accent-gold);
}

.section__head h2 {
    color: white;
    font-size: 1.2rem;
    padding: 15px;
}

.rta-table-wrapper {
    display: none;
    border-top: 1px solid var(--border-dark);
}

.rta-table {
    width: 100%;
    color: var(--text-primary);
}

.rta-table th {
    background: #252a30;
    color: var(--accent-gold);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.rta-table td {
    border-bottom: 1px solid var(--border-dark);
}

.rta-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Badges */
.badge {
    border-radius: 2px;
    font-size: 0.7rem;
    padding: 4px 8px;
}

.status-pendiente, .status-abierto { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }
.status-en-proceso, .status-en-seguimiento { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid #3b82f6; }
.status-cerrado, .status-realizado { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }

/* Mobile View - Dark Cards */
.rta-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rta-card-mobile {
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    border-left: 3px solid var(--accent-gold);
}

.card-header {
    border-bottom: 1px solid var(--border-dark);
}

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

.card-body strong {
    color: var(--accent-gold);
}

/* Buttons */
.btn-action {
    background: #333940;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.btn-action:hover {
    background: var(--accent-gold);
    color: black;
}

/* Responsividad */
@media (min-width: 768px) {
    .rta-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .rta-table-wrapper {
        display: block;
    }
    
    .rta-mobile-list {
        display: none;
    }
}
/* Layout de Gráficas */
.rta-analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
}

@media (min-width: 992px) {
    .rta-analytics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart-container {
        height: 260px;
    }
}

.rta-analytics-grid .section {
    margin-bottom: 0 !important;
}

.trend-chart-container {
    height: 280px;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.card-rta-modal {
    background: #16191d;
    width: 90%;
    max-width: 500px;
    padding: 20px;
    border-top: 4px solid #d4af37;
}
/* ===== MODAL DETALLE RTA ===== */

.card-rta-modal {
    background: #16191d;
    border-top: 4px solid #d4af37;
    max-height: 90vh;
    overflow-y: auto;
    width: 95%;
    max-width: 650px;
}

/* Secciones internas */
.detail-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2d3139;
}

/* Grid superior */
.info-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.info-item label,
.info-full label,
.section-title {
    display: block;
    font-size: 0.7rem;
    color: #d4af37;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.info-item span {
    color: #fff;
    font-size: 0.95rem;
}

/* Texto destacado */
.highlight-gold {
    color: #d4af37;
    font-weight: 600;
    font-size: 1.1rem;
}

.text-scrollable {
    background: #0a0c0e;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* ===== HISTORIAL ===== */

.historial-scroll {
    max-height: 180px;
    overflow-y: auto;
    background: #0f1113;
    padding: 10px;
    border-radius: 4px;
}

.historial-item {
    border-left: 2px solid #d4af37;
    padding-left: 12px;
    margin-bottom: 15px;
}

.hist-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.hist-date {
    color: #64748b;
}

.hist-flow {
    color: #d4af37;
    font-weight: bold;
}

.hist-text {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin: 0;
}

.empty-hist {
    text-align: center;
    color: #475569;
    padding: 20px;
    font-style: italic;
}

/* ===== ACCIONES ===== */

.action-box {
    background: rgba(212, 175, 55, 0.03);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #2d3139;
}

/* Extras */
.badge-id {
    background: #2d3139;
    color: #d4af37;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.mt-10 {
    margin-top: 10px;
}

/* FEEDBACK VISUAL MODAL */
.modal-feedback-box {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    animation: slideDown 0.3s ease;
}

.fb-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid #10b981;
}

.fb-error {
    background: rgba(196, 18, 48, 0.15);
    color: #f87171;
    border: 1px solid #c41230;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* MOBILE UX MODAL */
@media (max-width: 600px) {
    .modal-content.card-rta-modal {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .modal-body {
        padding: 15px;
        padding-bottom: 80px;
    }

    .select-field,
    .textarea-field {
        font-size: 16px !important;
        padding: 15px;
    }

    .btn-cta {
        padding: 18px;
        font-size: 1.05rem;
    }
}

.historial-scroll {
    scrollbar-width: thin;
}

/* ==========================================
   RESUMEN EJECUTIVO RTA
========================================== */

.btn-resumen-toggle {
    width: 100%;
    background: #111827;
    border: 1px solid #d4af37;
    color: #d4af37;
    padding: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 6px;
}

.btn-resumen-toggle:hover {
    background: #d4af37;
    color: #111827;
}

.detalle-expandido {
    margin-top: 16px;
    background: #0f1113;
    border: 1px solid #2d3139;
    border-radius: 8px;
    padding: 18px;
    animation: fadeDetail 0.25s ease;
}

.hidden {
    display: none;
}

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

.detalle-card {
    background: #16191d;
    border: 1px solid #2d3139;
    border-left: 3px solid #d4af37;
    border-radius: 6px;
    padding: 14px;
}

.detalle-label {
    display: block;
    color: #d4af37;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.detalle-card p {
    color: #f1f5f9;
    font-size: 0.9rem;
    line-height: 1.5;
}

@keyframes fadeDetail {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}