/* Layout estilo G-TICKETS: top bar + sidebar recolhível + abas */

:root {
    --header-bg: #3d4f5c;
    --header-text: #fff;
    --sidebar-bg: #2c3e50;
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 52px;
    --sidebar-text: #ecf0f1;
    --sidebar-hover: rgba(255,255,255,.08);
    --sidebar-active: rgba(255,255,255,.12);
    --tab-bar-bg: #f0f2f5;
    --tab-active-bg: #fff;
    --tab-close-hover: #dc3545;
}

body {
    margin: 0;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

#app-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Login em primeiro plano; conteúdo ofuscado (borrado) quando não autenticado */
body.auth-locked #app-shell {
    filter: blur(10px) saturate(0.85);
    pointer-events: none;
    user-select: none;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.auth-overlay-panel {
    max-width: 400px;
    width: calc(100% - 2rem);
    position: relative;
    z-index: 1;
}

.app-alerts {
    position: fixed;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    width: min(480px, calc(100% - 2rem));
    pointer-events: none;
}
.app-alerts .alert {
    pointer-events: auto;
}

.auth-form-error.alert {
    font-size: 0.875rem;
}

/* ---- Top Header ---- */
.app-header {
    display: flex;
    align-items: center;
    background: var(--header-bg);
    color: var(--header-text);
    height: 52px;
    flex-shrink: 0;
    padding: 0 1rem;
    gap: 1rem;
    position: relative;
    z-index: 1100;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}
.app-logo i { font-size: 1.4rem; }

/* Autocomplete Cliente/Projeto no centro */
.header-search-group {
    flex: 1;
    max-width: 560px;
    min-width: 200px;
    position: relative;
}
.header-autocomplete-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    gap: 0;
}
.header-autocomplete-wrap:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
.header-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    padding-left: 0.65rem;
    color: #6c757d;
    flex-shrink: 0;
    pointer-events: none;
}
.header-search-icon i { font-size: 0.95rem; }
.header-autocomplete-input {
    flex: 1;
    border: none;
    padding: 0.45rem 0.5rem 0.45rem 0.25rem;
    font-size: 0.95rem;
    outline: none;
    min-width: 0;
    color: #212529;
}
.header-autocomplete-input::placeholder {
    color: #adb5bd;
}
.btn-search-config {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 2px;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.btn-search-config:hover {
    background: #f1f3f5;
    color: #0d6efd;
}
.btn-clear-selection {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 4px;
    border: none;
    background: #dc3545;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}
.btn-clear-selection:hover { background: #bb2d3b; color: #fff; }
.header-autocomplete-wrap.has-selection .btn-clear-selection { display: flex; }
.header-autocomplete-wrap.has-selection .btn-search-config { display: none; }

/* Dropdown superior (não vinculado a cliente) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.header-actions .dropdown-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: var(--header-text);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.header-actions .dropdown-toggle:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.6);
    color: #fff;
}
.header-actions .btn-toggle-cadastros {
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: var(--header-text);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 1rem;
}
.header-actions .btn-toggle-cadastros:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.header-actions .btn-admin-settings {
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: var(--header-text);
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1;
}
.header-actions .btn-admin-settings:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
}
.admin-settings-menu .dropdown-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}
.admin-avatares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}
.admin-avatar-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    aspect-ratio: 1;
}
.admin-avatar-item.principal {
    border-color: #ffc107;
}
.admin-avatar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.admin-avatar-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    gap: 2px;
    justify-content: center;
    padding: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}
.admin-avatar-item:hover .admin-avatar-actions { opacity: 1; }
.header-actions .btn-user-menu {
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    color: var(--header-text);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}
.header-actions .btn-user-menu:hover { background: rgba(255,255,255,.1); color: #fff; }
.header-actions .user-avatar-wrap { display: inline-flex; align-items: center; justify-content: center; }
.header-actions .user-avatar-wrap img { display: block; }
.header-actions .dropdown-avatar { display: inline-flex; align-items: center; justify-content: center; }
.header-actions .dropdown-avatar img { display: block; }

/* Container principal: sidebar + área de conteúdo */
.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ---- Sidebar ---- */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow: hidden;
}
.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}
.app-sidebar .sidebar-toggle {
    align-self: flex-end;
    margin: 4px 4px 0 0;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255,255,255,.15);
    color: var(--sidebar-text);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}
.app-sidebar .sidebar-toggle:hover { background: rgba(255,255,255,.25); }
.app-sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.sidebar-nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.sidebar-nav .nav-item { margin: 0; }
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); border-left-color: #0d6efd; }
.sidebar-nav .nav-link i { font-size: 1.2rem; width: 24px; text-align: center; flex-shrink: 0; }
.app-sidebar.collapsed .sidebar-nav .nav-link span { display: none; }
.app-sidebar.collapsed .sidebar-nav .nav-link { justify-content: center; padding: 0.6rem; }

.sidebar-nav .nav-sub {
    list-style: none;
    padding: 0 0 0 2rem;
    margin: 0;
}
.sidebar-nav .nav-sub .nav-link { padding: 0.4rem 0.75rem; font-size: 0.88rem; }
.app-sidebar.collapsed .nav-sub { display: none; }

.sidebar-nav .nav-category {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(236,240,241,.7);
}
.app-sidebar.collapsed .nav-category { display: none; }

/* ---- Área de conteúdo com abas ---- */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: #f8f9fa;
}

.app-tabs-wrap {
    display: flex;
    align-items: center;
    background: var(--tab-bar-bg);
    /*border-bottom: 1px solid #dee2e6; */
    /* min-height: 40px; */
    flex-shrink: 0;
    padding: 0.25rem 0.25rem 0 0.5rem;
    gap: 0.5rem;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.app-tabs-wrap::-webkit-scrollbar {
    display: none;
}
.app-body:not(.has-selection) .app-tabs-wrap { display: none; }
.app-tabs {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.app-tabs::-webkit-scrollbar {
    display: none;
}
.app-tab-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.app-tab-action {
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.app-tab-action:hover { background: rgba(0,0,0,.06); }
.app-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem 0.4rem 1rem;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    margin-right: 2px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    max-width: 180px;
}
.app-tab:hover { background: #f0f2f5; }
.app-tab.active {
    background: var(--tab-active-bg);
    font-weight: 500;
    margin-bottom: -1px;
    padding-bottom: calc(0.4rem + 1px);
}
.app-tab .tab-close {
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}
.app-tab .tab-close:hover { background: var(--tab-close-hover); color: #fff; }

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    background: #fff;
}
.app-content .page-content {
    display: none;
    animation: fadeIn 0.2s ease;
}
.app-content .page-content.active { display: block; }

/* Dashboard */
.page-dashboard { padding: 0; }
.dashboard-tabs .nav-link {
    font-weight: 500;
    color: #495057;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
}
.dashboard-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}
.dashboard-tabs .nav-link i { margin-right: 0.35rem; }
.dashboard-list-panel {
    max-height: 320px;
    overflow-y: auto;
}
.dashboard-list-empty {
    padding: 1.25rem 1rem;
    text-align: center;
}
.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #eee;
}
.dashboard-list-item:last-child { border-bottom: none; }
.dashboard-list-item-titulo { font-weight: 600; flex: 1 1 100%; }
.dashboard-notif-item { flex-direction: column; align-items: flex-start; }
.dashboard-mun-grupo { border-bottom: 1px solid #eee; }
.dashboard-mun-grupo:last-child { border-bottom: none; }
.dashboard-mun-titulo {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.9rem;
}
.dashboard-table th { font-size: 0.8rem; white-space: nowrap; }
.dashboard-cal-legend .dashboard-legend-dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
}
.dashboard-agenda-7dias { max-height: 420px; overflow-y: auto; }
.dashboard-agenda-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 4px solid #adb5bd;
}
.dashboard-agenda-item:last-child { border-bottom: none; }
.dashboard-agenda-item.prioridade-baixa {
    background: #f1f3f5;
    border-left-color: #6c757d;
}
.dashboard-agenda-item.prioridade-media {
    background: #e8f4fc;
    border-left-color: #0dcaf0;
}
.dashboard-agenda-item.prioridade-alta {
    background: #fff8e6;
    border-left-color: #ffc107;
}
.dashboard-agenda-item.prioridade-urgente {
    background: #fdebec;
    border-left-color: #dc3545;
}
.dashboard-agenda-item-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}
.dashboard-agenda-item-titulo { font-weight: 600; font-size: 0.95rem; }
.dashboard-agenda-item-mun { font-size: 0.82rem; color: #495057; }
.dashboard-prio-legend .dashboard-prio-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 3px;
    margin-right: 0.2rem;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.dashboard-prio-swatch.prioridade-baixa { background: #f1f3f5; border-left: 3px solid #6c757d; }
.dashboard-prio-swatch.prioridade-media { background: #e8f4fc; border-left: 3px solid #0dcaf0; }
.dashboard-prio-swatch.prioridade-alta { background: #fff8e6; border-left: 3px solid #ffc107; }
.dashboard-prio-swatch.prioridade-urgente { background: #fdebec; border-left: 3px solid #dc3545; }
#dashboard-calendario { min-height: 360px; }
.calendar-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #dee2e6; }
.calendar-week .cal-day { background: #fff; padding: 0.5rem; min-height: 80px; font-size: 0.85rem; cursor: pointer; transition: background 0.15s; position: relative; }
.calendar-week .cal-day-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.25rem; margin-bottom: 0.25rem; }
.calendar-week .cal-day .cal-num { font-weight: 600; margin-bottom: 0; }
.cal-weather-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    font-size: 0.78rem;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.cal-weather-badge:hover { transform: scale(1.12); }
.cal-weather-badge.weather-clear { background: linear-gradient(135deg, #fef3c7, #fbbf24); color: #b45309; }
.cal-weather-badge.weather-partly { background: linear-gradient(135deg, #e0f2fe, #7dd3fc); color: #0369a1; }
.cal-weather-badge.weather-cloudy { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #374151; }
.cal-weather-badge.weather-fog { background: linear-gradient(135deg, #f3f4f6, #d1d5db); color: #6b7280; }
.cal-weather-badge.weather-drizzle { background: linear-gradient(135deg, #dbeafe, #93c5fd); color: #1d4ed8; }
.cal-weather-badge.weather-rain { background: linear-gradient(135deg, #bfdbfe, #60a5fa); color: #1e40af; }
.cal-weather-badge.weather-snow { background: linear-gradient(135deg, #f0f9ff, #bae6fd); color: #0284c7; }
.cal-weather-badge.weather-storm { background: linear-gradient(135deg, #c4b5fd, #7c3aed); color: #4c1d95; }
.calendar-week .cal-day:hover:not(.other-month) { background: #f0f7ff; }
.calendar-week .cal-day.other-month { color: #adb5bd; cursor: default; }
.calendar-week .cal-day.today {
    box-shadow: inset 0 0 0 2px #0d6efd;
    background: #e8f4ff;
}
.calendar-week .cal-day.today .cal-num {
    background: #0d6efd;
    color: #fff;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Painel de clima — layout principal + pizza */
.dashboard-clima-card .card-body { padding: 0.65rem 0.85rem 0.85rem; }
#dashboard-clima { margin-top: 0; }
.clima-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 0.75rem;
    align-items: stretch;
}
.clima-layout-loading { grid-template-columns: 1fr; }
@media (max-width: 992px) {
    .clima-layout { grid-template-columns: 1fr; }
}
.clima-col-principal { min-width: 0; }
.clima-col-pizza { min-width: 0; }
.clima-panel {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border-radius: 10px;
    padding: 0.85rem 1rem 1rem;
    color: #f1f5f9;
    height: 100%;
}
.clima-panel-pizza {
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
}
.clima-panel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 0.75rem;
}
.clima-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #fbbf24;
    border-radius: 50%;
    animation: clima-spin 0.7s linear infinite;
}
@keyframes clima-spin { to { transform: rotate(360deg); } }
.clima-loading-text {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
}
.clima-panel-compact .clima-resumo-atual {
    gap: 0.65rem 1rem;
    margin-bottom: 0.75rem;
}
.clima-panel-empty {
    text-align: center;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: 10px;
    color: #6c757d;
    font-size: 0.88rem;
}
.clima-resumo-atual {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 1rem 1.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
}
@media (max-width: 768px) {
    .clima-resumo-atual { grid-template-columns: auto 1fr; }
    .clima-resumo-stats { grid-column: 1 / -1; }
    .clima-resumo-info { grid-column: 1 / -1; text-align: left; }
}
.clima-resumo-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.clima-resumo-icon.weather-clear { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.clima-resumo-icon.weather-partly { background: rgba(125, 211, 252, 0.2); color: #7dd3fc; }
.clima-resumo-icon.weather-cloudy { background: rgba(156, 163, 175, 0.25); color: #d1d5db; }
.clima-resumo-icon.weather-rain { background: rgba(96, 165, 250, 0.25); color: #60a5fa; }
.clima-resumo-icon.weather-storm { background: rgba(167, 139, 250, 0.25); color: #a78bfa; }
.clima-resumo-icon.weather-drizzle,
.clima-resumo-icon.weather-fog,
.clima-resumo-icon.weather-snow { background: rgba(148, 163, 184, 0.2); color: #94a3b8; }
.clima-resumo-temp { font-size: 2rem; font-weight: 300; line-height: 1; }
.clima-resumo-temp span { font-size: 0.95rem; vertical-align: super; opacity: 0.7; }
.clima-resumo-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; font-size: 0.78rem; color: #94a3b8; }
.clima-resumo-stats i { margin-right: 0.2rem; }
.clima-resumo-info { text-align: right; }
.clima-condicao { font-size: 0.95rem; font-weight: 500; }
.clima-data-completa { font-size: 0.82rem; color: #94a3b8; margin-top: 0.15rem; }

.clima-pizza-titulo {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.clima-pizza-titulo i { margin-right: 0.3rem; color: #fbbf24; }
.clima-pizza-inner { flex: 1; display: flex; flex-direction: column; align-items: center; }
.clima-pizza-svg { width: 120px; height: 120px; display: block; margin-bottom: 0.5rem; }
.clima-pizza-legenda { width: 100%; display: flex; flex-direction: column; gap: 0.3rem; }
.clima-pizza-legenda-item {
    display: grid;
    grid-template-columns: 8px 2.2rem 1fr;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.72rem;
    color: #cbd5e1;
}
.clima-pizza-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.clima-pizza-dia { font-weight: 600; color: #e2e8f0; text-transform: lowercase; }
.clima-pizza-status { color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clima-pizza-status i { margin-right: 0.15rem; }
.clima-pizza-resumo {
    margin-top: 0.5rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.68rem;
    color: #64748b;
    text-align: center;
    line-height: 1.4;
}
.clima-pizza-vazio { font-size: 0.8rem; color: #64748b; text-align: center; padding: 1rem 0; }

.clima-dias-strip {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.15rem 0 0.65rem;
    margin-bottom: 0.35rem;
}
.clima-dia-btn {
    flex: 1;
    min-width: 3.75rem;
    border: none;
    background: rgba(255,255,255,0.06);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 0.45rem 0.35rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.clima-dia-btn:hover { background: rgba(255,255,255,0.12); }
.clima-dia-btn.active { background: rgba(255,255,255,0.14); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.5); }
.clima-dia-nome { font-size: 0.72rem; font-weight: 600; text-transform: lowercase; }
.clima-dia-icon { font-size: 1.1rem; }
.clima-dia-icon.weather-clear { color: #fbbf24; }
.clima-dia-icon.weather-partly { color: #7dd3fc; }
.clima-dia-icon.weather-cloudy { color: #9ca3af; }
.clima-dia-icon.weather-rain,
.clima-dia-icon.weather-drizzle { color: #60a5fa; }
.clima-dia-icon.weather-storm { color: #a78bfa; }
.clima-dia-temps { font-size: 0.75rem; }
.clima-dia-temps small { opacity: 0.65; }

.clima-grafico-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.75rem;
}
.clima-tab {
    background: none;
    border: none;
    color: #94a3b8;
    padding: 0.35rem 0;
    font-size: 0.82rem;
    cursor: pointer;
    position: relative;
}
.clima-tab.active { color: #fbbf24; font-weight: 600; }
.clima-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #fbbf24;
    border-radius: 2px;
}
.clima-tab[data-tab="chuva"].active { color: #60a5fa; }
.clima-tab[data-tab="chuva"].active::after { background: #60a5fa; }

.clima-grafico-wrap {
    width: 100%;
    min-height: clamp(180px, 28vh, 280px);
    aspect-ratio: 960 / 220;
    position: relative;
}
.clima-grafico {
    width: 100%;
    height: 100%;
    min-height: clamp(180px, 28vh, 280px);
    display: block;
}
.clima-axis-line { stroke: rgba(255,255,255,0.15); stroke-width: 1; }
.clima-axis-label { fill: #64748b; font-size: 13px; }
.clima-value-label { fill: #e2e8f0; font-size: 13px; font-weight: 600; }
.clima-grafico-vazio {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.82rem;
    min-height: clamp(180px, 28vh, 280px);
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 992px) {
    .clima-grafico-wrap,
    .clima-grafico,
    .clima-grafico-vazio {
        min-height: clamp(160px, 32vw, 220px);
    }
}
@media (max-width: 576px) {
    .clima-grafico-wrap,
    .clima-grafico,
    .clima-grafico-vazio {
        min-height: 200px;
        aspect-ratio: 16 / 9;
    }
}
.cal-weather-wrap { display: flex; align-items: center; gap: 0.15rem; flex-shrink: 0; }
.cal-weather-more {
    font-size: 0.62rem;
    font-weight: 700;
    color: #6c757d;
    background: #e9ecef;
    border-radius: 8px;
    padding: 0.05rem 0.25rem;
    line-height: 1.2;
}
.clima-municipio-seletor { margin-top: 0; }
.clima-municipio-label {
    display: block;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}
.clima-municipio-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(15, 23, 42, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f1f5f9;
    width: 100%;
    max-width: 200px;
    padding: 0.35rem 1.75rem 0.35rem 0.55rem;
    font-size: 0.82rem;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.clima-municipio-select:hover {
    border-color: rgba(251, 191, 36, 0.35);
}
.clima-municipio-select:focus {
    outline: none;
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.12);
}
.clima-municipio-select option { color: #1e293b; background: #fff; }
.clima-municipio-menu {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    min-width: 260px;
    max-width: 320px;
    padding: 0.35rem 0;
    overflow: hidden;
}
.clima-municipio-list {
    max-height: 280px;
    overflow-y: auto;
}
.clima-municipio-header {
    padding: 0.65rem 0.85rem 0.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.25rem;
}
.clima-municipio-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    transition: background 0.12s;
}
.clima-municipio-btn:hover { background: #f0f7ff; }
.clima-municipio-btn.active { background: rgba(13, 110, 253, 0.08); }
.clima-municipio-btn.active .clima-municipio-nome { color: #0d6efd; font-weight: 600; }
.clima-municipio-nome { font-size: 0.92rem; }
.clima-municipio-os { font-size: 0.75rem; }
.calendar-week .cal-day .cal-event {
    font-size: 0.72rem;
    border-radius: 3px;
    padding: 0.1rem 0.25rem;
    margin-top: 0.2rem;
    cursor: grab;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
}
.calendar-week .cal-day .cal-event-agendada {
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    border-left-color: #0d6efd;
}
.calendar-week .cal-day .cal-event-vencida {
    color: #b02a37;
    background: rgba(220, 53, 69, 0.12);
    border-left-color: #dc3545;
}
.calendar-week .cal-day .cal-event-finalizada {
    color: #146c43;
    background: rgba(25, 135, 84, 0.12);
    border-left-color: #198754;
}
.calendar-week .cal-day .cal-event-agendada:hover { background: rgba(13, 110, 253, 0.2); }
.calendar-week .cal-day .cal-event-vencida:hover { background: rgba(220, 53, 69, 0.2); }
.calendar-week .cal-day .cal-event-finalizada:hover { background: rgba(25, 135, 84, 0.2); }
.calendar-week .cal-day .cal-event.cal-event-dragging {
    opacity: 0.45;
    cursor: grabbing;
}
.calendar-week .cal-day.cal-day-drag-over {
    background: #e7f1ff !important;
    box-shadow: inset 0 0 0 2px #0d6efd;
}
#modalAgenda .nav-tabs .nav-link { font-size: 0.9rem; }
#modalAgenda .nav-tabs .nav-link i { margin-right: 0.25rem; }
.calendar-week .cal-day .cal-event-more { cursor: default; background: transparent; }
.cal-context-menu {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 0.5rem 0;
}
.cal-context-info { padding: 0.5rem 0.75rem; border-bottom: 1px solid #eee; margin-bottom: 0.25rem; }
.cal-context-btn {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
}
.cal-context-btn:hover { background: #f8f9fa; }
.calendar-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 600; font-size: 0.8rem; color: #6c757d; margin-bottom: 0.25rem; }

/* Autocomplete dropdown no header */
/* Barra Cadastros gerais: sempre visível */
.cadastros-gerais-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: #f0f2f5;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}
.cadastros-gerais-label { font-weight: 600; color: #495057; font-size: 0.9rem; }
.cadastros-gerais-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.9rem;
}
.cadastros-gerais-link:hover { background: rgba(13, 110, 253, 0.1); color: #0b5ed7; }

/* Sem seleção: esconder sidebar e abas; conteúdo (dashboard/cadastro) no iframe */
.app-body:not(.has-selection) .app-sidebar { display: none !important; }
.app-body:not(.has-selection) .app-content-tabs { display: flex; }
/* Com seleção: mostrar sidebar, barra de abas (tabs + ações) e iframe */
.app-body.has-selection .app-sidebar { display: flex; }
.app-body.has-selection .app-tabs-wrap { display: flex; }
.app-body.has-selection .app-content-tabs { display: flex; }

.header-autocomplete-wrap { position: relative; }
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1200;
    padding: 0.35rem 0;
}
.autocomplete-dropdown .ac-group-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #868e96;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}
.autocomplete-dropdown .ac-group-header i { font-size: 0.75rem; }
.autocomplete-dropdown .ac-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.12s ease;
}
.autocomplete-dropdown .ac-item:last-child { border-bottom: none; }
.autocomplete-dropdown .ac-item:hover,
.autocomplete-dropdown .ac-item:focus-visible {
    background: #e7f1ff;
    outline: none;
}
.autocomplete-dropdown .ac-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 6px;
    background: #f1f3f5;
    color: #495057;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.autocomplete-dropdown .ac-item-icon i { font-size: 0.85rem; }
.autocomplete-dropdown .ac-item-body { min-width: 0; flex: 1; }
.autocomplete-dropdown .ac-item .ac-title {
    font-weight: 600;
    color: #212529;
    line-height: 1.35;
    word-break: break-word;
}
.autocomplete-dropdown .ac-item .ac-sub {
    font-size: 0.82rem;
    color: #495057;
    line-height: 1.35;
    margin-top: 0.15rem;
    word-break: break-word;
}
.autocomplete-dropdown .ac-empty {
    padding: 1rem 0.85rem;
    text-align: center;
    color: #868e96;
    font-size: 0.9rem;
}
.autocomplete-dropdown .ac-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.85rem;
    color: #868e96;
    font-size: 0.9rem;
}

.search-config-group .search-config-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #868e96;
    margin-bottom: 0.35rem;
}
.search-config-group .form-check { margin-bottom: 0.25rem; }
.search-config-group .form-check-label { font-size: 0.9rem; }

@media (max-width: 768px) {
    .app-sidebar { width: var(--sidebar-collapsed-width); }
    .app-sidebar .sidebar-nav .nav-link span { display: none; }
    .app-sidebar .nav-sub, .app-sidebar .nav-category { display: none; }
    .header-search-group { max-width: 100%; }
    .header-autocomplete-wrap { max-width: 100%; }
}

/* Ações agrupadas na listagem de locais */
.list-table-action-btn + .dropdown,
.dropdown + .list-table-action-btn,
.dropdown + .dropdown {
    margin-left: 0.25rem;
}
.list-table-sortable td.text-nowrap .dropdown-menu {
    min-width: 220px;
}
.list-table-sortable td.text-nowrap .dropdown-item {
    font-size: 0.875rem;
}

.link-mgmt-item .link-url-field {
    font-size: 0.75rem;
    max-width: 100%;
}

.link-ativo-item .form-check-inline {
    margin-right: 0.5rem;
}

.sessao-item {
    background: #fafbfc;
}

.sessao-item .badge {
    font-weight: 500;
}
