/* ===================================
   Reset e Variáveis Modernas
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Paleta de Cores Moderna */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --purple: #8b5cf6;
    
    /* Cores Neutras */
    --light-gray: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --dark-gray: #1e293b;
    
    /* Estrutura */
    --sidebar-width: 280px;
    --header-height: 75px;
    
    /* Sombras Modernas */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-health: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Header Moderno
   =================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.header:hover {
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-health);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.user-info:hover {
    background: var(--gray-200);
    transform: translateY(-2px);
}

.user-name {
    font-weight: 600;
    color: var(--gray-700);
}

.btn-logout {
    padding: 10px 20px;
    background: var(--gradient-warm);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Sidebar Moderno
   =================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-xl);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-logo img {
    max-width: 180px;
    height: auto;
    filter: brightness(1.2);
    transition: transform 0.3s ease;
}

.sidebar-logo img:hover {
    transform: scale(1.05);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin: 5px 15px;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 15px;
    font-weight: 500;
    font-size: 15px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-light);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-menu a.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(30, 64, 175, 0.2) 100%);
}

.sidebar-menu a.active::before {
    transform: scaleY(1);
}

.sidebar-menu-icon {
    width: 22px;
    height: 22px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.sidebar-menu a:hover .sidebar-menu-icon {
    transform: scale(1.2);
}

/* ===================================
   Conteúdo Principal
   =================================== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 40px;
    min-height: calc(100vh - var(--header-height));
    background: transparent;
}

.page-header {
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.page-title {
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient-health);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.page-subtitle {
    color: var(--gray-600);
    font-size: 16px;
    font-weight: 500;
}

/* ===================================
   Cards Modernos
   =================================== */
.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-health);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.5px;
}

/* ===================================
   Formulários Modernos
   =================================== */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    color: var(--gray-800);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.form-control:required {
    border-left: 4px solid var(--primary-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* ===================================
   Botões Modernos
   =================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-health);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-600);
    color: white;
}

.btn-secondary:hover {
    background: var(--gray-700);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 17px;
}

/* ===================================
   Tabelas Modernas
   =================================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead {
    background: var(--gradient-health);
    color: white;
}

.table thead th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
    transform: scale(1.01);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ===================================
   Alertas Modernos
   =================================== */
.alert {
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: var(--secondary-color);
    color: #065f46;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    border-color: var(--info-color);
    color: #155e75;
}

/* ===================================
   Badges Modernos
   =================================== */
.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.badge-success {
    background: var(--gradient-success);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.badge-primary {
    background: var(--gradient-health);
    color: white;
}

/* ===================================
   Grid System
   =================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

.col-2 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
}

.col-3 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 15px;
}

.col-4 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
    min-width: 0; /* Permite que o flex shrink funcione corretamente */
}

/* ===================================
   Stats Cards
   =================================== */
.stats-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-health);
}

.stats-card:nth-child(1)::before {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.stats-card:nth-child(2)::before {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stats-card:nth-child(3)::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stats-card:nth-child(4)::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stats-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.stats-value {
    font-size: 42px;
    font-weight: 800;
    background: var(--gradient-health);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 15px 0;
    letter-spacing: -1px;
    transition: transform 0.3s ease;
}

.stats-card:hover .stats-value {
    transform: scale(1.1);
}

.stats-label {
    color: var(--gray-600);
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ===================================
   Busca e Filtros
   =================================== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.search-bar .form-control {
    flex: 1;
    min-width: 250px;
}

/* ===================================
   Login Page Moderna
   =================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-health);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: movePattern 20s linear infinite;
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 50px 45px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    background: var(--gradient-health);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 35px;
    letter-spacing: -1px;
}

.login-form .form-group {
    margin-bottom: 25px;
}

.login-form .btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    margin-top: 10px;
    background: var(--gradient-health);
}

.login-form .btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   Loading e Empty States
   =================================== */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-600);
}

.empty-state-icon {
    font-size: 80px;
    margin-bottom: 25px;
    opacity: 0.4;
    filter: grayscale(0.3);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .header {
        padding: 0 15px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .col,
    .col-2,
    .col-3,
    .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .stats-card {
        padding: 20px;
    }
    
    .stats-value {
        font-size: 32px;
    }
}

/* ===================================
   Scrollbar Personalizado
   =================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-health);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===================================
   Animações Extras
   =================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Efeito de brilho nos cards */
.card-shimmer {
    position: relative;
    overflow: hidden;
}

.card-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Efeito Ripple nos botões */
.btn {
    position: relative;
    overflow: hidden;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}
