:root {
    --sidebar-width: 300px;
    --censa-blue: #1e3a8a;
    --censa-light-blue: #3b82f6;
    --censa-dark-blue: #04192e;
}

[v-cloak] { display: none !important; }

@view-transition {
  navigation: auto;
}

html, body {
    touch-action: manipulation;
    background-color: #f8f9fa;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;    
}

html {
    height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
}

.navbar {
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px)) !important;
}

.offcanvas {
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
    padding-top: env(safe-area-inset-top, 0px);
}

footer {
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
}

input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    user-select: text;
}

@keyframes slide-out {
  to { transform: translateX(-100%); opacity: 0; }
}

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
}

::view-transition-old(root) {
  animation: 300ms ease-in-out both slide-out;
}

::view-transition-new(root) {
  animation: 300ms ease-in-out both slide-in;
  mix-blend-mode: normal;
}

.cursor-pointer { cursor:pointer; }
.resize-none{ resize: none; }
.text-legend{ font-size: 0.75rem }

.cursor-not-allowed {
    cursor: not-allowed !important;
    pointer-events: auto !important;
}

.h-viewport {
    height: calc(100vh - 100px); 
}

@media (max-width: 768px) {
    .h-viewport {
        height: calc(100vh - 60px); 
    }
}

button:disabled {
    cursor: not-allowed !important;
    pointer-events: auto !important;
}

input:disabled, 
select:disabled, 
textarea:disabled {
    background-color: #ffffff !important; 
    color: #333333; 
    opacity: 1; 
    cursor: not-allowed;
    border-color: #e5e5e5;
}

.ql-container.ql-disabled .ql-editor {
    cursor: not-allowed !important;
    background-color: #ffffff !important;
    color: #333;
}

.ql-toolbar.ql-disabled {
    cursor: not-allowed;
}

.bg-censa-dark {
    background-color: var(--censa-dark-blue) !important;
    color: #ffffff !important;
}

.offcanvas-backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.offcanvas-backdrop.show {
    background-color: rgba(0, 0, 0, 0.4) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    backdrop-filter: blur(3px) !important;
    /*-webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: backdrop-filter;*/
}

@supports (-webkit-touch-callout: none) {
    .offcanvas-backdrop {
        top: env(safe-area-inset-top, 0px) !important;
    }
}

#sidebarMenu .nav-link {
    transition: transform 0.1s ease, background-color 0.2s ease;
}

#sidebarMenu .nav-link:active {
    transform: scale(0.97);
    background-color: rgba(255, 255, 255, 0.1);
}

#sidebarMenu {
    width: var(--sidebar-width);
}

.offcanvas-body::-webkit-scrollbar { display: none; }
.offcanvas-body {
    -ms-overflow-style: none;
    scrollbar-width: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.list-group-item-censa {
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.7) !important; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: all 0.2s;
}

.list-group-item-censa:hover, 
.list-group-item-censa:focus {
    background-color: rgba(255, 255, 255, 0.1) !important; 
    color: #ffffff !important;
    padding-left: 25px;
}

.list-group-item-censa.active {
    background-color: #0d6efd !important;
    color: #ffffff !important;
    border-color: transparent;
}

.sidebar-category-header {
    width: 100%;
    background-color: transparent !important;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.5rem 1rem 0.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: color 0.2s;
}

.sidebar-category-header:hover {
    color: #ffffff;
}

.sidebar-category-header .fa-chevron-right {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.sidebar-category-header[aria-expanded="true"] .fa-chevron-right {
    transform: rotate(90deg);
}

.list-item {
    transition: all 0.2s ease-in-out;
    position: relative;
}

.list-item:hover {
    border-color: var(--bs-primary-border-subtle) !important; 
    box-shadow: var(--bs-box-shadow) !important;
    transform: translateY(-2px);
    z-index: 1;
}

.form-check-input.switch-warning:checked {
    background-color: var(--bs-warning) !important;
    border-color: var(--bs-warning) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23212529'/%3e%3c/svg%3e") !important;
}

.form-check-input.switch-warning:focus {
    border-color: var(--bs-warning) !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.3) !important;
}

textarea
{
    resize: none;
}

#sidebarMenu .list-group-item-censa.menu-destaque {
    order: -1;
    animation: menu-pulso 2s ease-in-out infinite;
}

@keyframes menu-pulso {
    0%, 100% { box-shadow: inset 0 0 0 0 rgba(96, 165, 250, 0); }
    50%      { box-shadow: inset 0 0 18px 2px rgba(96, 165, 250, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
    #sidebarMenu .list-group-item-censa.menu-destaque,
    #sidebarMenu .list-group-item-censa.menu-destaque::before { animation: none; }
}

#sidebarMenu .list-group-item-censa.menu-destaque::before {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 0.6rem;
    height: 0.6rem;
    margin-top: -0.3rem;
    border-radius: 50%;
    background: #60a5fa;
    animation: menu-bolinha 1.6s infinite;
}

@keyframes menu-bolinha {
    0%   { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.7); }
    70%  { box-shadow: 0 0 0 0.6rem rgba(96, 165, 250, 0); }
    100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0); }
}

.rotate-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

@media (orientation: portrait) and (max-width: 767.98px) {
    .rotate-overlay:not(.dispensado) { display: flex; }
}

.rotate-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    color: #333;
}

.fa-rotate-90 {
    animation: rotate-hint 2s infinite;
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}