/* BONOS - PASO 2: Rehabilitación Productiva */

.meag-form {
    max-width: 1200px;
    margin: 40px auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* GRID / COLUMNAS */
.meag-field-row {
    display: grid;
    gap: 18px;
    margin-bottom: 20px;
}

.meag-field-row.full-width {
    grid-template-columns: 1fr;
}

.meag-field-button {
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
}

/* =========================
   CAMPOS Y ELEMENTOS BASE
========================= */

.meag-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meag-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

.meag-field input[type="text"],
.meag-field input[type="number"],
.meag-field input[type="date"],
.meag-field select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #b1bbc9;
    background: #ffffff;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
    color: #333;
}

.meag-field input:focus,
.meag-field select:focus {
    outline: none;
    border-color: #0051a8;
    box-shadow: 0 0 0 3px rgba(0, 81, 168, 0.15);
}

/* Selector de Archivos Personalizado */
.meag-field input[type="file"] {
    width: 100%;
    height: 42px;
    padding: 0;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #b1bbc9;
    background: #ffffff;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
    cursor: pointer;
    line-height: 40px;
}

.meag-field input[type="file"]::-webkit-file-upload-button,
.meag-field input[type="file"]::file-selector-button {
    background: #0051a8;
    color: #ffffff;
    border: none;
    height: 100%;
    padding: 0 16px;
    margin-right: 15px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.2s;
}

.meag-field input[type="file"]::-webkit-file-upload-button:hover,
.meag-field input[type="file"]::file-selector-button:hover {
    background: #003d7e;
}

/* BOTONES */
.meag-btn-primary {
    background: #0051a8;
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.meag-btn-primary:hover {
    background: #003d7e;
}

.meag-btn-secondary {
    background: #ffffff;
    color: #0051a8;
    border: 1px solid #0051a8;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.meag-btn-secondary:hover {
    background: rgba(0, 81, 168, 0.05);
}

.meag-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 40px;
    border-top: 1px solid #e2e8f0;
    padding-top: 25px;
}

/* TAGS CONTAINER */
.meag-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.meag-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}

.meag-table thead {
    background: #0051a8;
    color: #ffffff;
}

.meag-table th {
    padding: 12px;
    font-weight: 600;
    text-align: left;
}

.meag-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.meag-actions i {
    font-size: 20px;
    margin: 0 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.meag-actions i:hover {
    transform: scale(1.2);
}

.meag-actions .view {
    color: #0051a8;
}

.meag-actions .delete {
    color: #ef4444;
}

.meag-tag {
    background: #e8f1ff;
    border: 1px solid #2f6fdf;
    color: #2f6fdf;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.meag-tag span {
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

.meag-tag span:hover {
    color: #cc0000;
}

/* STEPS INDICATOR */
.meag-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.meag-step {
    display: flex;
    align-items: center;
}

.meag-step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #0051a8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #0051a8;
    background: #fff;
    font-size: 15px;
}

.meag-step--active .meag-step-circle {
    background: #0051a8;
    color: #fff;
}

.meag-step--completed .meag-step-circle {
    background: #0051a8;
    color: #fff;
}

.meag-step--completed .meag-step-circle::before {
    content: '✓';
    font-size: 18px;
}

.meag-step-line {
    width: 80px;
    height: 2px;
    background: #0051a8; /* Line is blue because step 1 is done */
    margin: 0 8px;
}

.meag-step-line.pending {
    background: #cbd5e1;
}

/* TITLES */
.meag-form-title-main {
    text-align: left;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 5px;
    color: #0f172a;
}

.meag-form-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 30px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.meag-form-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    margin: 40px 0;
    color: #0f172a;
}

/* SUMMARY BOX (Matching Step 2 Emergencias) */
.meag-summary {
    background: #f8fafc;
    padding: 25px 30px;
    border-radius: 4px;
    margin-bottom: 40px;
}

.meag-summary h3 {
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.meag-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.meag-summary-table td {
    padding: 8px 15px;
    vertical-align: top;
    width: 25%;
}

.meag-summary-table td strong {
    display: block;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 4px;
}

.meag-summary-table td span, 
.meag-summary-table td div {
    font-size: 14px;
    color: #64748b;
    line-height: 1.4;
}

/* SECTIONS */
.meag-section {
    background: #eef5ff;
    padding: 30px;
    border-radius: 14px;
    margin-bottom: 30px;
}

.meag-section h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
}

/* =========================
   ACTION ICONS (DASHICONS)
========================= */
.meag-table td .dashicons {
    cursor: pointer;
    font-size: 20px;
    color: #0051a8;
    transition: color 0.2s;
    text-decoration: none;
    width: 20px;
    height: 20px;
}

.meag-table td a {
    text-decoration: none;
    display: inline-block;
}

.meag-table td .dashicons:hover {
    color: #003d7e;
}

.meag-table td .dashicons-trash:hover {
    color: #cc0000;
}

/* =========================
   FOOTER BUTTONS STANDARD
========================= */
.meag-form-footer {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 15px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.meag-btn-primary {
    background: #0051a8 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 22px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.meag-btn-primary:hover {
    background: #003d7e !important;
}

/* =========================
   AGRUPACIÓN DE COMUNAS
   ========================= */
.meag-region-group {
    margin-top: 15px;
    width: 100%;
}

.meag-region-group-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0051a8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
    font-family: inherit !important;
}

.meag-region-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
