/* ============================================================
   eJay Assist — CSS ÚNICO
   - Base (reset leve, variáveis, tipografia)
   - Header (topbar, menubar, drawer mobile)
   - Componentes (cards, botões, <pre>, etc.)
   - Layout de páginas internas + rodapé fixo ao fundo
   - Tela de login (hero + card)
   ============================================================ */

/* ========================= */
/* BASE / VARIÁVEIS GLOBAIS */
/* ========================= */

:root {
    --ejay-primary: #1895fc;
    --ejay-primary-dark: #0b77cf;

    --ejay-bg-page: #f3f4f6;
    --ejay-bg-card: #ffffff;

    --ejay-text-main: #111827;
    --ejay-text-muted: #6b7280;

    --ejay-border-subtle: #e5e7eb;

    --ejay-shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.06);

    --ejay-radius-lg: 14px;
}

/* Reset leve */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

/* Body como coluna para termos header + conteúdo + rodapé fixo */
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--ejay-bg-page);
    color: var(--ejay-text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Links */
a {
    color: var(--ejay-primary);
    text-decoration: none;
}

a:hover {
    color: var(--ejay-primary-dark);
    text-decoration: underline;
}

/* ================= */
/* HEADER / NAVBAR  */
/* ================= */

.ejay-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    flex-shrink: 0;
}

/* TOPBAR CINZA (nome da página) */
.ejay-topbar {
    background: #f3f4f6;
    border-bottom: 1px solid var(--ejay-border-subtle);
}

.ejay-topbar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.4rem 1.5rem;
    display: flex;
    align-items: center;
    min-height: 38px;
}

.ejay-topbar-title {
    font-size: 0.9rem;
    color: var(--ejay-text-muted);
}

/* MENUBAR BRANCA */
.ejay-menubar {
    background: #ffffff;
    border-bottom: 1px solid var(--ejay-border-subtle);
}

.ejay-menubar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.4rem 1.5rem;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Logo */
.ejay-header-logo img {
    height: 32px;
    display: block;
}

/* Menu desktop */
.ejay-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
}

.ejay-nav-item {
    font-size: 0.95rem;
    font-weight: 500;
    color: #4b5563;
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.ejay-nav-item:hover {
    color: #111827;
}

/* Estado ativo (futuro) */
.ejay-nav-item--active {
    color: #111827;
    font-weight: 600;
}

.ejay-nav-item--active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 28px;
    border-radius: 999px;
    background: var(--ejay-primary);
}

/* Botão usuário */
.ejay-user-btn {
    background: transparent !important;
    border: none !important;
    color: #374151;
    padding: 4px 8px;
}

.ejay-user-btn:hover {
    color: #111827;
}

.ejay-user-btn i {
    font-size: 1.5rem;
}

/* Botão menu mobile (hamburger) */
.ejay-mobile-menu-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    padding: 4px 8px;
}

/* Drawer lateral (mobile) */
.ejay-drawer {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 2000;
}

.ejay-drawer.open {
    opacity: 1;
    visibility: visible;
}

.ejay-drawer-inner {
    width: 260px;
    max-width: 80%;
    background: #ffffff;
    padding: 1.5rem 1.25rem;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ejay-drawer-inner a {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
    text-decoration: none;
    padding: 0.3rem 0;
}

.ejay-drawer-inner a:hover {
    color: var(--ejay-primary);
}

.ejay-drawer-inner hr {
    margin: 1.25rem 0;
    border-color: var(--ejay-border-subtle);
}

.ejay-drawer-user {
    font-size: 0.85rem;
    color: var(--ejay-text-muted);
}

.ejay-drawer-logout {
    color: #dc2626 !important;
    font-weight: 500;
    margin-top: 0.5rem;
}

/* Responsividade do menu */
@media (min-width: 768px) {
    .ejay-mobile-menu-btn {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .ejay-nav {
        display: none !important;
    }

    .ejay-menubar-inner {
        justify-content: space-between;
    }
}

/* ========================= */
/* LAYOUT PÁGINAS INTERNAS   */
/* ========================= */

/* main das páginas internas ocupa o espaço entre header e rodapé */
.ejay-page {
    width: 100%;
    max-width: 1320px;
    margin: 1.75rem auto 0;
    padding: 0 1.5rem 2.5rem;
    flex: 1 0 auto;
}

/* Título principal */
.ejay-page-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #111827;
}

/* Card padrão */
.ejay-card {
    background: var(--ejay-bg-card);
    border-radius: var(--ejay-radius-lg);
    padding: 1.75rem 2rem;
    box-shadow: var(--ejay-shadow-soft);
}

/* Card com scroll interno */
.ejay-card-scroll {
    max-height: 500px;
    overflow-y: auto;
}

/* Conteúdo pré-formatado */
.ejay-pre {
    background: #f3f4f6;
    border: 1px solid var(--ejay-border-subtle);
    padding: 1rem;
    border-radius: 10px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========================= */
/* BOTÕES / COMPONENTES      */
/* ========================= */

.ejay-btn-primary {
    background: var(--ejay-primary);
    border-color: var(--ejay-primary);
    font-weight: 600;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
}

.ejay-btn-primary:hover {
    background: var(--ejay-primary-dark);
    border-color: var(--ejay-primary-dark);
}

/* ========================= */
/* RODAPÉ                     */
/* ========================= */

.ejay-footer {
    width: 100%;
    border-top: 1px solid var(--ejay-border-subtle);
    background: #ffffff;
    flex-shrink: 0;
}

.ejay-footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem 1rem;
    font-size: 0.8rem;
    color: var(--ejay-text-muted);
    text-align: right;
}

@media (max-width: 767.98px) {
    .ejay-footer-inner {
        text-align: center;
    }
}

/* ========================= */
/* LOGIN (HERO + CARD)       */
/* ========================= */

.ejay-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: #0d6efd url("../images/bg-login.webp") center/cover no-repeat;
}

/* Overlay azul */
.ejay-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            rgba(13, 110, 253, 0.78),
            rgba(64, 87, 121, 0.78)
        ),
        rgba(0, 0, 0, 0.25);
    z-index: 1;
}

/* Conteúdo esquerdo */
.ejay-left-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
}

.ejay-left-content h2 {
    font-size: 2.1rem;
}

.ejay-left-content p {
    font-size: 1.05rem;
    max-width: 520px;
}

/* Linha abaixo do título */
.ejay-divider {
    width: 100%;
    max-width: 420px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    margin: 0 0 1.75rem 0;
}

/* Card de login */
.ejay-hero .card {
    position: relative;
    z-index: 2;
    border-radius: 16px;
}

/* ========================= */
/* RESPONSIVIDADE GERAL      */
/* ========================= */

@media (max-width: 991.98px) {
    .ejay-page {
        padding-inline: 1.25rem;
    }
}

@media (max-width: 767.98px) {

    .ejay-page {
        padding-inline: 1rem;
    }

    /* No hero, foca só no card em mobile */
    .ejay-left-content {
        display: none;
    }

    .ejay-hero {
        align-items: flex-start;
        padding-top: 4rem;
    }

    .ejay-hero .container {
        padding-inline: 1.25rem;
    }
}

/* ============================================================
   Utilitários herdados do template de login original
   (BootstrapBrain) — mantidos para compatibilidade
   ============================================================ */

.py-8{padding-bottom:4.5rem!important;padding-top:4.5rem!important}
@media(min-width:576px){
  .py-sm-8{padding-bottom:4.5rem!important;padding-top:4.5rem!important}
}
@media(min-width:768px){
  .py-md-8{padding-bottom:4.5rem!important;padding-top:4.5rem!important}
}
@media(min-width:992px){
  .py-lg-8{padding-bottom:4.5rem!important;padding-top:4.5rem!important}
}
@media(min-width:1200px){
  .py-xl-8{padding-bottom:4.5rem!important;padding-top:4.5rem!important}
}
@media(min-width:1400px){
  .py-xxl-8{padding-bottom:4.5rem!important;padding-top:4.5rem!important}
}

.bsb-btn-xl{
  --bs-btn-padding-y:0.625rem;
  --bs-btn-padding-x:1.25rem;
  --bs-btn-font-size:calc(1.26rem + 0.12vw);
  --bs-btn-border-radius:var(--bs-border-radius-lg)
}
@media(min-width:1200px){
  .bsb-btn-xl{--bs-btn-font-size:1.35rem}
}

.bsb-btn-2xl{
  --bs-btn-padding-y:0.75rem;
  --bs-btn-padding-x:1.5rem;
  --bs-btn-font-size:calc(1.27rem + 0.24vw);
  --bs-btn-border-radius:var(--bs-border-radius-lg)
}
@media(min-width:1200px){
  .bsb-btn-2xl{--bs-btn-font-size:1.45rem}
}

.bsb-btn-3xl{
  --bs-btn-padding-y:0.875rem;
  --bs-btn-padding-x:1.75rem;
  --bs-btn-font-size:calc(1.28rem + 0.36vw);
  --bs-btn-border-radius:var(--bs-border-radius-lg)
}
@media(min-width:1200px){
  .bsb-btn-3xl{--bs-btn-font-size:1.55rem}
}

.bsb-btn-4xl{
  --bs-btn-padding-y:1rem;
  --bs-btn-padding-x:2rem;
  --bs-btn-font-size:calc(1.29rem + 0.48vw);
  --bs-btn-border-radius:var(--bs-border-radius-lg)
}
@media(min-width:1200px){
  .bsb-btn-4xl{--bs-btn-font-size:1.65rem}
}

.bsb-btn-5xl{
  --bs-btn-padding-y:1.125rem;
  --bs-btn-padding-x:2.25rem;
  --bs-btn-font-size:calc(1.3rem + 0.6vw);
  --bs-btn-border-radius:var(--bs-border-radius-lg)
}
@media(min-width:1200px){
  .bsb-btn-5xl{--bs-btn-font-size:1.75rem}
}

.bsb-btn-circle{
  align-items:center;
  backface-visibility:hidden;
  border-radius:50%!important;
  display:inline-flex;
  height:2.5rem;
  justify-content:center;
  line-height:1;
  padding:0;
  width:2.5rem
}

.bsb-btn-circle.bsb-btn-circle-sm{height:2rem;width:2rem}
.bsb-btn-circle.bsb-btn-circle-lg{height:3rem;width:3rem}
.bsb-btn-circle.bsb-btn-circle-xl{height:3.5rem;width:3.5rem}
.bsb-btn-circle.bsb-btn-circle-2xl{height:4rem;width:4rem}
.bsb-btn-circle.bsb-btn-circle-3xl{height:4.5rem;width:4.5rem}
.bsb-btn-circle.bsb-btn-circle-4xl{height:5rem;width:5rem}
.bsb-btn-circle.bsb-btn-circle-5xl{height:5.5rem;width:5.5rem}
.bsb-btn-circle.bsb-btn-circle-6xl{height:6rem;width:6rem}
.bsb-btn-circle.bsb-btn-circle-7xl{height:6.5rem;width:6.5rem}
.bsb-btn-circle.bsb-btn-circle-8xl{height:7rem;width:7rem}
.bsb-btn-circle.bsb-btn-circle-9xl{height:7.5rem;width:7.5rem}
.bsb-btn-circle.bsb-btn-circle-10xl{height:8rem;width:8rem}


.ejay-page-home {
    max-width: 1320px;
    margin-top: 1.75rem;
}

.ejay-kpi-grid {
    margin-bottom: 1.75rem;
}

.ejay-kpi-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: #ffffff;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.ejay-kpi-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24, 149, 252, 0.08);
    color: var(--ejay-primary);
    font-size: 1.35rem;
}

.ejay-kpi-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ejay-kpi-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ejay-text-muted);
}

.ejay-kpi-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.ejay-kpi-sub {
    font-size: 0.8rem;
    color: var(--ejay-text-muted);
}

.ejay-kpi-warning .ejay-kpi-icon {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}

.ejay-kpi-success .ejay-kpi-icon {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.ejay-kpi-monitor .ejay-kpi-icon {
    background: rgba(56, 189, 248, 0.08);
    color: #0284c7;
}

.ejay-home-grid {
    margin-bottom: 1.75rem;
}

.ejay-card-section {
    padding: 1.5rem 1.5rem 1.3rem;
}

.ejay-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ejay-section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.ejay-section-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ejay-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ejay-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.ejay-list-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.ejay-list-meta {
    font-size: 0.78rem;
    color: var(--ejay-text-muted);
}

.ejay-pill {
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.ejay-pill-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #b91c1c;
}

.ejay-pill-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #92400e;
}

.ejay-pill-neutral {
    background: rgba(148, 163, 184, 0.2);
    color: #334155;
}

.ejay-monitor-status {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ejay-monitor-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.ejay-monitor-label {
    flex: 1;
    margin-left: 0.5rem;
}

.ejay-monitor-value {
    font-weight: 600;
}

.ejay-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.ejay-status-ok {
    background: #16a34a;
}

.ejay-status-warning {
    background: #f59e0b;
}

.ejay-status-critical {
    background: #dc2626;
}

.ejay-monitor-footnote {
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--ejay-text-muted);
}

.ejay-card-technical {
    margin-top: 1rem;
}


/* ========================= */
/* GRÁFICOS DO PAINEL        */
/* ========================= */

.ejay-home-charts .ejay-card-section {
    display: flex;
    flex-direction: column;
}

.ejay-chart-wrapper {
    position: relative;
    width: 100%;
    height: 230px;
    margin-top: 1rem;
}

@media (min-width: 992px) {
    .ejay-chart-wrapper {
        height: 260px;
    }
}

.ejay-chart-card canvas {
    width: 100% !important;
    height: 100% !important;
}


.ejay-table-wrapper {
    margin-top: 0.75rem;
}

.ejay-table {
    font-size: 0.86rem;
    margin-bottom: 0;
}

.ejay-table th {
    color: var(--ejay-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--ejay-border-subtle);
}

.ejay-table td {
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    padding-block: 0.55rem;
}

.ejay-table tr:last-child td {
    border-bottom: none;
}

.ejay-ticket-code {
    font-weight: 600;
    color: #0f172a;
}

.ejay-ticket-title {
    font-weight: 500;
}

.ejay-pagination-wrapper {
    margin-top: 0.75rem;
    display: flex;
    justify-content: flex-end;
}

/* Mobile: tabela vira cards empilhados */
@media (max-width: 767.98px) {
    .ejay-table thead {
        display: none;
    }

    .ejay-table tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border-radius: 10px;
        background: #f9fafb;
        padding: 0.5rem 0.75rem;
    }

    .ejay-table tbody td {
        display: flex;
        justify-content: space-between;
        border: none;
        padding: 0.25rem 0;
        font-size: 0.8rem;
    }

    .ejay-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--ejay-text-muted);
        margin-right: 0.75rem;
    }

    .ejay-pagination-wrapper {
        justify-content: center;
    }
}
