:root {
    --page: #e8edf5;
    --shell: #ffffff;
    --surface: #ffffff;
    --soft: #f5f7fb;
    --soft-2: #edf2f8;
    --border: #e2e8f0;
    --border-strong: #d5deea;
    --text: #152033;
    --muted: #7b8799;
    --accent: #356ae6;
    --accent-hover: #2859cb;
    --accent-soft: #edf3ff;
    --navy: #18274d;
    --navy-2: #223864;
    --green: #2f9e72;
    --green-soft: #eaf7f1;
    --amber: #d49327;
    --amber-soft: #fff5e3;
    --red: #d95d6c;
    --red-soft: #fff0f2;
    --radius-lg: 24px;
    --radius-md: 18px;
    --shadow: 0 20px 55px rgba(34, 55, 90, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 5%, rgba(53,106,230,.11), transparent 28%),
        var(--page);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.app-shell {
    width: min(1540px, 100%);
    min-height: calc(100vh - 48px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.82);
    border-radius: var(--radius-lg);
    background: var(--shell);
    box-shadow: var(--shadow);
}

.topbar {
    min-height: 82px;
    padding: 0 26px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.96);
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    font-weight: 800;
}

.brand-symbol {
    position: relative;
    width: 33px;
    height: 33px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--accent-soft);
}

.brand-symbol span {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--navy);
}

.brand-symbol span:nth-child(1) { transform: translate(-6px, -2px); }
.brand-symbol span:nth-child(2) { transform: translate(5px, -6px); background: var(--accent); }
.brand-symbol span:nth-child(3) { transform: translate(4px, 6px); }
.brand-text { font-size: .98rem; letter-spacing: -.02em; }

.top-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.top-nav a {
    min-height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    color: #657187;
    font-size: .76rem;
    font-weight: 650;
    transition: background .16s ease, color .16s ease;
}

.top-nav a:hover { background: var(--soft); color: var(--navy); }
.top-nav a.active { color: var(--navy); }

.nav-circle {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f6fb;
}

.top-nav a.active .nav-circle {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 6px 16px rgba(24,39,77,.18);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.icon-button,
.round-button {
    width: 39px;
    height: 39px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f4f7fb;
    cursor: pointer;
    transition: background .16s ease, transform .16s ease;
}

.round-button.compact { width: 32px; height: 32px; }
.icon-button:hover, .round-button:hover { background: #eaf0f8; transform: translateY(-1px); }

.notification { position: relative; }
.notification > span {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--red);
}

.profile-button {
    min-height: 46px;
    padding: 3px 4px 3px 3px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
}

.profile-button:hover { background: var(--soft); }

.profile-avatar {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #86a7ef);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
}

.profile-copy { display: grid; gap: 1px; text-align: left; }
.profile-copy strong { font-size: .72rem; }
.profile-copy small { color: var(--muted); font-size: .62rem; }
.profile-button > svg { width: 14px; height: 14px; color: #8b96a8; }

.app-body {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    background: #fff;
}

.utility-rail {
    min-height: calc(100vh - 132px);
    padding: 26px 14px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border);
    background: #fff;
}

.rail-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: #f7f9fc;
    color: #657187;
    cursor: pointer;
    transition: .16s ease;
}

.rail-button:hover { color: var(--navy); background: #edf2f8; transform: translateY(-1px); }
.rail-button.active { color: #fff; background: var(--navy); }
.rail-divider { width: 28px; height: 1px; margin: 3px 0 4px; background: var(--border); }
.rail-spacer { flex: 1; }

.page-content {
    min-width: 0;
    padding: 28px 32px 34px;
    background: #f8fafe;
}

.primary-button,
.ghost-button {
    min-height: 43px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 720;
    cursor: pointer;
    transition: .16s ease;
}

.primary-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 18px rgba(53,106,230,.18);
}

.primary-button:hover { background: var(--accent-hover); transform: translateY(-1px); }

.ghost-button {
    border: 1px solid var(--border);
    background: #fff;
    color: #48566e;
}

.ghost-button:hover { border-color: var(--border-strong); background: var(--soft); transform: translateY(-1px); }
.mobile-rail-toggle { display: none; }

.app-footer {
    padding: 12px 28px 18px 100px;
    color: #96a0af;
    background: #fff;
    font-size: .62rem;
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: start center;
    padding-top: 10vh;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15,28,54,.28);
    backdrop-filter: blur(5px);
}

.search-dialog {
    position: relative;
    z-index: 1;
    width: min(620px, calc(100% - 32px));
    min-height: 66px;
    padding: 0 15px 0 19px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(24,39,77,.18);
}

.search-dialog input {
    min-width: 0;
    height: 64px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: .92rem;
}

.search-dialog input::placeholder { color: #9aa5b5; }
.search-dialog kbd {
    padding: 4px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: #7f8999;
    background: var(--soft);
    font-family: inherit;
    font-size: .62rem;
}

.toast {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 120;
    min-height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #d8e9e1;
    border-radius: 14px;
    background: #fff;
    color: #286b52;
    box-shadow: 0 18px 46px rgba(26,50,75,.16);
    font-size: .74rem;
    font-weight: 700;
}

.toast svg { color: var(--green); }
[hidden] { display: none !important; }

@media (max-width: 1050px) {
    body { padding: 0; }
    .app-shell { min-height: 100vh; border: 0; border-radius: 0; }
    .topbar { grid-template-columns: auto 1fr auto; }
    .top-nav { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
    .top-nav::-webkit-scrollbar { display: none; }
    .profile-copy { display: none; }
}

@media (max-width: 760px) {
    .topbar {
        min-height: 70px;
        padding: 0 14px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .brand-text { display: none; }
    .top-nav { justify-content: center; }
    .top-nav a { padding: 0 4px; font-size: 0; }
    .top-nav a:nth-child(n+4) { display: none; }
    .profile-button > svg, .icon-button:first-child { display: none; }
    .app-body { grid-template-columns: 1fr; }

    .utility-rail {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: 14px;
        z-index: 80;
        min-height: auto;
        padding: 8px;
        flex-direction: row;
        justify-content: center;
        gap: 6px;
        border: 1px solid var(--border);
        border-radius: 18px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 18px 45px rgba(31,45,70,.16);
        backdrop-filter: blur(14px);
        transform: translateY(140%);
        transition: transform .2s ease;
    }

    body.rail-open .utility-rail { transform: translateY(0); }
    .rail-divider, .rail-spacer { display: none; }
    .page-content { padding: 22px 16px 100px; }
    .mobile-rail-toggle { display: inline-grid; }
    .app-footer { display: none; }
    .toast { right: 16px; bottom: 90px; left: 16px; }
}


/* Scrollbar refinada do SIGO */
html {
    scrollbar-width: thin;
    scrollbar-color: #9eabc0 #eef2f7;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: #eef2f7;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    min-height: 60px;
    border: 2px solid #eef2f7;
    border-radius: 999px;
    background: linear-gradient(180deg, #b8c4d6 0%, #8f9db3 100%);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7f94bc 0%, #5f78a8 100%);
}

html::-webkit-scrollbar-thumb:active,
body::-webkit-scrollbar-thumb:active {
    background: var(--accent);
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner {
    background: transparent;
}
