/* Sistema de Consolidacion Ministerial - Frontend Styles */

/* Reset & Base */
.scm-wrap {
    background: #FFFFFF;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    line-height: 1.6;
}

.scm-wrap * {
    box-sizing: border-box;
}

.scm-wrap h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #1a1a1a;
}

.scm-wrap h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 16px;
    color: #1a1a1a;
}

.scm-wrap h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.scm-wrap p {
    margin: 0 0 12px;
}

.scm-wrap a {
    color: #6C9BD2;
    text-decoration: none;
}

.scm-wrap a:hover {
    text-decoration: underline;
}

/* Login Prompt */
.scm-login-prompt {
    text-align: center;
    padding: 60px 20px;
}

.scm-login-prompt h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.scm-login-prompt p {
    color: #64748B;
    margin-bottom: 24px;
}

/* Header */
.scm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.scm-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Badge */
.scm-badge {
    display: inline-block;
    background: #DBEAFE;
    color: #1E40AF;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 12px;
    vertical-align: middle;
}

/* Buttons */
.scm-btn {
    display: inline-block;
    border-radius: 25px;
    padding: 10px 24px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
    transition: opacity 0.2s, transform 0.1s;
    box-sizing: border-box;
}

.scm-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    text-decoration: none;
}

.scm-btn:active {
    transform: translateY(0);
}

.scm-btn-primary {
    background: #6C9BD2;
    color: white;
}

.scm-btn-primary:hover { color: white; }

.scm-btn-success {
    background: #7BC89C;
    color: white;
}

.scm-btn-success:hover { color: white; }

.scm-btn-danger {
    background: #E88B8B;
    color: white;
}

.scm-btn-danger:hover { color: white; }

.scm-btn-warning {
    background: #F0C987;
    color: #1a1a1a;
}

.scm-btn-secondary {
    background: #E5E7EB;
    color: #374151;
}

.scm-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

.scm-btn-lg {
    padding: 12px 32px;
    font-size: 16px;
}

/* Metrics Grid */
.scm-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.scm-metric-card {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.scm-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.scm-metric-label {
    font-size: 14px;
    color: #64748B;
    margin-top: 4px;
}

/* Tables */
.scm-table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
}

.scm-table {
    border-collapse: collapse;
    width: 100%;
    background: white;
}

.scm-table th {
    background: #F1F5F9;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

.scm-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #E2E8F0;
    font-size: 14px;
    vertical-align: middle;
}

.scm-table tr:hover {
    background: #F8FAFC;
}

.scm-table .scm-empty {
    text-align: center;
    color: #94A3B8;
    padding: 40px 16px;
}

.scm-actions-cell {
    white-space: nowrap;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* Status Badges */
.scm-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-asignado {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-ubicado {
    background: #D1FAE5;
    color: #065F46;
}

.status-no_ubicado {
    background: #FEE2E2;
    color: #991B1B;
}

.status-vencido {
    background: #FEF3C7;
    color: #92400E;
}

.status-fuera_de_zona {
    background: #E5E7EB;
    color: #374151;
}

/* Filters */
.scm-filters {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.scm-filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    align-items: flex-end;
}

.scm-filters-row:last-child {
    margin-bottom: 0;
}

/* Form Elements */
.scm-input,
.scm-select,
.scm-textarea {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    color: #1a1a1a;
    background: white;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.scm-input:focus,
.scm-select:focus,
.scm-textarea:focus {
    outline: none;
    border-color: #6C9BD2;
    box-shadow: 0 0 0 3px rgba(108, 155, 210, 0.1);
}

.scm-input-small {
    max-width: 120px;
}

.scm-filters-row .scm-input,
.scm-filters-row .scm-select {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

.scm-filters-row .scm-input-small {
    max-width: 120px;
    min-width: 80px;
}

/* Forms */
.scm-form-section {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

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

.scm-form-group {
    margin-bottom: 8px;
}

.scm-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.scm-form-group-full {
    grid-column: 1 / -1;
}

.scm-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.scm-help-text {
    font-size: 12px;
    color: #94A3B8;
    margin-top: 4px;
    display: block;
}

.scm-text-muted {
    color: #64748B;
    font-size: 14px;
}

/* Sections */
.scm-section {
    background: #F8FAFC;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.scm-section h2 {
    margin-top: 0;
}

/* Notices */
.scm-notice {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.scm-notice-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.scm-notice-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.scm-notice-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* Modals */
.scm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.scm-modal.scm-modal-active {
    display: flex;
}

.scm-modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.scm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.scm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.scm-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #94A3B8;
    padding: 4px 8px;
    line-height: 1;
}

.scm-modal-close:hover {
    color: #1a1a1a;
}

.scm-modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Notes */
.scm-notes-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.scm-note {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.scm-note-correction {
    border-left: 3px solid #F0C987;
}

.scm-note-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #64748B;
}

.scm-note-meta strong {
    color: #1a1a1a;
}

.scm-note-badge {
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.scm-note-content {
    font-size: 14px;
    line-height: 1.5;
}

.scm-note-form {
    border-top: 1px solid #E2E8F0;
    padding-top: 16px;
}

/* Mobile Cards - hidden by default on desktop */
.scm-cards {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .scm-wrap {
        padding: 0 12px;
        margin: 10px auto;
    }

    .scm-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .scm-header-actions {
        width: 100%;
    }

    .scm-header-actions .scm-btn {
        flex: 1;
        text-align: center;
    }

    .scm-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .scm-metric-card {
        padding: 16px;
    }

    .scm-metric-value {
        font-size: 24px;
    }

    /* Hide desktop table, show cards */
    .scm-table-wrapper {
        display: none;
    }

    .scm-cards {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .scm-card {
        background: white;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid #E2E8F0;
    }

    .scm-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .scm-card-header strong {
        font-size: 16px;
    }

    .scm-card-body {
        margin-bottom: 12px;
    }

    .scm-card-field {
        font-size: 14px;
        margin-bottom: 6px;
        color: #374151;
    }

    .scm-card-label {
        font-weight: 500;
        color: #64748B;
    }

    .scm-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
    }

    .scm-card-actions .scm-btn {
        flex: 1;
        padding: 12px;
        font-size: 16px;
        text-align: center;
    }

    /* Filters */
    .scm-filters-row {
        flex-direction: column;
    }

    .scm-filters-row .scm-input,
    .scm-filters-row .scm-select,
    .scm-filters-row .scm-input-small {
        max-width: 100%;
        min-width: 100%;
    }

    /* Form */
    .scm-form-grid {
        grid-template-columns: 1fr;
    }

    .scm-form-actions {
        flex-direction: column;
    }

    .scm-form-actions .scm-btn {
        width: 100%;
    }

    /* Modal */
    .scm-modal-content {
        padding: 20px;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .scm-metrics-grid {
        grid-template-columns: 1fr;
    }
}
