/* Diseño Premium Hospital Nacional Sonsonate */
:root {
    --primary-color: #2c3e50; /* Azul Grisáceo del Logo */
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --white: #ffffff;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page Styles */
.login-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1a252f 100%);
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card img {
    max-width: 200px;
    margin-bottom: 2rem;
}

.login-card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    background-color: #1a252f;
    transform: translateY(-2px);
}

/* Sidebar & Dashboard */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: white;
    transition: var(--transition);
}

.content-area {
    flex: 1;
    padding: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    /* Mantenemos el sidebar visible como pidió el usuario */
    .sidebar {
        width: 260px;
        min-width: 260px;
    }
    .main-content {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
}

/* Dashboard Professional Cards */
.dashboard-card {
    position: relative;
    padding: 35px 25px;
    border-radius: 20px;
    color: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 150px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1); /* Sutil borde para glassmorphism */
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Material Design Sidebar Improvements */
.sidebar-menu li a {
    margin: 5px 15px;
    border-radius: 15px;
    transition: 0.3s;
}

.sidebar-menu li a.active {
    background: rgba(52, 152, 219, 0.15) !important;
    color: var(--accent-color) !important;
    font-weight: 700;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Floating Action Button (FAB) */
.fab-button {
    display: none;
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: white;
    border-radius: 20px;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
    z-index: 1050;
    border: none;
    cursor: pointer;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-button:active {
    transform: scale(0.9);
}

@media (max-width: 1024px) {
    .fab-button {
        display: flex;
    }
}

.card-body-content {
    flex: 1;
    z-index: 2;
}

.card-label-top {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    opacity: 0.8;
}

.card-main-value {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-sub-label {
    font-size: 0.8rem;
    margin-top: 10px;
    opacity: 0.7;
    font-weight: 600;
    background: rgba(255,255,255,0.15);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

/* Wavy Background */
.card-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 1;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.2" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: 1440px 100px;
    background-repeat: repeat-x;
}

.wave1 {
    opacity: 0.3;
    animation: wave-anim 10s linear infinite;
}

.wave2 {
    opacity: 0.2;
    animation: wave-anim 15s linear infinite reverse;
    bottom: 5px;
}

.wave3 {
    opacity: 0.1;
    animation: wave-anim 20s linear infinite;
    bottom: 10px;
}

@keyframes wave-anim {
    0% { background-position-x: 0; }
    100% { background-position-x: 1440px; }
}

/* Master Responsive Design (Móvil y Tablet < 1024px) */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .sidebar {
        left: -280px !important;
        width: 280px !important;
        box-shadow: none !important;
        position: fixed !important;
        z-index: 1000 !important;
    }
    
    .sidebar.active {
        left: 0 !important;
        box-shadow: 10px 0 30px rgba(0,0,0,0.3) !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
        min-height: 100vh;
        display: block !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
        backdrop-filter: blur(3px);
    }

    .sidebar-overlay.active {
        display: block !important;
    }

    .top-navbar {
        width: 100% !important;
        padding: 10px 15px !important;
        top: 0 !important;
        margin-bottom: 20px !important;
        position: sticky !important;
        z-index: 997 !important;
    }

    .mobile-toggle {
        display: flex !important;
    }

    .user-profile h3, 
    .user-profile small {
        display: none !important;
    }

    .grid-fluid,
    .form-grid-2,
    [style*="display: grid"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .content-body, 
    .content-body-wrapper {
        padding: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Form and Card Optimizations */
    .form-control {
        font-size: 16px !important;
        padding: 12px !important;
        width: 100% !important;
    }

    .dashboard-card {
        padding: 20px !important;
        min-height: auto !important;
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .card-icon-container {
        font-size: 2.5rem !important;
        min-width: 50px !important;
    }

    .card-main-value {
        font-size: 1.8rem !important;
    }

    .doc-grid {
        grid-template-columns: 1fr !important;
    }

    /* Table-to-Cards Transformation (Force) */
    .table-responsive, 
    .table-responsive-app {
        overflow-x: hidden !important;
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
    }

    .table-responsive table, 
    .table-responsive thead, 
    .table-responsive tbody, 
    .table-responsive th, 
    .table-responsive td, 
    .table-responsive tr { 
        display: block !important; 
        width: 100% !important;
    }

    .table-responsive thead tr { 
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    .table-responsive tr { 
        margin-bottom: 20px !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 15px !important;
        padding: 15px !important;
        background: #fff !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.03) !important;
    }

    .table-responsive td { 
        border: none !important;
        position: relative !important;
        padding-left: 45% !important; 
        text-align: right !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
        min-height: 45px;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    .table-responsive td:last-child {
        border-bottom: none !important;
    }

    .table-responsive td:before { 
        content: attr(data-label);
        position: absolute !important;
        left: 15px !important;
        width: 40% !important; 
        padding-right: 10px !important; 
        white-space: nowrap !important;
        text-align: left !important;
        font-weight: 700 !important;
        color: #64748b !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
    }

    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
}

@media (min-width: 1025px) {
    .desktop-only { display: flex !important; }
    .mobile-only { display: none !important; }
}

