:root {
    --hub-bg: #f3f6fb;
    --hub-surface: #ffffff;
    --hub-sidebar: #102a43;
    --hub-sidebar-hover: #1f3b57;
    --hub-primary: #0f766e;
    --hub-border: #dbe3ee;
    --hub-text: #1f2937;
    --hub-muted: #64748b;
    --sidebar-width: 264px;
    --sidebar-collapsed-width: 86px;
    --topbar-height: 64px;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 5% 0%, rgba(15, 118, 110, 0.1), transparent 30%),
        radial-gradient(circle at 95% 100%, rgba(16, 42, 67, 0.08), transparent 35%),
        var(--hub-bg);
    color: var(--hub-text);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #102a43 0%, #0b1f34 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1040;
    overflow-y: auto;
    transition: width 0.28s ease, transform 0.28s ease;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #22c55e, #0f766e);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-title {
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.1;
}

.brand-subtitle {
    color: #8fb8d8;
    font-size: 0.76rem;
}

.sidebar-nav {
    padding: 12px;
}

.sidebar-group-label {
    display: block;
    color: #7da0bc;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 14px 10px 8px;
}

.sidebar-link {
    width: 100%;
    border: 0;
    background: transparent;
    color: #d8e3ef;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 10px;
    padding: 10px 12px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-link i {
    font-size: 1.05rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: var(--hub-sidebar-hover);
    color: #ffffff;
}

.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.28s ease;
}

.topbar {
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d2dde8;
}

.content-area {
    padding: 1.25rem;
}

.system-card {
    border: 0;
    border-radius: 16px;
    background: var(--hub-surface);
    box-shadow: 0 10px 24px rgba(16, 42, 67, 0.08);
}

.system-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: var(--hub-primary);
    background: rgba(15, 118, 110, 0.13);
}

.iframe-container {
    height: calc(100vh - 210px);
    min-height: 460px;
}

#systemFrame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-wrapper {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .logo-text-wrap,
body.sidebar-collapsed .sidebar-group-label,
body.sidebar-collapsed .sidebar-link .label {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1035;
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-wrapper {
        margin-left: 0;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    body.sidebar-collapsed .sidebar,
    body.sidebar-collapsed .main-wrapper {
        width: var(--sidebar-width);
        margin-left: 0;
    }

    .iframe-container {
        min-height: 360px;
        height: calc(100vh - 240px);
    }
}