﻿:root {
    --navLinkHoverBgColor: #0B5ED7;
    --navbar-height: 49px;
    --sidebar-width: 240px;
}

/* ------------------------------
   BASE / GLOBAIS
--------------------------------*/
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
    /* Navbar-brand igual ao sidebar (apenas desktop) */
    .navbar-brand {
        width: var(--sidebar-width) !important;
        max-width: var(--sidebar-width) !important;
        flex: 0 0 var(--sidebar-width) !important;
    }
}

body {
    margin-bottom: 60px;
    min-height: 100%;
}

img {
    border: 0;
}

a img {
    vertical-align: middle;
}

a:has(img) {
    text-decoration: none;
}

.rowClick {
    cursor: pointer;
}

.rowClick:hover {
    font-weight: 600;
}

/* Focus styles */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.readonly-disabled {
    background-color: #e9ecef !important;
    opacity: 1 !important;
    cursor: not-allowed;
    pointer-events: none;
}

.closeSearch {
    text-align: right;
}

/* ------------------------------
   NAVBAR
--------------------------------*/
.navbar-brand {
    padding-top: .75rem;
    padding-bottom: .75rem;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, .25);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .25);
}

.navbar .navbar-nav .nav-link:hover {
    color: #fff;
    background-color: var(--navLinkHoverBgColor);
}

.navbar .navbar-toggler {
    top: .25rem;
    right: 1rem;
}

/* Search */
.navbar .form-control {
    padding: .75rem 1rem;
    border-width: 0;
    border-radius: 0;
}

.form-control-dark {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

/* ------------------------------
   SIDEBAR (DESKTOP)
--------------------------------*/
.sidebar {
    position: fixed;
    top: var(--navbar-height); /* navbar height */
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    transition: width .3s ease;
    z-index: 1030;
}

/* Compact mode */
.sidebar.compact {
    width: 48px;
    overflow-y: hidden;
}

/* Content shift */
#mainContent {
    margin-left: var(--sidebar-width);
    padding: 0px 20px 0px 20px;
    transition: margin-left .3s ease;
}

.sidebar.compact ~ #mainContent {
    margin-left: 48px;
}

/* Compact mode hides text */
.sidebar.compact .btn-toggle,
.sidebar.compact .btn-toggle-nav a {
    opacity: 0;
    visibility: hidden;
    white-space: nowrap;
    transition: opacity .15s ease, visibility 0s linear .15s;
}

/* Hover expands fully */
.sidebar.compact:hover {
    width: var(--sidebar-width);
    z-index: 1040;
}

.sidebar.compact:hover .btn-toggle,
.sidebar.compact:hover .btn-toggle-nav a {
    visibility: visible;
    opacity: 1;
    transition-delay: .1s;
}

/* Toggle button */
.sidebar-toggle {
    padding: 8px;
    text-align: left;
}

#toggleSidebar {
    cursor: pointer;
    font-size: 14px;
    position: relative;
    color: #333;
    z-index: 2000;
}

#toggleSidebar:hover {
    color: #000;
    transform: scale(1.15);
}

/* ------------------------------
   SIDEBAR MENU ITEMS
--------------------------------*/
.btn-toggle {
    display: block;
    text-align: left;
    padding: .25rem;
    font-weight: 600;
    border: 0;
    background-color: transparent;
    color: rgba(0, 0, 0, .65);
}

    .btn-toggle:hover,
    .btn-toggle[aria-expanded="true"]:hover {
        color: #fff;
        background-color: var(--navLinkHoverBgColor);
    }

    .btn-toggle::before {
        width: 1.25em;
        line-height: 0;
        content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
        transition: transform .35s ease;
        transform-origin: .5em 50%;
    }

    .btn-toggle[aria-expanded="true"]::before {
        transform: rotate(90deg);
    }

.btn-toggle-nav a {
    padding: .1875rem .5rem .1875rem 1.75rem;
    text-decoration: none;
}

    .btn-toggle-nav a:hover,
    .sidebar .link-dark.active:hover {
        color: #fff !important;
        background-color: var(--navLinkHoverBgColor);
    }

.sidebar .link-dark.active {
    color: var(--navLinkHoverBgColor) !important;
}

/* ------------------------------
   MOBILE SIDEBAR (OFFCANVAS)
--------------------------------*/
@media (max-width: 768px) {

    #mobileSidebarToggle{
        margin-top: 2px;
    }

    #sideMenu {
        position: fixed;
        top: calc(var(--navbar-height) + 34px); /* navbar + mobile button */
        left: 0;
        width: var(--sidebar-width);
        height: calc(100vh - 56px);
        background: #f8f9fa;
        border-right: 1px solid #ddd;
        transform: translateX(-100%);
        transition: transform .3s ease;
        z-index: 1060;
    }

    #sideMenu.mobile-open {
        transform: translateX(0);
    }

    #mainContent {
        margin-left: 0 !important;
    }
}

/* ------------------------------
   TOOLTIPS
--------------------------------*/
.tooltip {
    z-index: 2000 !important;
}

.tooltip-inner {
    text-align: left;
    border: 2px solid #000;
    padding: 8px;
}
/*
    flatpickr - esconder os dias for do mês
*/
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    visibility: hidden; 
}

