/**
 * DI Connector overrides on top of Fila theme.
 * Safe layer for branding without editing vendor style.css.
 */

/* Keep Fila shell typography consistent when app pages override body fonts */
.sidebar-area,
.sidebar-area .logo-text,
.sidebar-area .menu-title-text,
.sidebar-area .menu-link .title,
.header-area,
.fila-topnav {
    font-family: "Outfit", sans-serif;
}

#preloader.is-hidden {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
}

.fila-dev-banner {
    border: 1px dashed #0d6efd;
    background: #f0f6ff;
    border-radius: 10px;
}

.fila-dev-banner .badge {
    font-weight: 600;
}

.default-table-area .table thead th {
    white-space: nowrap;
}

/* App page content inside Fila shell */
.app-page-content {
    width: 100%;
}

.app-page-content .app-shell {
    width: 100%;
    padding: 0;
}

.app-page-content .app-card {
    border: 1px solid #eceef3;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

.app-page-content .workflow-shell {
    max-width: none;
    padding: 0;
}

/* Sidebar submenu visibility (Tools / Admin level-2 menus) */
#layout-menu.menu-vertical .menu-item:not(.open) > .menu-sub {
    display: none !important;
}

#layout-menu.menu-vertical .menu-item.open > .menu-sub {
    display: flex !important;
    flex-direction: column;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    overflow: visible;
}

#layout-menu .menu-link.menu-toggle {
    cursor: pointer;
}

#layout-menu button.menu-link {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: inherit;
    font: inherit;
    color: inherit;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

/* ------------------------------------------------------------------ */
/* Top navigation layout (full-width content, no sidebar offset)       */
/* ------------------------------------------------------------------ */

body.fila-layout-topnav .main-content,
body.fila-layout-topnav .main-content-topnav {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-top: 0;
    min-height: 100vh;
}

body.fila-layout-topnav .main-content .inner-main-content {
    padding-right: 0;
    min-height: auto;
    justify-content: flex-start;
}

body.fila-layout-topnav .fila-shell-fluid {
    padding-left: 12px;
    padding-right: 12px;
}

body.fila-layout-topnav .main-content-container {
    width: 100%;
    max-width: 100%;
}

body.fila-layout-topnav .app-page-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

body.fila-layout-topnav .footer-area {
    margin-top: 0;
}

body.fila-layout-topnav {
    padding-bottom: 68px;
}

.fila-app-footer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 9999;
    margin-top: 0 !important;
    border: 0 !important;
    border-top: 3px solid #0d6efd !important;
    border-radius: 0 !important;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.12);
    background-color: #fff !important;
}

.fila-app-footer-inner {
    padding: 5px 16px 6px;
    font-size: 0.72rem;
    line-height: 1.2;
}

.fila-app-footer-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
}

.fila-app-footer-line-2 {
    justify-content: center;
    margin-top: 3px;
    font-size: 0.71rem;
}

.fila-app-footer-brand,
.fila-app-footer-credits {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.fila-app-footer-versions {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
    font-weight: 600;
}

.fila-app-footer-sep {
    margin: 0 6px;
    color: #94a3b8;
}

.fila-app-footer-tier3 {
    white-space: nowrap;
}

.fila-app-footer-einvoicing {
    color: #0b5d2a !important;
}

.fila-app-footer-einvoicing:hover {
    color: #084421 !important;
}

.fila-app-footer-tier3-link {
    color: #c41e3a !important;
}

.fila-app-footer-tier3-link:hover {
    color: #9e1830 !important;
}

.fila-app-footer-logo {
    height: 20px;
    width: auto;
}

.fila-app-footer-ai-logo {
    height: 18px;
    width: auto;
}

body.fila-layout-topnav .main-content {
    padding-bottom: 0;
}

@media (max-width: 991.98px) {
    .fila-app-footer-line {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .fila-app-footer-brand,
    .fila-app-footer-credits,
    .fila-app-footer-versions {
        flex: 1 1 100%;
        justify-content: center;
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    body.fila-layout-topnav {
        padding-bottom: 0;
    }

    .fila-app-footer {
        position: static !important;
        box-shadow: none;
        margin-top: 1rem !important;
    }
}

.fila-topnav {
    margin-top: 12px;
    margin-bottom: 12px;
    padding-top: 6px;
    padding-bottom: 6px;
    z-index: 1030;
    box-shadow: rgba(100, 100, 111, 0.08) 0px 4px 18px 0px;
}

.fila-topnav-brand .fw-semibold {
    font-size: 15px;
}

.fila-topnav .fila-nav-link,
.fila-topnav button.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    border-radius: 8px;
    padding: 8px 12px;
    white-space: nowrap;
}

.fila-topnav .fila-nav-link .fila-nav-icon {
    font-size: 18px;
    line-height: 1;
}

.fila-topnav .fila-nav-link:hover,
.fila-topnav .fila-nav-link:focus {
    color: #0d6efd;
    background-color: #f4f6fc;
}

.fila-topnav .fila-nav-link.active {
    color: #0d6efd;
    background-color: #eaf4ff;
}

.fila-topnav .dropdown-menu {
    border-radius: 10px;
    padding: 8px;
    min-width: 220px;
}

.fila-topnav .dropdown-item {
    border-radius: 6px;
    font-size: 14px;
    padding: 8px 12px;
}

.fila-topnav .dropdown-item:hover,
.fila-topnav .dropdown-item:focus {
    background-color: #f4f6fc;
    color: #0d6efd;
}

.fila-topnav-meta .switch-toggle .material-symbols-outlined {
    font-size: 20px;
    color: #475569;
    cursor: pointer;
}

.fila-topnav-company {
    pointer-events: none;
    white-space: nowrap;
}

.fila-topnav-user::after {
    margin-left: 0.35em;
}

@media (max-width: 1199.98px) {
    .fila-topnav .navbar-collapse {
        padding-top: 8px;
        padding-bottom: 4px;
    }

    .fila-topnav-links {
        border-bottom: 1px solid #eceef3;
        margin-bottom: 8px !important;
        padding-bottom: 4px;
    }

    .fila-topnav-meta {
        padding-top: 4px;
    }
}

[data-theme=dark] .fila-topnav {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme=dark] .fila-topnav .fila-nav-link {
    color: #cbd5e1;
}

[data-theme=dark] .fila-topnav .fila-nav-link:hover,
[data-theme=dark] .fila-topnav .fila-nav-link.active {
    color: #60a5fa;
    background-color: rgba(96, 165, 250, 0.12);
}

[data-theme=dark] .fila-topnav .dropdown-menu {
    background-color: #1e293b;
}

[data-theme=dark] .fila-topnav .dropdown-item {
    color: #e2e8f0;
}

[data-theme=dark] .fila-topnav .dropdown-item:hover {
    background-color: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
}

/* Dashboard */
body.fila-layout-topnav .main-content-container:has(.dashboard-page) {
    overflow: visible !important;
}

.dashboard-page {
    width: 100%;
    overflow: visible;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-kpi-sparkline-card {
    border: 1px solid #eceef3 !important;
    box-shadow: none;
    overflow: hidden;
}

.dashboard-kpi-sparkline-card .flex-grow-1 {
    min-height: 115px;
}

.dashboard-kpi-sparkline-host {
    position: relative;
    width: 100%;
    max-width: 180px;
    height: 115px;
    margin-left: auto;
    margin-right: -5px;
}

.dashboard-welcome-card {
    border: none !important;
    overflow: hidden;
}

.dashboard-welcome-card .dashboard-welcome-logo {
    max-height: 140px;
    max-width: 100%;
    object-fit: contain;
    opacity: 0.95;
}

.dashboard-welcome-card .dashboard-welcome-sparkline {
    position: relative;
    max-width: 220px;
    height: 100px;
    margin-top: 8px;
}

.dashboard-welcome-card-compact {
    border: none !important;
}

.dashboard-welcome-card-compact h2 {
    margin-bottom: 0 !important;
}

.dashboard-recent-table thead th {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #eceef3;
    white-space: nowrap;
}

.dashboard-recent-table td {
    font-size: 14px;
    vertical-align: middle;
}

.dashboard-widget-grid .dashboard-widget-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    border: 1px solid #eceef3 !important;
    box-shadow: none;
}

.dashboard-widget-chart {
    min-height: 120px;
}

.dashboard-apex-host-widget {
    min-height: 120px;
    margin-bottom: -4px;
}

.dashboard-apex-gauge {
    min-height: 130px;
    max-height: 150px;
    margin-top: 0;
}

.dashboard-sale-donut-wrap-sm {
    height: 110px;
    max-width: 110px;
    width: 100%;
}

.dashboard-sale-legend-compact .dashboard-sale-legend-item {
    border-bottom: 0;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

@media (max-width: 1199.98px) {
    .dashboard-stats-grid,
    .dashboard-widget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .dashboard-stats-grid,
    .dashboard-widget-grid,
    .dashboard-charts-grid,
    .dashboard-tables-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-apex-host {
    width: 100%;
    min-height: 200px;
}

.dashboard-apex-host-gradient {
    min-height: 225px;
    margin-bottom: -8px;
}

.dashboard-apex-host-lg {
    min-height: 320px;
}

.dashboard-sale-donut-wrap {
    position: relative;
    height: 220px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.dashboard-sale-donut-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.dashboard-sale-icon-wrap {
    width: 44px;
    height: 44px;
    line-height: 44px;
    background-color: #f4f6fc;
}

.dashboard-sale-legend-item {
    border-bottom: 1px dashed #eceef3;
}

.dashboard-sale-legend-item:last-child {
    border-bottom: 0;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 16px;
}

.dashboard-tables-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 16px;
}

.dashboard-chart-host {
    position: relative;
    min-height: 320px;
    height: 320px;
    width: 100%;
    overflow: visible;
}

.dashboard-chart-host canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
}

.dashboard-chart-host-sm {
    min-height: 240px;
    height: 240px;
}

.dashboard-page .dashboard-stat-card {
    border: 1px solid #eceef3 !important;
    box-shadow: none;
}

.dashboard-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-stat-icon .material-symbols-outlined {
    font-size: 22px;
}

.dashboard-page .default-table-area .table thead th {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #eceef3;
}

.dashboard-page .default-table-area .table td {
    font-size: 14px;
    vertical-align: middle;
}

.bg-primary-70 { background: rgba(13, 110, 253, 0.12); }
.bg-success-70 { background: rgba(25, 135, 84, 0.12); }
.bg-warning-70 { background: rgba(255, 193, 7, 0.18); }
.bg-info-70 { background: rgba(13, 202, 240, 0.12); }
