/* ================================================================
   Santa Casa — Estilos Customizados Globais
   Autor: GitHub Copilot | Data: 2026-04-09
   Motivo: Recriação completa do arquivo após perda acidental.
           Cobre: variáveis CSS, navbar, sidebar, avatar, watermark,
           loading bar, animações, alertas e utilitários gerais.
   ================================================================ */

/* ----------------------------------------------------------------
   1. VARIÁVEIS GLOBAIS
   ---------------------------------------------------------------- */
:root {
    --sc-blue:        #0d9e8e;
    --sc-blue-dark:   #0d2137;
    --sc-teal:        #0d9e8e;
    --sc-teal-light:  #1ab8a6;
    --sc-gold:        #c9a84c;
    --sc-sidebar-bg:  #0d2137;
    --sc-gradient:    linear-gradient(135deg, #0d2137 0%, #0d9e8e 100%);
    --sc-shadow:      0 4px 18px rgba(13, 158, 142, 0.22);
    --sc-radius:      8px;
    --sc-transition:  all 0.25s ease;
}

/* ----------------------------------------------------------------
   2. BARRA DE LOADING (topo da página ao navegar)
   ---------------------------------------------------------------- */
#sc-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--sc-teal), var(--sc-gold));
    z-index: 9999;
    transition: width 0.3s ease, opacity 0.4s ease;
    opacity: 1;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(13, 158, 142, 0.6);
}

/* ----------------------------------------------------------------
   3. NAVBAR SUPERIOR
   ---------------------------------------------------------------- */
.main-header.navbar {
    border-bottom: 2px solid #e9ecef;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Container da logo centralizada na navbar */
.sc-navbar-center {
    display: none;
}

.sc-navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none !important;
}

.sc-navbar-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.15));
    transition: var(--sc-transition);
}

.sc-navbar-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 6px rgba(13, 158, 142, 0.35));
}

/* ----------------------------------------------------------------
   4. SIDEBAR
   ---------------------------------------------------------------- */
.main-sidebar {
    background: var(--sc-sidebar-bg) !important;
    box-shadow: 3px 0 12px rgba(0, 0, 0, 0.25);
}

/* Logo na sidebar (brand-link) */
.sc-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none !important;
    background: rgba(0, 0, 0, 0.55);
}

.sc-brand-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: brightness(0.75) drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    border-radius: 6px;
    transition: var(--sc-transition);
}

.sc-brand-logo:hover {
    transform: scale(1.04);
    filter: brightness(0.95) drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ----------------------------------------------------------------
   5. BLOCO DO USUÁRIO NA SIDEBAR
   ---------------------------------------------------------------- */
.sc-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 6px;
}

/* Avatar com iniciais */
.sc-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--sc-gradient);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 131, 143, 0.45);
    cursor: default;
    user-select: none;
    letter-spacing: 0.5px;
}

.sc-sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sc-sidebar-user-name {
    color: #e0e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.sc-sidebar-user-role {
    color: #7a9ab5;
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

/* Menu de navegação da sidebar */
.nav-sidebar > .nav-item > .nav-link {
    border-radius: 6px;
    margin: 2px 8px;
    transition: var(--sc-transition);
    color: #b8cce0 !important;
    font-size: 0.875rem;
}

.nav-sidebar > .nav-item > .nav-link:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #fff !important;
    transform: translateX(3px);
}

.nav-sidebar > .nav-item > .nav-link.active {
    background: var(--sc-gradient) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(13, 158, 142, 0.4);
}

.nav-sidebar .nav-icon {
    color: #7a9ab5 !important;
    transition: color 0.2s ease;
}

.nav-sidebar > .nav-item > .nav-link.active .nav-icon,
.nav-sidebar > .nav-item > .nav-link:hover .nav-icon {
    color: #fff !important;
}

/* ----------------------------------------------------------------
   6. MARCA D'ÁGUA NO CONTENT (watermark)
   ---------------------------------------------------------------- */
.sc-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 520px;
    height: 200px;
    background-image: url('../imgs/sansatacas.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* Garante que o conteúdo (yield) fica por cima da marca d'água */
.content-wrapper > .content > .container-fluid {
    position: relative;
    z-index: 1;
}

/* ----------------------------------------------------------------
   7. CONTENT WRAPPER — layout geral
   ---------------------------------------------------------------- */
.content-wrapper {
    background: #f0f4f8;
    position: relative;
}

.content-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0d2137;
    border-left: 4px solid var(--sc-teal);
    padding-left: 10px;
}

/* ----------------------------------------------------------------
   8. CARDS / SMALL-BOXES
   ---------------------------------------------------------------- */
.card {
    border-radius: var(--sc-radius) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07) !important;
    border: none !important;
}

.card-header {
    border-radius: var(--sc-radius) var(--sc-radius) 0 0 !important;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #0d2137;
    background: #fff !important;
}

.small-box {
    border-radius: var(--sc-radius) !important;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
}

.small-box h3 {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
}

/* ----------------------------------------------------------------
   9. BANNER DE BOAS-VINDAS (dashboard)
   ---------------------------------------------------------------- */
.sc-welcome-banner {
    background: var(--sc-gradient);
    border-radius: var(--sc-radius);
    color: #fff;
    padding: 22px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--sc-shadow);
    animation: scFadeInDown 0.5s ease both;
}

.sc-welcome-banner .sc-welcome-text h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.sc-welcome-banner .sc-welcome-text p {
    margin: 0;
    opacity: 0.88;
    font-size: 0.92rem;
}

.sc-welcome-banner .sc-welcome-icon {
    font-size: 3rem;
    opacity: 0.30;
}

/* ----------------------------------------------------------------
   10. UTILITÁRIOS DE SEÇÃO (dashboard)
   ---------------------------------------------------------------- */
.sc-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #90a4b8;
    margin-bottom: 14px;
}

.sc-stats-divider {
    border: none;
    border-top: 2px solid #e9ecef;
    margin: 8px 0 20px;
}

/* ----------------------------------------------------------------
   11. ALERTAS — animação de saída
   ---------------------------------------------------------------- */
.alert {
    border-radius: var(--sc-radius) !important;
    border-left: 4px solid transparent;
    animation: scFadeIn 0.3s ease both;
}

.alert-success { border-left-color: #28a745; }
.alert-danger   { border-left-color: #dc3545; }
.alert-warning  { border-left-color: #ffc107; }
.alert-info     { border-left-color: #17a2b8; }

/* Classe adicionada pelo JS ao fechar o alerta */
.sc-hiding {
    animation: scFadeOut 0.4s ease forwards !important;
    pointer-events: none;
}

/* ----------------------------------------------------------------
   12. TABELAS
   ---------------------------------------------------------------- */
.table thead th {
    background: #f0f4f8;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0d2137;
    border-top: none;
    border-bottom: 2px solid #b0c4d8;
}

.table-hover tbody tr:hover {
    background: rgba(13, 158, 142, 0.05);
}

/* ----------------------------------------------------------------
   13. BOTÕES
   ---------------------------------------------------------------- */
.btn {
    border-radius: 5px !important;
    font-weight: 500;
    transition: var(--sc-transition);
}

.btn:active {
    transform: scale(0.97);
}

/* ----------------------------------------------------------------
   14. RODAPÉ
   ---------------------------------------------------------------- */
.main-footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 0.84rem;
    padding: 12px 20px;
}

/* ----------------------------------------------------------------
   15. KEYFRAMES / ANIMAÇÕES
   ---------------------------------------------------------------- */
@keyframes scFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scFadeOut {
    from { opacity: 1; max-height: 200px; margin-bottom: 1rem; }
    to   { opacity: 0; max-height: 0;     margin-bottom: 0;    padding: 0; }
}

@keyframes scFadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* Classe aplicada pelo JS em campos inválidos */
.is-invalid,
.form-control.is-invalid {
    animation: scShake 0.4s ease;
}

/* ----------------------------------------------------------------
   16. TELA DE LOGIN
   ---------------------------------------------------------------- */

/* Logo centralizada acima do card */
.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.sc-login-logo {
    height: 110px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    animation: scFadeInDown 0.5s ease both;
}

/* Caixa de login — wrapper unificado, mesma cor branca do card */
.login-box {
    width: 380px;
    background: #d6e0e8;
    border-radius: 16px;
    padding: 28px 24px 20px;
}

/* Card interno e todos os filhos: totalmente transparentes para não criar camada separada */
.login-box .card,
.login-box .card-body,
.login-box .login-card-body {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    animation: none !important;
}

/* Botão olho — mostrar/ocultar senha (ícone flutuante dentro do input) */
.sc-password-wrap {
    position: relative;
}

.sc-password-input {
    padding-right: 36px !important;
}

.sc-eye-btn {
    position: absolute;
    right: 46px; /* espaço para o cadeado */
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    padding: 0 6px;
    color: #adb5bd;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.sc-eye-btn:hover {
    color: var(--sc-teal);
}

.sc-eye-btn:focus {
    outline: none;
}

/* Botão Entrar com gradiente */
.login-card-body .btn-primary {
    background: linear-gradient(135deg, var(--sc-blue-dark), var(--sc-teal)) !important;
    border: none !important;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: var(--sc-transition);
}

.login-card-body .btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13, 158, 142, 0.45);
}

/* Mobile */
@media (max-width: 480px) {
    .login-box {
        width: 90vw;
    }
    .sc-login-logo {
        height: 80px;
    }
}

/* Botões de ação em tabelas CRUD (Editar/Excluir) com tamanho uniforme */
.card table td .btn,
.card-body table td .btn {
    min-width: 75px;
    text-align: center;
}

/* Tabelas CRUD roláveis horizontalmente no mobile (sem arrastar a página) */
@media (max-width: 768px) {
    .card table,
    .card-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
}

/* ----------------------------------------------------------------
   17. SCROLLBAR CUSTOMIZADA (sidebar)
   ---------------------------------------------------------------- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
