        /* =========================================================================
           MODAL ADMINISTRATIVO COM 2FA & SUPABASE (iOS SHEET STYLE)
           ========================================================================= */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1500;
            padding: 20px;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal-box-ios {
            background: var(--ios-card-solid);
            border: 1px solid var(--ios-border-highlight);
            border-radius: 26px;
            width: 100%;
            max-width: 980px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
            overflow: hidden;
            animation: modalSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes modalSheet {
            from { transform: scale(0.92) translateY(20px); opacity: 0; }
            to { transform: scale(1) translateY(0); opacity: 1; }
        }

        .modal-header-ios {
            padding: 20px 24px;
            border-bottom: 1px solid var(--ios-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: var(--ios-card-bg);
        }

        .modal-header-ios h2 {
            font-size: 1.2rem;
            font-weight: 800;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .modal-close-ios {
            background: rgba(142, 142, 147, 0.16);
            border: none;
            color: var(--text-secondary);
            width: 30px;
            height: 30px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
        }

        .modal-close-ios:hover {
            color: var(--text-primary);
            background: rgba(142, 142, 147, 0.25);
        }

        .modal-body {
            padding: 24px;
            overflow-y: auto;
            flex-grow: 1;
        }

        .auth-card-ios {
            max-width: 400px;
            margin: 15px auto;
            text-align: center;
        }

        .auth-card-ios .lock-badge {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background: rgba(255, 51, 58, 0.12);
            color: var(--claro-red);
            font-size: 2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 16px;
            border: 1px solid rgba(255, 51, 58, 0.25);
        }

        .form-group-ios {
            margin-bottom: 16px;
            text-align: left;
        }

        .form-group-ios label {
            display: block;
            font-size: 0.82rem;
            font-weight: 600;
            margin-bottom: 6px;
            color: var(--text-secondary);
        }

        .form-control-ios {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--ios-border);
            border-radius: 12px;
            background: rgba(142, 142, 147, 0.08);
            color: var(--text-primary);
            font-size: 0.95rem;
            outline: none;
        }

        .form-control-ios:focus {
            border-color: var(--claro-red);
            background: var(--ios-card-solid);
        }

        /* Suporte a gerenciadores de senha (Bitwarden, 1Password, etc.) sem sobreposição de ícones */
        input[type="password"]::-ms-reveal,
        input[type="password"]::-ms-clear {
            display: none !important;
        }

        .password-input-wrapper {
            position: relative;
            width: 100%;
            display: flex;
            align-items: center;
        }

        .password-input-wrapper .form-control-ios {
            padding-right: 78px !important;
        }

        .password-toggle-btn {
            position: absolute;
            right: 44px; /* Posicionado à esquerda do badge do Bitwarden para nunca sobrepor */
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 6px 8px;
            font-size: 0.95rem;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            transition: color 0.2s, background 0.2s;
            z-index: 5;
        }

        .password-toggle-btn:hover {
            color: var(--claro-red);
            background: rgba(255, 51, 58, 0.08);
        }

        /* =========================================================================
           ESTILOS DO EDITOR DE LINK & SELETOR VISUAL DE ÍCONES (iOS 26)
           ========================================================================= */
        .form-grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 14px;
        }

        @media (max-width: 600px) {
            .form-grid-2 {
                grid-template-columns: 1fr;
            }
        }

        .icon-picker-container {
            background: rgba(142, 142, 147, 0.06);
            border: 1px solid var(--ios-border);
            border-radius: 18px;
            padding: 14px;
            margin-top: 4px;
        }

        .icon-picker-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }

        .selected-icon-preview {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--ios-card-solid);
            padding: 6px 14px 6px 8px;
            border-radius: var(--pill-radius);
            border: 1px solid var(--ios-border-highlight);
            box-shadow: var(--ios-shadow-sm);
        }

        .selected-icon-preview .preview-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: rgba(255, 51, 58, 0.12);
            color: var(--claro-red);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.15rem;
            border: 1px solid rgba(255, 51, 58, 0.25);
        }

        .icon-search-input {
            flex: 1;
            min-width: 180px;
            padding: 8px 14px;
            border-radius: var(--pill-radius);
            border: 1px solid var(--ios-border);
            background: var(--ios-card-solid);
            color: var(--text-primary);
            font-size: 0.84rem;
            outline: none;
        }

        .icon-search-input:focus {
            border-color: var(--claro-red);
            box-shadow: 0 0 0 2px var(--claro-red-glow);
        }

        .icon-grid-scroll {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
            gap: 8px;
            max-height: 170px;
            overflow-y: auto;
            padding: 4px 2px;
            scrollbar-width: thin;
        }

        .icon-picker-btn {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            background: var(--ios-card-solid);
            border: 1px solid var(--ios-border);
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .icon-picker-btn:hover {
            background: rgba(255, 51, 58, 0.12);
            color: var(--claro-red);
            border-color: var(--claro-red);
            transform: scale(1.1);
        }

        .icon-picker-btn.active {
            background: var(--claro-red);
            color: #ffffff;
            border-color: var(--claro-red);
            box-shadow: 0 0 10px var(--claro-red-glow);
        }

        /* =========================================================================
           PAINEL DE ADMIN: FILTROS & HERO CARDS (iOS 26 GLASS)
           ========================================================================= */
        .admin-toolbar {
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .admin-search-wrapper {
            flex: 1 1 240px;
            position: relative;
            display: flex;
            align-items: center;
        }

        .admin-search-wrapper i {
            position: absolute;
            left: 14px;
            color: var(--text-tertiary);
            font-size: 0.9rem;
            pointer-events: none;
            transition: color 0.2s, filter 0.2s;
        }

        .admin-search-input {
            width: 100%;
            padding: 10px 14px 10px 38px;
            border-radius: var(--pill-radius);
            border: 1px solid var(--ios-border);
            background: rgba(142, 142, 147, 0.08);
            color: var(--text-primary);
            font-size: 0.88rem;
            font-weight: 500;
            outline: none;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .admin-search-input:focus {
            border-color: var(--claro-red);
            background: var(--ios-card-solid);
            box-shadow: 0 0 0 3px rgba(239, 40, 46, 0.15);
        }

        .admin-search-input:focus + i,
        .admin-search-wrapper:focus-within i {
            color: var(--claro-red);
            filter: drop-shadow(0 0 6px rgba(239, 40, 46, 0.6));
        }

        .admin-category-filter {
            padding: 10px 16px;
            border-radius: var(--pill-radius);
            border: 1px solid var(--ios-border);
            background: rgba(142, 142, 147, 0.08);
            color: var(--text-primary);
            font-size: 0.86rem;
            font-weight: 600;
            outline: none;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
            min-width: 180px;
        }

        .admin-category-filter:focus {
            border-color: var(--claro-red);
            background: var(--ios-card-solid);
        }

        .admin-hero-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
            gap: 14px;
            max-height: 520px;
            overflow-y: auto;
            padding: 4px;
            padding-right: 8px;
        }

        @media (max-width: 768px) {
            .admin-hero-grid {
                grid-template-columns: 1fr;
                max-height: 480px;
            }
        }

        .admin-hero-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
            backdrop-filter: blur(28px) saturate(190%);
            -webkit-backdrop-filter: blur(28px) saturate(190%);
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: 20px;
            padding: 16px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            position: relative;
            box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.22),
                        inset 0 -1px 1px 0 rgba(0, 0, 0, 0.2),
                        0 8px 28px 0 rgba(0, 0, 0, 0.32);
            overflow: hidden;
        }

        [data-theme="light"] .admin-hero-card {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(245, 245, 247, 0.68) 100%);
            border: 1px solid rgba(255, 255, 255, 0.85);
            box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.9),
                        0 6px 20px 0 rgba(0, 0, 0, 0.07);
        }

        .admin-hero-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
            pointer-events: none;
        }

        .admin-hero-card:hover {
            border-color: rgba(239, 40, 46, 0.55);
            transform: translateY(-3px) scale(1.008);
            box-shadow: inset 0 1px 2px 0 rgba(255, 255, 255, 0.35),
                        0 14px 36px rgba(0, 0, 0, 0.45),
                        0 0 22px rgba(239, 40, 46, 0.22);
        }

        .admin-hero-card-header {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            margin-bottom: 10px;
        }

        .admin-hero-icon {
            width: 44px;
            height: 44px;
            border-radius: 14px;
            background: linear-gradient(135deg, rgba(239, 40, 46, 0.22) 0%, rgba(239, 40, 46, 0.06) 100%);
            border: 1px solid rgba(239, 40, 46, 0.35);
            color: var(--claro-red);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            flex-shrink: 0;
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 12px rgba(239, 40, 46, 0.2);
            transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .admin-hero-card:hover .admin-hero-icon {
            transform: scale(1.08);
            box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 16px rgba(239, 40, 46, 0.5);
        }

        .admin-hero-title-group {
            flex: 1;
            min-width: 0;
        }

        .admin-hero-title {
            font-size: 0.96rem;
            font-weight: 800;
            color: var(--text-primary);
            line-height: 1.25;
            margin-bottom: 6px;
            word-break: break-word;
        }

        .admin-hero-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            align-items: center;
        }

        .admin-hero-desc {
            font-size: 0.82rem;
            color: var(--text-secondary);
            line-height: 1.4;
            margin-bottom: 12px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .admin-hero-links {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 14px;
            padding-top: 8px;
            border-top: 1px dashed var(--ios-border);
        }

        .admin-hero-url {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.78rem;
            color: var(--text-tertiary);
            text-decoration: none;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: color 0.2s;
        }

        .admin-hero-url:hover {
            color: var(--claro-red);
            text-decoration: underline;
        }

        .admin-hero-training {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.76rem;
            color: #ff9800;
            font-weight: 600;
            text-decoration: none;
            transition: filter 0.2s;
        }

        .admin-hero-training:hover {
            filter: brightness(1.2);
            text-decoration: underline;
        }

        .admin-hero-actions {
            display: flex;
            gap: 8px;
            align-items: center;
            justify-content: flex-end;
            padding-top: 10px;
            border-top: 1px solid var(--ios-border);
        }

        .admin-hero-btn-edit {
            padding: 6px 14px;
            font-size: 0.82rem;
            font-weight: 700;
            border-radius: var(--pill-radius);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
            border: 1px solid rgba(255, 255, 255, 0.18);
            color: var(--text-primary);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15);
        }

        .admin-hero-btn-edit:hover {
            background: var(--claro-red);
            color: #ffffff;
            border-color: var(--claro-red);
            box-shadow: 0 0 14px var(--claro-red-glow);
            transform: translateY(-1px);
        }

        .admin-hero-btn-delete {
            padding: 6px 12px;
            font-size: 0.82rem;
            font-weight: 700;
            border-radius: var(--pill-radius);
            background: rgba(239, 40, 46, 0.08);
            border: 1px solid rgba(239, 40, 46, 0.25);
            color: var(--claro-red);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .admin-hero-btn-delete:hover {
            background: var(--claro-red);
            color: #ffffff;
            border-color: var(--claro-red);
            box-shadow: 0 0 14px var(--claro-red-glow);
            transform: translateY(-1px);
        }

        /* --- FOOTER --- */
        footer {
            text-align: center;
            color: var(--text-tertiary);
            font-size: 0.84rem;
            margin-top: 60px;
            padding: 25px 20px;
            border-top: 1px solid var(--ios-border);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            position: relative;
            z-index: 1;
        }

        .footer-admin-link {
            color: var(--text-secondary);
            font-size: 0.8rem;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            padding: 7px 14px;
            border-radius: var(--pill-radius);
            background: var(--ios-card-bg);
            border: 1px solid var(--ios-border);
        }

        .footer-admin-link:hover {
            color: var(--claro-red);
            border-color: var(--claro-red);
        }

        /* =========================================================================
           PÁGINA DE GESTÃO (gestao.html) — SHELL COM SIDEBAR PERSISTENTE
           Substitui a antiga interface de modal por uma página própria de
           verdade: sidebar lateral colapsável (ícones sempre visíveis mesmo
           recolhida) + topbar + área de conteúdo com scroll único.
           ========================================================================= */
        /* Escopado a .gestao-page (classe no <html> de gestao.html) — "html"
           sozinho vazaria esse overflow:hidden para o index.html também, já
           que admin.css é carregado nas duas páginas. */
        html.gestao-page, body.gestao-body {
            height: 100%;
            overflow: hidden;
        }

        .gestao-shell {
            display: flex;
            height: 100vh;
            width: 100vw;
        }

        /* --- SIDEBAR --- */
        .gestao-sidebar {
            width: 248px;
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            background: var(--ios-card-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-right: 1px solid var(--ios-border);
            transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
            overflow: hidden;
        }

        .gestao-sidebar.collapsed {
            width: 72px;
        }

        /* .gestao-sidebar/.gestao-topbar têm display:flex explícito, que teria
           precedência sobre o [hidden] nativo do navegador — força a ocultação
           antes do login (ver showAuthScreen() em admin-auth.js). */
        .gestao-sidebar[hidden],
        .gestao-topbar[hidden] {
            display: none !important;
        }

        .gestao-sidebar-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 18px 16px;
            border-bottom: 1px solid var(--ios-border);
            flex-shrink: 0;
        }

        .sidebar-toggle-btn {
            width: 36px;
            height: 36px;
            flex-shrink: 0;
            border-radius: 10px;
            border: 1px solid var(--ios-border);
            background: var(--ios-card-elevated);
            color: var(--text-primary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.95rem;
        }
        .sidebar-toggle-btn:hover {
            border-color: var(--claro-red);
            color: var(--claro-red);
        }

        .sidebar-brand-label {
            font-weight: 800;
            font-size: 0.95rem;
            white-space: nowrap;
            overflow: hidden;
            color: var(--text-primary);
        }
        .gestao-sidebar.collapsed .sidebar-brand-label,
        .gestao-sidebar.collapsed .sidebar-nav-label,
        .gestao-sidebar.collapsed .sidebar-nav-badge,
        .gestao-sidebar.collapsed .sidebar-footer-label {
            display: none;
        }

        .gestao-sidebar-nav {
            flex: 1;
            overflow-y: auto;
            padding: 12px 10px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .sidebar-nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 11px 12px;
            border-radius: 12px;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            font-size: 0.86rem;
            font-weight: 600;
            cursor: pointer;
            text-align: left;
            width: 100%;
            white-space: nowrap;
        }
        .gestao-sidebar.collapsed .sidebar-nav-item {
            justify-content: center;
            padding: 11px 0;
        }

        .sidebar-nav-item i {
            font-size: 1.05rem;
            width: 20px;
            text-align: center;
            flex-shrink: 0;
        }

        .sidebar-nav-item:hover {
            background: var(--ios-card-elevated);
            color: var(--text-primary);
        }

        .sidebar-nav-item.active {
            background: rgba(239, 40, 46, 0.12);
            color: var(--claro-red);
        }

        .sidebar-nav-label {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sidebar-nav-badge {
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--text-tertiary);
        }

        .gestao-sidebar-footer {
            border-top: 1px solid var(--ios-border);
            padding: 10px;
            flex-shrink: 0;
        }

        /* --- TOPBAR + CONTEÚDO --- */
        .gestao-main {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            height: 100vh;
        }

        .gestao-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            flex-wrap: wrap;
            padding: 16px 24px;
            border-bottom: 1px solid var(--ios-border);
            flex-shrink: 0;
        }

        .gestao-content {
            flex: 1;
            overflow-y: auto;
            padding: 24px;
        }

        .gestao-login-wrap {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow-y: auto;
        }

        /* Selects nativos herdam a paleta do SO no popup de opções em alguns
           navegadores — força a lista de opções a seguir o tema escuro/claro. */
        select.form-control-ios option,
        .admin-category-filter option {
            background-color: var(--ios-card-solid);
            color: var(--text-primary);
        }

        @media (max-width: 768px) {
            .gestao-sidebar {
                position: fixed;
                inset: 0 auto 0 0;
                z-index: 50;
                box-shadow: var(--ios-shadow);
            }
            .gestao-sidebar:not(.collapsed) {
                width: 220px;
            }
        }
