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

:root {
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --secondary: #0ea5e9;
    --accent: #22c55e;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --bg-light: #eef2f7;
    --border: #e2e8f0;
    --shadow: rgba(15, 23, 42, 0.12);
    --nav-bg: #1d4ed8;
    --nav-bg-dark: #1e3a8a;
    --nav-text: #f8fafc;
    --nav-pill: rgba(255, 255, 255, 0.16);
    --sidebar-bg: #f8fafc;
    --nav-height: 64px;
    --mobile-bottom-nav-height: 72px;
}

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(180deg, #eef2f7 0%, #f8fafc 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* Navbar */
.navbar {
    background: linear-gradient(90deg, var(--nav-bg) 0%, var(--nav-bg-dark) 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.25);
    padding: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: var(--nav-height);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18);
    transition: all 0.3s ease;
}

/* Estado quando sidebar está aberta em mobile */
.navbar.sidebar-open {
    z-index: 1080; /* Ainda mais alto quando sidebar aberta */
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.25);
    background: rgba(30, 58, 138, 0.98);
    backdrop-filter: blur(25px);
}

@media (max-width: 1024px) {
    .navbar.sidebar-open {
        background: rgba(30, 58, 138, 0.99);
        border-bottom: 1px solid rgba(147, 197, 253, 0.25);
    }
}

.nav-container {
    max-width: none;
    margin: 0;
    padding: 0 1.25rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    height: var(--nav-height);
    gap: 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    color: var(--nav-text);
    letter-spacing: 0.2px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1090;
    min-width: 0;
    height: 100%;
    line-height: 1.15;
}

.navbar-brand-text {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
}

.nav-context {
    color: var(--nav-text);
    font-weight: 600;
    font-size: 0.95rem;
    opacity: 0.9;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}

.nav-context:empty {
    display: none;
}

/* Estado destacado quando sidebar aberta */
.navbar.sidebar-open .navbar-brand {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 8px rgba(147, 197, 253, 0.35));
}

.logo {
    max-height: 30px;
    border-radius: 50%;
    transition: transform 0.3s ease;
    width: auto;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Animação do logo quando sidebar aberta */
.navbar.sidebar-open .logo {
    transform: scale(1.1) rotate(5deg);
    filter: brightness(1.1);
}

.navbar-brand img {
    max-height: 40px;
    margin-right: 0.5rem;
    flex-shrink: 0;
    display: block;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.75rem;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.nav-user-mobile {
    display: none;
}

.nav-user-mobile .nav-link {
    padding: 0.45rem 0.75rem;
}

.nav-user-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: var(--nav-text);
    font-weight: 700;
    text-transform: uppercase;
}

.nav-user-mobile .dropdown-menu {
    right: 0;
    left: auto;
}

@media (max-width: 1024px) {
    .nav-user-mobile .dropdown-menu {
        max-height: 70vh;
        overflow-y: auto;
    }
}

.nav-user-name {
    display: inline;
}

.mobile-nav {
    display: none;
    background: linear-gradient(90deg, var(--nav-bg) 0%, var(--nav-bg-dark) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.3s ease;
}

.mobile-nav.is-open {
    max-height: calc(100vh - var(--nav-height));
    opacity: 1;
    visibility: visible;
}

.mobile-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 1rem 0.75rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid transparent;
}

.mobile-nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-nav-item {
    position: relative;
}

.mobile-nav .dropdown-menu {
    left: 0;
    right: auto;
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1035;
    align-items: center;
    justify-content: space-between;
    gap: 0.2rem;
    height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 0.34rem 0.4rem calc(0.34rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(12px);
}

.mobile-bottom-link {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    text-decoration: none;
    color: #64748b;
    font-size: 0;
    font-weight: 700;
    min-height: 48px;
    padding: 0.5rem 0.2rem;
    border-radius: 14px;
    transition: color 0.2s ease, background 0.2s ease;
}

.mobile-bottom-link i {
    display: block;
    font-size: 1.22rem;
    line-height: 1;
}

.mobile-bottom-link.active {
    color: var(--primary);
    background: rgba(14, 165, 233, 0.12);
}

.mobile-bottom-link:active {
    transform: scale(0.98);
}

.nav-item {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.nav-link:hover {
    color: var(--nav-text);
    background: var(--nav-pill);
}

.nav-link.active {
    color: var(--nav-bg-dark);
    background: var(--bg-white);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-icon-link {
    justify-content: center;
    min-width: 40px;
    padding: 0.45rem 0.7rem;
}

.nav-icon-link.dropdown-toggle::after {
    display: none;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: '▼';
    margin-left: 0.5rem;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-toggle::after {
    content: 'v';
}

.dropdown-toggle::after {
    content: '';
    display: inline-block;
    margin-left: 0.4rem;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.3s ease;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border-radius: 14px;
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
    padding: 1rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notifications-toggle {
    position: relative;
}

.notifications-badge {
    top: -6px;
    right: -6px;
    font-size: 0.62rem;
    min-width: 18px;
    padding: 0.15rem 0.35rem;
}

.notifications-dropdown {
    min-width: 320px;
    max-width: min(420px, calc(100vw - 1.5rem));
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

.notifications-header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-white);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding: 0.75rem 1rem;
}

.notifications-title {
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
}

.notifications-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.notifications-summary span {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: #334155;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
}

.dropdown-item.notification-item {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    white-space: normal;
    border-left: 3px solid transparent;
    padding: 0.75rem 0.95rem;
}

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.notification-content {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.notification-item-title {
    display: block;
    color: var(--text-primary);
    font-size: 0.84rem;
    line-height: 1.28;
    font-weight: 700;
}

.notification-item-description {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.34;
}

.notification-info {
    border-left-color: #0ea5e9;
}

.notification-info .notification-icon {
    color: #0369a1;
    background: #e0f2fe;
}

.notification-warning {
    border-left-color: #f59e0b;
}

.notification-warning .notification-icon {
    color: #b45309;
    background: #fef3c7;
}

.notification-danger {
    border-left-color: #ef4444;
}

.notification-danger .notification-icon {
    color: #b91c1c;
    background: #fee2e2;
}

.dropdown-item.notification-empty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #047857;
    font-size: 0.82rem;
    padding: 0.95rem 1rem;
}

.dropdown-item {
    display: block;
    padding: 0.4rem 1.2rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
}

.dropdown-item-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.support-menu-badge {
    position: static;
    inset: auto;
    margin-left: auto;
    min-width: 22px;
}

.dropdown-item:hover {
    background: rgba(14, 165, 233, 0.12);
    color: var(--primary);
}

.dropdown-item.active {
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
    color: var(--bg-white);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.dropdown-item.clinic-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item.clinic-option .clinic-option-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-item.clinic-option .dropdown-item-check {
    margin-left: auto;
    flex: 0 0 auto;
}

.clinic-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.clinic-name {
    flex: 1;
    font-weight: 600;
}

.clinic-caret {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.clinic-dropdown {
    display: none;
}

.dropdown.clinic-open .clinic-dropdown {
    display: block;
}

.dropdown.clinic-open .clinic-caret {
    transform: rotate(180deg);
}

.dropdown-header {
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(14, 165, 233, 0.08);
    pointer-events: none;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

/* Badge */
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--nav-text);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1090; /* Sempre clicável */
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--nav-text);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

/* Estado ativo do botão quando sidebar está aberta */
.mobile-menu-btn.active {
    color: var(--nav-text);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Animação do ícone hambúrguer */
.mobile-menu-btn .hamburger {
    display: inline-block;
    transition: transform 0.3s ease;
}

.mobile-menu-btn.active .hamburger {
    transform: rotate(90deg);
}

/* Efeito de pulso sutil quando sidebar ativa */
.mobile-menu-btn.active {
    animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    }
}

/* Indicador visual adicional na navbar quando sidebar aberta */
.navbar.sidebar-open::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #93c5fd, #38bdf8);
    opacity: 0;
    animation: slideIn 0.3s ease-out 0.1s forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Main Layout */
.main-layout {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
    width: 100%;
    min-width: 0;
}

.no-navbar .main-layout {
    margin-top: 0;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.08);
    padding: 2rem 0;
    position: fixed;
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1050;
    top: var(--nav-height);
    left: 0;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.main-layout.has-sidebar .main-content {
    margin-left: 260px;
}

.sidebar-nav {
    list-style: none;
    padding: 0 1rem;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.5rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.25rem;
    color: #334155;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    border: 1px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(14, 165, 233, 0.08);
    color: var(--primary);
}

.sidebar-nav .nav-link.active {
    background: rgba(14, 165, 233, 0.15);
    color: #0f172a;
    border-color: rgba(14, 165, 233, 0.25);
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-nav .nav-link i {
    font-size: 1.2rem;
}

.sidebar-nav .nav-group-toggle {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    justify-content: space-between;
}

.sidebar-nav .nav-group-toggle .nav-caret {
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
}

.sidebar-nav .nav-group.is-open .nav-group-toggle .nav-caret {
    transform: rotate(180deg);
}

.sidebar-nav .nav-submenu {
    list-style: none;
    margin: 0.25rem 0 0.75rem 1.5rem;
    padding: 0;
    display: none;
    gap: 0.35rem;
}

.sidebar-nav .nav-group.is-open .nav-submenu {
    display: grid;
}

.sidebar-nav .nav-sublink {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-nav .nav-sublink:hover {
    background: rgba(14, 165, 233, 0.08);
    color: var(--primary);
}

.sidebar-nav .nav-sublink.active {
    background: rgba(14, 165, 233, 0.15);
    color: #0f172a;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-nav .nav-sublink.is-disabled {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.18);
    cursor: not-allowed;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: 2rem 2.25rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1; /* Abaixo da sidebar em mobile */
    min-width: 0;
    width: 100%;
    background: transparent;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.content-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #0f172a;
}

/* Alert Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInDown 0.3s ease;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: #38a169;
    border-left: 4px solid #48bb78;
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    color: #e53e3e;
    border-left: 4px solid #f56565;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    color: #dd6b20;
    border-left: 4px solid #ed8936;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary);
    border-left: 4px solid var(--secondary);
}

.alert-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.alert-close:hover {
    opacity: 1;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.table-responsive,
.table-container,
.data-table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 10px;
}

.table-responsive table,
.table-container table,
.data-table-wrapper table {
    min-width: 640px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px var(--shadow);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title i {
    font-size: 1.3rem;
}

.card-text {
    color: #718096;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px var(--shadow);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.maintenance-modal-open {
    overflow: hidden;
}

.maintenance-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.maintenance-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.maintenance-modal {
    width: min(560px, calc(100vw - 2rem));
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 28px 50px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

.maintenance-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 165, 233, 0.08);
}

.maintenance-modal-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
    font-size: 1.05rem;
}

.maintenance-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: var(--bg-white);
    color: #1f2937;
    cursor: pointer;
}

.maintenance-modal-close:hover {
    background: rgba(14, 165, 233, 0.1);
}

.maintenance-modal-body {
    padding: 1rem 1.2rem 0.4rem;
    color: var(--text-primary);
}

.maintenance-modal-body p {
    margin: 0 0 0.65rem;
}

.maintenance-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.7rem 1.2rem 1.1rem;
}

.maintenance-modal-footer .btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.92rem;
    border-radius: 10px;
}

.support-chat-open {
    overflow: hidden;
}

.support-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.support-chat-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.support-chat-modal {
    width: min(640px, calc(100vw - 2rem));
    height: min(82vh, 700px);
    background: var(--bg-white);
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.32);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.support-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(14, 165, 233, 0.08);
}

.support-chat-header h3 {
    margin: 0;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #0f172a;
}

.support-chat-header p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #475569;
}

.support-chat-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.15);
    background: var(--bg-white);
    color: #334155;
    cursor: pointer;
}

.support-chat-close:hover {
    background: rgba(148, 163, 184, 0.12);
}

.support-chat-body {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
}

.support-chat-info {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    color: #334155;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: #f8fafc;
}

.support-chat-messages {
    padding: 0.85rem 1rem;
    overflow-y: auto;
    display: grid;
    gap: 0.65rem;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}

.support-chat-message {
    max-width: min(85%, 520px);
    border-radius: 12px;
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: var(--bg-white);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.support-chat-message-header {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
    font-size: 0.74rem;
    color: #475569;
}

.support-chat-message-header strong {
    color: #0f172a;
}

.support-chat-message p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #0f172a;
    word-break: break-word;
}

.support-chat-message.origin-usuario {
    margin-left: auto;
    background: #dbeafe;
    border-color: #93c5fd;
}

.support-chat-message.origin-admin {
    margin-right: auto;
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.support-chat-message.origin-bot,
.support-chat-message.origin-sistema {
    margin-right: auto;
    background: #f8fafc;
    border-style: dashed;
}

.support-chat-form {
    border-top: 1px solid var(--border);
    padding: 0.8rem 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    background: var(--bg-white);
}

.support-chat-form textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    resize: none;
    padding: 0.6rem 0.75rem;
    font: inherit;
    line-height: 1.4;
    min-height: 68px;
    max-height: 180px;
}

.support-chat-form textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.16);
}

.support-chat-form button {
    align-self: end;
    padding: 0.65rem 0.95rem;
    min-width: 100px;
}

/* Responsive */
@media (max-width: 1200px) {
    .nav-container {
        padding: 0 1.5rem;
    }

    .sidebar {
        width: 230px;
    }

    .main-layout.has-sidebar .main-content {
        margin-left: 0;
    }
}

@media (max-width: 1024px) {
    .nav-container {
        padding: 0 1rem;
        gap: 0.35rem;
        display: flex;
        position: relative;
        align-items: center;
    }

    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
        padding: 0.45rem;
        position: relative;
        z-index: 1091;
    }

    .navbar-brand {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        justify-content: center;
        width: auto;
        max-width: calc(100% - 10rem);
        overflow: hidden;
        font-size: 1.05rem;
        gap: 0.45rem;
        height: auto;
        z-index: 1085;
    }

    .navbar-brand img {
        max-height: 30px;
        margin-right: 0;
    }

    .navbar-brand-text {
        display: -webkit-box;
        max-width: 100%;
        text-align: center;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.05;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        max-height: 2.1em;
    }

    .nav-actions {
        margin-left: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        justify-content: flex-end;
        margin-left: auto;
        min-width: max-content;
        position: relative;
        z-index: 1091;
    }

    .nav-actions .nav-item {
        flex-shrink: 0;
    }

    .nav-actions .nav-link {
        padding: 0.35rem 0.5rem;
    }

    .nav-notifications .nav-link {
        min-width: 36px;
    }

    .nav-user-mobile .nav-link {
        padding: 0.3rem 0.45rem;
    }

    .nav-user-mobile .dropdown-toggle::after {
        display: none;
    }

    .nav-user-initial {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }

    .nav-user-mobile {
        display: flex;
    }

    .navbar.sidebar-open .navbar-brand {
        transform: translate(-50%, -50%) scale(1.02);
    }

    .nav-user-name {
        display: none;
    }

    .nav-user-mobile.show .nav-user-name {
        display: inline;
    }

    .nav-context {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    .has-mobile-bottom-nav .mobile-bottom-nav {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 80%;
        max-width: 320px;
        z-index: 1060; /* Acima do overlay */
        box-shadow: 5px 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1.5rem;
    }

    .has-mobile-bottom-nav .main-content {
        padding: 1.25rem 1.5rem calc(1.25rem + var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .content-title {
        font-size: 2rem;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 0.75rem;
    }

    .navbar-brand {
        font-size: 0.98rem;
    }

    .notifications-dropdown {
        min-width: min(320px, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
    }

    .main-content {
        padding: 1rem 1.25rem;
    }

    .has-mobile-bottom-nav .main-content {
        padding: 1rem 1.25rem calc(1rem + var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .cards-grid {
        gap: 1rem;
    }

    .support-chat-modal {
        width: calc(100vw - 1rem);
        height: calc(100vh - 1rem);
        border-radius: 14px;
    }

    .support-chat-form {
        grid-template-columns: 1fr;
    }

    .support-chat-form button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 90%;
        max-width: 280px;
    }
    
    /* Ajustar padding em telas muito pequenas */
    .main-content {
        padding: 0.5rem 0.75rem;
    }

    .has-mobile-bottom-nav .main-content {
        padding: 0.5rem 0.75rem calc(0.5rem + var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    }
    
    .content-header {
        gap: 0.75rem;
    }
}

/* Animacoes melhoradas para sidebar */
@media (max-width: 1024px) {
    .sidebar {
        will-change: transform;
    }
    
    .sidebar-overlay {
        backdrop-filter: blur(2px);
    }
}

/* Estados de foco para acessibilidade */
.mobile-menu-btn:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.sidebar-nav .nav-link:focus {
    outline: 2px solid #93c5fd;
    outline-offset: -2px;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* Icons using Unicode symbols */
.icon-home::before { content: '🏠'; }
.icon-people::before { content: '👥'; }
.icon-building::before { content: '🏢'; }
.icon-person-plus::before { content: '👤+'; }
.icon-envelope::before { content: '✉️'; }
.icon-cash::before { content: '💰'; }
.icon-calendar::before { content: '📅'; }
.icon-graph::before { content: '📊'; }
.icon-person::before { content: '👤'; }
.icon-check::before { content: '✓'; }
