/* ========================================
   VARIÁVEIS DE DESIGN (tema consistente)
   ======================================== */
:root {
    /* Cores primárias */
    --primary-50: #f8fafc;
    --primary-100: #f1f5f9;
    --primary-200: #e2e8f0;
    --primary-300: #cbd5e1;
    --primary-400: #94a3b8;
    --primary-500: #64748b;
    --primary-600: #475569;
    --primary-700: #334155;
    --primary-800: #1e293b;
    --primary-900: #0f172a;
    
    /* Cores azul (principal) */
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-300: #93c5fd;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    
    /* Cores verde (sucesso/novo) */
    --emerald-600: #059669;
    --emerald-700: #047857;
    
    /* Cores vermelho (perigo/excluir) */
    --red-50: #fef2f2;
    --red-600: #dc2626;
    --red-700: #b91c1c;
    --red-800: #991b1b;
    
    /* Cores âmbar (editar) */
    --amber-600: #d97706;
    --amber-700: #b45309;
    --amber-800: #92400e;
    
    /* Cinzas para texto e bordas */
    --gray-50: #f4f8fb; /* #f9fafb; */
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Espaçamentos padrão */
    --spacing: 0.25rem;
    
    /* Bordas */
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-2xl: 3rem;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Transições */
    --transition: all 0.3s ease;
}

/* ========================================
   RESET E BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--gray-50);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: var(--gray-800);
    line-height: 1.5;
}

/* ========================================
   UTILITÁRIOS DE DISPLAY
   ======================================== */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
/*.flex-1 { flex: 1; }*/
.flex-1 {
    flex: 1 1 0%;
    min-width: 0;
}
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: calc(var(--spacing) * 1); }
.gap-2 { gap: calc(var(--spacing) * 2); }
.gap-3 { gap: calc(var(--spacing) * 3); }
.gap-4 { gap: calc(var(--spacing) * 4); }
.gap-6 { gap: calc(var(--spacing) * 6); }
.flex.gap-4 {
    align-items: center;
}

/* Grid responsivo */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) {
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

#empty_state {
    padding-top: 3rem;
    padding-bottom: 3rem;

}

#unidades_buttons > * {
    width: auto;
    display: inline-flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: var(--blue-100);
    color: var(--blue-800);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    gap: 1rem!important;
    margin-right:5px; margin-bottom:5px;
}

#unidades_buttons > *:hover {
    background-color: var(--blue-200);
}

#unidades_buttons {
    margin-right:5px; margin-bottom:5px;
}

#filtro_orgao {
    /* width: 240px; */
}

/* FILTROS TRIPLOS */

.filtros-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem!important;
    margin-bottom: 1.5rem;
}

.filtro-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 1.5rem;
    font-size: 0.875rem;
}

/* FILTROS DUPLOS */
.filtros-duo {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem!important;
    margin-bottom: 1.5rem;
}

.filtro-duo-item {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 1.5rem;
    font-size: 0.875rem;

}

/* ========================================
   POSICIONAMENTO
   ======================================== */
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-100 { z-index: 100; }
.z-999 { z-index: 999; }

/* ========================================
   TAMANHOS
   ======================================== */
.w-full { width: 100%; }
.w-5 { width: 1.25rem; }
.w-7 { width: 1.75rem; }
.w-9 { width: 2.25rem; }
.w-64 { width: 16rem; }
.max-w-2xl { max-width: 42rem; width: 100%;}
.max-w-7xl { max-width: 80rem; }
.max-w-full { max-width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-5 { height: 1.25rem; }
.h-7 { height: 1.75rem; }
.h-9 { height: 2.25rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }

.w-12 { width: 3rem; }
.h-12 { height: 3rem; }

.w-14 { width: 3.5rem; }
.w-20 { width: 5rem; }
.h-14 { height: 3.5rem; }
.min-h-screen { min-height: 100vh; }
.max-w-md {
    max-width: 28rem;
    width: 100%;
}

.max-w-lg {
    max-width: 32rem;
    width: 100%;
}

/* ========================================
   ESPAÇAMENTO (Padding & Margin)
   ======================================== */
.p-1 { padding: calc(var(--spacing) * 1); }
.p-2 { padding: calc(var(--spacing) * 2); }
.p-4 { padding: calc(var(--spacing) * 4); }
.p-6 { padding: calc(var(--spacing) * 6); }
.p-8 { padding: calc(var(--spacing) * 8); }
.p-10 { padding: calc(var(--spacing) * 10); }
.p-12 { padding: calc(var(--spacing) * 12); }
.px-3 { padding-left: calc(var(--spacing) * 3); padding-right: calc(var(--spacing) * 3); }
.px-4 { padding-left: calc(var(--spacing) * 4); padding-right: calc(var(--spacing) * 4); }
.px-6 { padding-left: calc(var(--spacing) * 6); padding-right: calc(var(--spacing) * 6); }
.py-1 { padding-top: calc(var(--spacing) * 1); padding-bottom: calc(var(--spacing) * 1); }
.py-2 { padding-top: calc(var(--spacing) * 2); padding-bottom: calc(var(--spacing) * 2); }
.py-3 { padding-top: calc(var(--spacing) * 3); padding-bottom: calc(var(--spacing) * 3); }
.py-4 { padding-top: calc(var(--spacing) * 4); padding-bottom: calc(var(--spacing) * 4); }
.py-5 { padding-top: calc(var(--spacing) * 5); padding-bottom: calc(var(--spacing) * 5); }
.py-6 { padding-top: calc(var(--spacing) * 6); padding-bottom: calc(var(--spacing) * 6); }
.pt-6 { padding-top: calc(var(--spacing) * 6); }
.mx-auto { margin-left: auto; margin-right: auto; }
.mx-4 { margin-left: calc(var(--spacing) * 4); margin-right: calc(var(--spacing) * 4); }
.mb-1 { margin-bottom: calc(var(--spacing) * 1); }
.mb-2 { margin-bottom: calc(var(--spacing) * 2); }
.mb-3 { margin-bottom: calc(var(--spacing) * 3); }
.mb-6 { margin-bottom: calc(var(--spacing) * 6); }
.mb-8 { margin-bottom: calc(var(--spacing) * 8); }
.mt-1 { margin-top: calc(var(--spacing) * 1); }
.mt-6 { margin-top: calc(var(--spacing) * 6); }
.mt-8 { margin-top: calc(var(--spacing) * 8); }
.mt-10 { margin-top: calc(var(--spacing) * 10); }
.mr-3 { margin-right: calc(var(--spacing) * 3); }
.mr-4 { margin-right: calc(var(--spacing) * 4); }

.mt-4 { margin-top: calc(var(--spacing) * 4); }
.mb-4 { margin-bottom: calc(var(--spacing) * 4); }

.mt-2 { margin-top: calc(var(--spacing) * 2); }

.mx-2 { margin-left: calc(var(--spacing) * 2); margin-right: calc(var(--spacing) * 2); }

.py-8 { padding-top: calc(var(--spacing) * 8); padding-bottom: calc(var(--spacing) * 8); }

.px-8 { padding-left: calc(var(--spacing) * 8); padding-right: calc(var(--spacing) * 8); }
.ml-2 { margin-left: 0.5rem; }
/* ========================================
   CORES DE FUNDO
   ======================================== */
.bg-white { background-color: white; }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-blue-100 { background-color: var(--blue-100); }
.bg-blue-600 { background-color: var(--blue-600); }
.bg-emerald-600 { background-color: var(--emerald-600); }
.bg-red-50 { background-color: var(--red-50); }
.bg-green-100 {
    background-color: #dcfce7;
    border: 1px solid #86efac;
}

.bg-red-100 {
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
}

.bg-yellow-100 {
    background-color: #fef9c3;
    border: 1px solid #fde047;
}

.bg-black\/60 { background-color: rgba(0, 0, 0, 0.6); }

.hover\:bg-gray-100:hover { background-color: var(--gray-100); }
.hover\:bg-red-50:hover { background-color: var(--red-50); }
.hover\:bg-blue-700:hover { background-color: var(--blue-700); }
.hover\:bg-emerald-700:hover { background-color: var(--emerald-700); }

/* ========================================
   CORES DE TEXTO
   ======================================== */
.text-white { color: white; }
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.text-blue-600 { color: var(--blue-600); }
.text-blue-800 { color: var(--blue-800); }
.text-red-600 { color: var(--red-600); }
.text-red-700 { color: var(--red-700); }
.text-red-800 { color: var(--red-800); }
.text-amber-600 { color: var(--amber-600); }
.text-amber-800 { color: var(--amber-800); }
.text-emerald-600 { color: var(--emerald-600); }

.text-green-700 {
    color: #15803d;
}

.text-yellow-700 {
    color: #a16207;
}

.hover\:text-blue-800:hover { color: var(--blue-800); }
.hover\:text-red-700:hover { color: var(--red-700); }
.hover\:text-amber-800:hover { color: var(--amber-800); }

/* ========================================
   TIPOGRAFIA
   ======================================== */
.font-sans { font-family: system-ui, -apple-system, sans-serif; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }

/* ========================================
   BORDAS E SOMBRAS
   ======================================== */
.border { border: 1px solid var(--gray-200); }
.border-t { border-top: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.border-r { border-right: 1px solid var(--gray-200); }
.border-gray-200 { border-color: var(--gray-200); }
.border-gray-300 { border-color: var(--gray-300); }

.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); }


/* ========================================
   TRANSIÇÕES E TRANSFORMAÇÕES
   ======================================== */
.transition-transform { transition: transform var(--transition); }
.duration-300 { transition-duration: 300ms; }
.-translate-x-full { transform: translateX(-100%); }
.translate-x-0 { transform: translateX(0); }

/* ========================================
   COMPONENTES: TABELAS
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background-color: var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

tbody tr:hover {
    background-color: var(--gray-50);
}

/* Responsividade para tabelas em mobile */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead {
        display: none;
    }
    
    tr {
        margin-bottom: 1rem;
        border: 1px solid var(--gray-200);
        border-radius: 0.5rem;
        padding: 0.5rem;
    }
    
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        border: none;
        border-bottom: 1px solid var(--gray-100);
    }
    
    td:before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 1rem;
        color: var(--gray-600);
    }
    
    .filtros-container > * + *,
    .filtros-duo > * + * {
       /* margin-top: 1rem; */
    }
    
}

/* ========================================
   COMPONENTES: FORMULÁRIOS
   ======================================== */

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 1.25rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input {
    min-width: 0;
}

label {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

/* Botões */
button {
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    background: none;
    -webkit-appearance: none;
    appearance: none;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   COMPONENTES: MODAL
   ======================================== */
.fixed.inset-0.bg-black\/60 {
    /* display: flex;
    align-items: center;
    justify-content: center; */
    backdrop-filter: blur(4px);
}

.fixed.inset-0 {
    padding: 1rem;
}

.modal-content {
    max-height: 90vh;
    /* overflow: auto; */
}

/* caixa do modal */
.modal-box {
    background: #fff;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* header fixo */
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

/* CORREÇÃO PRINCIPAL */
.modal-body {
    /* padding: 20px; */
    overflow-y: auto;
    scrollbar-width: thin;
}

/* footer fixo */
.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}



/* ========================================
   COMPONENTES: SIDEBAR
   ======================================== 
#sidebar {
    transition: transform 0.3s ease;
    background-color: #fff; 
    border-right: 1px solid var(--gray-200)
}

#sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#sidebar .menu-section {
    margin-top: 1rem;
}

#sidebar .logo-box {
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
}


#sidebar nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.2s ease;
}


#sidebar nav a:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}


#sidebar nav a.active {
    background-color: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
}


#sidebar nav a svg {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

#sidebar nav a.active svg {
    opacity: 1;
}

#sidebar .logout {
    color: var(--red-600);
    border-radius: 0.75rem;
}

#sidebar .logout:hover {
    background-color: var(--red-50);
}

*/








/* ========================================
   COMPONENTES: SIDEBAR
   ======================================== */




/* ========================================
   SIDEBAR (ESTILO THEMESBERG)
   ======================================== */

#sidebar {
    background: linear-gradient(180deg, #1e40af 0%, #1d4ed8 100%);
    color: #e0e7ff;
    border-right: none;
    transition: transform 0.3s ease;

}

#sidebar .sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#sidebar .logo-box {
    width: 36px;
    height: 36px;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}
/* logo-box no topo */
.logo-box {
    width: 64px;
    height: 38px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}




#sidebar h1 {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

#sidebar p {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

#sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
}

#sidebar .menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    color:#fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

#sidebar .menu-item:hover {
    background-color: rgba(255,255,255,0.15);
    color: #ffffff;
}

#sidebar .menu-item.active {
    background-color: rgba(255,255,255,0.15);
    color: #ffffff;
    font-weight: 600;
}

#sidebar .menu-item svg {
    
    /* width: 18px;
    height: 18px; 
    stroke: rgba(255,255,255,0.8); 
    stroke-width: 2; */
    transition: all 0.2s ease;
    
}

#sidebar .menu-item:hover svg,
#sidebar .menu-item.active svg {
   /* stroke: #ffffff; */
}

#sidebar .sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}


#sidebar .logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.2s ease;
}

#sidebar .logout:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}
.logout_red{font-weight:700; color:#ee5050;}












@media (min-width: 768px) {
    .md\:static {
        position: static;
    }
    
    .md\:translate-x-0 {
        transform: translateX(0);
    }
}

/* Scrollbar customizada */
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: var(--gray-100);
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

/* ========================================
   COMPONENTES: CARDS E CHIPS
   ======================================== */
   
.card { transition: all 0.2s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }

.bg-blue-100 {
    background-color: var(--blue-100);
    color: var(--blue-800);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
    background-color: var(--blue-100);
    color: var(--blue-800);
    border-radius: 9999px;
    font-size: 0.875rem;
}

/* Padronização de cards */
/* .bg-white.rounded-3xl {
    border-radius: 1.25rem;
    transition: all 0.2s ease;
} */
.bg-white.rounded-3xl {
    border-radius: 1.25rem;
    transition: all 0.2s ease;
    width: 100%;
    /* max-width: 720px; */
    margin-left: auto;
    margin-right: auto;
}

.bg-white.rounded-3xl:hover {
    box-shadow: var(--shadow-lg);
}
.bg-white.rounded-3xl.y:hover {
    transform: translateY(-3px);
}

/* Cards do dashboard (números grandes) */
.text-4xl {
    font-size: 2.25rem;
}

@media (min-width: 768px) {
    .text-4xl {
        font-size: 2.25rem;
    }
    /* .md\:flex-row > * {
        flex-shrink: 1; 
    } */
    .md\:flex-row {
        flex-direction: row;
    }

    .md\:items-end {
        align-items: flex-end;
    }

    .md\:w-auto {
        width: auto;
    }

    .md\:flex-row > .flex-1 {
        flex: 1 1 0%;
        min-width: 0;
    }
    .filtros-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .filtros-duo {
        grid-template-columns: 1fr 1fr;
    }

}

/* Cards de ação (acesso rápido) */
a.bg-white {
    min-height: 120px;
    justify-content: center;
    transition: all 0.2s ease;
}

a.bg-white:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Ícones mais equilibrados */
a.bg-white svg {
    width: 28px;
    height: 28px;
}

/* Texto mais compacto */
a.bg-white p {
    font-size: 0.9rem;
}

/* ========================================
   UTILITÁRIOS ADICIONAIS
   ======================================== */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.whitespace-nowrap { white-space: nowrap; }
.divide-y > * + * { border-top: 1px solid var(--gray-200); }
.space-y-1 > * + * { margin-top: calc(var(--spacing) * 1); }
.space-y-6 > * + * { margin-top: calc(var(--spacing) * 6); }



/* Larguras úteis pra layout */
.w-auto { width: auto; }
.min-w-0 { min-width: 0; }
.min-w-\[140px\] { min-width: 140px; }
.min-w-\[160px\] { min-width: 160px; }



/* Cores para ações */
.text-red-600 { color: var(--red-600); }
.text-amber-600 { color: var(--amber-600); }
.text-blue-600 { color: var(--blue-600); }

/* Responsividade para sidebar em mobile */
@media (max-width: 767px) {
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 50;
        transform: translateX(-100%);
    }
    
    #sidebar:not(.-translate-x-full) {
        transform: translateX(0);
    }
}

/* Melhorias de toque para mobile */
@media (max-width: 768px) {
    button, a, [onclick] {
        min-height: 44px;
    }
    
    input, select, button {
        font-size: 16px; /* Previne zoom automático no iOS */
    }
}

@media (max-width: 480px) {
    
    

    /* Cards menores no mobile */
    .p-6 {
        padding: 1rem;
    }

    /* Títulos menores */
    .text-3xl {
        font-size: 1.5rem;
    }

    /* Espaçamento mais justo */
    .gap-4 {
        gap: 0.75rem;
    }
}

/* Print styles */
@media print {
    .no-print, .sidebar, button {
        display: none !important;
    }
    
    body {
        background: white;
    }
}

.btn-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f3f4f6;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* cores */
.btn-icon.fav svg { color: #f59e0b; }
.btn-icon.edit svg { color: #3b82f6; }
.btn-icon.delete svg { color: #ef4444; }
.btn-icon.add svg { color: #2563eb; }
.btn-icon.ok svg { color: #10b981; }
.btn-icon.view svg { color: #6b7280; }

/* hover */
.btn-icon:hover {
    transform: scale(1.08);
    background: #e5e7eb;
}



@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db; /* cinza */
    border-top: 2px solid #3b82f6; /* azul */
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}



.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }