/* ============================================
   JURÍDICO DASHBOARD - PLANIFICACIÓN CSS
   ============================================ */

/* Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #059669;
    --accent: #f59e0b;
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 8px;
}

/* Dark theme */
.dark {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Reset y base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo .icon { font-size: 2rem; }
.logo h1 { font-size: 1.25rem; font-weight: 700; }
.logo .tagline { font-size: 0.875rem; color: var(--text-light); }
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}
.btn:hover { background: var(--bg-secondary); }
.btn-primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-icon { font-size: 1.25rem; padding: 0.5rem; }

/* Navigation */
.section-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 65px;
    z-index: 99;
    overflow-x: auto;
    white-space: nowrap;
}
.section-nav .container { display: flex; gap: 0.5rem; }
.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}
.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Main Content */
.main-content { padding: 2rem 0; }
.section { margin-bottom: 3rem; scroll-margin-top: 140px; }
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-light); font-size: 0.95rem; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}
.stat-card.success { border-color: var(--success); background: linear-gradient(135deg, var(--bg), #ecfdf5); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.stat-label { font-weight: 600; margin-bottom: 0.25rem; }
.stat-detail { font-size: 0.875rem; color: var(--text-light); }

/* Progress bar */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Cards */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 1rem; font-size: 1.1rem; }

/* Timeline */
.timeline { margin-left: 1rem; }
.timeline-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}
.timeline-marker {
    min-width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}
.timeline-content {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.timeline-content h3 { margin-bottom: 0.75rem; font-size: 1.1rem; }
.subtasks { margin-top: 1rem; }
.subtask {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 6px;
}
.subtask input[type="checkbox"] { margin-right: 0.5rem; }
.subtask label { font-weight: 500; cursor: pointer; }
.subtask small {
    display: block;
    margin-left: 1.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}
.budget-note {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fef3c7;
    border-left: 3px solid var(--warning);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Task Board */
.filters { margin-top: 1rem; display: flex; gap: 0.5rem; }
.filter-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    font-size: 0.875rem;
}
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.task-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}
.task-column {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
}
.task-column h4 { margin-bottom: 1rem; font-size: 0.95rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; }
.task-list { display: flex; flex-direction: column; gap: 0.5rem; }
.task-item {
    background: var(--bg);
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.task-item.completed { opacity: 0.7; background: var(--bg-secondary); }
.task-item.completed label { text-decoration: line-through; color: var(--text-light); }
.task-item input[type="checkbox"] { margin-top: 0.2rem; }
.task-item span { font-weight: 500; flex: 1; }
.task-item small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin-left: 1.5rem;
}
.progress-summary {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.overall-progress { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.overall-progress .progress-bar { flex: 1; }
#progress-text { font-weight: 600; min-width: 180px; text-align: right; }

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.chart-container {
    min-height: 300px;
}
.chart-container h3 { margin-bottom: 1rem; font-size: 1rem; }

/* Table */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}
.data-table tbody tr:hover { background: var(--bg-secondary); }

/* Budget table */
.budget-table td { padding: 0.6rem 0.75rem; }
.total-row { font-weight: 600; }
.total-row.highlight {
    background: #fef3c7;
    border-top: 2px solid var(--warning);
}

/* KPIs */
.kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.kpi-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.kpi-label { font-weight: 600; font-size: 0.875rem; }
.kpi-target { font-size: 0.75rem; color: var(--text-light); }
.kpi-values { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.kpi-current { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.kpi-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.kpi-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.5s ease;
}
.kpi-card small { color: var(--text-light); font-size: 0.875rem; }

/* Insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.insight-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 3px solid var(--secondary);
}
.insight-icon { font-size: 1.5rem; flex-shrink: 0; }
.insight-item strong { display: block; margin-bottom: 0.25rem; color: var(--text); }

/* Roadmap */
.roadmap-timeline { display: flex; flex-direction: column; gap: 1.5rem; }
.roadmap-phase {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.phase-header {
    background: var(--bg-secondary);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}
.phase-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
}
.phase-badge.current { background: var(--success); }
.phase-header h3 { flex: 1; }
.timeline-mark { font-size: 0.875rem; color: var(--text-light); white-space: nowrap; }
.phase-content { padding: 1rem; }
.phase-content ul { list-style: none; }
.phase-content li { margin-bottom: 0.5rem; padding-left: 1rem; position: relative; }
.phase-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}
.roadmap-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 1.5rem;
}
.arrow-line { flex: 1; height: 2px; background: var(--border); position: relative; top: -0.5rem; }

.decision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.decision-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}
.decision-item strong { display: block; margin-bottom: 0.5rem; }
.decision-item p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* Validation status */
.validation-status { display: flex; flex-direction: column; gap: 0.75rem; }
.validation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}
.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    background: var(--success);
}
.validation-item:has(.status-icon:not(:empty)):not(:has(.status-icon:empty)) .status-icon:nth-child(4) {
    background: var(--warning);
}

/* Budget sections */
.budget-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.revenue-summary { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.revenue-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed var(--border); }
.revenue-item strong { color: var(--secondary); }
.pricing-strategy { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.pricing-tier { background: var(--bg-secondary); padding: 1rem; border-radius: var(--radius); }
.pricing-tier h4 { margin-bottom: 0.5rem; color: var(--primary); }
.pricing-tier ul { list-style: none; }
.pricing-tier li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.pricing-tier li strong { color: var(--text); }

/* Footer */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}
.footer a { color: var(--primary); text-decoration: none; }

/* Responsive */
@media (max-width: 768px) {
    .header .container { flex-direction: column; gap: 1rem; text-align: center; }
    .section-nav .container { flex-wrap: nowrap; justify-content: flex-start; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .task-board { grid-template-columns: 1fr; }
    .timeline-item { flex-direction: column; gap: 1rem; }
    .timeline-marker { align-self: flex-start; }
    .kpis-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .kpis-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
}
