/* estilos.css */

/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fbfd;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Cores principais */
:root {
    --primary: #4A90E2;
    --primary-dark: #3a78c7;
    --primary-light: #6ba8f0;
    --sidebar-bg: linear-gradient(180deg, #4A90E2 0%, #3a78c7 100%);
    --hover-bg: rgba(255, 255, 255, 0.15);
    --active-bg: rgba(255, 255, 255, 0.25);
    --border-highlight: #6ba8f0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background: var(--sidebar-bg);
    color: white;
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 4px 0 15px rgba(74, 144, 226, 0.2);
}

.sidebar.collapsed {
    transform: translateX(-220px);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.logo-sidebar i {
    font-size: 1.8rem;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Menu */
.sidebar-menu ul {
    list-style: none;
    padding: 1rem 0;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::before,
.sidebar-menu a::after {
    content: '';
    position: absolute;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--border-highlight);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-menu a::before { left: 0; }
.sidebar-menu a::after { right: 0; }

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: var(--hover-bg);
    padding-left: 1.8rem;
    padding-right: 1.2rem;
}

.sidebar-menu a:hover::before,
.sidebar-menu a:hover::after,
.sidebar-menu li.active a::before,
.sidebar-menu li.active a::after {
    transform: scaleY(1);
}

.sidebar-menu li.active a {
    background: var(--active-bg);
    font-weight: 500;
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* Submenu */

/* Submenu sempre fechado por padrão */
.sidebar-menu .submenu {
    display: none;
    padding-left: 0.0rem;
    margin: 0;
    flex-direction: column;
}



.has-submenu {
    margin-bottom: 0;
}

.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.9rem 1.5rem;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.submenu-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.has-submenu.open > .submenu {
    display: flex;
}

.submenu-toggle .submenu-icon {
    margin-left: auto;
    transition: transform 0.25s ease;
}

.has-submenu.open .submenu-icon {
    transform: rotate(180deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: rgba(255, 255, 255, 0.1);
}

.has-submenu.open .submenu {
    max-height: 250px;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 0.75rem 3rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.submenu a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Colapsado */
.sidebar.collapsed .logo-sidebar span,
.sidebar.collapsed .sidebar-menu span {
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-block !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    transition: all 0.2s ease;
}

.sidebar.collapsed .sidebar-menu a {
    justify-content: center;
    padding: 0.9rem;
    margin: 0 auto 0.25rem;
}

.sidebar.collapsed .sidebar-menu a::before,
.sidebar.collapsed .sidebar-menu a::after {
    display: none;
}

.sidebar.collapsed .toggle-btn i {
    transform: rotate(180deg);
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
    backdrop-filter: blur(2px);
}

.overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background-color: #f8fbfd;
}

.main-content.expanded {
    margin-left: 60px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    position: sticky;
    top: 0;
    z-index: 800;
    border-bottom: 1px solid #e6f0fa;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s;
}

.mobile-menu-btn:hover {
    background: rgba(74, 144, 226, 0.1);
}



.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #555;
}

.user-info i {
    color: var(--primary);
}


/* COR DO ICONE - TITULO DO MAIN */
#page-title i {
    color: var(--primary);
    margin-right: 8px;
    opacity: 0.9;
}


/* =========================================
   👤 USUÁRIO LOGADO (HEADER)
========================================= */

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.usuario-nome {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827; /* quase preto */
}

.usuario-nome i {
    color: #2563eb; /* azul médico */
}

.usuario-perfil {
    font-size: 0.75rem;
    color: #6b7280; /* cinza */
    font-weight: 500;
}








/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Páginas */
.page {
    display: none;
}

.page.active {
    display: block;
}

.page.active:has(.empty-state) {
    align-items: center;
    justify-content: center;
}


.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h2 {
    margin: 1rem 0;
    color: #444;
}

/* Requisições */
.requisicoes-content {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.setor-content {
    animation: fadeIn 0.4s ease;
}

.setor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f0f6ff 0%, #e6f0fa 100%);
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--primary);
}

#setor-nome-solicitar, #setor-nome-pendentes {
    font-weight: 600;
    color: var(--primary-dark);
}

.btn-small {
    background: transparent;
    color: var(--primary);
    border: 1.8px solid var(--primary);
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--primary);
    color: white;
}

/* Wrappers */
.form-wrapper, .lista-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.08);
    border: 1px solid #e6f0fa;
}

/* Modal de Setor */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1090;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: block;
}

.setor-selector-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(74, 144, 226, 0.25);
    z-index: 1100;
    animation: modalIn 0.3s ease;
    border: 1px solid #e6f0fa;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #f0f6ff 0%, #e6f0fa 100%);
    border-bottom: 1px solid #e6f0fa;
    border-radius: 14px 14px 0 0;
}

.panel-header h3 {
    margin: 0;
    color: var(--primary-dark);
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #999;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.btn-close:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.setor-groups {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.setor-group + .setor-group {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e6f0fa;
}

.setor-group .group-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.setor-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.btn-setor {
    background: white;
    color: var(--primary);
    border: 1.8px solid var(--primary);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-setor:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-setor.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from { opacity: 0; transform: translate(-50%, -55%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Formulários e Cards */
form {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}

input, select, textarea {
    margin-bottom: 1rem;
    padding: 0.85rem;
    border: 1.5px solid #d0e2f5;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fbfcff;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
    background-color: white;
}

button {
    background-color: var(--primary);
    color: white;
    padding: 0.85rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-cancel {
    background-color: #e74c3c !important;
}

.btn-cancel:hover {
    background-color: #c0392b !important;
}

.requisicao-card {
    background: linear-gradient(135deg, #f8fbff 0%, #f0f6ff 100%);
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    border-left: 4px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.2s;
}

.requisicao-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(74, 144, 226, 0.15);
}

.requisicao-card p {
    margin: 0.3rem 0;
    font-size: 0.95rem;
}

.requisicao-card button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.form-container {
    max-width: 600px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
    border: 1px solid #e6f0fa;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.empty-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Responsivo */
@media (max-width: 992px) {
    .main-content { margin-left: 0; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .mobile-menu-btn { display: block; }
}

@media (max-width: 768px) {
    .header h1 { font-size: 1.2rem; }
    .setor-buttons { grid-template-columns: 1fr; }
    .setor-header { flex-direction: column; gap: 0.75rem; text-align: center; }
    .btn-small { width: 100%; }
}

/* Ocultar botão de colapsar sidebar em telas pequenas */
@media (max-width: 992px) {
    #toggle-sidebar {
        display: none !important;
    }
}

/* ===== BADGE DE STATUS ===== */
.badge-status {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    margin-top: 0.0rem;
}

.badge-solicitado {
    background-color: #f1c40f;
    color: #7d6608;
}

.badge-em-exame {
    background-color: #3498db;
    color: white;
}

.badge-laudo {
    background-color: #2ecc71;
    color: white;
}

.badge-cancelado {
    background: #ff7367;
    color: white;
}





/* ===== PACIENTE | NASCIMENTO | IDADE | PRONTUÁRIO ===== */

.linha-paciente-extra {
    display: grid;
    grid-template-columns: 1.2fr 0.6fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.linha-paciente-extra .campo {
    display: flex;
    flex-direction: column;
}

/* Campo idade */
#idade {
    background-color: #f4f6f8;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 768px) {
    .linha-paciente-extra {
        grid-template-columns: 1fr;
    }
}







/* ===============================
        GESTÃO DE USUÁRIOS
================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-subtitle {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 0.95rem;
}




/* =====================================================
   GESTÃO DE USUÁRIOS — TOOLBAR ISOLADA (V2)
===================================================== */

.usuarios-toolbar-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    margin-bottom: 0px;
}


/* lado esquerdo — filtros */
.usuarios-filtros-v2 {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* inputs e selects */
.usuarios-filtros-v2 input,
.usuarios-filtros-v2 select {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.9rem;
    color: #111827;
}

/* desabilitados */
.usuarios-filtros-v2 input:disabled,
.usuarios-filtros-v2 select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* lado direito — botão */
.usuarios-btn-novo-v2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    height: 40px;
    padding: 0 18px;

    white-space: nowrap;
}

/* correção óptica fina do botão */
.usuarios-btn-novo-v2 {
    align-self: center;        /* 🔑 ignora baseline */
    line-height: 1;            /* 🔑 mata deslocamento do texto */
    padding-top: 0;            /* 🔑 remove micro-offset */
    padding-bottom: 0;
   
}

.usuarios-btn-novo-v2 i {
    line-height: 1;
    position: relative;
    top: -0.5px; /* ajuste fino óptico */
}

.usuarios-btn-novo-v2 {
    margin-top: 0px; /* ajuste óptico fino, NÃO negativo */
}

.usuarios-btn-novo-v2 {
    margin-top: -15px;
}





/* ===============================
   CONTADOR — GESTÃO DE USUÁRIOS
================================ */

.contador-usuarios {
    font-size: 0.8rem;
    font-style: italic;
    color: #6b7280;
    margin-top: 0px;
    margin-bottom: 5px;
}






/* ===============================
   GESTÃO DE USUÁRIOS – TABELA
================================ */

.usuarios-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.usuarios-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
}

.usuarios-table thead th {
    text-align: left;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    padding: 0 12px;
}

.usuarios-table tbody tr {
    background: #f9fafb;
    border-radius: 10px;
}

.usuarios-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
}

.usuarios-table tbody tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.usuarios-table tbody tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    text-align: right;
}

/* Usuário */
.usuario-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.usuario-info .email {
    display: block;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Badges – Gestão de Usuários */

.user-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}



    /* ===============================
    Badges por perfil — Gestão de Usuários
    ================================ */

    .user-badge--medico {
        background: #e0e7ff;
        color: #3730a3;
    }

    .user-badge--tecnico {
        background: #e0e7ff;
        color: #3730a3;
    }

    .user-badge--ultra {
        background: #e0e7ff;
        color: #3730a3;
    }

    .user-badge--eco {
        background: #e0e7ff;
        color: #3730a3;
    }

    .user-badge--radio {
        background: #e0e7ff;
        color: #3730a3;
    }

    .user-badge--admin {
        background: #dcfce7;
        color: #166534;
    }

    .user-badge--dev {
        background: #e2e2e2;
        color: #8f8f8f;
    }

    /* fallback */
    .user-badge--default {
        background: #e0e7ff;
    color: #3730a3;
    }











.user-badge--ativo {
    background: #dcfce7;
    color: #166534;
}

.user-badge--inativo {
    background: #fef2f2;
    color: #991b1b;
}




/* ===============================
   Último acesso — estilo sutil
=============================== */

.usuarios-table td.ultimo-acesso {
    font-style: italic;
    font-size: 0.85rem;
    color: #6b7280; /* cinza elegante (tailwind gray-500 vibe) */
    white-space: nowrap;
}









/* Ações */
.btn-ghost {
    background: transparent;
    color: #3730a3;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.btn-ghost:hover {
    background: #e5e7eb;
}



/* ===============================
   GESTÃO DE USUÁRIOS – FILTROS
================================ */

#gestao-usuarios .filtros-usuarios {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

#gestao-usuarios .filtros-usuarios input,
#gestao-usuarios .filtros-usuarios select {
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    font-size: 0.9rem;
    color: #111827;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
}

#gestao-usuarios .filtros-usuarios input::placeholder {
    color: #9ca3af;
}

#gestao-usuarios .filtros-usuarios input:focus,
#gestao-usuarios .filtros-usuarios select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Desabilitados (por enquanto) */
#gestao-usuarios .filtros-usuarios input:disabled,
#gestao-usuarios .filtros-usuarios select:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}


/* ===============================
   GESTÃO DE USUÁRIOS – UX POLISH
================================ */

/* Zebra sutil */
.usuarios-table tbody tr:nth-child(even) {
    background: #f3f4f6;
}

/* Hover de linha */
.usuarios-table tbody tr {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.usuarios-table tbody tr:hover {
    background: #eef2ff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
    cursor: pointer;
}

/* Destaque suave da coluna Usuário */
.usuarios-table tbody tr:hover .usuario-info strong {
    color: #1d4ed8;
}

/* Ações (⋯) mais discretas */
.usuarios-table .acoes {
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.usuarios-table tbody tr:hover .acoes {
    opacity: 1;
}

/* Ajuste fino de tipografia */
.usuarios-table tbody td {
    font-size: 0.95rem;
}

.usuarios-table thead th {
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-size: 0.7rem;
}





/* ===============================
   MENU CONTEXTUAL – USUÁRIO
================================ */

.acoes {
    position: relative;
}

.menu-usuario {
    position: absolute;
    top: 36px;
    right: 0;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    padding: 6px;
    min-width: 180px;
    display: none;
    z-index: 20;
}

.menu-usuario .menu-item {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #111827;
}

.menu-usuario .menu-item:hover {
    background: #f3f4f6;
}

.menu-usuario .menu-item i {
    width: 18px;
    text-align: center;
    color: #6b7280;
}

.menu-usuario .menu-item.danger {
    color: #b91c1c;
}

.menu-usuario .menu-item.danger i {
    color: #b91c1c;
}


/* MENU USUÁRIO — ATIVAR */
.menu-usuario .menu-item.success {
    color: #166534;              /* verde escuro */
}

.menu-usuario .menu-item.success i {
    color: #16a34a;
}

.menu-usuario .menu-item.success:hover {
    background-color: #dcfce7;   /* verde claro */
}




.btn-success {
    background-color: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background-color: #15803d;
}





/* ===============================
   CONFIRMACAO DE DESATIVAR USUARIO
================================ */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#confirm-desativar-overlay {
    display: none;
}

.confirm-modal {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 360px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  animation: scaleIn 0.2s ease;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.confirm-icon.danger {
  background: #fee2e2;
  color: #dc2626;
}

.confirm-icon.success {
    background: #dcfce7;
    color: #16a34a;
}

.confirm-icon.success i {
    color: #16a34a;
}

.confirm-modal h3 {
  margin: 8px 0;
}

.confirm-modal p {
  font-size: 14px;
  color: #555;
  margin-bottom: 20px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
}

.btn-danger {
  padding: 8px 14px;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  border: none;
  cursor: pointer;
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}




/* ===============================
   DRAWER – NOVO USUÁRIO
================================ */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 90;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -8px 0 24px rgba(0,0,0,0.08);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.drawer-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    gap: 8px;
    align-items: center;
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.drawer-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form */
.drawer .form-group {
    margin-bottom: 16px;
}

.drawer label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.drawer input,
.drawer select {
    width: 100%;
    height: 42px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 0 12px;
    font-size: 0.9rem;
}

/* Estados desabilitados */
.drawer input:disabled,
.drawer select:disabled,
.drawer button:disabled {
    background: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
}



.crm-wrapper {
    display: flex;
    gap: 0.5rem;
}

.crm-wrapper input {
    flex: 2;
}

.crm-wrapper select {
    flex: 1;
}












/* ===== BADGES DE REVISÃO ===== */

.badge-revisao {
    background-color: #f39c12; /* laranja */
    color: #fff;
}

.badge-em-revisao {
    background-color: #9b59b6; /* roxo */
    color: #fff;
}



.data-info {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.2rem;
    font-style: italic;
}






/* ===== TEXTO URGENTE NO CARD ===== */

.urgente {
    color: red;
    font-weight: bold;
}


/* ===== TEXTO COM CONTRASTE NO CARD ===== */

.contraste {
    font-weight: bold;
    color: #f39c12; /* amarelo-alaranjado */
}



/* ===== TOGGLE SWITCH ===== */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle input {
    display: none;
}

.toggle .slider {
    position: relative;
    width: 42px;
    height: 22px;
    background-color: #ccc;
    border-radius: 22px;
    transition: background-color 0.3s;
}

.toggle .slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle input:checked + .slider {
    background-color: #4CAF50;
}

.toggle input:checked + .slider::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.9rem;
}



/* ===== ACOES MINHAS ===== */

.acoes-minhas {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.acoes-minhas button {
    padding: 4px 10px;
    font-size: 0.75rem;
}

/* Botão desabilitado */
.acoes-minhas button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botão habilitado */
.acoes-minhas button:not(:disabled) {
    opacity: 1;
    cursor: pointer;
}




/* BOTOES DE ABRIR LAUDO, BAIXAR E ASSINAR */


.acoes-laudo {
    display: flex;
    gap: 8px;
    margin-top: 0.5rem;
}

.btn-laudo {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 32px;
    padding: 0 12px;

    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;

    border-radius: 6px;
    background: var(--primary);
    color: #fff;

    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}


.btn-laudo.editar {
    background-color: #7f8c8d; /* cinza */
    color: #fff;
}



.btn-laudo.secondary {
    background: #7f8c8d;
}

.btn-laudo.assinar {
    background: #27ae60;
}

.laudo-assinado {
    font-size: 0.8rem;
    color: #27ae60;
    font-weight: 600;
}




/* ===== AJUSTE FINAL – LAUDOS EM LINHA ÚNICA ===== */

.requisicao-card.laudo-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.laudo-linha {
    display: flex;
    align-items: center;
    gap: 1.25rem 2rem;
    flex-wrap: wrap;          /* 🔥 permite quebra */
    flex: 1;                  /* ocupa o espaço disponível */
    min-width: 0;             /* MUITO IMPORTANTE */
}

.laudo-linha span {
    white-space: nowrap;
    font-size: 0.9rem;
    color: #333;
}

.laudo-linha strong {
    font-weight: 600;
}

.acoes-laudo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    flex-shrink: 0;   /* 🔥 nunca encolhe */
}

/* Responsivo: quebra elegante */
@media (max-width: 1000px) {
    .requisicao-card.laudo-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .laudo-linha {
        flex-wrap: wrap;
        gap: 0.75rem 1.25rem;
    }

    .acoes-laudo {
        margin-top: 0.5rem;
    }
}



/* Remover itálico do "Laudo em" nos cards de laudo */
.requisicao-card.laudo-card .data-info {
    font-style: normal;
}

.laudo-linha .data-info {
    margin-top: 0 !important;
    font-style: normal;
}


/* Alinhamento perfeito entre Abrir / Baixar / Assinar */
.acoes-laudo a,
.acoes-laudo button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;              /* força mesma altura */
    line-height: 1;
    padding: 0 12px;
    margin-top: 0 !important;
}



/* ===== FILTROS DE LAUDOS ===== */

.laudos-filtros {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.2fr)   /* Paciente */
        minmax(180px, 1.2fr)   /* Tipo */
        minmax(160px, 1fr)     /* Setor */
        minmax(160px, 1fr)     /* Data */
        minmax(140px, auto)   /* Período */
        auto;                  /* Botão Limpar */

    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1.2rem;
}

/* === CORREÇÃO DEFINITIVA DO GRID DE FILTROS === */
.laudos-filtros > input,
.laudos-filtros > select,
.laudos-filtros > button {
    margin: 0 !important;
}

.laudos-filtros input,
.laudos-filtros select,
.laudos-filtros button {
    height: 36px;
}

.laudos-filtros input,
.laudos-filtros select {
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #d0e2f5;
    border-radius: 8px;
    font-size: 0.85rem;
    min-width: 160px;
}

.laudos-filtros input:focus,
.laudos-filtros select:focus {
    outline: none;
    border-color: var(--primary);
}



.laudos-filtros button {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    background: #7f8c8d;
    color: white;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin-top: 0;
}



.laudos-filtros button:hover {
    background: #5f6a6a;
}



/* Responsivo */
@media (max-width: 768px) {
    .laudos-filtros {
        grid-template-columns: 1fr;
    }
}



/* CONTADOR DE RESULTADOS DA BUSCA */

.contador-laudos {
    grid-column: 1 / -1;
    text-align: left;
    font-size: 0.8rem;
    font-style: italic;
    color: #555;
    margin: 0.5rem 0 1rem 0;
    font-weight: 500;
}


/* ===== TOAST / SNACKBAR ===== */

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 14px 18px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    animation: slideIn 0.35s ease, fadeOut 0.4s ease 3.5s forwards;
}

.toast.success { background: #2ecc71; }
.toast.error   { background: #e74c3c; }
.toast.warning { background: #f39c12; }
.toast.info    { background: #3498db; }

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}



/* ===== MODAL DE CONFIRMAÇÃO ===== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.confirm-box {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.confirm-box p {
    font-size: 1rem;
    margin-bottom: 1.25rem;
    color: #333;
}

.confirm-actions {
    display: flex;
    justify-content: center;   /* centraliza o grupo */
    gap: 1rem;                 /* espaço equilibrado */
    margin-top: 1rem
}

.confirm-actions button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-cancelar {
    background: #ecf0f1;
    border: none;
    color: #555;
}

.btn-confirmar {
    background: #27ae60;
    border: none;
    color: white;
}


.confirm-actions .btn-confirmar {
    order: 1;   /* fica à esquerda */
}

.confirm-actions .btn-cancelar {
    order: 2;   /* fica à direita */
}




/* NEUTRALIZA O BUTTON DENTRO DE ACOES LAUDO */

.acoes-laudo button {
    all: unset;                 /* remove estilo nativo e global */
    box-sizing: border-box;
}


.acoes-laudo a,
.acoes-laudo button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 32px;
    padding: 0 12px;

    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;

    border-radius: 6px;
    border: none;

    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn-laudo.assinar,
.btn-laudo.secondary,
.btn-laudo.retificar {
    color: #fff;
}




/* ===== CREATININA – ALERTAS ===== */

.creatinina-ok {
    border-color: #2ecc71 !important;
    background-color: #f0fbf4;
}

.creatinina-alerta {
    border-color: #f5d556 !important;
    background-color: #fff8e1;
}

.creatinina-critica {
    border-color: #ff4000 !important;
    background-color: #fff1e6;
}






/* ==== DESIGN ACCORDION PARA FILTROS - APENAS MOBILE ==== */

.btn-toggle-filtros {
    display: none; /* desktop */
    background: #ecf0f1;
    color: #555;
    border: 1px solid #d0e2f5;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}



@media (max-width: 768px) {

    .btn-toggle-filtros {
        display: block;
        margin-bottom: 0.75rem;
    }

    .laudos-filtros {
        display: none; /* fechado por padrão */
    }

    .laudos-filtros.aberto {
        display: grid;
    }
}



/* ===== REQUISIÇÕES EM LINHA ÚNICA ===== */

.requisicao-linha {
    display: flex;
    align-items: center;
    gap: 0.5rem 2rem; /* ↓ vertical | → horizontal */
    flex-wrap: wrap;
}

.requisicao-linha span {
    white-space: normal;
    max-width: max-content;
    font-size: 0.9rem;
    color: #333;
}

.requisicao-linha strong {
    font-weight: 600;
}

/* Badge sempre na linha de baixo */
.requisicao-card .badge-status {
    margin-top: 0.4rem;
}

@media (max-width: 900px) {
    .requisicao-linha {
        flex-wrap: wrap;
        gap: 0.5rem 1.2rem;
    }
}



/* ===== CODIGO DE REQUISICAO ===== */

.codigo-requisicao {
    font-size: 0.75rem;
    font-style: italic;
    color: #6b7280; /* cinza elegante */
    font-family: monospace;
}







/* ===== LINHA EXCLUSIVA PARA STATUS ===== */

.status-linha {
    margin-top: 0.4rem;
}




/* Garantir cores semânticas dentro da linha */
.requisicao-linha .urgente {
    color: red !important;
    font-weight: bold;
}

.requisicao-linha .contraste {
    color: #f39c12 !important;
    font-weight: bold;
}





.requisicao-linha .data-info {
    margin-top: 0;
    font-style: italic;
    font-size: 0.9rem;
}







/* ===== CARD EXPANSÍVEL ===== */

.card-expansivel {
    flex-direction: column;
}

.requisicao-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

/* Setinha */
.toggle-card {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #aaa;
    padding: 4px;
    transition: transform 0.25s ease, color 0.25s ease;
}

.toggle-card:hover {
    color: var(--primary);
}

/* ===== ANIMAÇÃO SUAVE DO CARD ===== */

.requisicao-detalhes {
    max-height: 0;
    overflow: hidden;
    margin-top: 0.3rem;

    opacity: 0;
    transform: translateY(-4px);

    transition:
        max-height 0.25s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* Estado aberto */
.card-expansivel.aberto .requisicao-detalhes {
    max-height: 500px; /* valor seguro para o conteúdo */
    opacity: 1;
    transform: translateY(0);
}

/* Rotação da seta */
.card-expansivel.aberto .toggle-card {
    transform: rotate(180deg);
}


.requisicao-detalhes,
.status-linha {
    margin-top: 0.2rem;
}

.status-linha {
    display: flex;
    align-items: center;
}

.status-linha {
    margin-top: 0.1rem;
    display: flex;
    align-items: center;
}



.requisicao-linha span {
    line-height: 1.3;
}






/* ===== DADOS DO PACIENTE NO CARD EXPANDIDO ===== */

.requisicao-detalhes .dados-paciente {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.requisicao-detalhes .dados-paciente span {
    font-size: 0.9rem;
    color: #555;
}

@media (max-width: 768px) {
    .requisicao-detalhes .dados-paciente {
        gap: 0.75rem 1.5rem;
    }
}


.requisicao-card {
    position: relative; /* necessário para o ícone absoluto */
    cursor: pointer;
}

/* Ícone de expansão */
.icone-expansivel {
    position: absolute;
    right: 1rem;
    top: 1.2rem;

    width: 14px;
    height: 14px;

    border-right: 2px solid #999;
    border-bottom: 2px solid #999;

    transform: rotate(45deg); /* setas para baixo */
    transition: transform 0.25s ease, opacity 0.2s;
    opacity: 0.6;
}

.icone-expansivel {
    pointer-events: none;
}

/* Estado aberto */
.card-expansivel.aberto .icone-expansivel {
    transform: rotate(-135deg); /* setas para cima */
    opacity: 0.9;
}




.requisicao-detalhes strong {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.requisicao-detalhes span {
    font-size: 0.9rem;
    color: #555;
}

.requisicao-detalhes .requisicao-linha span {
    max-width: 100%;
}



.acoes-radiologia {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-right: 2rem; /* 👈 espaço para a seta */
}

.requisicao-linha.resumo {
    flex-wrap: nowrap;
}   

.requisicao-linha.resumo {
    width: 100%;
}






/* ===== CONTROLES – REQUISIÇÕES POR SETOR ===== */

.controles-pendentes {
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* 👈 força alinhamento à esquerda */
    gap: 0.1rem;              /* 👈 controla espaço filtro ↔ contador */
    margin-bottom: 0.5rem;
}

/* Filtro (texto + select na mesma linha) */
.filtro-periodo {
    display: flex;
    align-items: baseline;       /* 👈 alinhamento vertical perfeito */
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #444;
}

/* Texto */
.filtro-periodo span {
    line-height: 1;
    white-space: nowrap;
}

/* Select compacto */
.filtro-periodo select {
    height: 32px;
    padding: 0 0.6rem;
    font-size: 0.85rem;
}

/* Contador logo abaixo, colado */
#contador-requisicoes {
    font-size: 0.8rem;
    font-style: italic;
    color: #555;
    font-weight: 500;
}

#contador-exames-realizar {
    font-size: 0.8rem;
    font-style: italic;
    color: #555;
    font-weight: 500;
}

#contador-minhas-requisicoes {
    font-size: 0.8rem;
    font-style: italic;
    color: #555;
    font-weight: 500;
}


    

/* ===== AJUSTE FINO – TOPO DA LISTA DE REQUISIÇÕES ===== */

#pendentes .lista-wrapper {
    padding-top: 1rem;   /* antes: 2rem */
}








                /* =========================
                PAINEL – LAYOUT GERAL
                ========================= */

#painel {
    padding: 1px;
    flex-direction: column;
    gap: 16px;
}

#painel {
    padding-bottom: 00px; /* espaço para o rodapé fixo */
}

/* =========================
   BLOCO 1 – KPIs
========================= */

.painel-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 3  px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.kpi-title {
    font-size: 0.85rem;
    color: #777;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
}

.kpi-sub {
    font-size: 0.75rem;
    color: #999;
}

/* Cores */
.kpi-card.warning { border-left: 6px solid #f5b700; }
.kpi-card.info    { border-left: 6px solid #4a90e2; }
.kpi-card.alert   { border-left: 6px solid #f57c00; }
.kpi-card.success { border-left: 6px solid #2ecc71; }

/* =========================
   BLOCO 2 – AÇÕES
========================= */

.painel-acoes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.acao-card {
    background: linear-gradient(135deg, #4a90e2, #6ba8f0);
    border: none;
    color: #fff;
    padding: 18px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s ease;
}

.acao-card:hover {
    transform: translateY(-3px);
}

/* =========================
   BLOCO 3 – ALERTAS
========================= */

.painel-alertas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alerta {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.alerta-critico {
    background: #fdecea;
    color: #b71c1c;
}

.alerta-aviso {
    background: #fff8e1;
    color: #8a6d00;
}

/* =========================
   BLOCO 4 – OPERACIONAL
========================= */

.painel-operacional {
    position: fixed;
    bottom: 0;
    left: 280px; /* largura da sidebar */
    right: 0;

    background: #f8fbfd;
    border-top: 1px solid #e6f0fa;

    padding: 10px 16px;
    z-index: 850;
}

.painel-operacional {
    border-top: none !important;
    box-shadow: none !important;
}


.main-content.expanded .painel-operacional {
    left: 60px;
}

.painel-operacional h3 {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;

    margin: 0 0 8px 0;
    letter-spacing: 0.08em;
}





.servicos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 12px;
}

.servico-card {
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;

    box-shadow: 0 2px 6px rgba(0,0,0,0.04);

    display: flex;
    align-items: stretch;
    gap: 0;

    min-height: auto; /* 🔥 remove crescimento artificial */
}

.servico-card h4 {
    font-size: 0.85rem;
    margin: 0;
}

.servico-card p {
    font-size: 0.55rem;
    margin: 0;
}

.servico-card .desde {
    font-size: 0.7rem;
}



        /* CORES DAS ABAS LATERAIS POR ESTADOS */


.servico-card.ativo {
    border-left: 6px solid #2ecc71; /* verde */
}

.servico-card.aguardando {
    border-left: 6px solid #f5b700; /* amarelo */
}

.servico-card.manutencao {
    border-left: 6px solid #e53935; /* vermelho */
}










.servico-info {
    display: flex;
    flex-direction: column;
    align-items: center;   /* 🔥 CENTRALIZA */
    text-align: center;    /* 🔥 CENTRALIZA TEXTO */
    gap: 2px;
    width: 100%;
}

.servico-info h4 {
    font-size: 0.7rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.1;
}

.servico-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.linha-final {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;   /* 🔥 centraliza o conjunto */
    gap: 6px;                 /* espaço entre texto e botão */
    margin-top: 2px;
}

.btn-mini {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 5px;
    line-height: 1;
    font-weight: 600;
}


.btn-checkin {
    background: #4a90e2;
    color: #fff;
}


.btn-checkout {
    background: #f39c12;
    color: #fff;
}




.linha-servico {
    font-size: 0.65rem;
    line-height: 1.1;      /* 🔥 ESSENCIAL */
    margin: 0;
}


.linha-servico.destaque {
    color: #b26a00;
    font-weight: 600;
}

.linha-servico,
.linha-servico.destaque {
    justify-content: center;
}









@media (max-width: 992px) {
    .servicos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .servicos-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-height: 800px) {
    .kpi-card {
        padding: 14px;
    }

    .acao-card {
        padding: 14px;
        font-size: 0.95rem;
    }

    .alerta {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    .servico-card {
        padding: 8px 12px;
        min-height: auto;
    }
}











/* Check-in */
.checkin-acoes {
    margin-top: 12px;
}


.checkin-acoes button {
    font-size: 0.55rem;
    padding: 6px 10px;
    border-radius: 6px;
}


.btn-primario {
    background: #4a90e2;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-secundario {
    background: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}



        /* =========================
        PAINEL — SEM SCROLL
        ========================= */

#painel.page.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}


.painel-conteudo {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.painel-conteudo {
    margin-bottom: 0 !important;
    border-bottom: none !important;
}




.painel-status-fixo {
    border-top: 1px solid #e6f0fa;
    margin-top: auto;
    padding-top: 12px;
}


/* =========================
   MOBILE — STATUS DOS SERVIÇOS
========================= */

@media (max-width: 768px) {

    /* Painel deixa de ser fixo */
    .painel-operacional {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;

        padding: 16px 12px 0;
        background: transparent;
    }

    /* Título */
    .painel-operacional h3 {
        text-align: left;
        font-size: 0.8rem;
        margin-bottom: 12px;
        letter-spacing: 0.05em;
    }

    /* Grid vira lista */
    .servicos-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    /* Card mais confortável */
    .servico-card {
        padding: 10px 12px;
        border-radius: 10px;
    }

    /* Texto volta para leitura */
    .servico-info {
        align-items: flex-start;
        text-align: left;
        gap: 4px;
    }

    .servico-info h4 {
        font-size: 0.85rem;
    }

    .linha-servico {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    /* Linha final (botão) */
    .linha-final {
        justify-content: flex-start;
        margin-top: 6px;
    }

    /* Botões tocáveis */
    .btn-mini {
        font-size: 0.75rem;
        padding: 6px 10px;
        border-radius: 6px;
    }

    /* Remove compactação excessiva */
    .servico-card p {
        font-size: 0.75rem;
    }
}





/* =========================
   PAINEL — GRÁFICOS
========================= */

.painel-graficos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.grafico-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);

    display: flex;
    flex-direction: column;
    gap: 12px;

    height: 220px;
}

.grafico-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grafico-header span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

.grafico-header select {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #d0e2f5;
    background: #fff;
}

.grafico-card canvas {
    width: 100% !important;
    height: 140px !important;
}










/* OCULTAR BOTÕES DO PAINEL (temporário) */
body.painel-ativo .painel-acoes {
    display: none;
}





/* =====================================================
   MODAL – UPLOAD DE DICOM
===================================================== */

.setor-selector-panel.modal-dicom {
    width: 95%;
    max-width: 800px;
}

/* Corpo do modal */
.modal-dicom .panel-body {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* ===== CONTEXTO DO EXAME ===== */
.modal-dicom .modal-contexto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1.5rem;

    padding: 1rem 1.25rem;
    background: #f4f8ff;
    border: 1px solid #e2ecfa;
    border-radius: 10px;

    font-size: 0.9rem;
}

.modal-dicom .modal-contexto strong {
    color: #3a78c7;
    font-weight: 600;
}

/* ===== FORM ===== */
.modal-dicom .dicom-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-dicom .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* Upload */
.modal-dicom input[type="file"] {
    padding: 0.6rem;
    border: 2px dashed #6ba8f0;
    border-radius: 10px;
    background: #f8fbff;
    cursor: pointer;
}

.modal-dicom input[type="file"]:hover {
    background: #eef5ff;
}

/* Texto auxiliar */
.modal-dicom small {
    font-size: 0.75rem;
    color: #666;
}

/* Observações */
.modal-dicom textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== AÇÕES ===== */
.modal-dicom .form-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e6f0fa;
}

/* Botões */
.modal-dicom .btn-cancelar {
    background: #e0e0e0;
    color: #333;
}

.modal-dicom .btn-cancelar:hover {
    background: #cfcfcf;
}

.modal-dicom .btn-confirmar {
    background: #27ae60;
    color: #fff;
    font-weight: 600;
}

.modal-dicom .btn-confirmar:hover {
    background: #1e8f4f;
}








/* =====================================================
   LOGIN – CSS EXTRAÍDO DO styles.css (100% FIEL, ISOLADO)
===================================================== */

/* Reset SOMENTE no login */
.login-page * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base SOMENTE no login */
.login-page {
    font-family: Arial, sans-serif;
    background-color: #f4f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login */
.login-page .login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f4f7fa;
}

.login-page .login-box {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 350px;
    text-align: center;
}

.login-page .login-box .logo {
    max-height: 60px;
    margin-bottom: 10px;
}

.login-page .login-box h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.2;
}

/* Formulário */
.login-page .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.login-page .form-group label {
    font-weight: 600;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
}

.login-page .form-group .required {
    color: #e8685a;
    font-size: 1rem;
}

/* Inputs com ícones */
.login-page .input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-page .input-wrapper input {
    height: 44px;
    padding: 10px 10px 10px 36px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

/* Ícones */
.login-page .input-wrapper[data-icon="user"]::before,
.login-page .input-wrapper[data-icon="lock"]::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 14px; /* alinhamento visual correto */
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
    pointer-events: none;
}

.login-page .input-wrapper[data-icon="user"]::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237f8c8d" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>');
}

.login-page .input-wrapper[data-icon="lock"]::before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%237f8c8d" stroke-width="2"><path d="M12 2a5 5 0 0 0-5 5v4H5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7a2 2 0 0 0-2-2h-2V7a5 5 0 0 0-5-5zm0 2a3 3 0 0 1 3 3v4H9V7a3 3 0 0 1 3-3z"/></svg>');
}

/* Botão */
.login-page .form-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.login-page .form-actions button {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

.login-page .form-actions button.primary {
    padding-top: 10px;
    padding-bottom: 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
}



