/* ============================================
   SISTEMA DE FARMACIA - ESTILOS PROFESIONALES
   ============================================ */

:root {
    /* Colores principales - Tema Farmacia */
    --primary-color: #3b82f6;
    /* Verde farmacia */
    --primary-dark: #2563eb;
    --primary-light: #e8f5f0;
    --secondary-color: #0066cc;
    /* Azul médico */
    --secondary-dark: #004d99;
    --accent-color: #ff6b35;
    /* Naranja para alertas */

    /* Colores de estado */
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Grises */
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #0d1117;

    /* Tipografía */
    --font-primary: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Segoe UI Semibold', 'Roboto', sans-serif;

    /* Sombras */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.18);

    /* Bordes */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ============================================
   RESET Y BASE
   ============================================ */

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

body {
    font-family: var(--font-primary);
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

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

.pharmacy-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pharmacy-header h1 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pharmacy-header .header-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* ============================================
   TARJETAS ESTADÍSTICAS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border-left: 5px solid transparent;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(0, 168, 107, 0.05) 0%, rgba(0, 168, 107, 0.1) 100%);
    border-radius: 50%;
    transform: translate(40%, -40%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card.success {
    border-left-color: var(--success);
}

.stat-card.info {
    border-left-color: var(--info);
}

.stat-card.warning {
    border-left-color: var(--warning);
}

.stat-card.danger {
    border-left-color: var(--danger);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: var(--shadow-sm);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success) 0%, #20c997 100%);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info) 0%, #0dcaf0 100%);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #ffb800 100%);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ff4757 100%);
}

.stat-content h3 {
    font-size: 13px;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1;
}

.stat-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 8px;
}

.stat-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    transition: var(--transition-fast);
}

.stat-link:hover {
    color: var(--primary-dark);
    gap: 8px;
}

/* ============================================
   BOTONES DE ACCIÓN RÁPIDA
   ============================================ */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.action-button {
    background: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 0, 0, 0.03) 100%);
    opacity: 0;
    transition: var(--transition-normal);
}

.action-button:hover::before {
    opacity: 1;
}

.action-button:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.action-button.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.action-button.secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: white;
}

.action-button.accent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.action-content p {
    font-size: 14px;
    opacity: 0.9;
}

.action-icon {
    font-size: 24px;
    opacity: 0.8;
}

/* ============================================
   SECCIONES DE CONTENIDO
   ============================================ */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
}

.content-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-md);
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-100);
}

.content-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.content-card-header .icon {
    color: var(--primary-color);
}

/* ============================================
   LISTA DE ITEMS
   ============================================ */

.item-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.list-item:hover {
    background: var(--primary-light);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.list-item-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.list-item-content p {
    font-size: 13px;
    color: var(--gray-500);
}

.list-item-meta {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.list-item-value {
    text-align: right;
}

.list-item-value .amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
}

.list-item-value .quantity {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

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

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.badge.success {
    background: #d4edda;
    color: #155724;
}

.badge.warning {
    background: #fff3cd;
    color: #856404;
}

.badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.badge.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ============================================
   ESTADO VACÍO
   ============================================ */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-400);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

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

@media (max-width: 1024px) {
    .pharmacy-container {
        padding: 20px 15px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .pharmacy-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 1rem;
    }

    .pharmacy-header h1 {
        font-size: 1.25rem;
    }

    .action-button {
        padding: 20px;
    }

    .action-content h3 {
        font-size: 18px;
    }

    .action-icon {
        font-size: 38px;
    }
}

@media (max-width: 640px) {
    .pharmacy-container {
        padding: 15px 10px;
    }

    .pharmacy-header {
        padding: 15px;
        border-radius: var(--radius-md);
    }

    .pharmacy-header h1 {
        font-size: 1.1rem;
        flex-direction: column;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }

    .content-card {
        padding: 18px;
    }

    .list-item {
        padding: 14px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pharmacy-header h1 {
        font-size: 18px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 22px;
    }

    .action-button {
        padding: 18px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.action-button,
.content-card {
    animation: fadeInUp var(--transition-normal) ease-out;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}