/* Fox Default — layout sidebar profissional */

.fox-theme-default {
    --fox-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --fox-primary: #3b82f6;
    --fox-primary-dark: #2563eb;
    --fox-sidebar-bg: #0f172a;
    --fox-sidebar-border: #1e293b;
    --fox-sidebar-width: 252px;
    --fox-page-bg: #f1f5f9;
    --fox-surface: #ffffff;
    --fox-text: #0f172a;
    --fox-muted: #64748b;
    --fox-radius: 10px;
}

.fox-theme-default,
.fox-theme-default * {
    font-family: var(--fox-font) !important;
}

.fox-theme-default body,
.fox-theme-default.fox-shell-sidebar {
    background: var(--fox-page-bg);
    color: var(--fox-text);
}

/* ── Shell ── */
.fox-shell-sidebar {
    display: flex;
    min-height: 100vh;
}

.fox-sidebar {
    width: var(--fox-sidebar-width);
    flex-shrink: 0;
    background: var(--fox-sidebar-bg);
    border-right: 1px solid var(--fox-sidebar-border);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
}

.fox-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem 0.75rem;
}

.fox-main {
    flex: 1;
    margin-left: var(--fox-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.fox-topbar {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem 0;
}

.fox-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.fox-page-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
    color: var(--fox-muted);
}

.fox-topbar-head {
    flex: 1;
    min-width: 0;
}

.fox-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: var(--fox-surface);
    color: var(--fox-text);
    cursor: pointer;
    flex-shrink: 0;
}

.fox-sidebar-backdrop {
    display: none;
}

.fox-config-editor {
    font-size: 0.8125rem;
    line-height: 1.45;
    min-height: 240px;
}

.fox-log-viewer {
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    -webkit-overflow-scrolling: touch;
}

.fox-content {
    flex: 1;
    padding: 1.25rem 1.75rem 2rem;
}

.fox-footer {
    padding: 1rem 1.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--fox-muted);
    border-top: 1px solid #e2e8f0;
    background: var(--fox-surface);
}

/* ── Brand ── */
.fox-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: #f8fafc !important;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.25rem 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.fox-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--fox-primary);
    color: #fff;
}

.fox-brand-text {
    line-height: 1.2;
}

/* ── Nav ── */
.fox-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
}

.fox-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    color: #94a3b8 !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.fox-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9 !important;
}

.fox-nav-item.is-active {
    background: var(--fox-primary);
    color: #fff !important;
}

.fox-nav-icon {
    display: flex;
    width: 20px;
    height: 20px;
    opacity: 0.85;
}

.fox-nav-item.is-active .fox-nav-icon {
    opacity: 1;
}

.fox-nav-divider {
    height: 1px;
    background: #1e293b;
    margin: 0.5rem 0.75rem;
}

.fox-nav-section-label {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    font-weight: 600;
    opacity: 0.75;
}

.fox-nav-sub {
    padding-left: 1.35rem !important;
    font-size: 0.8125rem !important;
}

.fox-nav-sub .fox-nav-icon {
    width: 16px;
    height: 16px;
}

.fox-nav-accordion {
    margin: 0;
}

.fox-nav-accordion-trigger {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.fox-nav-accordion-trigger::-webkit-details-marker {
    display: none;
}

.fox-nav-accordion-chevron {
    margin-left: auto;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.6;
    transition: transform 0.15s ease;
}

.fox-nav-accordion[open] > .fox-nav-accordion-trigger .fox-nav-accordion-chevron {
    transform: rotate(-135deg);
    margin-top: 0.2rem;
}

.fox-nav-accordion-body {
    padding-left: 0.35rem;
}

.fox-nav-accordion-body .fox-nav-sub {
    padding-left: 1.75rem !important;
}

.fox-sidebar-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #1e293b;
}

/* ── User bar ── */
.fox-user-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fox-lang-btn {
    width: 100%;
    border: 1px solid #334155;
    background: transparent;
    color: #cbd5e1;
    border-radius: 8px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-align: left;
}

.fox-user-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.25rem;
}

.fox-user-name {
    font-size: 0.8125rem;
    color: #94a3b8;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fox-logout {
    color: #64748b;
    display: flex;
}

.fox-logout:hover {
    color: #f1f5f9;
}

/* ── Cards & UI ── */
.fox-theme-default .card {
    border: 1px solid #e2e8f0;
    border-radius: var(--fox-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fox-theme-default .subheader {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fox-muted);
}

.fox-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: var(--fox-radius);
    background: var(--fox-surface);
    border: 1px solid #e2e8f0;
    color: var(--fox-text) !important;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fox-action-btn:hover {
    border-color: var(--fox-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    color: var(--fox-primary-dark) !important;
}

.fox-theme-default .btn-primary {
    background: var(--fox-primary);
    border-color: var(--fox-primary);
    font-weight: 500;
}

.fox-theme-default .btn-primary:hover {
    background: var(--fox-primary-dark);
    border-color: var(--fox-primary-dark);
}

/* ── Auth ── */
.fox-auth-default .fox-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
    padding: 1.5rem;
}

.fox-auth-default .fox-auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--fox-surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.fox-auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin: 1rem 0 0.25rem;
}

.fox-auth-sub {
    text-align: center;
    color: var(--fox-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.fox-brand-center {
    justify-content: center;
    color: var(--fox-text) !important;
}

.fox-brand-center .fox-brand-mark {
    width: 48px;
    height: 48px;
}

/* ── Shared utilities ── */
.datagrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.datagrid-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fox-muted);
    margin-bottom: 0.25rem;
}

.datagrid-content {
    font-weight: 500;
}

.fox-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.fox-flash {
    margin-bottom: 1rem;
}

/* Status badges — texto claro sobre fundo colorido */
.fox-theme-default .badge.fox-status-badge,
.fox-theme-default .badge.bg-success,
.fox-theme-default .badge.bg-danger,
.fox-theme-default .badge.bg-info,
.fox-theme-default .badge.bg-primary {
    color: #fff !important;
}

.fox-theme-default .badge.bg-warning.fox-status-badge {
    color: #1e293b !important;
}

.fox-theme-default .badge.bg-secondary.fox-status-badge {
    color: #fff !important;
    background-color: #64748b !important;
}

.fox-theme-neumorphism .badge.fox-status-badge,
.fox-theme-neumorphism .badge.bg-success,
.fox-theme-neumorphism .badge.bg-danger,
.fox-theme-neumorphism .badge.bg-info,
.fox-theme-neumorphism .badge.bg-primary {
    color: #fff !important;
}

@media (max-width: 991px) {
    .fox-sidebar-toggle {
        display: inline-flex;
    }

    .fox-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    body.fox-sidebar-open .fox-sidebar {
        transform: translateX(0);
    }

    .fox-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 99;
    }

    body.fox-sidebar-open .fox-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .fox-main {
        margin-left: 0;
    }

    .fox-content {
        padding: 1rem 1rem 1.5rem;
    }

    .fox-nav-item {
        min-height: 44px;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }
}
