/* Toggle de método de cálculo */
.method-toggle {
    display: flex;
    gap: 0;
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.method-btn {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-align: center;
}

.method-btn:not(:last-child) {
    border-right: 2px solid var(--border, #e2e8f0);
}

.method-btn.active {
    background: var(--primary, #2563eb);
    color: #fff;
}

/* Campos de fecha */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.field-group label {
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field-group input[type="date"],
.field-group select {
    border: 2px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    background: #fff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.field-group input[type="date"]:focus,
.field-group select:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    font-family: 'Montserrat', sans-serif;
    margin-top: 0.15rem;
}

/* Panel de resultados */
.results-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.dash-card {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
    background: #fff;
    text-align: center;
}

.dash-card.dash-primary {
    border-color: var(--primary, #2563eb);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.07), rgba(99, 102, 241, 0.05));
}

.dash-card .dash-icon {
    font-size: 1.3rem;
    margin-bottom: 0.35rem;
    color: var(--primary, #2563eb);
}

.dash-card .dash-val {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: 'Ubuntu', monospace, sans-serif;
    color: var(--text, #1e293b);
    line-height: 1.2;
}

.dash-card.dash-primary .dash-val {
    font-size: 1.65rem;
    color: var(--primary, #2563eb);
}

.dash-card .dash-label {
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

.dash-card .dash-sub {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    font-family: 'Montserrat', sans-serif;
    margin-top: 0.2rem;
}

/* Barra de progreso del embarazo */
.progress-section {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: #fff;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.progress-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-pct {
    font-family: 'Ubuntu', monospace, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary, #2563eb);
}

.progress-bar-track {
    height: 14px;
    background: var(--bg-alt, #f1f5f9);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0.6rem;
}

/* Separadores de trimestre */
.progress-bar-track::before,
.progress-bar-track::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.7);
    z-index: 2;
}

.progress-bar-track::before {
    left: 32.5%;
}

/* fin T1: sem 13/40 */
.progress-bar-track::after {
    left: 67.5%;
}

/* fin T2: sem 27/40 */

.progress-bar-fill {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress-bar-fill.t1 {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

.progress-bar-fill.t2 {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.progress-bar-fill.t3 {
    background: linear-gradient(90deg, #8b5cf6, #6366f1);
}

.progress-labels {
    display: flex;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
}

.progress-labels span {
    flex: 1;
}

.progress-labels span:nth-child(2) {
    text-align: center;
}

.progress-labels span:nth-child(3) {
    text-align: right;
}

/* Trimestre destacado */
.trimester-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.trimester-badge.t1 {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.trimester-badge.t2 {
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.trimester-badge.t3 {
    background: rgba(236, 72, 153, 0.1);
    color: #be185d;
    border: 1px solid rgba(236, 72, 153, 0.2);
}

/* Desglose */
.breakdown-box {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.breakdown-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.1rem;
    background: var(--primary, #2563eb);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.84rem;
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row:nth-child(even) {
    background: var(--bg-alt, #f8fafc);
}

.breakdown-row .br-label {
    color: var(--text-muted, #64748b);
    font-weight: 600;
}

.breakdown-row .br-val {
    font-family: 'Ubuntu', monospace, sans-serif;
    font-weight: 700;
    color: var(--text, #1e293b);
    text-align: right;
}

.breakdown-row.br-total {
    background: rgba(37, 99, 235, 0.06);
}

.breakdown-row.br-total .br-label {
    color: var(--text, #1e293b);
    font-weight: 700;
    font-size: 0.9rem;
}

.breakdown-row.br-total .br-val {
    color: var(--primary, #2563eb);
    font-size: 1rem;
}

/* Línea de tiempo de hitos */
.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.milestone-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.83rem;
    transition: background 0.12s;
}

.milestone-item:last-child {
    border-bottom: none;
}

.milestone-item:nth-child(even) {
    background: var(--bg-alt, #f8fafc);
}

.milestone-item.passed {
    opacity: 0.55;
}

.milestone-item.current {
    background: rgba(37, 99, 235, 0.06);
    border-left: 3px solid var(--primary, #2563eb);
}

.milestone-item.upcoming {}

.milestone-week {
    min-width: 52px;
    font-weight: 700;
    font-family: 'Ubuntu', monospace, sans-serif;
    color: var(--primary, #2563eb);
    font-size: 0.82rem;
    padding-top: 0.05rem;
}

.milestone-item.passed .milestone-week {
    color: var(--text-muted, #94a3b8);
}

.milestone-icon {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    padding-top: 0.05rem;
    flex-shrink: 0;
}

.milestone-text {
    flex: 1;
    line-height: 1.5;
}

.milestone-text strong {
    color: var(--text, #1e293b);
}

.milestone-text span {
    color: var(--text-muted, #64748b);
}

.milestone-status {
    font-size: 0.67rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
    align-self: center;
}

.ms-done {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.ms-current {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.ms-pending {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
}

/* Tabla de referencia por trimestre */
.ref-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
}

.ref-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    min-width: 420px;
}

.ref-table-wrap thead {
    background: var(--primary, #2563eb);
    color: #fff;
}

.ref-table-wrap thead th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
}

.ref-table-wrap tbody tr:nth-child(even) {
    background: var(--bg-alt, #f8fafc);
}

.ref-table-wrap tbody td {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    font-family: 'Montserrat', sans-serif;
    color: var(--text, #1e293b);
    vertical-align: top;
    line-height: 1.5;
}

.ref-table-wrap tbody tr:last-child td {
    border-bottom: none;
}

.tri-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
}

.tri-1 {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.tri-2 {
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
}

.tri-3 {
    background: rgba(236, 72, 153, 0.1);
    color: #be185d;
}

/* Aviso médico */
.medical-disclaimer {
    display: flex;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    color: #92400e;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.medical-disclaimer i {
    color: #d97706;
    font-size: 1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .results-dashboard {
        grid-template-columns: 1fr 1fr;
    }

    .results-dashboard .dash-primary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .results-dashboard {
        grid-template-columns: 1fr;
    }
}