/**
 * Guardião Renal - Estilos Personalizados
 * Design moderno e responsivo
 */

:root {
    /* Cores Principais - Personalizar conforme manual da marca */
    --primary-color: #2C5282;
    --primary-dark: #1A3A5E;
    --primary-light: #4A7AA8;
    --secondary-color: #48BB78;
    --accent-color: #ED8936;
    --danger-color: #F56565;
    --warning-color: #ED8936;
    --success-color: #48BB78;
    --info-color: #4299E1;
    
    /* Cores Neutras */
    --dark: #2D3748;
    --gray-100: #F7FAFC;
    --gray-200: #EDF2F7;
    --gray-300: #E2E8F0;
    --gray-400: #CBD5E0;
    --gray-500: #A0AEC0;
    --gray-600: #718096;
    --gray-700: #4A5568;
    --gray-800: #2D3748;
    --gray-900: #1A202C;
    
    /* Cores de Status */
    --status-low: #48BB78;
    --status-moderate: #ED8936;
    --status-high: #F56565;
    --status-critical: #C53030;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
}

/* Layout Principal */
.sidebar {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    position: fixed;
    width: 260px;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar .brand {
    padding: 0.75rem 1rem 0.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .brand h3 {
    color: #FFFFFF !important;
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
}

.sidebar .brand .subtitle {
    color: #FFFFFF !important;
    font-size: 0.7rem;
    margin-top: 0.15rem;
    opacity: 0.9;
    line-height: 1.2;
}

.sidebar .nav-menu {
    padding: 0.5rem 0;
    overflow: hidden;
}

.sidebar .nav-item {
    margin: 0.1rem 0.75rem;
}

.sidebar .nav-link {
    color: #FFFFFF !important;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.3;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF !important;
    transform: translateX(5px);
}

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF !important;
    font-weight: 600;
}

.sidebar .nav-link span {
    color: #FFFFFF !important;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    color: #FFFFFF !important;
    flex-shrink: 0;
}

/* Separador e rodapé do sidebar */
.sidebar hr {
    margin: 0.4rem 1rem !important;
    opacity: 0.3;
}

.sidebar .sidebar-footer,
.sidebar .sidebar-footer .nav-item {
    margin: 0.1rem 0.75rem;
}

.sidebar .sidebar-footer .nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    line-height: 1.3;
}

.main-content {
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

/* Header */
.page-header {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: none;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    padding: 1.25rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    font-weight: 600;
    color: var(--dark);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200);
    padding: 1rem 1.5rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

/* Stats Cards */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card.stat-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #68D391 100%);
}

.stat-card.stat-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #F6AD55 100%);
}

.stat-card.stat-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #FC8181 100%);
}

.stat-card.stat-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #63B3ED 100%);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 0.95rem;
    opacity: 0.9;
}

.stat-card .stat-icon {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 3rem;
    opacity: 0.3;
}

/* Tabelas */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--gray-100);
    border-bottom: 2px solid var(--gray-300);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    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 td {
    padding: 1rem;
    vertical-align: middle;
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
}

.badge-low {
    background: var(--status-low);
    color: white;
}

.badge-moderate {
    background: var(--status-moderate);
    color: white;
}

.badge-high {
    background: var(--status-high);
    color: white;
}

.badge-critical {
    background: var(--status-critical);
    color: white;
}

/* Botões */
.btn {
    border-radius: var(--radius);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: #FFFFFF !important;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #FFFFFF !important;
}

.btn-primary * {
    color: #FFFFFF !important;
}

.btn-primary i {
    color: #FFFFFF !important;
}

.btn-success {
    background: var(--success-color);
    border: none;
}

.btn-warning {
    background: var(--warning-color);
    border: none;
}

.btn-danger {
    background: var(--danger-color);
    border: none;
}

/* Forms */
.form-control,
.form-select {
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 82, 130, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* Alertas */
.alert {
    border-radius: var(--radius);
    border: none;
    padding: 1rem 1.5rem;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50px, -50px) rotate(180deg); }
}

.login-box {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
    z-index: 1050;
    height: 56px;
}

.mobile-logo {
    filter: brightness(0) invert(1);
}

/* Responsive */
@media (max-width: 991px) {
    .mobile-header {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        top: 56px;
        height: calc(100vh - 56px);
        min-height: calc(100vh - 56px);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        transition: opacity 0.3s ease;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
        margin-top: 56px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Ajustar logo no mobile */
    .mobile-logo {
        max-height: 40px !important;
        width: auto;
    }
}

/* Utilitários */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: var(--shadow-lg);
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

