

.admin-wrapper{
    display:flex;
    min-height:100vh;
}

/* SIDEBAR */
.sidebar{
    width:240px;
    background:linear-gradient(135deg, #1f3c88, #1f2937);
    color:white;
    position:fixed;
    height:100%;
    transition: left 0.3s ease, box-shadow 0.3s ease;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header{
    padding:18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid rgba(255,255,255,.1);
}

.logo{
    font-weight:600;
    font-size:18px;
}

.menu{
    list-style:none;
    padding:0;
    margin:0;
}

.menu li a{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 18px;
    color:#cbd5e1;
    text-decoration:none;
    min-height: 44px;
    transition: background 0.2s, color 0.2s;
}

.menu li a:hover,
.menu li a:focus{
    background:#374151;
    color:white;
}

.submenu{
    background:#111827;
}

.submenu a{
    padding-left:45px;
    font-size:14px;
}

/* MAIN */
.main{
    flex:1;
    margin-left:240px;
    transition:.3s;
    display:flex;
    flex-direction:column;
}

.sidebar.closed + .main{
margin-left:0;
}


/* TOPBAR */
.topbar{
    height:60px;
    background:white;
    border-bottom:1px solid #e5e7eb;
    display:flex;
    align-items:center;
    padding:0 20px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 900;
}

/* Hamburger button (mobile only) — target de toque mínimo 44px */
.btn-menu{
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #1f3c88;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-menu:hover{
    background: #f3f4f6;
}

/* Close button dentro do sidebar mobile */
.btn-toggle{
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-toggle:hover{
    background: rgba(255,255,255,0.1);
}

/* CONTENT */

.content{
    padding:25px;
}

/* CARDS */

.card{
    border:none;
    box-shadow:0 2px 6px rgba(0,0,0,0.05);
}

/* MOBILE */
@media(max-width:991px){
    .content{padding: 12px; }

    .card-body {
        padding: 15px;
    }

    fieldset {
        margin-bottom: 15px;
        padding: 20px 14px 14px;
    }
    legend {
        font-size: 13px;
    }

    /* Em mobile, mantém apenas o botão necessário (Filtrar/Limpar);
       evita empilhar botões que devem ficar lado a lado */
    .btn-group > .btn,
    .btn-toolbar > .btn {
        width: auto;
        margin-bottom: 0;
    }
    .btn {
        /* Buttons principais continuam full-width em mobile,
           mas com min-height confortável para toque */
        min-height: 44px;
    }
    /* Pequenos botões de filtro não devem virar barra inteira */
    fieldset .btn {
        width: auto;
    }
    fieldset > .row > [class*="col-"] > .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        height: 100%;
        width: 240px;
        z-index: 1100;
        background: linear-gradient(135deg, #1f3c88, #1f2937);
        transition: left 0.3s ease, box-shadow 0.3s ease;
        box-shadow: none;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 6px 0 24px rgba(0,0,0,0.35);
    }

    .main{
        margin-left:0;
        width: 100%;
        min-height: 100vh;
    }

    /* Overlay cobre o conteúdo quando sidebar está aberto */
    .overlay {
        z-index: 1050;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .overlay.active {
        opacity: 1;
    }

    /* Tabelas: scroll horizontal em mobile (não estoura layout) */
    .table-responsive,
    table.table,
    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table thead,
    .table tbody,
    .table tr {
        display: table;
        width: 100%;
        table-layout: auto;
    }

    /* Campos do formulário em fieldset: full width */
    fieldset input[type="text"],
    fieldset input[type="email"],
    fieldset input[type="password"],
    fieldset input[type="number"],
    fieldset input[type="date"],
    fieldset input[type="tel"],
    fieldset select,
    fieldset textarea {
        width: 100%;
        max-width: 100%;
    }

    /* Topbar mais compacta no mobile */
    .topbar {
        height: 56px;
        padding: 0 12px;
    }
    .topbar h1,
    .topbar .page-title {
        font-size: 16px;
    }
}

fieldset {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 25px 20px 20px;
    margin-bottom: 20px;
    background: #fff;
}

legend {
    position: absolute;
    top: -10px;
    left: 10px;

    padding: 0 10px;
    font-size: 14px;
    font-weight: 600;

    background: #fff; 
    color: #495057;

    border: 1px solid transparent;
    width: fit-content;
}



/* FIELDSET INTERNO */
fieldset fieldset {
    border: 3px solid #dee2e6;
    background: #f9fafb;
    padding: 15px 15px 15px 20px;
}
/* LEGEND INTERNO */
fieldset fieldset > legend {
    font-weight: 900;
    width: initial;
}

/* Base */
body{
    background:#f4f6f9;
    font-family:system-ui;
}

/* Login */

.login-body{
    background:linear-gradient(135deg,#4e73df,#224abe);
}

/* Cards */
.card {
    border-radius: 12px;
}
.card h2{
    font-weight:bold;
}

.card-icon{
    font-size:28px;
    opacity:0.8;
}

.stat-card{
    border:none;
    border-radius:12px;
}
.overlay {
  display: none;
}

.overlay.active {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  z-index: 1050;
  cursor: pointer;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

@media (min-width: 992px) {
  /* Em desktop, sidebar é fixa e visível — overlay não é necessário */
  .overlay.active {
    display: none;
  }
}
.bg-gray{
    background-color: #ccc !important;
}

.page-link{
    color: #6c757d !important;
    border-color: #6c757d !important;
    background-color: #fff !important;
}

.page-item.active .page-link{
    background-color: #6c757d !important;
    border-color: #fff !important;
    color: #fff !important;
}