@font-face { font-family: Urbanist; src: url(fonts/Urbanist.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }
body { font-family: Urbanist, system-ui, sans-serif; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { height: 44px; }

/* ---- Admin Master: layout com menu lateral ---- */
.app-shell { display: flex; min-height: 100vh; background: var(--ax-bg, var(--bs-body-bg)); }
.app-sidebar { --bs-offcanvas-width: 264px; width: 264px; flex: 0 0 264px; background: var(--ax-surface, var(--bs-body-bg)); border-right: 1px solid var(--ax-border, var(--bs-border-color)); }
/* menu lateral fixo na altura da tela; só o conteúdo principal rola (o menu tem a própria barra de rolagem se for maior que a tela) */
@media (min-width: 992px) {
    .app-sidebar { position: fixed !important; top: 0; bottom: 0; left: 0; width: 264px !important; height: 100vh !important; height: 100dvh !important; display: flex; flex-direction: column; overflow: hidden; background-color: var(--ax-surface, var(--bs-body-bg)) !important; border-right: 1px solid var(--ax-border, var(--bs-border-color)) !important; z-index: 1030; }
    .app-sidebar .offcanvas-body { display: flex; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
    .app-main { margin-left: 264px; }
}
.side-logo { height: 30px; }
.side-brand { padding: 20px 20px 4px; align-items: center; }
.side-tag { padding: 4px 20px 14px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ax-text-3, var(--bs-secondary-color)); }
.side-nav { padding: 0 12px; gap: 2px; }
.side-nav .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ax-text-2, var(--bs-secondary-color)); font-weight: 500; }
.side-nav .nav-link i { font-size: 1.1rem; }
.side-nav .nav-link:hover { background: var(--ax-hover, var(--bs-tertiary-bg)); color: var(--ax-text, var(--bs-body-color)); }
.side-nav .nav-link.active { background: var(--ax-violet-50, var(--bs-tertiary-bg)); color: var(--ax-violet-text, var(--bs-primary)); }
.side-foot { padding: 16px 20px; font-size: .8125rem; color: var(--ax-text-3, var(--bs-secondary-color)); border-top: 1px solid var(--ax-border, var(--bs-border-color)); }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: var(--ax-surface, var(--bs-body-bg)); border-bottom: 1px solid var(--ax-border, var(--bs-border-color)); position: sticky; top: 0; z-index: 1020; }
.app-content { padding: 20px 16px 48px; width: 100%; max-width: 1100px; margin: 0 auto; }
@media (min-width: 768px) { .app-content { padding: 28px 28px 56px; } }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-icon { font-size: 1.25rem; color: var(--ax-violet-icon, var(--bs-primary)); }

/* logo: versão escura no claro, branca no dark/night */
.logo-dark { display: none; }
[data-bs-theme="dark"] .logo-light, [data-bs-theme="night"] .logo-light { display: none; }
[data-bs-theme="dark"] .logo-dark, [data-bs-theme="night"] .logo-dark { display: inline; }
.card > .table-responsive { border-radius: inherit; }

/* topo enxuto no celular */
.app-topbar .btn { display: inline-flex; align-items: center; justify-content: center; height: 36px; min-width: 36px; padding: 0 10px; }
.topbar-brand img { height: 24px; }

/* ---- Painel da Plataforma: marca (logo ou iniciais) e rodapé do menu ---- */
.side-brand-row { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; object-fit: contain; flex-shrink: 0; }
.brand-mark-initials { display: inline-flex; align-items: center; justify-content: center; background: var(--ax-violet); color: var(--ax-on-brand, #fff); font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.brand-mark-sm { width: 32px; height: 32px; border-radius: 9px; font-size: .8rem; }
.app-sidebar .side-brand { padding: 20px 20px 16px; margin-bottom: 4px; border-bottom: 1px solid var(--ax-border, var(--bs-border-color)); text-decoration: none; color: inherit; }
.side-foot .side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--ax-border, var(--bs-border-color)); border-radius: 12px; background: var(--ax-surface-2, transparent); min-width: 0; }
.made-with { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 0 4px; font-size: .75rem; color: var(--ax-text-3, var(--bs-secondary-color)); }
.made-with img { height: 13px; }
.topbar-hello { line-height: 1.2; }
.side-nav .nav-link .badge { font-size: .7rem; }
.kpi .stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.sec-t { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ax-text-3, var(--bs-secondary-color)); font-weight: 700; }
.app-content.wide { max-width: 1280px; }
.list-actions .btn { white-space: nowrap; }
.logo-preview { max-height: 56px; max-width: 160px; border-radius: 10px; border: 1px solid var(--ax-border, var(--bs-border-color)); padding: 6px; background: var(--ax-surface-2, transparent); }
@media (max-width: 575.98px) { .hide-xs { display: none !important; } }
@media (min-width: 992px) { .app-sidebar .offcanvas-body { flex: 1 1 auto; } }

/* ---- Personalização da Plataforma ---- */
.img-slot { height: 96px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--ax-border-strong, var(--bs-border-color)); border-radius: 14px; background: var(--ax-surface-2, transparent); overflow: hidden; }
.img-slot img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.img-slot i { font-size: 1.6rem; }
.img-slot-dark { background: #0E1A3A; border-color: #2A3054; }
.img-slot-dark i { color: #9095B8 !important; }
.pv-swatches { display: flex; gap: 8px; }
.pv-swatches span { flex: 1; height: 36px; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .08); }
.pv-btn { display: inline-flex; align-items: center; padding: .35rem .8rem; border-radius: 10px; font-weight: 600; font-size: .85rem; }
.pv-badge { display: inline-flex; padding: .2rem .6rem; border-radius: 999px; font-weight: 700; font-size: .75rem; border: 1px solid; }
.sugg-dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); display: inline-block; }

/* logotipo e ícone da Plataforma (ou padrão do Aulix) */
.brand-logo { height: 34px; width: auto; max-width: 190px; object-fit: contain; }
.brand-icon { height: 32px; width: 32px; object-fit: contain; border-radius: 8px; }
.site-logo { max-height: 72px; max-width: 260px; width: auto; }
.app-sidebar .side-brand .brand-logo { height: 36px; }
.pv-brand { display: grid; gap: 10px; }
.pv-logo-box { display: flex; align-items: center; padding: 10px 12px; border: 1px solid var(--ax-border, var(--bs-border-color)); border-radius: 12px; background: #fff; min-height: 56px; }
.pv-logo-dark { background: #0E1A3A; border-color: #2A3054; }
.pv-icon .brand-icon { height: 36px; width: 36px; }
/* na prévia, o logotipo escuro sempre aparece (mesmo no tema claro) e o claro só no claro */
.pv-logo-dark .logo-light { display: none !important; }
.pv-logo-dark .logo-dark { display: inline !important; }
.pv-logo-box:not(.pv-logo-dark) .logo-dark { display: none !important; }
.pv-logo-box:not(.pv-logo-dark) .logo-light { display: inline !important; }
.pv-chip { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, .08); }

/* ---- Campo de data (date_field): o seletor nativo fica invisível sobre o botão, só para abrir o calendário ---- */
/* ---- Campo com botão de ação dentro (.field-wrap + .field-action): senha, data, cor... O botão cobre a altura toda do input, à direita ---- */
.field-wrap { position: relative; --fa-w: 2.75rem; }
.field-wrap > .form-control, .field-wrap > .form-control.is-invalid, .field-wrap > .form-control.is-valid { padding-right: calc(var(--fa-w) + .5rem); background-image: none; }
.field-wrap > .field-action { position: absolute; top: 0; right: 0; bottom: 0; width: var(--fa-w); display: flex; align-items: center; justify-content: center; padding: 0; z-index: 4; border-top-left-radius: 0; border-bottom-left-radius: 0; border-top-right-radius: var(--bs-border-radius); border-bottom-right-radius: var(--bs-border-radius); }
.field-wrap > .field-action .color-chip { width: 1.25rem; height: 1.25rem; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .15); display: block; }
.field-wrap > .field-action input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.date-field .date-native { position: absolute; right: 0; bottom: 0; width: var(--fa-w); height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* ---- Foto de perfil editável (avatar_field) ---- */
.avatar-box { --avatar-size: 112px; width: var(--avatar-size); height: var(--avatar-size); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; background: var(--ax-violet-100, var(--bs-tertiary-bg)); color: var(--ax-violet-text, var(--bs-primary)); font-weight: 700; font-size: calc(var(--avatar-size) * .34); flex-shrink: 0; border: 2px solid var(--ax-surface, var(--bs-body-bg)); box-shadow: var(--ax-shadow-xs, none); }
.avatar-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-circle { border-radius: 50%; } .avatar-rounded { border-radius: 22%; } .avatar-square { border-radius: 0; }
.avatar-pick { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; line-height: 0; }
.avatar-pick:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 2px; }
.avatar-pencil { position: absolute; right: 2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bs-primary); color: #fff; font-size: .8rem; border: 2px solid var(--ax-surface, var(--bs-body-bg)); line-height: 1; }
.avatar-crop canvas { max-width: 100%; touch-action: none; cursor: grab; border-radius: 12px; border: 1px solid var(--bs-border-color); }

/* ---- Topo: sino de notificações e avatar do usuário ---- */
.user-btn { line-height: 0; } .user-btn:focus-visible { outline: 3px solid var(--bs-primary); outline-offset: 2px; }
.user-btn .avatar { width: 2.25rem; height: 2.25rem; }
.bell-btn { height: 36px; min-width: 36px; }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bs-danger); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--ax-surface, var(--bs-body-bg)); box-sizing: content-box; }
.bell-menu { width: 22rem; max-width: calc(100vw - 24px); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-item { display: flex; gap: 12px; padding: 10px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--ax-border, var(--bs-border-color)); }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--ax-hover, var(--bs-tertiary-bg)); color: inherit; }
.bell-item > i { font-size: 1.1rem; color: var(--ax-violet-icon, var(--bs-primary)); margin-top: 2px; }
.bell-item.unread { background: var(--ax-violet-50, var(--bs-tertiary-bg)); }
.bell-item.unread .fw-semibold::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bs-primary); margin-left: 6px; vertical-align: middle; }
.bell-time { font-size: .72rem; color: var(--ax-text-3, var(--bs-secondary-color)); }

/* layout fixo: foto de um lado, botões e texto do outro, nunca quebra de linha quando o texto muda */
.avatar-field-edit { display: flex; flex-wrap: nowrap; align-items: center; gap: 16px; }
.avatar-field-edit .avatar-pick { flex: 0 0 auto; }
.avatar-side { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1 1 0; min-width: 0; }
@media (max-width: 400px) { .avatar-field-edit .avatar-box { --avatar-size: 88px !important; } }

/* ---- Tom Select (select com busca e HTML): segue os temas light/dark/night e a cor primária da Plataforma ---- */
.ts-wrapper { --ts-focus: color-mix(in srgb, var(--bs-primary) 25%, transparent); }
.ts-wrapper.form-control { background-image: none; } /* o form-select mantém a seta do Bootstrap (segue os temas) */
.ts-wrapper.form-select-sm .ts-control { min-height: calc(1.5em + .5rem + 2px); padding-top: .25rem; padding-bottom: .25rem; font-size: .875rem; }
.ts-wrapper.w-auto { min-width: 9rem; }
.ts-wrapper .ts-control, .ts-wrapper.single.input-active .ts-control { background-color: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--bs-border-color); }
.ts-wrapper .ts-control > input { color: var(--bs-body-color); }
.ts-wrapper .ts-control > input::placeholder, .ts-wrapper .ts-control .ts-placeholder { color: var(--bs-secondary-color); }
.ts-wrapper.focus .ts-control, .ts-wrapper.dropdown-active .ts-control { border-color: var(--bs-primary); box-shadow: 0 0 0 .25rem var(--ts-focus); }
.ts-wrapper.is-invalid .ts-control { border-color: var(--bs-form-invalid-border-color, var(--bs-danger)); }
.ts-wrapper.is-invalid.focus .ts-control { box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--bs-danger) 25%, transparent); }
.ts-wrapper.disabled .ts-control { background-color: var(--bs-secondary-bg); opacity: .75; }
.ts-dropdown { background: var(--bs-body-bg); color: var(--bs-body-color); border: 1px solid var(--bs-border-color); box-shadow: var(--ax-shadow, 0 .5rem 1rem rgba(0, 0, 0, .15)); z-index: 2000; }
.ts-dropdown .ts-dropdown-content { max-height: min(320px, 50vh); }
.ts-dropdown .option, .ts-dropdown .no-results, .ts-dropdown .create { padding: .45rem .75rem; }
.ts-dropdown .option i.bi { display: inline-block; width: 1.4em; text-align: center; margin-right: .35rem; color: var(--bs-primary); }
.ts-control .item i.bi { margin-right: .35rem; color: var(--bs-primary); }
.ts-dropdown .optgroup-header { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: .4rem .75rem; }
.ts-dropdown .active { background-color: color-mix(in srgb, var(--bs-primary) 12%, var(--bs-body-bg)); color: var(--bs-body-color); }
.ts-dropdown .active.create { color: var(--bs-body-color); }
.ts-dropdown .dropdown-input { background: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--bs-border-color); }
.ts-dropdown .dropdown-input-wrap { padding: .5rem; }
.ts-wrapper.multi .ts-control > div { background: color-mix(in srgb, var(--bs-primary) 14%, var(--bs-body-bg)); color: var(--bs-body-color); border: 1px solid color-mix(in srgb, var(--bs-primary) 30%, transparent); border-radius: 999px; padding: .1rem .6rem; }
.ts-wrapper.multi .ts-control > div.active { background: var(--bs-primary); color: #fff; }
.ts-wrapper.multi .ts-control > div .remove { border-left-color: transparent; color: inherit; }
.ts-wrapper.multi .ts-control > div .remove:hover { background: transparent; opacity: .7; }
@media (max-width: 575.98px) { .ts-dropdown .option { padding: .6rem .75rem; } .ts-dropdown .ts-dropdown-content { max-height: 45vh; } }
.icon-select { min-width: 14rem; }

/* Configurar Site: cartões de escolha de layout (miniatura pequena + radio ao lado) */
.layout-pick { display: flex; align-items: center; gap: .75rem; height: 100%; padding: .6rem; border: 2px solid var(--bs-border-color); border-radius: var(--bs-border-radius-lg, .75rem); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.layout-pick:hover { border-color: var(--bs-primary); }
.layout-pick:has(input:checked) { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18); }
.layout-pick:has(input:focus-visible) { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.layout-pick img { flex: 0 0 auto; width: 120px; height: auto; max-width: 35%; border-radius: .4rem; border: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); }

/* ---- "Ver como" (Admin Master): faixa fixa embaixo, sempre visível ---- */
.imp-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2000; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #B4232C; color: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.25); }
.imp-bar .imp-sub { opacity: .85; font-size: .85em; }
body.has-imp { padding-bottom: 56px; }
@media (min-width: 992px) { body.has-imp .app-sidebar { bottom: 56px; height: calc(100dvh - 56px) !important; } }

/* flex filhos podem encolher: evita itens estourando o card */
.min-w-0 { min-width: 0; }
.lesson-row > .d-flex { flex-wrap: wrap; }
.lesson-row > .d-flex > .flex-grow-1 { flex: 1 1 12rem; }
.lesson-row > .d-flex > .d-flex.flex-shrink-0 { margin-left: auto; }
