/* =================================
           1. GLOBAIS E VARIÁVEIS DE COR
           ================================= */
        /* --- CONFIGURAÇÕES GLOBAIS PARA TOUCH --- */
        * {
            /* Melhora responsividade em dispositivos touch */
            -webkit-tap-highlight-color: transparent;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }
        
        /* Permitir seleção em inputs e text areas */
        input, textarea, select {
            -webkit-user-select: auto;
            -moz-user-select: auto;
            -ms-user-select: auto;
            user-select: auto;
        }

        :root {
            --bg-gradient-start: #8e44ad;
            --bg-gradient-end: #614bc3;
            --bg-header: rgba(118, 75, 162, 0.8);
            --card-bg: #ffffff;
            --text-dark: #34495e;
            --text-muted: #7f8c8d;
            --text-on-header: #ffffff;
            --green: #2ecc71;
            --blue: #3498db;
            --orange: #f39c12;
            --red: #e74c3c;
            --purple: #8e44ad;
            --gray: #6c757d;
            --nav-btn-bg: rgba(255, 255, 255, 0.1);
            --nav-btn-hover: rgba(255, 255, 255, 0.2);
            --nav-btn-active: #ffffff;
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Poppins', sans-serif;
            background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
            color: var(--text-dark);
            -webkit-font-smoothing: antialiased;
        }

        /* =================================
           2. LAYOUT PRINCIPAL E HEADER
           ================================= */
        .admin-panel {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }
        
        .main-header {
            background-color: var(--bg-header);
            backdrop-filter: blur(5px);
            padding: 20px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .header-title { display: flex; align-items: center; gap: 16px; }
        .header-title .logo {
            width: 40px; height: 40px;
            background: white; border-radius: 8px;
            display: grid; place-items: center;
            font-size: 1.5rem; color: #8e44ad;
        }
        .header-title .title-text h1 { font-size: 1.5rem; font-weight: 600; color: var(--text-on-header); }
        .header-title .title-text p { font-size: 0.9rem; color: var(--text-on-header); opacity: 0.8; }

        .status-badge {
            background-color: var(--green);
            color: white;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
        }

        /* --- Barra de Navegação --- */
        .main-nav {
            background: rgba(0,0,0,0.1);
            padding: 10px 40px;
        }
        .main-nav ul { list-style: none; display: flex; gap: 10px; }
        .main-nav a {
            display: flex; align-items: center; gap: 8px;
            text-decoration: none;
            color: var(--text-on-header);
            background-color: var(--nav-btn-bg);
            padding: 10px 20px;
            border-radius: 8px;
            font-weight: 500;
            transition: all 0.2s ease;
            touch-action: manipulation;
            min-height: 44px;
        }
        .main-nav a:hover { background-color: var(--nav-btn-hover); }
        .main-nav a.active {
            background-color: var(--nav-btn-active);
            color: var(--text-dark);
        }
        
        /* --- Área de Conteúdo --- */
        .content-area {
            flex-grow: 1;
            padding: 40px;
            overflow-y: auto;
            min-height: 0; /* Permite que o flex funcione corretamente */
        }

        .page { 
            display: none; 
            min-height: 100%;
        }
        .page.active { 
            display: block; 
        }
        
        .card {
            background: var(--card-bg);
            border-radius: 12px;
            padding: 24px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            margin-bottom: 20px; /* Espaçamento entre cards */
        }

        /* Estilos específicos para botões */
        button {
            cursor: pointer;
            transition: all 0.3s ease;
            z-index: 1;
            position: relative;
        }

        button:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        button:active {
            transform: translateY(0);
        }

        /* Garantir que os formulários tenham espaçamento adequado */
        form {
            position: relative;
            z-index: 1;
        }

        /* Estilos específicos para a página de notificações */
        #notificacoes.active {
            display: flex;
            flex-direction: column;
            gap: 32px;
        }

        #notificacoes .card {
            flex-shrink: 0;
        }

        /* Estilos para campos de formulário */
        .form-group {
            margin-bottom: 20px;
        }

        .form-group select,
        .form-group input,
        .form-group textarea {
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            padding: 12px;
            font-size: 14px;
            width: 100%;
            transition: border-color 0.3s ease;
        }

        .form-group select:focus,
        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--blue);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }

        /* Garantir que os botões de ação sempre fiquem visíveis */
        .form-group:last-child {
            margin-bottom: 0;
            padding-bottom: 20px;
        }

        /* Estilos para notificações automáticas */
        .auto-rule-card {
            transition: all 0.3s ease;
        }

        .auto-rule-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .auto-rule-card input[type="checkbox"]:checked + div h5 {
            color: var(--green) !important;
        }

        .rule-config {
            animation: slideDown 0.3s ease-out;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid rgba(0,0,0,0.1);
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .rule-config textarea {
            resize: vertical;
            font-family: inherit;
            transition: border-color 0.3s ease;
        }

        .rule-config textarea:focus {
            border-color: var(--blue);
            outline: none;
            box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
        }

        /* Indicadores de status das regras */
        .auto-rule-card input[type="checkbox"]:checked::before {
            content: "✓";
            position: absolute;
            color: var(--green);
            font-weight: bold;
        }

        /* Configurações globais */
        #auto-notification-settings {
            animation: fadeIn 0.4s ease-out;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Responsividade para cards de regras */
        @media (max-width: 768px) {
            #auto-notification-settings .grid {
                grid-template-columns: 1fr;
            }
            
            .auto-rule-card {
                margin-bottom: 16px;
            }
        }

        /* =================================
           3. ESTILOS DAS PÁGINAS E COMPONENTES
           ================================= */
        
        /* --- Visão Geral --- */
        .overview-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 24px;
        }
        .stat-card { position: relative; }
        .stat-card .title { font-size: 1.1rem; font-weight: 500; color: var(--text-muted); }
        .stat-card .value { font-size: 3rem; font-weight: 700; margin-top: 8px; }
        .stat-card .detail { font-size: 0.9rem; color: var(--green); font-weight: 500; }
        .stat-card .icon {
            position: absolute;
            top: 24px; right: 24px;
            font-size: 2.5rem;
            color: #ecf0f1;
        }
        
        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.15);
            transition: all 0.3s ease;
        }
        
        .stat-card.has-critical-errors {
            border-left: 4px solid var(--red);
            animation: pulse-error 2s infinite;
        }
        
        @keyframes pulse-error {
            0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
            50% { box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3); }
        }
        
        /* --- Notificações --- */
        .form-section .title { font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
        .form-section .subtitle { color: var(--text-muted); margin-bottom: 24px; }
        .form-group { margin-bottom: 20px; }
        .form-group label { display: block; font-weight: 500; margin-bottom: 8px; }
        .form-group select, .form-group textarea {
            width: 100%;
            padding: 12px;
            border: 1px solid #bdc3c7;
            border-radius: 8px;
            font-size: 1rem;
            font-family: 'Poppins', sans-serif;
        }
        
        .form-group input[type="text"] {
            width: 100%;
            padding: 12px;
            border: 1px solid #bdc3c7;
            border-radius: 8px;
            font-size: 1rem;
            font-family: 'Poppins', sans-serif;
        }
        
        .form-group textarea { min-height: 120px; resize: vertical; }
        
        .alert {
            padding: 12px 16px;
            border-radius: 6px;
            font-weight: 500;
            margin-top: 12px;
        }
        
        .alert.success {
            background: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
        
        .alert.error {
            background: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }
        
        .alert.loading {
            background: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
        /* --- Botões e Elementos Interativos --- */
        button, .btn, .nav-link, .user-item, [role="button"] {
            touch-action: manipulation;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            cursor: pointer;
            min-height: 44px; /* Tamanho mínimo recomendado para touch */
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .btn-purple { 
            background: var(--bg-gradient-start); 
            color: white; 
            border: none; 
            padding: 12px 24px; 
            border-radius: 8px; 
            cursor: pointer; 
            font-size: 1rem; 
            font-weight: 600;
            touch-action: manipulation;
            min-height: 44px;
        }

        /* --- Usuários --- */
        .user-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
        .stat-list .item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
        .stat-list .item:last-child { border-bottom: none; }
        .stat-list .stat-value {
            font-weight: 700;
            color: #fff; background: var(--bg-gradient-start);
            border-radius: 12px; padding: 2px 10px; font-size: 0.9rem;
        }
        .stat-card .value { font-size: 2rem; font-weight: 700; color: var(--text-dark); }
        .stat-card .detail { font-size: 0.95rem; color: var(--green); font-weight: 600; }
        
        /* --- Gerenciar --- */
        .manage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
        .search-filter input { width: 100%; padding: 12px 16px; border: 1px solid #bdc3c7; border-radius: 8px; }
        .user-list {
            /* display: flex
        ; */
            /* flex-direction: column; */
            /* gap: 16px; */
            /* max-height: 500px; */
            /* overflow-y: auto; */
            /* padding: 4px; */
        }
        
        .user-list::-webkit-scrollbar {
            width: 6px;
        }
        
        .user-list::-webkit-scrollbar-track {
            background: #f1f3f4;
            border-radius: 3px;
        }
        
        .user-list::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }
        
        .user-list::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        /* Estilos para área de histórico de notificações */
        #notifications-history {
            max-height: 500px;
            overflow-y: auto;
            padding-right: 8px;
        }

        #notifications-history::-webkit-scrollbar {
            width: 6px;
        }

        #notifications-history::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        #notifications-history::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 3px;
        }

        #notifications-history::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
        .user-item { 
            display: flex; 
            align-items: center; 
            gap: 16px; 
            padding: 16px; 
            border: 1px solid #e0e6ed; 
            border-radius: 12px; 
            flex-wrap: wrap; 
            background: #fff;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            transition: all 0.2s ease;
            margin-bottom: 12px;
        }
        
        .user-item:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
            border-color: #d0d9e0;
        }
        .user-tag { 
            font-size: 0.75rem; 
            font-weight: 600; 
            padding: 6px 12px; 
            border-radius: 16px; 
            color: #fff; 
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .tag-cliente { background-color: var(--blue); } .tag-prestador { background-color: var(--green); }
        .user-info { flex-grow: 1; } 
        .user-info .name { 
            font-weight: 600; 
            font-size: 1rem;
            color: #2c3e50;
            margin-bottom: 4px;
            line-height: 1.3;
        } 
        .user-info .contact { 
            font-size: 0.85rem; 
            color: #64748b; 
            line-height: 1.4;
        }
        .user-actions {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            align-items: center;
        }
        .user-actions .btn {
            border: none;
            padding: 10px 14px;
            border-radius: 8px;
            cursor: pointer;
            color: white;
            touch-action: manipulation;
            min-height: 40px;
            font-size: 0.85rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s ease;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        .user-actions .btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }
        
        .user-actions .btn:active {
            transform: translateY(0);
        }
        @media (max-width: 768px) {
            .user-item { 
                flex-direction: column; 
                align-items: stretch; 
                gap: 16px; 
                padding: 20px 16px;
                border: 1px solid #e0e6ed;
                border-radius: 12px;
                background: #fff;
                box-shadow: 0 2px 8px rgba(0,0,0,0.08);
                margin-bottom: 16px;
                transition: all 0.2s ease;
            }
            
            .user-item:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 16px rgba(0,0,0,0.12);
                border-color: #d0d9e0;
            }
            
            .user-info {
                width: 100%;
                margin-bottom: 12px;
                padding-bottom: 12px;
                border-bottom: 1px solid #f0f3f6;
            }
            
            .user-info .name {
                font-size: 1.1rem;
                font-weight: 600;
                margin-bottom: 6px;
                color: #2c3e50;
                line-height: 1.3;
            }
            
            .user-info .contact {
                font-size: 0.85rem;
                line-height: 1.4;
                color: #64748b;
                display: flex;
                flex-direction: column;
                gap: 2px;
            }
            
            .user-actions { 
                display: grid;
                grid-template-columns: repeat(4, 1fr);
                gap: 10px;
                width: 100%;
                margin-top: 0;
            }
            
            .user-actions .btn { 
                padding: 12px 8px;
                font-size: 0.8rem;
                min-height: 44px;
                border-radius: 8px;
                white-space: nowrap;
                font-weight: 500;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 4px;
                transition: all 0.2s ease;
                text-align: center;
                line-height: 1.2;
            }
            
            .user-actions .btn i {
                font-size: 1.1rem;
                margin-bottom: 2px;
            }
            
            .user-actions .btn:hover {
                transform: translateY(-1px);
                box-shadow: 0 4px 8px rgba(0,0,0,0.15);
            }
            
            .user-actions .btn:active {
                transform: translateY(0);
            }
            
            /* Cores específicas dos botões */
            .user-actions .btn[style*="var(--blue)"] {
                background: var(--blue) !important;
            }
            
            .user-actions .btn[style*="var(--green)"] {
                background: var(--green) !important;
            }
            
            .user-actions .btn[style*="var(--orange)"] {
                background: var(--orange) !important;
            }
            
            .user-actions .btn[style*="var(--red)"] {
                background: var(--red) !important;
            }
        }

        /* --- Erros e Logs --- */
        .status-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: #f8f9fa;
            border-radius: 8px;
            font-size: 0.9rem;
        }
        
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--text-muted);
        }
        
        .status-dot.online { background: var(--green); }
        .status-dot.warning { background: var(--orange); }
        .status-dot.error { background: var(--red); }
        
        .status-text {
            font-weight: 500;
            color: var(--text-muted);
        }
        
        .log-item { 
            display: flex; 
            gap: 16px; 
            padding: 16px; 
            border: 1px solid var(--border-color); 
            border-radius: 8px; 
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .log-item:hover {
            background: #f8f9fa;
            border-color: var(--blue);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        .log-tag { 
            font-size: 0.75rem; 
            font-weight: 600; 
            padding: 4px 8px; 
            border-radius: 12px; 
            color: #fff;
            min-width: 60px;
            text-align: center;
        }
        
        .tag-info { background-color: var(--blue); }
        .tag-success { background-color: var(--green); }
        .tag-error { background-color: var(--red); } 
        .tag-warning { background-color: var(--orange); }
        
        .log-message { 
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .log-title {
            font-weight: 600;
            color: var(--text-dark);
        }
        
        .log-description {
            font-size: 0.9rem;
            color: var(--text-muted);
        }
        
        .log-timestamp { 
            font-size: 0.8rem; 
            color: var(--text-muted); 
            align-self: flex-start;
            white-space: nowrap;
        }
        
        .modal {
            display: none !important;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0,0,0,0.4);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }
        
        .modal.show {
            display: flex !important;
        }

        /* Modal genérico: conteúdo e ações */
        .modal .modal-content {
            background: #fff;
            border-radius: 12px;
            padding: 24px;
            width: 100%;
            max-width: 420px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.15);
        }
        
        /* Modal de usuário: tamanho menor no desktop */
        #user-modal .modal-content {
            max-width: 480px;
        }
        
        @media (min-width: 768px) {
            #user-modal .modal-content {
                max-width: 420px;
                width: 420px;
            }
        }
        .modal .modal-title {
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .modal .modal-message {
            color: var(--text-muted);
            margin-bottom: 16px;
        }
        .modal .modal-actions {
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }
        #confirm-modal .btn {
            border: none;
            padding: 10px 16px;
            border-radius: 8px;
            color: #fff;
        }
        #confirm-modal .btn.cancel { background: var(--gray); }
        #confirm-modal .btn.ok { background: var(--blue); }
        #confirm-modal .btn.ok.danger { background: var(--red); }
        #confirm-modal .btn.ok.warn { background: var(--orange); }
        
        .diagnostic-section {
            margin-bottom: 20px;
        }
        
        .diagnostic-section h4 {
            color: var(--text-dark);
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .diagnostic-steps {
            background: #f8f9fa;
            padding: 12px;
            border-radius: 6px;
            border-left: 4px solid var(--blue);
        }
        
        .diagnostic-steps ol {
            margin-left: 16px;
        }
        
        .diagnostic-steps li {
            margin-bottom: 4px;
            font-size: 0.9rem;
        }
        
        /* --- Backup --- */
        .backup-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
            gap: 24px; 
            text-align: center; 
        }
        
        .backup-card { 
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            min-height: 180px;
        }
        
        .backup-card .title {
            font-size: 1.1rem;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .backup-card .subtitle {
            font-size: 0.9rem;
            color: var(--text-muted);
            margin-bottom: 16px;
            flex-grow: 1;
        }
        
        .backup-card .btn { 
            width: 100%; 
            margin-top: auto; 
            padding: 12px; 
            font-size: 1rem;
            border: none;
            border-radius: 8px;
            color: white;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.2s ease;
        }
        
        .backup-card .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        /* ==============================
           4. RESPONSIVIDADE (Tablet/Mobile)
           ============================== */
        /* Tablet */
        @media (max-width: 1024px) {
            .main-header { padding: 16px 24px; }
            .content-area { padding: 24px; }
            .overview-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
            .stat-card .icon { top: 16px; right: 16px; font-size: 2rem; }
            .stat-card .value { font-size: 2.2rem; }
            .user-stats-grid { grid-template-columns: 1fr; }
        }

        /* Mobile */
        @media (max-width: 768px) {
            .main-header { padding: 14px 16px; gap: 10px; flex-direction: column; align-items: stretch; }
            .header-title { gap: 10px; justify-content: center; }
            .header-title .title-text h1 { font-size: 1.25rem; text-align: center; }
            .header-title .title-text p { font-size: 0.8rem; text-align: center; }
            .status-badge { padding: 6px 12px; font-size: 0.8rem; border-radius: 14px; align-self: center; margin-top: 8px; }

            .main-nav { padding: 8px 12px; }
            .main-nav ul { gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding: 4px 0; }
            .main-nav a { 
                padding: 8px 10px; 
                font-size: 0.8rem; 
                flex: 0 0 auto; 
                white-space: nowrap; 
                min-width: fit-content;
                text-align: center;
            }

            .content-area { padding: 12px; }
            .card { padding: 16px; border-radius: 10px; }

            .overview-grid { 
                grid-template-columns: 1fr; 
                gap: 12px; 
                max-width: 100%;
            }
            
            .stat-card { 
                position: relative; 
                min-height: 100px;
                display: flex;
                flex-direction: column;
                justify-content: space-between;
            }
            
            .stat-card .title { 
                font-size: 0.95rem; 
                margin-bottom: 8px;
                padding-right: 40px; /* Espaço para o ícone */
            }
            
            .stat-card .value { 
                font-size: 2.2rem; 
                line-height: 1;
                margin: 8px 0;
            }
            
            .stat-card .detail { 
                font-size: 0.85rem; 
                margin-top: auto;
            }
            
            .stat-card .icon { 
                font-size: 1.5rem; 
                top: 16px; 
                right: 16px; 
                opacity: 0.3;
            }

            .user-stats-grid { grid-template-columns: 1fr; gap: 12px; }
            .stat-list .item { padding: 10px 0; flex-wrap: wrap; }
            .stat-list .stat-value { font-size: 0.85rem; padding: 2px 8px; }

            .manage-header { flex-direction: column; align-items: stretch; gap: 12px; }
            .user-item { flex-direction: column; align-items: flex-start; gap: 8px; }
            .user-actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
            .user-actions .btn { padding: 8px 10px; flex: 1; min-width: 70px; }

            /* Touch otimizations para mobile */
            .user-actions .btn,
            .backup-card .btn,
            .btn,
            button,
            .stat-card,
            .main-nav a,
            select,
            input[type="button"],
            input[type="submit"] {
                touch-action: manipulation;
                -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
            }
            
            .user-actions .btn {
                min-height: 44px;
                padding: 12px 10px;
                font-size: 0.9rem;
            }
            
            .backup-card .btn {
                min-height: 44px;
                padding: 12px;
                font-size: 0.9rem;
            }
            
            /* Melhorar áreas de toque */
            .main-nav a {
                min-height: 40px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .stat-card {
                min-height: 120px;
                transition: transform 0.1s ease;
            }
            
            .stat-card:active {
                transform: scale(0.98);
            }
            
            /* Form inputs mobile friendly */
            select,
            input {
                font-size: 16px; /* Evita zoom no Safari iOS */
                padding: 12px;
                min-height: 44px;
            }

            /* Backup responsivo */
            .backup-grid { 
                grid-template-columns: 1fr; 
                gap: 16px; 
            }
            
            .backup-card {
                min-height: 140px;
                padding: 16px;
            }
            
            .backup-card .title {
                font-size: 1rem;
            }
            
            .backup-card .subtitle {
                font-size: 0.85rem;
                margin-bottom: 12px;
            }
            
            .backup-card .btn {
                padding: 10px;
                font-size: 0.9rem;
            }

            /* Modal ajustes para telas pequenas */
            #user-modal .modal-content { 
                width: 92vw !important; 
                max-width: 92vw !important; 
            }
            
            /* Melhorar lista de usuários no mobile */
            .user-list {
                gap: 8px;
            }

        /* Toasts do painel admin */
        #admin-toast-container {
            position: fixed;
            right: 24px;
            bottom: 24px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 1100;
        }
        .admin-toast {
            min-width: 260px;
            max-width: 420px;
            background: #fff;
            border-left: 4px solid var(--blue);
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            padding: 12px 14px;
            border-radius: 8px;
            display: flex;
            align-items: flex-start;
            gap: 10px;
            animation: slideIn .25s ease-out;
        }
        .admin-toast.success { border-left-color: var(--green); }
        .admin-toast.error { border-left-color: var(--red); }
        .admin-toast.warn { border-left-color: var(--orange); }
        .admin-toast .icon { font-size: 1.1rem; margin-top: 2px; }
        .admin-toast.success .icon { color: var(--green); }
        .admin-toast.error .icon { color: var(--red); }
        .admin-toast.warn .icon { color: var(--orange); }
        .admin-toast .content { color: var(--text-dark); font-weight: 600; }
        .admin-toast .message { color: var(--text-muted); font-weight: 500; }
        .admin-toast .close { margin-left: auto; background: none; border: none; color: #888; cursor: pointer; }
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }
            
            /* Melhorar navegação mobile */
            .main-nav ul::-webkit-scrollbar { height: 4px; }
            .main-nav ul::-webkit-scrollbar-track { background: transparent; }
            .main-nav ul::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }
        }

        /* Estilos para notificações */
        #notification-form .form-group {
            margin-bottom: 20px;
        }

        #notification-form input:focus,
        #notification-form select:focus,
        #notification-form textarea:focus {
            border-color: var(--purple);
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 69, 255, 0.1);
        }

        #notification-form button:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        #notification-form button:active {
            transform: translateY(0);
        }

        .notification-history-item {
            transition: all 0.3s ease;
        }

        .notification-history-item:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        @media (max-width: 768px) {
            #notification-form {
                gap: 16px;
            }
            
            #notification-form button {
                width: 100%;
                margin-bottom: 8px;
            }
        }

        /* Telas muito pequenas */
        @media (max-width: 380px) {
            .header-title .title-text h1 { font-size: 1.1rem; }
            .stat-card .value { font-size: 1.6rem; }
        }
