/* ========================================
   GLOBAL NAVBAR - Painel MH (from WEBAPP)
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Sistema de Cores e Tipografia */
:root {
    --font-primary: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --text-muted: #666;
    --text-light: #fff;
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --border-color: #e2e8f0;
    --border-light: #ddd;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
    --navbar-height: 56px;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-blur: 16px;
    --glass-card-bg: rgba(255, 255, 255, 0.25);
    --glass-card-header-bg: rgba(248, 249, 250, 0.5);
    --glass-item-card-header-bg: rgba(255, 255, 255, 0.55);
}

* {
    box-sizing: border-box;
}

/* Panel: neutral background (painel-login / painel-page override in estilo.css) */
body {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Blocos e formas animados de fundo - sempre visiveis */
.bg-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-shapes .shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    animation: float-shapes 6s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* Rounded rectangles (blocos) */
.bg-shapes .shape[data-shape="rect"] {
    border-radius: 12px;
}
.bg-shapes .shape[data-shape="rect"]:nth-child(1) {
    width: 120px; height: 80px; border-radius: 15px;
    top: 18%; left: 8%; animation-delay: 0s;
    --start-rotation: 15deg; transform: rotate(15deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(2) {
    width: 90px; height: 140px; border-radius: 12px;
    top: 58%; right: 12%; left: auto; animation-delay: 2s;
    --start-rotation: -20deg; transform: rotate(-20deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(3) {
    width: 100px; height: 60px; border-radius: 10px;
    bottom: 22%; left: 18%; animation-delay: 4s;
    --start-rotation: 25deg; transform: rotate(25deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(4) {
    width: 80px; height: 120px; border-radius: 8px;
    top: 8%; right: 28%; left: auto; animation-delay: 1s;
    --start-rotation: -10deg; transform: rotate(-10deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(5) {
    width: 110px; height: 70px; border-radius: 14px;
    bottom: 38%; right: 18%; left: auto; animation-delay: 3s;
    --start-rotation: 30deg; transform: rotate(30deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(6) {
    width: 95px; height: 95px; border-radius: 20px;
    top: 38%; left: 4%; animation-delay: 5s;
    --start-rotation: -15deg; transform: rotate(-15deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(7) {
    width: 70px; height: 100px; border-radius: 10px;
    top: 72%; left: 25%; animation-delay: 1.5s;
    --start-rotation: 12deg; transform: rotate(12deg);
}
.bg-shapes .shape[data-shape="rect"]:nth-child(8) {
    width: 130px; height: 55px; border-radius: 18px;
    top: 12%; left: 45%; animation-delay: 3.5s;
    --start-rotation: -8deg; transform: rotate(-8deg);
}

/* Circles */
.bg-shapes .shape[data-shape="circle"] {
    border-radius: 50%;
}
.bg-shapes .shape[data-shape="circle"]:nth-child(9) {
    width: 85px; height: 85px;
    top: 25%; right: 8%; left: auto; animation-delay: 0.5s;
    --start-rotation: 5deg; transform: rotate(5deg);
}
.bg-shapes .shape[data-shape="circle"]:nth-child(10) {
    width: 55px; height: 55px;
    bottom: 30%; right: 35%; left: auto; animation-delay: 2.5s;
    --start-rotation: -12deg; transform: rotate(-12deg);
}
.bg-shapes .shape[data-shape="circle"]:nth-child(11) {
    width: 70px; height: 70px;
    top: 55%; left: 8%; animation-delay: 4.5s;
    --start-rotation: 18deg; transform: rotate(18deg);
}
.bg-shapes .shape[data-shape="circle"]:nth-child(12) {
    width: 45px; height: 45px;
    top: 8%; left: 35%; animation-delay: 1.2s;
    --start-rotation: -25deg; transform: rotate(-25deg);
}
.bg-shapes .shape[data-shape="circle"]:nth-child(13) {
    width: 65px; height: 65px;
    bottom: 15%; right: 8%; left: auto; animation-delay: 3.8s;
    --start-rotation: 22deg; transform: rotate(22deg);
}

/* Ovals (elongated circles) */
.bg-shapes .shape[data-shape="oval"] {
    border-radius: 50%;
}
.bg-shapes .shape[data-shape="oval"]:nth-child(14) {
    width: 100px; height: 50px;
    top: 42%; right: 22%; left: auto; animation-delay: 2.2s;
    --start-rotation: -18deg; transform: rotate(-18deg);
}
.bg-shapes .shape[data-shape="oval"]:nth-child(15) {
    width: 60px; height: 95px;
    bottom: 45%; left: 32%; animation-delay: 0.8s;
    --start-rotation: 28deg; transform: rotate(28deg);
}
.bg-shapes .shape[data-shape="oval"]:nth-child(16) {
    width: 80px; height: 40px;
    top: 68%; left: 55%; animation-delay: 4s;
    --start-rotation: -5deg; transform: rotate(-5deg);
}

/* Triangles (clip-path) */
.bg-shapes .shape[data-shape="triangle"] {
    width: 75px;
    height: 65px;
    background: rgba(255, 255, 255, 0.08);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.bg-shapes .shape[data-shape="triangle"]:nth-child(17) {
    top: 15%; left: 62%; animation-delay: 1.8s;
    --start-rotation: 35deg; transform: rotate(35deg);
}
.bg-shapes .shape[data-shape="triangle"]:nth-child(18) {
    top: 48%; right: 5%; left: auto; animation-delay: 3.2s;
    --start-rotation: -40deg; transform: rotate(-40deg);
}
.bg-shapes .shape[data-shape="triangle"]:nth-child(19) {
    bottom: 25%; left: 48%; animation-delay: 0.3s;
    --start-rotation: 50deg; transform: rotate(50deg);
}
.bg-shapes .shape[data-shape="triangle"]:nth-child(20) {
    top: 75%; right: 42%; left: auto; animation-delay: 4.2s;
    --start-rotation: -22deg; transform: rotate(-22deg);
}

@keyframes float-shapes {
    0%, 100% { transform: translateY(0) rotate(var(--start-rotation, 0deg)); }
    50% { transform: translateY(-20px) rotate(calc(var(--start-rotation, 0deg) + 180deg)); }
}

/* Navbar Principal */
.navbar {
    background-color: #fff !important;
    box-shadow: var(--shadow);
    padding: calc(0.5rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left));
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    min-height: var(--navbar-height);
    margin-bottom: 2rem;
}

.navbar .container-fluid {
    position: relative;
    display: flex;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
}

.navbar-brand {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.navbar .container-fluid .d-flex {
    margin-left: auto;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.navbar-brand img.navbar-logo {
    height: 52px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    vertical-align: middle;
}

.user-welcome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.badge-role {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.btn-light {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-light);
    color: var(--text-color);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

.btn-light:hover {
    background-color: #e9ecef;
    color: var(--text-color);
}

.btn-light i {
    margin-right: 0.25rem;
}

body,
.main-container {
    padding-top: calc(var(--navbar-height) + env(safe-area-inset-top));
}

.navbar.bg-light {
    background-color: #fff !important;
}

.navbar .d-flex {
    gap: 0.5rem;
}

/* Responsividade - logo e acoes */
@media (max-width: 768px) {
    :root {
        --navbar-height: 60px;
    }
    .navbar {
        padding: calc(0.5rem + env(safe-area-inset-top)) calc(0.5rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(0.5rem + env(safe-area-inset-left)) !important;
        min-height: var(--navbar-height);
    }
    .navbar .container-fluid {
        justify-content: space-between;
        gap: 0.5rem;
    }
    .navbar-brand {
        position: static;
        transform: none;
        font-size: 0.95rem;
        flex-shrink: 0;
        order: 1;
        margin-left: 1.25rem;
    }
    .navbar-brand img.navbar-logo {
        height: 42px;
        max-width: 140px;
    }
    .navbar .container-fluid .d-flex {
        margin-left: 0;
        order: 2;
        flex-shrink: 0;
        min-width: 0;
    }
    .user-welcome .user-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100px;
    }
}

@media (max-width: 576px) {
    :root {
        --navbar-height: 56px;
    }
    .navbar-brand img.navbar-logo {
        height: 36px;
        max-width: 130px;
    }
}

@media (max-width: 480px) {
    :root {
        --navbar-height: 52px;
    }
    .navbar-brand img.navbar-logo {
        height: 32px;
        max-width: 110px;
    }
}

/* Cards e tabelas (glass style) */
.card {
    background: var(--glass-card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
}

.card-header {
    background: var(--glass-card-header-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.card-body {
    padding: 1.5rem;
}

.table thead th {
    background: var(--glass-card-header-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 2px solid rgba(255, 255, 255, 0.25);
    color: var(--text-color);
    font-weight: 600;
    padding: 0.75rem;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
