:root {
    --erp-bg: #f4f7fb;
    --erp-surface: #ffffff;
    --erp-border: #dbe3ef;
    --erp-text: #18212f;
    --erp-muted: #6b7280;
    --erp-sidebar: #111827;
    --erp-sidebar-border: rgba(255,255,255,0.08);
    --erp-primary: #2563eb;
}

html, body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--erp-bg);
    color: var(--erp-text);
}

body {
    margin: 0;
}

a {
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.main-shell {
    min-width: 0;
}

.sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: start;
    background: linear-gradient(180deg, #111827 0%, #0f172a 100%);
}

.nav-shell {
    min-height: 100vh;
}

.nav-stack .nav-link {
    border-radius: 0.9rem;
    padding: 0.8rem 0.95rem;
    transition: 0.2s ease;
}

.nav-stack .nav-link:hover,
.nav-stack .nav-link:focus {
    background: rgba(255,255,255,0.08);
}

.nav-link.active {
    background: rgba(255,255,255,0.16);
    border-radius: 0.9rem;
    font-weight: 600;
}

.top-bar {
    z-index: 1000;
}

.content-wrap {
    max-width: 1480px;
}

.card {
    border-color: var(--erp-border);
}

.stats-card .display-6 {
    font-size: 2rem;
    font-weight: 700;
}

.toolbar-card {
    border-style: dashed;
}

.log-box {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
    margin: 0;
}

.service-table-clean thead th {
    white-space: nowrap;
    background: #fff;
    box-shadow: inset 0 -1px 0 var(--erp-border);
}

.service-table-clean th,
.service-table-clean td {
    padding: 1rem 0.85rem;
    vertical-align: top;
}

.service-order-stack {
    display: inline-grid;
    gap: 0.5rem;
}

.service-name-cell {
    min-width: 220px;
}

.dependency-list {
    max-width: 220px;
    overflow-wrap: anywhere;
}

.status-cell {
    min-width: 180px;
}

.service-actions-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: flex-end;
}

.service-mobile-card .card-body {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(250,251,253,1) 100%);
}

.installed-grid-shell {
    max-height: 420px;
    background: #fbfcfe;
}

.installed-table thead th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.erp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1040;
}

.erp-modal-shell {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1050;
}

.erp-modal-card {
    width: min(720px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid var(--erp-border);
}

.erp-modal-card-lg {
    width: min(1040px, calc(100vw - 2rem));
}

.form-label {
    font-weight: 500;
}

.offcanvas .nav-shell {
    min-height: auto;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .content-wrap {
        padding-bottom: 5rem;
    }

    .service-actions-wrap {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .toolbar-card .card-body {
        padding: 1rem;
    }

    .erp-modal-shell {
        align-items: flex-end;
        padding: 0;
    }

    .erp-modal-card,
    .erp-modal-card-lg {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        border-radius: 1.25rem 1.25rem 0 0 !important;
        border-bottom: 0;
    }

    .stats-card .display-6 {
        font-size: 1.6rem;
    }
}

.host-action-card {
    border-color: var(--erp-border);
}

.host-action-card .card-body {
    min-height: 100%;
}

.host-action-card-accent {
    background: linear-gradient(180deg, rgba(37,99,235,0.04) 0%, rgba(255,255,255,0.98) 100%);
}

.console-command-box {
    display: inline-block;
    padding: 0.65rem 0.8rem;
    border-radius: 0.9rem;
    background: #0f172a;
    color: #e5e7eb;
    max-width: 100%;
    overflow-wrap: anywhere;
}
