/**
 * SMARTER Gest — theme (dark/light) + sidebar
 */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="light"] {
    color-scheme: light;
}

/* Ensure native controls (select, date, multi) inherit dark chrome */
html[data-theme="dark"],
html[data-theme="dark"] body {
    color-scheme: dark;
    background: var(--color-bg);
    color: var(--color-text);
}
html[data-theme="light"],
html[data-theme="light"] body {
    color-scheme: light;
}

:root,
[data-theme="dark"] {
    --color-bg: #0a0c10;
    --color-bg-elevated: #141820;
    --color-bg-card: #1a2030;
    --color-bg-input: #2a3348;
    --color-bg-hover: #343f56;
    --sidebar-bg-from: #0a1628;
    --sidebar-bg-to: #060d18;
    --color-sidebar-border: rgba(255, 255, 255, 0.14);
    --color-sidebar-text: rgba(255, 255, 255, 0.92);
    --color-sidebar-text-muted: rgba(255, 255, 255, 0.72);

    --color-text: #f4f7fc;
    --color-text-muted: #c5d0e0;
    --color-text-label: #dce4f0;

    --color-border: #5a6578;
    --color-primary: #6b9fd4;
    --color-primary-hover: #5a8fc4;
    --color-btn-insert-bg: rgba(255, 255, 255, 0.05);
    --color-btn-insert-border: rgba(255, 255, 255, 0.18);
    --color-btn-insert-text: #dce4f0;
    --color-btn-insert-hover-bg: #1976d2;
    --color-btn-insert-hover-text: #ffffff;
    --color-btn-delete-bg: rgba(229, 57, 53, 0.1);
    --color-btn-delete-border: rgba(229, 57, 53, 0.38);
    --color-btn-delete-text: #ef9a9a;
    --color-btn-delete-hover-bg: #c62828;
    --color-btn-delete-hover-text: #ffffff;
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-danger: #ef4444;

    --radius-md: 8px;
    --sidebar-width: 260px;
    --header-height: 77px;
    --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
    --color-bg: #eef1f6;
    --color-bg-elevated: #ffffff;
    --color-bg-card: #ffffff;
    --color-bg-input: #ffffff;
    --color-bg-hover: #e8ecf3;
    --sidebar-bg-from: #0a66c2;
    --sidebar-bg-to: #084c8c;
    --color-sidebar-border: rgba(255, 255, 255, 0.14);
    --color-sidebar-text: rgba(255, 255, 255, 0.92);
    --color-sidebar-text-muted: rgba(255, 255, 255, 0.68);
    --color-text: #1a1f2e;
    --color-text-muted: #4a5568;
    --color-text-label: #374151;
    --color-border: #c5cdd8;
    --color-primary: #1565c0;
    --color-primary-hover: #0d47a1;
    --color-btn-insert-bg: rgba(0, 0, 0, 0.03);
    --color-btn-insert-border: #c5cdd8;
    --color-btn-insert-text: #374151;
    --color-btn-insert-hover-bg: #1565c0;
    --color-btn-insert-hover-text: #ffffff;
    --color-btn-delete-bg: rgba(182, 2, 14, 0.09);
    --color-btn-delete-border: rgba(182, 2, 14, 0.42);
    --color-btn-delete-text: #9f1d1d;
    --color-btn-delete-hover-bg: #b6020e;
    --color-btn-delete-hover-text: #ffffff;
    --color-danger: #dc2626;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: none; }

.app-layout {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    align-items: stretch;
}

.app-layout.sg-app--with-sidebar {
    flex-direction: row;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg-from), var(--sidebar-bg-to));
    border-right: 1px solid var(--color-sidebar-border);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar__brand {
    min-height: var(--header-height);
    padding: 0.65rem 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--color-sidebar-text);
    box-sizing: border-box;
}

.sidebar__brand--lm {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    text-align: center;
    padding: 0 0.75rem 0.35rem;
    min-height: var(--header-height);
    margin-bottom: 10px;
}

.sidebar__brand-logo {
    display: block;
    width: min(218px, 100%);
    height: auto;
    max-height: 55px;
    object-fit: contain;
    margin: calc((var(--header-height) - 55px) / 2) auto 8px;
}

/* Auth / login page */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d27 0%, #0f1117 50%, #14161e 100%);
    position: relative;
    padding: 1.5rem 1rem 2rem;
}

.auth-lang {
    position: fixed;
    top: 1.1rem;
    right: 1.35rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-lang__link {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.auth-lang__link:hover {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.auth-lang__link--active {
    color: #fff;
}

.auth-lang__sep {
    color: rgba(255, 255, 255, 0.4);
}

.auth-container {
    width: 100%;
    max-width: 430px;
    padding: 0 0.75rem;
}

.auth-card {
    width: 100%;
    border-radius: 16px;
}

.auth-card__body {
    padding: 1.35rem 1.5rem 1.15rem;
}

.auth-card__brand {
    text-align: center;
    margin-bottom: 1.35rem;
}

.auth-card__logo {
    display: inline-block;
    max-width: 200px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-card__appname {
    margin: 0.75rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text);
    line-height: 1.2;
}

.auth-forgot-link {
    margin: 0.375rem 0 0;
}

.auth-footer {
    margin: 0.85rem 0 0;
    color: rgba(255, 255, 255, 0.45);
}

.sidebar__brand-heading {
    margin-top: 0.2rem;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.sidebar__brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-sidebar-text);
}

.sidebar__brand-version {
    display: block;
    width: 100%;
    margin: -25px 0 0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-sidebar-text-muted);
    text-align: right;
    white-space: nowrap;
}

.sidebar__group + .sidebar__group {
    border-top: 1px solid var(--color-sidebar-border);
}

.sidebar__group-label {
    padding: 0.45rem 1rem 0.15rem;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-sidebar-text-muted);
    opacity: 0.85;
}

.sidebar__nav { list-style: none; margin: 0; padding: 0.15rem 0 0.25rem; flex: 1; }
.sidebar__nav li { margin: 0; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.75rem;
    margin: 1px 6px;
    border-radius: 5px;
    font-size: 0.96rem;
    color: var(--color-sidebar-text-muted);
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar__link:hover {
    background: var(--sidebar-accent, rgba(255, 255, 255, 0.12));
    color: var(--color-sidebar-text);
    text-decoration: none;
}
.sidebar__link--active {
    background: var(--sidebar-accent-active, rgba(255, 255, 255, 0.16));
    color: var(--color-sidebar-text);
    font-weight: 600;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 0;
    width: 100%;
}

.sg-app--with-sidebar .main-content.sg-main {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin-top: 0;
    padding: 0;
}

.topbar {
    height: var(--header-height);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0 1.2rem;
    margin: 0;
    border-bottom: 1px solid var(--color-sidebar-border);
    background: var(--color-bg-elevated);
    box-sizing: border-box;
    z-index: 40;
    width: 100%;
    flex-shrink: 0;
}

.topbar__brand {
    flex: 1;
    min-width: 0;
    margin-left: 0;
}

/* Topbar brand — own classes (never inherit sidebar white text). */
.topbar__brand-heading {
    margin-top: 0;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.topbar__brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

.topbar__version {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    color: var(--color-text-muted);
    opacity: 1;
}

/* Explicit theme colours so menu sidebar tokens never bleed into the topbar. */
[data-theme="light"] .topbar__brand-name {
    color: #1a1f2e;
}
[data-theme="light"] .topbar__version {
    color: #4a5568;
}
[data-theme="dark"] .topbar__brand-name {
    color: #f4f7fc;
}
[data-theme="dark"] .topbar__version {
    color: #c5d0e0;
}

/* Legacy selectors (if any partial still uses sidebar classes inside topbar). */
.topbar__brand .sidebar__brand-heading {
    margin-top: 0;
    justify-content: flex-start;
}
.topbar__brand .sidebar__brand-name {
    color: var(--color-text);
}
.topbar__brand .sidebar__brand-version {
    color: var(--color-text-muted);
}
[data-theme="light"] .topbar__brand .sidebar__brand-name,
[data-theme="light"] .topbar__brand .sidebar__brand-version {
    color: #1a1f2e;
}
[data-theme="light"] .topbar__brand .sidebar__brand-version {
    color: #4a5568;
}
[data-theme="dark"] .topbar__brand .sidebar__brand-name {
    color: #f4f7fc;
}
[data-theme="dark"] .topbar__brand .sidebar__brand-version {
    color: #c5d0e0;
}

.topbar__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

:root {
    --topbar-control-height: 30px;
}

.topbar-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--topbar-control-height);
    min-width: var(--topbar-control-height);
    padding: 0 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    color: var(--color-text);
    font: inherit;
    font-size: 0.8rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
}

.topbar-btn--outline {
    background: transparent;
}

.topbar-btn--soft {
    background: var(--color-bg-hover);
}

.topbar-btn:hover,
.topbar-btn:focus-visible {
    border-color: var(--color-primary);
    outline: none;
}

.topbar-btn .material-icons {
    font-size: 1.15rem !important;
}

.topbar-btn__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: var(--color-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
    pointer-events: none;
}

.topbar-lang {
    position: relative;
}

.topbar-lang__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 150px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 50;
    padding: 0.35rem 0;
}

.topbar-lang__menu[hidden] {
    display: none;
}

.topbar-lang__item {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--color-text);
    font-size: 0.875rem;
    text-decoration: none;
}

.topbar-lang__item:hover {
    background: var(--color-bg-hover);
}

.topbar-lang__item--active {
    font-weight: 600;
    color: var(--color-primary);
}

.topbar-profile {
    position: relative;
}

.topbar-profile__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: var(--topbar-control-height);
    padding: 0 0.45rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    color: var(--color-text);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    max-width: 220px;
    box-sizing: border-box;
}

.topbar-profile__toggle:hover,
.topbar-profile__toggle:focus-visible {
    border-color: var(--color-primary);
    outline: none;
}

.topbar-profile__icon {
    font-size: 1.25rem !important;
    color: var(--color-primary);
    flex-shrink: 0;
}

.topbar-profile__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .topbar-profile__name {
        display: none;
    }
}

.topbar-profile__caret {
    font-size: 0.95rem !important;
    opacity: 0.7;
    flex-shrink: 0;
}

.topbar-profile__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    min-width: 200px;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 50;
    padding: 0.35rem 0;
}

.topbar-profile__menu[hidden] {
    display: none;
}

.topbar-profile__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.topbar-profile__item:hover {
    background: var(--color-bg-hover);
}

.topbar-profile__item--logout {
    color: var(--color-danger);
    border-top: 1px solid var(--color-border);
    margin-top: 0.25rem;
    padding-top: 0.65rem;
}

.topbar-profile__item .material-icons {
    font-size: 1.15rem !important;
}

.content-wrapper {
    padding: 1.25rem;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

.sg-impersonation-banner {
    flex-shrink: 0;
}

.sg-footer {
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .topbar__actions {
        gap: 0.75rem;
    }
}

@media (min-width: 769px) {
    .app-layout.sg-app--with-sidebar {
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto;
        z-index: 30;
    }

    .sg-app--with-sidebar .main-content.sg-main {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
}

.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.card__body { padding: 1.25rem; }
.card__title { margin: 0 0 0.75rem; font-size: 1.25rem; }
.card__subtitle { margin: 1.25rem 0 0.5rem; font-size: 1rem; font-weight: 600; color: var(--color-text); }

.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: 0.35rem; font-size: 0.875rem; color: var(--color-text-label); }
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-input);
    color: var(--color-text);
    font: inherit;
}

.form-hint { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.form-actions { margin-top: 1rem; }

.profile-section {
    margin-top: 1.5rem;
    padding-top: 0.25rem;
}
.profile-section:first-of-type {
    margin-top: 0;
}
.profile-section--security {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-hover);
}
.profile-security__btn {
    gap: 0.4rem;
}
.profile-2fa__email-switch {
    margin-bottom: 1.25rem;
}
.profile-2fa__confirm {
    margin-top: 0.75rem;
}
.profile-2fa__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.profile-2fa__cancel {
    margin-top: 0.75rem;
}
.profile-security__btn .material-icons {
    font-size: 1.125rem;
}
.profile-menu-reset {
    margin-top: 0.5rem;
}
.form-actions--profile {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.sg-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    cursor: pointer;
    user-select: none;
}
.sg-toggle__text {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: inherit;
    line-height: 1.35;
}
.sg-toggle__control {
    position: relative;
    flex-shrink: 0;
    width: 44px;
    height: 26px;
}
.sg-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}
.sg-toggle__slider {
    display: block;
    width: 44px;
    height: 26px;
    background: #c5cdd8;
    border-radius: 999px;
    position: relative;
    transition: background 0.18s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.sg-toggle__slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.18s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}
.sg-toggle input:checked + .sg-toggle__slider {
    background: var(--color-primary);
}
.sg-toggle input:checked + .sg-toggle__slider::after {
    transform: translateX(18px);
}
.sg-toggle input:focus-visible + .sg-toggle__slider {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}
[data-theme="dark"] .sg-toggle__slider {
    background: #4a5568;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.btn--primary {
    background: var(--color-btn-insert-bg, rgba(0, 0, 0, 0.03));
    color: var(--color-btn-insert-text, var(--color-text));
    border: 1px solid var(--color-btn-insert-border, var(--color-border));
    font-weight: 600;
}
.btn--primary:hover {
    background: var(--color-btn-insert-hover-bg, var(--color-primary));
    color: var(--color-btn-insert-hover-text, #fff);
    border-color: var(--color-btn-insert-hover-bg, var(--color-primary));
}
.btn--danger {
    background: var(--color-btn-delete-bg, rgba(182, 2, 14, 0.09));
    color: var(--color-btn-delete-text, #9f1d1d);
    border: 1px solid var(--color-btn-delete-border, rgba(182, 2, 14, 0.42));
    font-weight: 600;
}
.btn--danger:hover {
    background: var(--color-btn-delete-hover-bg, #b6020e);
    color: var(--color-btn-delete-hover-text, #fff);
    border-color: var(--color-btn-delete-hover-bg, #b6020e);
}
.btn--secondary { background: var(--color-bg-hover); color: var(--color-text); border: 1px solid var(--color-border); }
.btn--ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn--ghost:hover { background: var(--color-bg-hover); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0;
    cursor: pointer;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    height: var(--topbar-control-height);
    min-height: var(--topbar-control-height);
    width: var(--topbar-control-height);
    min-width: var(--topbar-control-height);
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-theme-toggle--square {
    padding: 0;
    gap: 0;
}

.btn-theme-toggle--square .btn-theme-toggle__label {
    display: none;
}

.btn-theme-toggle:hover,
.btn-theme-toggle:focus-visible {
    background: var(--color-bg-hover);
    color: var(--color-text);
    border-color: var(--color-primary);
    outline: none;
}

.btn-theme-toggle__icon {
    font-size: 1.125rem !important;
}

.btn-theme-toggle__label {
    white-space: nowrap;
}

.alert { padding: 0.75rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; color: var(--color-text); }
.alert--success { background: rgba(74, 222, 128, 0.15); border: 1px solid var(--color-success); }
.alert--warning { background: rgba(251, 191, 36, 0.15); border: 1px solid var(--color-warning); }
.alert--danger { background: rgba(248, 113, 113, 0.15); border: 1px solid var(--color-danger); }

[data-theme="dark"] .alert--success { color: #b8f5d0; }
[data-theme="dark"] .alert--warning { color: #ffe6a8; }
[data-theme="dark"] .alert--danger { color: #ffc8c8; }

.text-muted { color: var(--color-text-muted); }
.text-muted--sm { font-size: 0.875rem; }
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-3 { margin-top: 1rem; }
.p-4 { padding: 1.25rem; }
.small { font-size: 0.8rem; }

.dashboard-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.widget {
    padding: 1rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
}

.widget__label { display: block; font-size: 0.8rem; color: var(--color-text-muted); }
.widget__value { display: block; font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }

.sidebar-overlay[hidden] { display: none; }

@media (max-width: 768px) {
    .app-layout.sg-app--with-sidebar {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        z-index: 100;
        top: 0;
        left: 0;
        height: 100%;
        min-height: 100%;
        transform: translateX(-100%);
        transition: transform 0.2s;
    }

    .sidebar.is-open { transform: translateX(0); }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

    .sg-app--with-sidebar .main-content.sg-main {
        width: 100%;
    }

}

/* Party mode — efeitos apenas no overlay de carregamento */
[data-party-mode="1"] .se-pre-con {
    animation: gest-party-hue 6s linear infinite;
}

@keyframes gest-party-hue {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}
/* Banco de horas chart */
.sg-banco-chart {
  margin: 0.75rem 1rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--sg-surface-2, rgba(127,127,127,0.08));
}
.sg-banco-chart canvas {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  display: block;
}
.sg-banco-chart__legend {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}
.sg-banco-chart__swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.sg-banco-chart__swatch--contract { background: rgba(66, 133, 244, 0.85); }
.sg-banco-chart__swatch--worked { background: rgba(52, 168, 83, 0.85); }
