        :root {
            --app-bg: #f3f6fb;
            --panel: #0b2f69;
            --panel-soft: #0f3f8a;
            --line: #dce4f1;
            --text: #0f1b2d;
            --muted: #64748b;
            --brand: #1f6feb;
            --brand-2: #26b7a0;
            --surface: #ffffff;
            --radius-lg: 16px;
            --radius-md: 12px;
            --shadow: 0 20px 35px rgba(15, 23, 42, 0.08);
        }

        body {
            background: radial-gradient(circle at 5% 10%, #e8eefb 0%, transparent 30%), var(--app-bg);
            color: var(--text);
        }

        .auth-shell {
            min-height: 100vh;
            display: grid;
            grid-template-columns: 280px 1fr;
        }

        .sidebar {
            background:
                radial-gradient(circle at 8% 8%, rgba(255, 255, 255, 0.08) 0%, transparent 22%),
                linear-gradient(180deg, #0b2f69 0%, #0f3b7b 45%, #15458f 100%);
            color: #eaf2ff;
            padding: 1.25rem;
            border-right: 1px solid rgba(255, 255, 255, 0.25);
            position: sticky;
            top: 0;
            height: 100vh;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
            box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.15);
        }

        .sidebar-brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
            text-decoration: none;
            color: #ffffff;
            font-weight: 700;
            letter-spacing: 0.01em;
        }

        .sidebar-mark {
            width: 52px;
            height: 52px;
            border-radius: 999px;
            background: radial-gradient(circle at 30% 30%, #85f3ff 0%, #54b8ff 35%, #225fca 75%, #0f3f8a 100%);
            display: grid;
            place-items: center;
            color: #fff;
            box-shadow: 0 14px 28px rgba(11, 47, 105, 0.45);
            border: 1px solid rgba(186, 234, 255, 0.7);
            position: relative;
            overflow: hidden;
            perspective: 240px;
        }

        .sidebar-mark::before {
            content: "";
            position: absolute;
            inset: 6px;
            border-radius: 999px;
            background: radial-gradient(circle at 25% 20%, rgba(180, 247, 255, 0.45), transparent 52%);
            z-index: 0;
            pointer-events: none;
        }

        .sidebar-mark svg {
            width: 36px;
            height: 36px;
            display: block;
            z-index: 1;
        }

        .sidebar-mark .earth-tilt {
            transform-origin: 32px 32px;
            animation: globe-spin 9s linear infinite;
        }

        .sidebar-mark .earth-surface {
            transform-origin: 32px 32px;
            animation: earth-surface-spin 5.8s linear infinite;
        }

        .sidebar-mark::after {
            content: "";
            position: absolute;
            inset: -8px;
            border-radius: 999px;
            border: 2px solid rgba(175, 232, 255, 0.58);
            animation: sidebar-orbit 8.8s linear infinite;
        }

        @keyframes sidebar-orbit {
            from { transform: rotate(0deg) scale(1); }
            to { transform: rotate(360deg) scale(1); }
        }

        @keyframes globe-spin {
            from { transform: rotate(-17deg); }
            to { transform: rotate(343deg); }
        }

        @keyframes earth-surface-spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        .sidebar-brand-name {
            font-size: 1.06rem;
            font-weight: 800;
            letter-spacing: 0.01em;
        }

        .sidebar-menu {
            display: grid;
            gap: 0.8rem;
            flex: 1 1 auto;
            min-height: 0;
            overflow-y: hidden;
            overflow-x: hidden;
            padding-right: 0.2rem;
        }

        .sidebar-menu.is-scrollable {
            overflow-y: auto;
        }

        .sidebar-menu.is-scrollable::-webkit-scrollbar {
            width: 8px;
        }

        .sidebar-menu.is-scrollable::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.08);
            border-radius: 999px;
        }

        .sidebar-menu.is-scrollable::-webkit-scrollbar-thumb {
            background: rgba(224, 238, 255, 0.45);
            border-radius: 999px;
        }

        .sidebar-menu.is-scrollable::-webkit-scrollbar-thumb:hover {
            background: rgba(224, 238, 255, 0.65);
        }

        .sidebar-menu-group {
            display: grid;
            gap: 0.35rem;
        }

        .sidebar-section-label {
            margin: 0.1rem 0 0.2rem;
            padding: 0 0.15rem;
            font-size: 0.7rem;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(224, 238, 255, 0.72);
        }

        .sidebar-link {
            color: #eaf2ff;
            text-decoration: none;
            padding: 0.72rem 0.95rem;
            border-radius: 12px;
            font-size: 0.93rem;
            font-weight: 600;
            border: 1px solid rgba(255, 255, 255, 0.06);
            position: relative;
            overflow: hidden;
            transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
            display: flex;
            align-items: center;
            gap: 0.58rem;
        }

        .sidebar-link-text {
            flex: 1;
            min-width: 0;
        }

        .sidebar-link-icon {
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: rgba(236, 245, 255, 0.95);
        }

        .sidebar-link-icon svg {
            width: 18px;
            height: 18px;
            display: block;
        }

        .sidebar-link::before {
            content: "";
            position: absolute;
            left: 0;
            top: 20%;
            height: 60%;
            width: 3px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.85);
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .sidebar-link:hover {
            color: #fff;
            transform: translateX(2px);
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.25);
            box-shadow: 0 10px 18px rgba(17, 41, 90, 0.18);
        }

        .sidebar-link:hover::before {
            opacity: 0.8;
        }

        .sidebar-link.active {
            color: #fff;
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(198, 224, 255, 0.20));
            border-color: rgba(255, 255, 255, 0.45);
            box-shadow: 0 14px 24px rgba(18, 46, 99, 0.2);
        }

        .sidebar-link.active::before {
            opacity: 1;
        }

        .sidebar-link.active .sidebar-link-icon {
            color: #ffffff;
        }

        .sidebar.sidebar-billing-locked .sidebar-link:not(.is-billing-entry) {
            opacity: 0.42;
            filter: saturate(0.45);
            pointer-events: none;
            cursor: not-allowed;
            transform: none !important;
            box-shadow: none !important;
        }

        .sidebar.sidebar-billing-locked .sidebar-link:not(.is-billing-entry)::before {
            opacity: 0 !important;
        }

        .sidebar.sidebar-billing-locked .sidebar-link.is-billing-entry {
            border-color: rgba(255, 255, 255, 0.55);
            box-shadow: 0 14px 24px rgba(18, 46, 99, 0.2);
        }

        .sidebar-link-disabled {
            opacity: 0.52;
            cursor: not-allowed;
            user-select: none;
        }

        .sidebar-link-badge {
            min-width: 20px;
            height: 20px;
            padding: 0 0.35rem;
            border-radius: 999px;
            background: #ef4444;
            color: #fff;
            font-size: 0.72rem;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            box-shadow: 0 8px 14px rgba(239, 68, 68, 0.35);
        }

        .sidebar-floating-tooltip {
            position: fixed;
            top: 0;
            left: 0;
            transform: translateY(-50%) translateX(-4px);
            background: linear-gradient(180deg, rgba(11, 33, 74, 0.98), rgba(8, 24, 56, 0.98));
            color: #f8fbff;
            border: 1px solid rgba(172, 205, 255, 0.22);
            border-radius: 10px;
            padding: 0.44rem 0.62rem;
            font-size: 0.76rem;
            font-weight: 600;
            letter-spacing: 0.01em;
            line-height: 1.2;
            white-space: nowrap;
            box-shadow: 0 12px 26px rgba(4, 14, 36, 0.36);
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
            transition: opacity 0.18s ease, transform 0.2s ease, visibility 0.18s ease;
            z-index: 2200;
        }

        .sidebar-floating-tooltip.is-visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(-50%) translateX(0);
        }

        .sidebar-user {
            margin-top: 1.2rem;
            border: 1px solid rgba(255, 255, 255, 0.34);
            background: rgba(10, 42, 92, 0.25);
            border-radius: var(--radius-md);
            padding: 0.85rem;
            color: #eaf2ff;
            font-size: 0.9rem;
            backdrop-filter: blur(4px);
        }

        .sidebar-user-name {
            font-weight: 700;
            color: #ffffff;
            line-height: 1.2;
        }

        .sidebar-user-role {
            display: inline-flex;
            align-items: center;
            margin-top: 0.35rem;
            padding: 0.18rem 0.55rem;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.45);
            background: rgba(255, 255, 255, 0.16);
            color: #ffffff;
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: 0.05em;
            text-transform: uppercase;
        }

        .main-area {
            display: flex;
            flex-direction: column;
            min-width: 0;
        }

        .main-header {
            padding: 0.9rem 1.5rem;
            border-bottom: 1px solid var(--line);
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(6px);
        }

        .main-header-panel {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            min-width: 0;
        }

        .sidebar-toggle {
            display: none;
            width: 36px;
            height: 36px;
            border-radius: 10px;
            border: 1px solid #c8d7ef;
            background: #ffffff;
            color: #0f3f8a;
            align-items: center;
            justify-content: center;
            padding: 0;
            box-shadow: 0 8px 14px rgba(15, 63, 138, 0.14);
            flex-shrink: 0;
        }

        .sidebar-toggle svg {
            width: 19px;
            height: 19px;
            display: block;
        }

        .sidebar-mobile-close {
            display: none;
            width: 34px;
            height: 34px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.45);
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            align-items: center;
            justify-content: center;
            padding: 0;
            margin-left: auto;
        }

        .sidebar-collapse-btn {
            width: 34px;
            height: 34px;
            border-radius: 999px;
            border: 1px solid rgba(255, 255, 255, 0.45);
            background: rgba(255, 255, 255, 0.12);
            color: #ffffff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            margin-left: auto;
            transition: transform 0.2s ease, background 0.2s ease;
        }

        .sidebar-collapse-btn svg {
            width: 16px;
            height: 16px;
            display: block;
        }

        body.sidebar-collapsed .sidebar-collapse-btn svg {
            transform: rotate(180deg);
        }

        .sidebar-mobile-close svg {
            width: 16px;
            height: 16px;
            display: block;
        }

        .sidebar-overlay {
            display: none;
        }

        .main-header-badge {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background:
                radial-gradient(circle at 30% 30%, rgba(122, 220, 255, 0.95) 0%, rgba(95, 173, 255, 0.35) 28%, transparent 46%),
                linear-gradient(135deg, #0b2f69, #1b57bf 62%, #2d79f2 100%);
            color: #fff;
            display: grid;
            place-items: center;
            box-shadow: 0 10px 18px rgba(10, 56, 138, 0.28);
            border: 1px solid rgba(163, 224, 255, 0.5);
            overflow: hidden;
            flex-shrink: 0;
        }

        .main-header-badge svg {
            width: 21px;
            height: 21px;
            display: block;
        }

        .main-header-title {
            margin: 0;
            font-family: "Plus Jakarta Sans", "Inter", "Segoe UI", sans-serif;
            font-size: clamp(1.02rem, 1.4vw, 1.2rem);
            font-weight: 800;
            line-height: 1.18;
            letter-spacing: -0.01em;
            color: #0c2f60;
            text-wrap: balance;
        }

        .main-header-subtitle {
            margin: 0;
            font-size: 0.8rem;
            color: #607695;
        }

        .main-content {
            padding: 1.5rem;
        }

        .app-card {
            border: 1px solid var(--line);
            border-radius: var(--radius-lg);
            background: var(--surface);
            box-shadow: var(--shadow);
        }

        .app-card .btn {
            border-radius: 999px;
            padding-left: 0.95rem;
            padding-right: 0.95rem;
            font-weight: 600;
        }

        .header-logout-btn {
            border-radius: 999px;
            padding: 0.45rem 1.2rem;
            font-size: 0.95rem;
            font-weight: 700;
        }

        .header-dicas-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            border: 1px solid #9fc5f8;
            background: #e8f3ff;
            color: #0b4ca8;
            padding: 0.4rem 0.9rem;
            line-height: 1;
        }

        .header-dicas-btn:hover,
        .header-dicas-btn:focus-visible {
            background: #dcebff;
            color: #083f8e;
            border-color: #89b7f5;
        }

        .header-dicas-btn-icon {
            width: 22px;
            height: 22px;
            border-radius: 999px;
            display: inline-grid;
            place-items: center;
            background: #0d6efd;
            color: #fff;
            font-size: 0.88rem;
            font-weight: 700;
            line-height: 1;
            flex: 0 0 22px;
        }

        .header-dicas-btn-text {
            display: inline-block;
            font-weight: 700;
            line-height: 1.1;
            white-space: nowrap;
        }

        .form-stack label {
            font-weight: 600;
            font-size: 0.92rem;
            margin-bottom: 0.35rem;
            color: #1e293b;
        }

        .form-stack input,
        .form-stack select,
        .form-stack textarea {
            width: 100%;
            border: 1px solid #cdd8ea;
            background: #fff;
            border-radius: 10px;
            padding: 0.62rem 0.75rem;
            font-size: 0.95rem;
            color: var(--text);
        }

        .form-stack input:focus,
        .form-stack select:focus,
        .form-stack textarea:focus {
            border-color: var(--brand);
            outline: 0;
            box-shadow: 0 0 0 0.2rem rgba(31, 111, 235, 0.15);
        }

        .anon-nav {
            background: #111827;
        }

        @media (max-width: 991.98px) {
            .auth-shell {
                grid-template-columns: 1fr;
            }

            .sidebar {
                position: fixed;
                inset: 0 auto 0 0;
                width: min(86vw, 320px);
                height: 100dvh;
                z-index: 1045;
                transform: translateX(-105%);
                transition: transform 0.2s cubic-bezier(0.22, 0.8, 0.2, 1);
                border-right: 1px solid rgba(255, 255, 255, 0.3);
                overflow: hidden;
            }

            .sidebar-menu {
                overflow-y: auto !important;
                padding-bottom: 0.8rem;
            }

            .sidebar-toggle {
                display: inline-flex;
            }

            .sidebar-mobile-close {
                display: inline-flex;
            }

            .sidebar-collapse-btn {
                display: none;
            }

            .sidebar-overlay {
                display: block;
                position: fixed;
                inset: 0;
                background: rgba(3, 12, 25, 0.45);
                backdrop-filter: blur(1px);
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.18s ease-out;
                z-index: 1040;
            }

            body.sidebar-open .sidebar {
                transform: translateX(0);
            }

            body.sidebar-open .sidebar-overlay {
                opacity: 1;
                pointer-events: auto;
            }
        }

        @media (min-width: 992px) {
            body.sidebar-collapsed {
                --sidebar-collapsed-item-size: 54px;
                --sidebar-collapsed-gap: 0.55rem;
            }

            body.sidebar-collapsed .auth-shell {
                grid-template-columns: 96px 1fr;
            }

            body.sidebar-collapsed .sidebar {
                padding: 0.9rem 0.7rem;
                overflow: visible;
                z-index: 1500;
            }

            body.sidebar-collapsed .sidebar-brand {
                justify-content: center;
                margin-bottom: 0.8rem;
            }

            body.sidebar-collapsed .sidebar-brand-name,
            body.sidebar-collapsed .sidebar-section-label,
            body.sidebar-collapsed .sidebar-link-text,
            body.sidebar-collapsed .sidebar-link-badge,
            body.sidebar-collapsed .sidebar-user {
                display: none !important;
            }

            body.sidebar-collapsed .sidebar-menu-group {
                display: grid;
                gap: var(--sidebar-collapsed-gap);
            }

            body.sidebar-collapsed .sidebar-menu-group + .sidebar-menu-group {
                margin-top: var(--sidebar-collapsed-gap);
            }

            body.sidebar-collapsed .sidebar-menu {
                display: flex;
                flex-direction: column;
                gap: 0;
                overflow-y: auto;
                overflow-x: hidden;
                padding-right: 0.12rem;
            }

            body.sidebar-collapsed .sidebar-link {
                width: 100%;
                height: var(--sidebar-collapsed-item-size);
                min-height: var(--sidebar-collapsed-item-size);
                justify-content: center;
                padding: 0;
                border-radius: 11px;
                position: relative;
                overflow: visible;
            }

            body.sidebar-collapsed .sidebar-link-icon {
                width: 18px;
                height: 18px;
                position: relative;
            }

            body.sidebar-collapsed .sidebar-link-icon svg {
                width: 16px;
                height: 16px;
            }

            body.sidebar-collapsed .sidebar-link::before {
                top: auto;
                bottom: 4px;
                left: 50%;
                width: 28%;
                height: 2px;
                transform: translateX(-50%);
            }

            body.sidebar-collapsed .sidebar-collapse-btn {
                width: 100%;
                height: 42px;
                padding: 0;
                justify-content: center;
            }

            body.sidebar-collapsed .sidebar-link[data-tooltip]::after {
                content: attr(data-tooltip);
                position: absolute;
                left: calc(100% + 12px);
                top: 50%;
                transform: translateY(-50%) translateX(-4px);
                background: linear-gradient(180deg, rgba(11, 33, 74, 0.98), rgba(8, 24, 56, 0.98));
                color: #f8fbff;
                border: 1px solid rgba(172, 205, 255, 0.22);
                border-radius: 10px;
                padding: 0.44rem 0.62rem;
                font-size: 0.76rem;
                font-weight: 600;
                letter-spacing: 0.01em;
                line-height: 1.2;
                white-space: nowrap;
                box-shadow: 0 12px 26px rgba(4, 14, 36, 0.36);
                opacity: 0;
                visibility: hidden;
                pointer-events: none;
                transition: opacity 0.18s ease, transform 0.2s ease, visibility 0.18s ease;
                z-index: 1600;
            }

            body.sidebar-collapsed .sidebar-link[data-tooltip]::before {
                box-shadow: none;
            }

            body.sidebar-collapsed .sidebar-link[data-tooltip]:hover::after,
            body.sidebar-collapsed .sidebar-link[data-tooltip]:focus-visible::after {
                opacity: 1;
                visibility: visible;
                transform: translateY(-50%) translateX(0);
            }

            body.sidebar-collapsed .sidebar-link[data-tooltip] .sidebar-link-icon::after {
                content: "";
                position: absolute;
                left: calc(100% + 7px);
                top: 50%;
                width: 9px;
                height: 9px;
                background: rgba(10, 28, 63, 0.98);
                border-left: 1px solid rgba(172, 205, 255, 0.22);
                border-bottom: 1px solid rgba(172, 205, 255, 0.22);
                transform: translateY(-50%) rotate(45deg);
                opacity: 0;
                visibility: hidden;
                transition: opacity 0.18s ease, visibility 0.18s ease;
                pointer-events: none;
                z-index: 1599;
            }

            body.sidebar-collapsed .sidebar-link[data-tooltip]:hover .sidebar-link-icon::after,
            body.sidebar-collapsed .sidebar-link[data-tooltip]:focus-visible .sidebar-link-icon::after {
                opacity: 1;
                visibility: visible;
            }
        }

        @media (max-width: 575.98px) {
            .main-header {
                padding: 0.7rem 0.75rem;
                gap: 0.45rem;
            }

            .main-header-panel {
                gap: 0.45rem;
                flex: 0 0 auto;
            }

            .main-header-title {
                display: none;
            }

            .sidebar-toggle {
                width: 40px;
                height: 40px;
            }

            .sidebar-toggle svg {
                width: 20px;
                height: 20px;
            }

            .main-header-badge {
                width: 40px;
                height: 40px;
            }

            .main-header-badge svg {
                width: 23px;
                height: 23px;
            }

            .main-header-actions {
                flex: 1 1 auto;
                justify-content: flex-end;
                gap: 0.34rem !important;
                min-width: 0;
            }

            .main-header-actions .header-logout-btn {
                min-height: 38px;
                padding: 0.34rem 0.58rem;
                border-radius: 999px;
                font-size: 0.78rem;
                line-height: 1.05;
                white-space: normal;
                text-align: center;
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .main-header-actions .header-dicas-btn {
                padding-inline: 0.56rem;
                gap: 0.34rem;
            }

            .main-header-actions .header-dicas-btn-icon {
                width: 18px;
                height: 18px;
                flex-basis: 18px;
                font-size: 0.72rem;
            }
        }

        @media (max-width: 380px) {
            .main-header {
                padding-inline: 0.68rem;
            }

            .main-header-panel {
                gap: 0.38rem;
            }

            .sidebar-toggle,
            .main-header-badge {
                width: 38px;
                height: 38px;
            }

            .main-header-actions {
                gap: 0.28rem !important;
            }

            .main-header-actions .header-logout-btn {
                min-height: 36px;
                padding-inline: 0.5rem;
                font-size: 0.74rem;
            }

            .main-header-actions .header-dicas-btn {
                padding-inline: 0.5rem;
                gap: 0.28rem;
            }
        }

        @media (max-width: 340px) {
            .main-header-badge {
                display: none;
            }
        }

.is-hidden {
    display: none;
}

.page-narrow {
    max-width: 760px;
}

.danger-confirm-card {
    border-radius: 16px;
    box-shadow: 0 12px 24px rgba(180, 35, 24, 0.10);
}
