:root {
    --lm-bg: #f5f7fb;
    --lm-surface: #ffffff;
    --lm-border: #e3e8ef;
    --lm-text: #172033;
    --lm-muted: #667085;
    --lm-primary: #2563eb;
    --lm-danger-soft: #fff1f2;
}

body {
    min-height: 100vh;
    background: var(--lm-bg);
    color: var(--lm-text);
}

.app-header {
    background: rgba(255, 255, 255, 0.96);
}

.brand-name {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lm-primary);
}

.brand-product {
    font-size: 1rem;
    font-weight: 700;
}

.metric-card,
.panel,
.login-card {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.metric-card {
    min-height: 164px;
    padding: 1.5rem;
}

.metric-label {
    color: var(--lm-muted);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-value {
    margin-top: 0.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.metric-note {
    margin-top: 0.75rem;
    color: var(--lm-muted);
    font-size: 0.875rem;
}

.attention-card {
    background: var(--lm-danger-soft);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--lm-border);
}

.empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    place-items: center;
    border-radius: 50%;
    background: #ecfdf3;
    color: #027a48;
    font-size: 1.5rem;
    font-weight: 800;
}

.login-wrapper {
    display: grid;
    min-height: calc(100vh - 130px);
    place-items: center;
}

.login-card {
    width: min(100%, 460px);
    padding: 2rem;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: 270px;
    min-height: 100vh;
    padding: 1.5rem;
    background: #ffffff;
    border-right: 1px solid var(--lm-border);
    z-index: 100;
}

.sidebar-brand {
    padding: 0.5rem 0.75rem 1.75rem;
}

.sidebar-nav {
    flex: 1;
}

.nav-section-label {
    margin: 0 0.75rem 0.5rem;
    color: var(--lm-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-link {
    display: block;
    margin-bottom: 0.25rem;
    padding: 0.75rem;
    border-radius: 0.65rem;
    color: var(--lm-text);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover {
    background: #f2f4f7;
    color: var(--lm-text);
}

.sidebar-link.active {
    background: #eff6ff;
    color: var(--lm-primary);
}

.sidebar-link.disabled {
    color: #98a2b3;
    cursor: default;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--lm-border);
}

.sidebar-user {
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.app-main {
    width: calc(100% - 270px);
    min-height: 100vh;
    margin-left: 270px;
}

.topbar {
    display: flex;
    min-height: 76px;
    align-items: center;
    padding: 0 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--lm-border);
}

.topbar-product {
    font-weight: 700;
}

.content-area {
    padding: 2rem;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.page-eyebrow {
    margin-bottom: 0.5rem;
    color: var(--lm-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    font-weight: 800;
}

.page-description {
    margin-bottom: 0;
    color: var(--lm-muted);
}

.form-panel {
    overflow: hidden;
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.form-section {
    padding: 1.75rem;
    border-bottom: 1px solid var(--lm-border);
}

.form-section-title {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 800;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    background: #fafbfc;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-active {
    background: #ecfdf3;
    color: #027a48;
}

.status-inactive {
    background: #f2f4f7;
    color: #475467;
}

.table > :not(caption) > * > * {
    padding: 1rem 1.5rem;
    border-color: var(--lm-border);
}

.table thead th {
    background: #fafbfc;
    color: var(--lm-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

@media (max-width: 991.98px) {
    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .app-shell {
        display: block;
    }

    .app-main {
        width: 100%;
        margin-left: 0;
    }

    .page-heading {
        flex-direction: column;
    }

    .content-area {
        padding: 1.25rem;
    }
}

.detail-list {
    padding: 0.5rem 1.5rem 1.5rem;
}

.detail-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--lm-border);
}

.detail-item:last-child {
    border-bottom: 0;
}

.detail-label {
    margin-bottom: 0.35rem;
    color: var(--lm-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.detail-value {
    color: var(--lm-text);
    font-weight: 600;
}

.detail-notes {
    font-weight: 400;
    white-space: pre-line;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.metric-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.metric-link:hover {
    color: inherit;
    transform: translateY(-2px);
    border-color: #bfdbfe;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.status-card {
    min-height: 150px;
}

.status-healthy {
    background: #f0fdf4;
}

.status-warning {
    background: #fffbeb;
}

.status-critical {
    background: #fff1f2;
}

.status-offline {
    background: #f8fafc;
}

.status-late {
    background: #fff7ed;
}

.status-retired {
    background: #fef3f2;
    color: #b42318;
}

.metric-status {
    margin-top: 0.75rem;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
}

.status-critical-badge {
    background: #fff1f2;
    color: #be123c;
}

.status-warning-badge {
    background: #fffbeb;
    color: #b45309;
}