/* ============================================================================
   MD PORTAL CLIENTES - ESTILOS PRINCIPALES
   ============================================================================ */

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #111827;
    background: #F9FAFB;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.md-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.md-header {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.md-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.md-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #F16334;
    text-decoration: none;
}

.md-logo img {
    max-height: 40px;
    width: auto;
}

.md-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.md-nav a {
    color: #4B5563;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.md-nav a:hover {
    color: #F16334;
}

.md-user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.md-user-name {
    font-weight: 600;
    color: #111827;
}

.md-btn-logout {
    background: #EF4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.md-btn-logout:hover {
    background: #DC2626;
    transform: translateY(-1px);
}

/* ============================================================================
   BOTONES
   ============================================================================ */

.md-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.md-btn-primary {
    background: #F16334;
    color: white;
    box-shadow: 0 4px 10px rgba(241, 99, 52, 0.25);
}

.md-btn-primary:hover {
    background: #E05524;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(241, 99, 52, 0.35);
}

.md-btn-secondary {
    background: white;
    color: #111827;
    border: 2px solid #94C6C5;
}

.md-btn-secondary:hover {
    background: #94C6C5;
    color: white;
}

.md-btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

/* ============================================================================
   CARDS Y GRIDS
   ============================================================================ */

.md-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.md-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
}

.md-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

/* ============================================================================
   KPIs / ESTADÍSTICAS
   ============================================================================ */

.md-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.md-kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.md-kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: #F16334;
    margin-bottom: 8px;
}

.md-kpi-label {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
}

/* ============================================================================
   FORMULARIOS
   ============================================================================ */

.md-form-group {
    margin-bottom: 1rem;
}

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

.md-form-input,
.md-form-select,
.md-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.md-form-input:focus,
.md-form-select:focus,
.md-form-textarea:focus {
    outline: none;
    border-color: #F16334;
    box-shadow: 0 0 0 3px rgba(241, 99, 52, 0.1);
}

.md-form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================================================
   TABLAS
   ============================================================================ */

.md-table-container {
    overflow-x: auto;
}

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

.md-table thead th {
    background: #F9FAFB;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #E5E7EB;
    font-size: 14px;
}

.md-table tbody td {
    padding: 12px;
    border-bottom: 1px solid #F3F4F6;
    font-size: 14px;
    color: #111827;
}

.md-table tbody tr:hover {
    background: #F9FAFB;
}

/* ============================================================================
   ALERTS / NOTIFICACIONES
   ============================================================================ */

.md-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}

.md-alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.md-alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.md-alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

.md-alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #3B82F6;
}

/* ============================================================================
   BADGES / ETIQUETAS
   ============================================================================ */

.md-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.md-badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.md-badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

.md-badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.md-badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

/* ============================================================================
   LOADING / SPINNERS
   ============================================================================ */

.md-loading {
    text-align: center;
    padding: 40px;
}

.md-spinner {
    border: 4px solid #E5E7EB;
    border-top: 4px solid #F16334;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: md-spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes md-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .md-container {
        padding: 15px;
    }
    
    .md-header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .md-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .md-kpis {
        grid-template-columns: 1fr 1fr;
    }
    
    .md-grid-2,
    .md-grid-3,
    .md-grid-4 {
        grid-template-columns: 1fr;
    }
}

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

/* ============================================================================
   UTILIDADES
   ============================================================================ */

.md-text-center { text-align: center; }
.md-text-right { text-align: right; }
.md-mt-1 { margin-top: 0.5rem; }
.md-mt-2 { margin-top: 1rem; }
.md-mt-3 { margin-top: 1.5rem; }
.md-mb-1 { margin-bottom: 0.5rem; }
.md-mb-2 { margin-bottom: 1rem; }
.md-mb-3 { margin-bottom: 1.5rem; }
.md-hidden { display: none; }
