:root {
    --sidebar-width: 240px;
    --sidebar-bg: #0b4f79;
    --sidebar-bg-dark: #083d5e;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(255,255,255,0.14);
    --sidebar-text: #ffffff;
    --sidebar-muted: rgba(255,255,255,0.68);
    --content-bg: #f8f9fa;
    --sso-border: #e6e9ee;
}

html, body { min-height: 100%; margin: 0; overflow-x: hidden; }
body { background: var(--content-bg); color: #263238; font-size: .92rem; }
a { text-decoration: none; }
.app-shell { min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    overflow-y: auto;
    overflow-x: hidden;
    padding: .75rem .65rem;
}

.app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 1.25rem;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #fff;
    padding: .35rem .35rem .8rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: .75rem;
}

.sidebar-brand:hover { color: #fff; }
.sidebar-brand img { width: 100%; max-width: 205px; height: 52px; object-fit: contain; margin-bottom: .45rem; }
.sidebar-brand-title { font-size: 1rem; font-weight: 700; line-height: 1.2; margin-bottom: .15rem; }
.sidebar-brand-user { font-size: .74rem; color: var(--sidebar-muted); line-height: 1.2; }

.sidebar-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--sidebar-muted);
    margin: .75rem 0 .35rem;
    padding: 0 .45rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .55rem;
    width: 100%;
    color: #fff;
    border-radius: .45rem;
    padding: .5rem .6rem;
    font-size: .87rem;
    line-height: 1.2;
    margin-bottom: .12rem;
    transition: .15s ease-in-out;
}

.sidebar-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-link.active { background: var(--sidebar-active); font-weight: 600; color: #fff; }
.sidebar-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: .82rem; }
.sidebar-footer { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid rgba(255,255,255,.08); }

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.page-heading h1, .page-heading h2, .page-heading h3, .page-heading h4 { margin-bottom: .2rem; font-weight: 700; }
.card { border: 0; box-shadow: 0 .125rem .45rem rgba(31, 45, 61, .08); }
.card-header { background: #fff; border-bottom: 1px solid var(--sso-border); font-weight: 600; }
.metric-card .metric-icon { display: inline-flex; width: 45px; height: 45px; border-radius: .55rem; align-items: center; justify-content: center; background: #f2f6fa; }
.table thead th { white-space: nowrap; font-size: .82rem; vertical-align: middle; }
.table td { vertical-align: middle; }
.form-section-title { font-weight: 700; font-size: 1rem; margin-bottom: 1rem; }
.system-access-card { border: 1px solid var(--sso-border); box-shadow: none; }
.system-access-card.is-enabled { border-color: #b6d4fe; background: #fbfdff; }

.sso-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: radial-gradient(circle at top right, rgba(11,79,121,.10), transparent 34rem), #f5f7fa;
}
.login-card { width: 100%; max-width: 470px; border: 0; border-radius: .8rem; box-shadow: 0 .6rem 2rem rgba(31,45,61,.12); }
.login-logo { display: block; width: 100%; max-width: 310px; height: 70px; object-fit: contain; margin: 0 auto .8rem; }
.provider-button { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: .55rem; }
.app-launch-card { height: 100%; border: 1px solid var(--sso-border); box-shadow: none; transition: transform .12s ease, box-shadow .12s ease; }
.app-launch-card:hover { transform: translateY(-1px); box-shadow: 0 .35rem .9rem rgba(31,45,61,.08); }
.context-json { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: .78rem; white-space: pre-wrap; word-break: break-word; margin: 0; }

@media (max-width: 767.98px) {
    .app-sidebar { position: relative; width: 100%; min-width: 100%; max-width: 100%; height: auto; }
    .app-main { margin-left: 0; width: 100%; padding: .85rem; }
    .page-heading { flex-direction: column; }
}
