/* =============================
   Portal Masterfarma - Theme CSS
   Reutilizável para todas as telas
   ============================= */

/* --- Empresas, Cards, Tabelas, Botões de ação --- */
.empresa-table th, .empresa-table td { vertical-align: middle !important; }
.empresa-row:hover {
    background: #eaf7ff;
    box-shadow: 0 4px 16px rgba(40,60,90,0.11);
    transition: background 0.18s, box-shadow 0.18s;
}
.empresa-logo {
    width: 56px; height: 40px; object-fit: contain; border-radius: 8px; background: #f8fafc;
    box-shadow: 0 2px 8px rgba(80,110,180,0.08);
    border: 1px solid #e5e7eb;
}
.avatar-empresa {
    width: 44px; height: 44px; border-radius: 8px;
    background: linear-gradient(120deg,#e3f0fa 70%,#fafcff 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; color: #7c98b6;
    box-shadow: 0 2px 8px rgba(40,60,90,0.07);
    border: 1px solid #e5e7eb;
}

/* Botões de ação padrão para listas/tabelas */
.btn-action {
    min-width: 38px;
    margin-right: 6px;
    box-shadow: 0 2px 8px rgba(80,110,180,0.06);
    transition: box-shadow 0.18s, transform 0.18s;
}
.btn-action:last-child { margin-right: 0; }
.btn-action:hover {
    box-shadow: 0 4px 14px rgba(40,60,90,0.13)!important;
    transform: scale(1.09);
}

/* Cabeçalho de lista/card */
.empresa-header, .list-header, .card-header-gradient {
    background: linear-gradient(120deg,#e3f0fa 70%,#fafcff 100%);
    border-radius: 1rem;
    padding: 1.2rem 1rem;
    box-shadow: 0 2px 16px rgba(80,110,180,0.09);
    margin-bottom: 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}

/* --- Card padrão para dashboard, listas, etc --- */
.card-portal {
    border-radius: 1.2rem;
    box-shadow: 0 2px 10px rgba(40,60,90,0.09);
    border: none;
    background: linear-gradient(135deg, #eaf0fa 0%, #f7faff 100%);
    transition: box-shadow 0.18s, transform 0.18s;
}
.card-portal:hover {
    transform: scale(1.03) translateY(-2px);
    box-shadow: 0 8px 24px rgba(40,60,90,0.18)!important;
    border: 2px solid #0d6efd22;
    z-index: 2;
}
.card-portal .card-header {
    border-radius: 1.2rem 1.2rem 0 0;
    background: linear-gradient(120deg,#e3f0fa 80%,#fafcff 100%);
    border-bottom: 1px solid #e3e8f1;
}

/* --- Avatar inicial para listas, cards, pessoas --- */
.avatar-inicial, .avatar-lista {
    width:45px; height:45px; border-radius:50%; background:#dbeafe; display:flex; align-items:center; justify-content:center;
    font-size:1.5rem; font-weight:600; color:#1769aa;
    box-shadow: 0 2px 8px rgba(40,60,90,0.07);
}

/* --- Status dot --- */
.status-dot {
    width:12px; height:12px; border-radius:50%; display:inline-block; margin-right:5px;
}
.status-dot.ativo { background:#34d399; }
.status-dot.inativo { background:#ef4444; }

/* --- Responsive tweak --- */
@media (max-width: 767.98px) {
    .empresa-header, .list-header, .card-header-gradient { flex-direction: column; gap: 1rem; }
    .empresa-logo, .avatar-empresa { width: 38px; height: 38px; font-size: 1.2rem; }
    .btn-action { min-width: 32px; }
    .card-portal, .card-portal .card-header { border-radius: 0.7rem; }
    .avatar-inicial, .avatar-lista { width: 34px; height: 34px; font-size: 1.1rem; }
}

/* --- Tabela padrão portal --- */
.table-portal th, .table-portal td { vertical-align: middle !important; }
.table-portal thead { background: #f8fafc; }

/* --- Botão principal portal --- */
.btn-portal {
    font-weight: 600;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px rgba(80,110,180,0.05);
    transition: box-shadow 0.18s, transform 0.18s;
}
.btn-portal:hover {
    box-shadow: 0 6px 18px rgba(40,60,90,0.12)!important;
    transform: scale(1.04);
}

/* --- Input e select portal --- */
.form-select, .form-control {
    border-radius: 0.7rem;
    box-shadow: 0 2px 6px rgba(40,60,90,0.05);
}

/* --- Breadcrumb portal --- */
.breadcrumb-portal {
    background: #f8fafc;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px rgba(80,110,180,0.06);
    padding: 0.8rem 1.2rem;
    margin-bottom: 1.2rem;
}

/* --- Badge padrão portal --- */
.badge-portal {
    font-size: 0.96rem;
    padding: 0.4em 0.7em;
    background: #e3f0fa;
    color: #1769aa;
    border-radius: 0.7rem;
}

/* --- Tooltip fix for buttons --- */
.btn[data-bs-toggle="tooltip"] { position: relative; z-index: 2; }

/* --- Loader spinner centralizado --- */
.center-spinner { display:flex;justify-content:center;align-items:center;min-height:120px; }

/* --- Utility classes --- */
.text-truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.min-w-0 { min-width: 0; }
.gap-2 { gap: 0.5rem; }
.gap-1 { gap: 0.25rem; }

/* --- Ajuste para botões em cards e listas --- */
.btn-group-portal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}
