:root {
    --sc-brand: #2b2b6c;
    --sc-brand-700: #23235a;
    --sc-brand-800: #1b1c49;
    --sc-brand-soft: #f0f0fa;
    --sc-accent: #67bc46;
    --sc-accent-700: #4d9833;
    --sc-accent-soft: #eff9ea;
    --sc-bg: #f5f6fa;
    --sc-surface: #ffffff;
    --sc-surface-soft: #fafbfc;
    --sc-text: #17182d;
    --sc-muted: #70758a;
    --sc-border: #e6e8ef;
    --sc-border-strong: #d9dce6;
    --sc-danger: #c83e4d;
    --sc-warning: #b97712;
    --sc-success: #2f8a52;
    --sc-info: #3c64bd;
    --sc-sidebar-width: 282px;
    --sc-radius-sm: 10px;
    --sc-radius: 16px;
    --sc-radius-lg: 22px;
    --sc-shadow-sm: 0 1px 2px rgba(29, 31, 53, .04), 0 6px 18px rgba(29, 31, 53, .04);
    --sc-shadow: 0 12px 34px rgba(29, 31, 53, .08);
    --sc-transition: 180ms ease;
}

* { box-sizing: border-box; }

html { background: var(--sc-bg); }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--sc-bg);
    color: var(--sc-text);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.scopious-auth { background: #f3f4f8; }

::selection { background: rgba(103, 188, 70, .2); color: var(--sc-brand); }

a { color: inherit; text-decoration: none; }

button,
input,
select,
textarea { font: inherit; }

button,
a,
input,
select,
textarea { -webkit-tap-highlight-color: transparent; }

img { max-width: 100%; }

/* App shell */
.os-shell { min-height: 100vh; }

.os-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: var(--sc-sidebar-width);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 25% 5%, rgba(103, 188, 70, .14), transparent 25%),
        linear-gradient(180deg, #2b2b6c 0%, #24245b 55%, #1e1f4f 100%);
    border-left: 1px solid rgba(255,255,255,.08);
    box-shadow: -14px 0 40px rgba(24, 25, 62, .10);
}

.os-brand {
    min-height: 100px;
    padding: 22px 20px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.os-brand img {
    display: block;
    width: 218px;
    max-height: 58px;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
}

.os-nav {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px 24px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.18) transparent;
}

.os-nav-section { margin: 0 0 22px; }

.os-nav-label {
    padding: 0 12px 8px;
    color: rgba(255,255,255,.48);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.os-nav-link {
    position: relative;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 3px 0;
    padding: 10px 13px;
    color: rgba(255,255,255,.77);
    border: 1px solid transparent;
    border-radius: 13px;
    transition: background var(--sc-transition), color var(--sc-transition), border-color var(--sc-transition), transform var(--sc-transition);
}

.os-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.075);
    transform: translateX(-2px);
}

.os-nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(103,188,70,.22), rgba(255,255,255,.075));
    border-color: rgba(103,188,70,.26);
    box-shadow: inset -3px 0 0 var(--sc-accent);
}

.os-nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    opacity: .92;
}

.os-nav-link.active .os-nav-icon { color: #9cdb82; }

.os-nav-text { font-size: 14px; font-weight: 650; }

.os-sidebar-foot {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.os-sidebar-status {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    color: rgba(255,255,255,.62);
    font-size: 12px;
}

.os-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-accent);
    box-shadow: 0 0 0 4px rgba(103,188,70,.13);
}

.os-workspace {
    min-height: 100vh;
    margin-right: var(--sc-sidebar-width);
}

.os-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 76px;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--sc-border);
}

.os-topbar-start,
.os-topbar-end,
.os-user-chip {
    display: flex;
    align-items: center;
}

.os-topbar-start { gap: 14px; min-width: 0; }
.os-topbar-end { gap: 12px; }

.os-section-eyebrow {
    color: var(--sc-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
}

.os-section-title {
    margin-top: 2px;
    color: var(--sc-text);
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--sc-border);
    border-radius: 12px;
    background: #fff;
    color: var(--sc-brand);
    cursor: pointer;
}

.os-mobile-toggle svg { width: 21px; height: 21px; }

.os-user-menu { position: relative; }
.os-user-menu > summary { list-style: none; cursor: pointer; }
.os-user-menu > summary::-webkit-details-marker { display: none; }

.os-user-chip {
    gap: 10px;
    padding: 6px 8px 6px 12px;
    border: 1px solid var(--sc-border);
    border-radius: 14px;
    background: #fff;
    transition: border-color var(--sc-transition), box-shadow var(--sc-transition);
}

.os-user-chip:hover { border-color: #cfd3df; box-shadow: var(--sc-shadow-sm); }

.os-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(145deg, var(--sc-brand), #41418e);
    font-size: 13px;
    font-weight: 900;
}

.os-user-meta { min-width: 0; }
.os-user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 13px; }
.os-user-role { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sc-muted); font-size: 11px; margin-top: 1px; }

.os-user-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    left: 0;
    min-width: 210px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--sc-border);
    border-radius: 14px;
    box-shadow: var(--sc-shadow);
}

.os-user-dropdown form { margin: 0; }
.os-user-dropdown .btn { width: 100%; justify-content: center; }

.os-content { padding: 0 0 44px; }
.os-overlay { display: none; }

/* Existing pages inherit the design system automatically */
.container {
    width: min(1280px, calc(100% - 48px));
    margin: 28px auto;
}

.card {
    display: block;
    background: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius-lg);
    padding: 22px;
    box-shadow: var(--sc-shadow-sm);
}

a.card {
    transition: transform var(--sc-transition), box-shadow var(--sc-transition), border-color var(--sc-transition);
}

a.card:hover {
    transform: translateY(-2px);
    border-color: #d9dce8;
    box-shadow: var(--sc-shadow);
}

h1, h2, h3, h4 { color: var(--sc-text); letter-spacing: -.015em; }
h1 { font-size: clamp(25px, 3vw, 34px); line-height: 1.25; }
h2 { font-size: 21px; }
h3 { font-size: 16px; }

.muted { color: var(--sc-muted) !important; }

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--sc-border);
    border-radius: 12px;
    background: #fff;
    color: var(--sc-brand);
    cursor: pointer;
    font-weight: 800;
    line-height: 1.1;
    transition: transform var(--sc-transition), box-shadow var(--sc-transition), background var(--sc-transition), border-color var(--sc-transition), color var(--sc-transition);
}

.btn:hover { transform: translateY(-1px); border-color: #cfd3df; box-shadow: 0 7px 18px rgba(31,32,77,.08); }
.btn:active { transform: translateY(0); }

body .btn-dark {
    border-color: var(--sc-brand) !important;
    background: linear-gradient(135deg, var(--sc-brand), #3a3a83) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(43,43,108,.16);
}

body .btn-dark:hover { background: linear-gradient(135deg, var(--sc-brand-700), #323274) !important; }
body .btn-light { background: #fff !important; color: var(--sc-brand) !important; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--sc-brand-soft);
    color: var(--sc-brand);
    border: 1px solid rgba(43,43,108,.08);
    font-size: 12px;
    font-weight: 850;
}

.alert-error {
    border: 1px solid #f0cbd0;
    background: #fff4f5;
    color: #9d2f3c;
    padding: 13px 15px;
    border-radius: 13px;
    margin-bottom: 18px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--sc-border-strong) !important;
    border-radius: 12px !important;
    padding: 10px 13px !important;
    background: #fff !important;
    color: var(--sc-text);
    outline: none;
    transition: border-color var(--sc-transition), box-shadow var(--sc-transition), background var(--sc-transition);
}

textarea { min-height: 110px; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #a1a6b5; }
input:focus, select:focus, textarea:focus {
    border-color: rgba(43,43,108,.72) !important;
    box-shadow: 0 0 0 4px rgba(43,43,108,.08) !important;
}

label { display: block; margin-bottom: 7px; color: #33364e; font-weight: 800; font-size: 13px; }
.field { margin-bottom: 18px; }

/* Tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 13px 14px; text-align: right; border-bottom: 1px solid var(--sc-border); vertical-align: middle; }
th { color: var(--sc-muted); background: #fafbfc; font-size: 12px; font-weight: 850; }
tbody tr { transition: background var(--sc-transition); }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }

/* Dashboard */
.dashboard-shell { padding-top: 28px; }
.dashboard-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .65fr);
    gap: 24px;
    align-items: center;
    padding: 30px;
    color: #fff;
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 5%, rgba(103,188,70,.28), transparent 26%),
        linear-gradient(135deg, #2b2b6c 0%, #25265e 58%, #1f204f 100%);
    box-shadow: 0 22px 46px rgba(43,43,108,.18);
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    left: -60px;
    bottom: -110px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 72px rgba(255,255,255,.018);
}
.dashboard-hero-copy { position: relative; z-index: 1; }
.dashboard-kicker { color: #a5dc8f; font-size: 12px; font-weight: 900; letter-spacing: .07em; }
.dashboard-hero h1 { margin: 8px 0 8px; color: #fff; font-size: clamp(28px, 4vw, 40px); }
.dashboard-hero p { margin: 0; max-width: 680px; color: rgba(255,255,255,.72); }
.dashboard-hero-meta { position: relative; z-index: 1; display: grid; gap: 10px; }
.dashboard-hero-chip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.07); backdrop-filter: blur(8px); }
.dashboard-hero-chip span { color: rgba(255,255,255,.63); font-size: 12px; }
.dashboard-hero-chip strong { color: #fff; font-size: 13px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
    margin-top: 18px;
}
.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 4px; background: var(--sc-accent); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--sc-brand-soft); color: var(--sc-brand); }
.metric-icon svg { width: 19px; height: 19px; }
.stat-number { margin-top: 14px; color: var(--sc-text); font-size: 34px; line-height: 1; font-weight: 900; letter-spacing: -.03em; }
.metric-label { margin-top: 8px; color: var(--sc-muted); font-size: 12px; }

.dashboard-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 32px 0 14px; }
.dashboard-section-head h2 { margin: 0; }
.dashboard-section-head p { margin: 4px 0 0; color: var(--sc-muted); font-size: 13px; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 0; }
.module-card { position: relative; min-height: 150px; padding: 21px; }
.module-card .module-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.module-card .module-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--sc-brand); background: linear-gradient(145deg, var(--sc-brand-soft), #f8f8fd); border: 1px solid rgba(43,43,108,.07); }
.module-card .module-icon svg { width: 21px; height: 21px; }
.module-card .module-arrow { color: #a1a5b4; transition: transform var(--sc-transition), color var(--sc-transition); }
.module-card:hover .module-arrow { color: var(--sc-accent-700); transform: translateX(-4px); }
.module-card h3 { margin: 17px 0 6px; font-size: 16px; }
.module-card .muted { font-size: 13px; line-height: 1.7; }

/* Login */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 80% 5%, rgba(103,188,70,.13), transparent 28%),
        linear-gradient(135deg, #f7f8fb, #eef0f6);
}
.login-panel {
    width: min(1020px, 100%);
    min-height: 600px;
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    overflow: hidden;
    border: 1px solid var(--sc-border);
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(31,32,77,.14);
}
.login-brand-panel {
    position: relative;
    overflow: hidden;
    padding: 48px 42px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(160deg, #2b2b6c 0%, #24245a 65%, #1d1e4c 100%);
}
.login-brand-panel::after { content:""; position:absolute; width:310px; height:310px; left:-120px; bottom:-130px; border:1px solid rgba(255,255,255,.1); border-radius:50%; box-shadow:0 0 0 52px rgba(255,255,255,.025),0 0 0 105px rgba(255,255,255,.015); }
.login-brand-logo { position: relative; z-index: 1; width: 315px; max-width: 100%; }
.login-brand-copy { position: relative; z-index: 1; max-width: 420px; }
.login-brand-copy .eyebrow { color: #a7de91; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.login-brand-copy h1 { margin: 9px 0 12px; color: #fff; font-size: 34px; }
.login-brand-copy p { margin: 0; color: rgba(255,255,255,.68); line-height: 1.9; }
.login-brand-foot { position: relative; z-index: 1; color: rgba(255,255,255,.5); font-size: 11px; }
.login-form-panel { padding: 58px 58px 48px; display: flex; align-items: center; }
.login-form-wrap { width: 100%; max-width: 420px; margin: auto; }
.login-form-wrap h2 { margin: 0 0 8px; font-size: 27px; }
.login-subtitle { margin: 0 0 30px; color: var(--sc-muted); line-height: 1.7; }
.login-btn { width: 100%; margin-top: 4px; min-height: 48px; font-size: 14px; }
.login-security { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--sc-muted); font-size: 11px; }
.login-security svg { width: 15px; height: 15px; color: var(--sc-accent-700); }

/* Little touches for old page-specific markup */
.toolbar { align-items: center; }
.status { color: var(--sc-brand); font-weight: 850; }
.empty { color: var(--sc-muted); }
.page-grid > main, .page-grid > aside { min-width: 0; }
.meta-box { border: 1px solid #eef0f5; }
.timeline { border-color: #dfe2ea !important; }
.timeline::marker { color: var(--sc-accent); }

@media (max-width: 1120px) {
    :root { --sc-sidebar-width: 250px; }
    .module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dashboard-hero { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
    .os-sidebar {
        width: 278px;
        transform: translateX(105%);
        transition: transform 220ms ease;
        box-shadow: -16px 0 50px rgba(20,21,52,.24);
    }
    body.os-nav-open .os-sidebar { transform: translateX(0); }
    .os-workspace { margin-right: 0; }
    .os-mobile-toggle { display: inline-flex; }
    .os-overlay { position: fixed; inset: 0; z-index: 35; display: block; pointer-events: none; opacity: 0; background: rgba(15,17,37,.38); transition: opacity 220ms ease; }
    body.os-nav-open .os-overlay { pointer-events: auto; opacity: 1; }
    body.os-nav-open { overflow: hidden; }
    .os-topbar { height: 68px; padding: 0 18px; }
    .container { width: min(100% - 28px, 1280px); margin: 20px auto; }
    .stat-grid { grid-template-columns: 1fr; }
    .module-grid { grid-template-columns: 1fr 1fr; }
    .login-panel { grid-template-columns: 1fr; min-height: auto; }
    .login-brand-panel { min-height: 300px; padding: 34px 30px; }
    .login-brand-copy h1 { font-size: 29px; }
    .login-form-panel { padding: 40px 30px; }
}

@media (max-width: 620px) {
    .os-section-eyebrow { display: none; }
    .os-section-title { font-size: 15px; }
    .os-user-meta { display: none; }
    .os-user-chip { padding: 5px; border: 0; background: transparent; }
    .os-topbar { padding: 0 14px; }
    .container { width: calc(100% - 22px); margin: 14px auto; }
    .card { padding: 17px; border-radius: 17px; }
    .module-grid { grid-template-columns: 1fr; }
    .dashboard-hero { padding: 23px 20px; border-radius: 20px; }
    .dashboard-section-head { margin-top: 26px; }
    .login-shell { padding: 12px; }
    .login-panel { border-radius: 22px; }
    .login-brand-panel { min-height: 250px; padding: 28px 24px; }
    .login-brand-logo { width: 260px; }
    .login-brand-copy h1 { font-size: 25px; }
    .login-form-panel { padding: 32px 22px; }
}

/* ================================================================
   Scopious UI Hotfix 2 — compact + collapsible desktop sidebar
   ================================================================ */
:root {
    --sc-sidebar-width: 252px;
    --sc-sidebar-collapsed-width: 82px;
}

.os-sidebar,
.os-workspace,
.os-brand-logo,
.os-brand-mark,
.os-nav-label,
.os-nav-text,
.os-sidebar-status span:not(.os-status-dot) {
    transition:
        width 220ms ease,
        margin 220ms ease,
        padding 220ms ease,
        opacity 150ms ease,
        transform 220ms ease;
}

.os-sidebar { width: var(--sc-sidebar-width); }
.os-workspace { margin-right: var(--sc-sidebar-width); }

.os-brand {
    min-height: 88px;
    padding: 16px 18px 13px;
    justify-content: center;
}

.os-brand-logo {
    width: 190px;
    max-height: 50px;
}

.os-brand-mark {
    display: none;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
}

.os-nav {
    padding: 14px 12px 18px;
}

.os-nav-section { margin-bottom: 17px; }

.os-nav-label {
    padding: 0 10px 6px;
    font-size: 10px;
}

.os-nav-link {
    min-height: 42px;
    gap: 10px;
    margin: 2px 0;
    padding: 8px 11px;
    border-radius: 12px;
}

.os-nav-icon {
    width: 19px;
    height: 19px;
    flex-basis: 19px;
}

.os-nav-text {
    font-size: 13px;
    white-space: nowrap;
}

.os-sidebar-foot { padding: 10px 12px; }
.os-sidebar-status { padding: 8px 10px; font-size: 11px; }

.os-nav-toggle {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    padding: 0;
    border: 1px solid var(--sc-border);
    border-radius: 12px;
    background: #fff;
    color: var(--sc-brand);
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(29,31,53,.04);
    transition: border-color var(--sc-transition), box-shadow var(--sc-transition), transform var(--sc-transition), background var(--sc-transition);
}

.os-nav-toggle:hover {
    border-color: #cfd3df;
    box-shadow: var(--sc-shadow-sm);
    background: #fbfbfe;
}

.os-nav-toggle svg { width: 20px; height: 20px; }
.os-toggle-mobile-icon { display: none; }
.os-toggle-desktop-icon { transition: transform 220ms ease; }

body.os-sidebar-collapsed .os-sidebar {
    width: var(--sc-sidebar-collapsed-width);
}

body.os-sidebar-collapsed .os-workspace {
    margin-right: var(--sc-sidebar-collapsed-width);
}

body.os-sidebar-collapsed .os-brand {
    min-height: 82px;
    padding: 14px 9px 11px;
}

body.os-sidebar-collapsed .os-brand-logo { display: none; }
body.os-sidebar-collapsed .os-brand-mark { display: block; }
body.os-sidebar-collapsed .os-nav { padding: 13px 10px 18px; overflow-x: hidden; }
body.os-sidebar-collapsed .os-nav-section { margin-bottom: 13px; }
body.os-sidebar-collapsed .os-nav-label { display: none; }

body.os-sidebar-collapsed .os-nav-link {
    min-height: 46px;
    justify-content: center;
    gap: 0;
    padding: 10px;
}

body.os-sidebar-collapsed .os-nav-link:hover { transform: none; }
body.os-sidebar-collapsed .os-nav-link.active { box-shadow: inset -3px 0 0 var(--sc-accent); }
body.os-sidebar-collapsed .os-nav-icon { width: 21px; height: 21px; flex-basis: 21px; }
body.os-sidebar-collapsed .os-nav-text { display: none; }
body.os-sidebar-collapsed .os-sidebar-foot { padding: 10px; }
body.os-sidebar-collapsed .os-sidebar-status { justify-content: center; padding: 9px 0; }
body.os-sidebar-collapsed .os-sidebar-status span:not(.os-status-dot) { display: none; }
body.os-sidebar-collapsed .os-toggle-desktop-icon { transform: rotate(180deg); }

@media (max-width: 1120px) and (min-width: 881px) {
    :root { --sc-sidebar-width: 236px; }
    .os-brand-logo { width: 176px; }
}

@media (max-width: 880px) {
    .os-sidebar,
    body.os-sidebar-collapsed .os-sidebar {
        width: 278px;
    }

    .os-workspace,
    body.os-sidebar-collapsed .os-workspace {
        margin-right: 0;
    }

    .os-brand,
    body.os-sidebar-collapsed .os-brand {
        min-height: 88px;
        padding: 16px 18px 13px;
    }

    .os-brand-logo,
    body.os-sidebar-collapsed .os-brand-logo {
        display: block;
        width: 190px;
        max-height: 50px;
    }

    .os-brand-mark,
    body.os-sidebar-collapsed .os-brand-mark { display: none; }

    .os-nav,
    body.os-sidebar-collapsed .os-nav { padding: 14px 12px 18px; overflow-y: auto; }
    body.os-sidebar-collapsed .os-nav-section { margin-bottom: 17px; }
    body.os-sidebar-collapsed .os-nav-label { display: block; }

    body.os-sidebar-collapsed .os-nav-link {
        min-height: 42px;
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 11px;
    }

    body.os-sidebar-collapsed .os-nav-icon { width: 19px; height: 19px; flex-basis: 19px; }
    body.os-sidebar-collapsed .os-nav-text { display: inline; }
    body.os-sidebar-collapsed .os-sidebar-foot { padding: 10px 12px; }
    body.os-sidebar-collapsed .os-sidebar-status { justify-content: flex-start; padding: 8px 10px; }
    body.os-sidebar-collapsed .os-sidebar-status span:not(.os-status-dot) { display: inline; }

    .os-toggle-desktop-icon { display: none; }
    .os-toggle-mobile-icon { display: block; }
}

/* ================================================================
   Scopious UI Hotfix 3 — sidebar polish after visual QA
   - slimmer desktop sidebar
   - clean collapsed brand mark
   - floating circular collapse control on the sidebar boundary
   ================================================================ */
@media (min-width: 881px) {
    :root {
        --sc-sidebar-width: 232px;
        --sc-sidebar-collapsed-width: 72px;
    }

    .os-brand {
        min-height: 82px;
        padding: 14px 14px 12px;
    }

    .os-brand-logo {
        width: 172px;
        max-height: 46px;
    }

    /* Beat the older .os-brand img rule so the compact mark never leaks
       beside the full logo while the sidebar is open. */
    .os-brand .os-brand-mark {
        display: none;
        width: 42px;
        height: 42px;
        object-fit: contain;
        border-radius: 0;
    }

    .os-nav {
        padding: 12px 10px 16px;
    }

    .os-nav-section {
        margin-bottom: 15px;
    }

    .os-nav-label {
        padding: 0 9px 5px;
        font-size: 9.5px;
    }

    .os-nav-link {
        min-height: 40px;
        gap: 9px;
        padding: 7px 10px;
        border-radius: 11px;
    }

    .os-nav-icon {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    .os-nav-text {
        font-size: 12.5px;
    }

    .os-sidebar-foot {
        padding: 9px 10px;
    }

    .os-sidebar-status {
        padding: 7px 8px;
        font-size: 10.5px;
    }

    /* The control belongs visually to the sidebar edge, not inside the
       topbar content. Fixed positioning keeps it in the same place on all
       pages and while scrolling. */
    .os-nav-toggle {
        position: fixed;
        top: 20px;
        right: calc(var(--sc-sidebar-width) - 18px);
        z-index: 60;
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 50%;
        border-color: #d8dbe6;
        background: #fff;
        box-shadow: 0 8px 24px rgba(29,31,53,.14);
    }

    .os-nav-toggle:hover {
        transform: scale(1.04);
        border-color: rgba(103,188,70,.55);
        box-shadow: 0 10px 28px rgba(29,31,53,.18);
    }

    .os-nav-toggle svg {
        width: 18px;
        height: 18px;
    }

    body.os-sidebar-collapsed .os-nav-toggle {
        right: calc(var(--sc-sidebar-collapsed-width) - 18px);
    }

    body.os-sidebar-collapsed .os-brand {
        min-height: 72px;
        padding: 11px 8px 9px;
    }

    body.os-sidebar-collapsed .os-brand .os-brand-logo {
        display: none;
    }

    body.os-sidebar-collapsed .os-brand .os-brand-mark {
        display: block;
        width: 40px;
        height: 40px;
    }

    body.os-sidebar-collapsed .os-nav {
        padding: 10px 8px 14px;
    }

    body.os-sidebar-collapsed .os-nav-section {
        margin-bottom: 11px;
    }

    body.os-sidebar-collapsed .os-nav-link {
        min-height: 42px;
        padding: 9px;
        border-radius: 11px;
    }

    body.os-sidebar-collapsed .os-nav-icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
    }

    body.os-sidebar-collapsed .os-sidebar-foot {
        padding: 8px;
    }
}


/* ================================================================
   Scopious UI Hotfix 4 — hard cache-bust + truly compact desktop nav
   Visual QA: sidebar remained visually large and old desktop JS could
   still be served by browser/CDN cache. These rules are intentionally
   last and explicit so the desktop shell has one authoritative size.
   ================================================================ */
@media (min-width: 881px) {
    :root {
        --sc-sidebar-width: 204px;
        --sc-sidebar-collapsed-width: 60px;
    }

    .os-sidebar {
        width: var(--sc-sidebar-width) !important;
    }

    .os-workspace {
        margin-right: var(--sc-sidebar-width) !important;
    }

    .os-brand {
        min-height: 72px !important;
        padding: 10px 10px 9px !important;
    }

    .os-brand-logo {
        width: 150px !important;
        max-height: 42px !important;
    }

    .os-brand .os-brand-mark {
        display: none !important;
    }

    .os-nav {
        padding: 9px 8px 12px !important;
    }

    .os-nav-section {
        margin-bottom: 11px !important;
    }

    .os-nav-label {
        padding: 0 8px 4px !important;
        font-size: 8.5px !important;
        letter-spacing: .04em !important;
    }

    .os-nav-link {
        min-height: 36px !important;
        gap: 8px !important;
        margin: 1px 0 !important;
        padding: 6px 8px !important;
        border-radius: 10px !important;
    }

    .os-nav-icon {
        width: 17px !important;
        height: 17px !important;
        flex-basis: 17px !important;
    }

    .os-nav-text {
        font-size: 11.5px !important;
        line-height: 1.25 !important;
    }

    .os-sidebar-foot {
        padding: 7px 8px !important;
    }

    .os-sidebar-status {
        gap: 7px !important;
        padding: 6px 7px !important;
        font-size: 9.5px !important;
    }

    .os-nav-toggle {
        position: fixed !important;
        top: 18px !important;
        right: calc(var(--sc-sidebar-width) - 16px) !important;
        z-index: 80 !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        flex: 0 0 32px !important;
        padding: 0 !important;
        display: inline-grid !important;
        place-items: center !important;
        border-radius: 999px !important;
        border: 1px solid #d8dbe6 !important;
        background: #fff !important;
        color: var(--sc-brand) !important;
        box-shadow: 0 6px 18px rgba(29,31,53,.16) !important;
        overflow: hidden !important;
        line-height: 1 !important;
    }

    .os-nav-toggle .os-toggle-desktop-icon {
        display: block !important;
        width: 16px !important;
        height: 16px !important;
    }

    .os-nav-toggle .os-toggle-mobile-icon {
        display: none !important;
    }

    body.os-sidebar-collapsed .os-sidebar {
        width: var(--sc-sidebar-collapsed-width) !important;
    }

    body.os-sidebar-collapsed .os-workspace {
        margin-right: var(--sc-sidebar-collapsed-width) !important;
    }

    body.os-sidebar-collapsed .os-nav-toggle {
        right: calc(var(--sc-sidebar-collapsed-width) - 16px) !important;
    }

    body.os-sidebar-collapsed .os-brand {
        min-height: 60px !important;
        padding: 8px 6px !important;
    }

    body.os-sidebar-collapsed .os-brand .os-brand-logo {
        display: none !important;
    }

    body.os-sidebar-collapsed .os-brand .os-brand-mark {
        display: block !important;
        width: 34px !important;
        height: 34px !important;
        margin: 0 auto !important;
    }

    body.os-sidebar-collapsed .os-nav {
        padding: 8px 6px 12px !important;
        overflow-x: hidden !important;
    }

    body.os-sidebar-collapsed .os-nav-label,
    body.os-sidebar-collapsed .os-nav-text,
    body.os-sidebar-collapsed .os-sidebar-status span:not(.os-status-dot) {
        display: none !important;
    }

    body.os-sidebar-collapsed .os-nav-section {
        margin-bottom: 8px !important;
    }

    body.os-sidebar-collapsed .os-nav-link {
        min-height: 38px !important;
        justify-content: center !important;
        gap: 0 !important;
        padding: 7px !important;
        border-radius: 9px !important;
    }

    body.os-sidebar-collapsed .os-nav-icon {
        width: 19px !important;
        height: 19px !important;
        flex-basis: 19px !important;
    }

    body.os-sidebar-collapsed .os-sidebar-foot {
        padding: 6px !important;
    }

    body.os-sidebar-collapsed .os-sidebar-status {
        justify-content: center !important;
        padding: 7px 0 !important;
    }

    body.os-sidebar-collapsed .os-toggle-desktop-icon {
        transform: rotate(180deg) !important;
    }
}
