/* Layout geral */
:root {
    --sidebar-width: 240px;
    --accent: #2b6cb0;
    --bg: #f7fafc;
    --text: #1a202c;
    --btn-bg: #ffffff;
    --btn-border: #e2e8f0;

    /* Admin */
    --admin-sidebar-bg: #1e293b;
    --admin-sidebar-text: #cbd5e1;
    --admin-sidebar-text-muted: #64748b;
    --admin-sidebar-active-bg: rgba(255,255,255,0.08);
    --admin-sidebar-active-text: #f1f5f9;
    --admin-sidebar-hover-bg: rgba(255,255,255,0.05);
    --admin-sidebar-section: #475569;
    --admin-sidebar-brand-bg: #0f172a;
    --admin-content-bg: #f1f5f9;
    --admin-topbar-bg: #ffffff;
    --admin-topbar-border: #e2e8f0;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ============================
   ACCOUNT / AUTH LAYOUT
   ============================ */
.account-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 45%, #0f172a 100%);
    padding: 2rem 1rem;
}

.account-layout-inner {
    width: 100%;
    max-width: 460px;
}

/* ============================
   ADMIN LAYOUT
   ============================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Brand */
.admin-sidebar-brand {
    background: var(--admin-sidebar-brand-bg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    min-height: 64px;
}

.admin-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-brand-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-brand-sub {
    font-size: 0.7rem;
    color: var(--admin-sidebar-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-sidebar-toggle {
    background: none;
    border: none;
    color: var(--admin-sidebar-text);
    font-size: 1.4rem;
    padding: 0;
    cursor: pointer;
}

/* Nav */
.admin-nav {
    padding: 0.75rem 0;
}

.admin-nav-section {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--admin-sidebar-section);
    font-weight: 600;
}

.admin-nav-item {
    padding: 0 0.5rem;
    margin-bottom: 2px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.admin-nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.75;
}

.admin-nav-link:hover {
    background: var(--admin-sidebar-hover-bg);
    color: var(--admin-sidebar-active-text);
}

.admin-nav-link:hover i {
    opacity: 1;
}

.admin-nav-link.active {
    background: var(--admin-sidebar-active-bg);
    color: var(--admin-sidebar-active-text);
}

.admin-nav-link.active i {
    opacity: 1;
    color: #60a5fa;
}

.admin-nav-link-danger {
    color: #fca5a5 !important;
}

.admin-nav-link-danger:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #f87171 !important;
}

/* Footer */
.admin-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.75rem 0.5rem 0.5rem;
}

.admin-sidebar-credit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 0.7rem;
    color: var(--admin-sidebar-section);
}

/* Content area */
.admin-content {
    flex: 1;
    min-width: 0;
    background: var(--admin-content-bg);
    display: flex;
    flex-direction: column;
}

/* Mobile topbar — hidden on desktop, shown on mobile */
.admin-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--admin-sidebar-brand-bg);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    align-items: center;
    padding: 0 0.875rem;
    gap: 0.75rem;
    z-index: 1030;
    box-shadow: 0 1px 8px rgba(0,0,0,0.25);
}

.admin-topbar-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #e2e8f0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.admin-topbar-toggle:hover,
.admin-topbar-toggle:active {
    background: rgba(255,255,255,0.15);
}

.admin-topbar-brand {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
}

.admin-topbar-user {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.45rem;
    text-decoration: none;
    border-radius: 50%;
    flex-shrink: 0;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.admin-topbar-user:hover {
    color: #f1f5f9;
}

/* Backdrop overlay */
.admin-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

/* Page */
.admin-page {
    padding: 1.5rem;
    flex: 1;
}

/* Page Header — padrão uniforme */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.admin-page-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-page-header h3 i {
    color: var(--accent);
}

/* Table card padrão */
.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}

.admin-card .table {
    margin-bottom: 0;
}

.admin-card .table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.75rem 1rem;
}

.admin-card .table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.admin-card .table tbody tr:hover {
    background: #f8fafc;
}

/* Empty state */
.admin-empty {
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
}

.admin-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Loading state */
.admin-loading {
    text-align: center;
    padding: 3rem;
}

/* Alert bar */
.admin-alert {
    border-radius: 10px;
    border: none;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

/* Breadcrumb */
.admin-breadcrumb {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

/* Section header (inside form pages) */
.admin-section-header {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

/* ============================
   ADMIN FORM SYSTEM (af-*)
   ============================ */

.af-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
}

.af-section {
    background: white;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}

.af-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    padding: .7rem 1rem .65rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.af-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .875rem;
}

/* Responsive grid — collapses to 1 col on mobile */
.af-grid {
    display: grid;
    gap: .875rem;
}
.af-grid-2 { grid-template-columns: 1fr 1fr; }
.af-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.af-grid-3-1 { grid-template-columns: 3fr 1fr; }
.af-grid-1-3 { grid-template-columns: 1fr 3fr; }
.af-grid-2-1 { grid-template-columns: 2fr 1fr; }

@media (max-width: 575px) {
    .af-grid-2, .af-grid-3, .af-grid-3-1, .af-grid-1-3, .af-grid-2-1 {
        grid-template-columns: 1fr;
    }
}

/* Field label */
.af-label {
    font-size: .78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: .3rem;
    display: block;
}
.af-label .req { color: #ef4444; margin-left: 2px; }

/* Helper text below input */
.af-hint {
    font-size: .72rem;
    color: #94a3b8;
    margin-top: .25rem;
    line-height: 1.4;
}

/* Inputs taller for touch */
.af-form .form-control,
.af-form .form-select {
    min-height: 44px;
    border-radius: 10px;
    border-color: #e2e8f0;
    font-size: .875rem;
}
.af-form .form-control:focus,
.af-form .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.af-form textarea.form-control { min-height: unset; }

/* Toggle/switch row */
.af-switch {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    cursor: pointer;
    user-select: none;
}
.af-switch input[type=checkbox] {
    width: 40px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}
.af-switch-label {
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.3;
}
.af-switch-sub {
    font-size: .75rem;
    color: #94a3b8;
}

/* Action bar — sticky on mobile */
.af-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    padding: .875rem 0 .25rem;
}
.af-actions .af-del { margin-left: auto; }

@media (max-width: 767px) {
    .af-actions {
        position: sticky;
        bottom: 0;
        background: #f1f5f9;
        margin: 0 -1rem;
        padding: .875rem 1rem;
        border-top: 1px solid #e2e8f0;
        z-index: 20;
    }
}

/* Image preview box */
.af-img-preview {
    width: 100%;
    aspect-ratio: 16/9;
    max-height: 180px;
    border-radius: 10px;
    border: 1.5px dashed #e2e8f0;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: .5rem;
}
.af-img-preview img { width: 100%; height: 100%; object-fit: cover; }
.af-img-preview i { font-size: 2rem; color: #cbd5e1; }

/* Validation */
.af-form .invalid-feedback { font-size: .75rem; }

/* ============================
   PORTAL — perfil e detalhe
   ============================ */

/* Cabeçalho do perfil */
.portal-profile-header {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.75rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.portal-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -1px;
}

.portal-profile-info {
    flex: 1;
    min-width: 0;
}

.portal-profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.portal-profile-nick {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 2px;
}

.portal-profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

/* Card de informações */
.portal-info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 1rem;
}

.portal-info-card-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.portal-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f8fafc;
    font-size: 0.875rem;
}

.portal-info-row:last-child {
    border-bottom: none;
}

.portal-info-row i {
    width: 18px;
    text-align: center;
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.portal-info-label {
    font-size: 0.75rem;
    color: #94a3b8;
    min-width: 90px;
    flex-shrink: 0;
}

.portal-info-value {
    color: #1e293b;
    font-weight: 500;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Card de moto */
.portal-moto-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-moto-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Cabeçalho do grupo */
.portal-group-header {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    padding: 1.75rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

@media (max-width: 575.98px) {
    .portal-profile-header,
    .portal-group-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .portal-profile-badges {
        justify-content: center;
    }

    .portal-avatar-lg {
        width: 80px;
        height: 80px;
    }

    .portal-info-label {
        min-width: 70px;
    }
}

/* ============================
   ADMIN LIST — substitui tabelas
   ============================ */
.admin-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}

.admin-list-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.75rem;
    transition: background 0.12s;
}

.admin-list-item:last-child {
    border-bottom: none;
}

.admin-list-item:hover {
    background: #f8fafc;
}

/* Avatar colorido */
.admin-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    flex-shrink: 0;
}

.admin-list-avatar.av-blue   { background: #dbeafe; color: #1d4ed8; }
.admin-list-avatar.av-green  { background: #dcfce7; color: #15803d; }
.admin-list-avatar.av-purple { background: #ede9fe; color: #6d28d9; }
.admin-list-avatar.av-orange { background: #ffedd5; color: #c2410c; }
.admin-list-avatar.av-slate  { background: #f1f5f9; color: #475569; }
.admin-list-avatar.av-rose   { background: #ffe4e6; color: #be123c; }
.admin-list-avatar.av-teal   { background: #ccfbf1; color: #0f766e; }
.admin-list-avatar.av-indigo { background: #e0e7ff; color: #4338ca; }

/* Corpo do item */
.admin-list-body {
    flex: 1;
    min-width: 0;
}

.admin-list-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-list-meta {
    font-size: 0.79rem;
    color: #64748b;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.admin-list-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex-shrink: 0;
    justify-content: flex-end;
}

/* Ações */
.admin-list-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.admin-list-actions .btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

@media (max-width: 575.98px) {
    .admin-list-item {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .admin-list-badges {
        order: 4;
        width: 100%;
        padding-left: 52px;
        justify-content: flex-start;
    }

    .admin-list-actions {
        margin-left: auto;
    }

    .admin-list-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
}

/* ============================
   MENU TREE (admin) — drag-and-drop
   ============================ */
.menu-tree-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.menu-tree {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
}

.menu-tree-empty {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    padding: 1rem;
}

.menu-tree-row {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.6rem;
    background: white;
    cursor: grab;
    transition: background 0.12s, opacity 0.12s;
}

.menu-tree-row:hover {
    background: #f8fafc;
}

.menu-tree-row.dragging {
    opacity: 0.4;
}

.menu-tree-row.nest-hover {
    outline: 2px dashed #6366f1;
    outline-offset: -2px;
    background: #eef2ff;
}

.menu-tree-handle {
    color: #cbd5e1;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.menu-tree-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.menu-tree-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-tree-badges {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.menu-tree-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.menu-tree-actions .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.menu-tree-children {
    border-bottom: 1px solid #f1f5f9;
}

.menu-tree-dropzone {
    height: 4px;
}

.menu-tree-dropzone.drag-active {
    height: 10px;
    border-top: 2px dashed #cbd5e1;
    margin: 1px 0;
}

.menu-tree-dropzone.drag-active.hover-target {
    border-top-color: #6366f1;
    background: #eef2ff;
}

/* ============================
   RESPONSIVE — MOBILE FIRST
   ============================ */
@media (max-width: 991.98px) {
    /* Show mobile topbar */
    .admin-topbar {
        display: flex;
    }

    /* Backdrop visible when sidebar open */
    .admin-layout.sidebar-open .admin-backdrop {
        display: block;
    }

    /* Sidebar as slide-in drawer */
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 272px;
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
    }

    .admin-layout.sidebar-open .admin-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 32px rgba(0, 0, 0, 0.35);
    }

    /* Content: account for fixed topbar */
    .admin-content {
        margin-left: 0;
        padding-top: 56px;
    }

    /* More breathing room */
    .admin-page {
        padding: 1rem;
    }

    /* Page header stacks on mobile */
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Touch-friendly nav links */
    .admin-nav-link {
        min-height: 48px;
        padding: 0.75rem 0.875rem;
        font-size: 0.925rem;
    }

    /* Tighter table cells on small screens */
    .admin-card .table thead th,
    .admin-card .table tbody td {
        padding: 0.6rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Form actions — full width on mobile */
    .admin-form-actions {
        flex-direction: column;
    }

    .admin-form-actions .btn {
        width: 100%;
    }
}

@media (min-width: 992px) {
    /* Ensure sidebar is always visible on desktop — override any transform */
    .admin-sidebar {
        transform: none !important;
        position: sticky;
    }

    /* No backdrop on desktop */
    .admin-backdrop {
        display: none !important;
    }
}

body, html {
    height: 100%;
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
}

.top-row{
    background-color:unset !important;
}

/* Splash */
.splash {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    text-align: center;
}

.splash-logo {
    width: 220px;
    max-width: 45%;
    transition: transform .5s ease;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.button-group.site {
    margin-top: 8px;
}

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--btn-border);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 2px 6px rgba(16,24,40,0.03);
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(16,24,40,0.08);
}

/* Site layout */
.site-layout {
    display: flex;
    min-height: 40vh;
    flex-direction: column;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 12px;
    box-sizing: border-box;
}

/* logo centralizada verticalmente */
.sidebar-logo {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    max-width: 140px;
    width: 100%;
}

/* Menu embaixo da logo (pode ficar centrado tamb�m) */
.sidebar-nav {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.nav-item {
    display: block;
    padding: 10px 14px;
    color: var(--text);

    text-decoration: none;
    border-radius: 8px;
}

.nav-item:hover {
    background: rgba(43,108,176,0.08);
    color: var(--accent);
}

/* Conte�do principal */
.main-content {
    flex: 0 0 auto;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    
}

.content-panel {
    max-width: 980px;
    margin: 0 auto;
}

.video-overlay {
      position: fixed;
      inset: 0;
      z-index: 0;
      background: rgba(0,0,0,0.25);
      pointer-events: none;
  }

footer {
  flex: 1 0 auto;
}

@media (max-width: 900px) {
    .site-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 16px;
    }

    .sidebar-logo img {
        max-width: 100px;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 6px;
        margin-top: 0;
    }
}

/* ============================
   UTILITÁRIOS GLOBAIS
   ============================ */

/* Botão extra-pequeno para tabelas admin */
.btn-xs {
    padding: 0.2rem 0.45rem;
    font-size: 0.78rem;
    border-radius: 6px;
    line-height: 1.4;
}

/* ============================
   TIPOGRAFIA PÚBLICA
   ============================ */

/* Cabeçalho de página pública (substituição do .title/.subTitle) */
.pub-page-header {
    margin-bottom: 3rem;
}

.pub-page-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--bs-secondary, #fff);
}

.pub-page-subtitle {
    font-size: 1.05rem;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    margin-top: 0.4rem;
}

/* Divisor de seção interno nas páginas de detalhe */
.pub-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-primary, #000);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--bs-primary, #000);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* Card público — vidro semi-transparente sobre o fundo */
.pub-card {
    background: rgba(255,255,255,0.92);
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.4);
}

/* Hover nos cards de listagem */
.pub-card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.pub-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18) !important;
}

.pub-card-hover:hover img {
    transform: scale(1.04);
}

/* Feedback de toque (mobile não tem :hover) */
.pub-card-hover:active {
    transform: scale(0.98);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

/* Imagem de capa dos cards de listagem (grupos, membros) */
.pub-card-img {
    height: 260px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 575.98px) {
    .pub-page-header { margin-bottom: 1.75rem; }
    .pub-card-img { height: 200px; }
}

/* Hero de página de detalhe (capa em destaque) */
.detail-hero {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    height: 320px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

.detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.detail-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto;
    height: 38px;
    padding: 0 0.9rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.detail-back-btn:hover {
    background: rgba(0,0,0,0.65);
    opacity: 1;
}

.detail-back-btn.detail-back-btn-floating {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}

@media (max-width: 575.98px) {
    .detail-hero { height: 220px; border-radius: 0.75rem; }
}

/* ============================
   LIGHTBOX GLOBAL
   ============================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 0.5rem;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.gallery-thumb {
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    border-radius: 0.75rem;
    aspect-ratio: 1 / 1;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.2);
}

.gallery-thumb:active {
    transform: scale(0.97);
}