﻿
        /* Light Theme (Default) */
        :root {
            --primary-color: #10b981;
            --secondary-color: #14b8a6;
            --accent-color: #0d9488;
            --dark-primary: #059669;
            --light-primary: #34d399;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --bg-gray: #f1f5f9;
            --bg-card: #ffffff;
            --border-color: #e2e8f0;
            --border-hover: #cbd5e1;
            --text-dark: #1e293b;
            --text-medium: #475569;
            --text-light: #64748b;
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
            --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
            --shadow-color: rgba(16, 185, 129, 0.15);
            --glow-color: rgba(16, 185, 129, 0.3);
            --gradient-primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
            --gradient-secondary: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
            --gradient-accent: linear-gradient(135deg, #0d9488 0%, #0891b2 100%);
            --success-color: #10b981;
            --info-color: #0891b2;
        }

        /* Dark Theme (Mainframe) */
        body.dark-theme {
            --primary-color: #00ff00;
            --secondary-color: #00cc00;
            --accent-color: #009900;
            --dark-primary: #008800;
            --light-primary: #33ff33;
            --bg-light: #000000;
            --bg-white: #0a0a0a;
            --bg-gray: #001100;
            --bg-card: #001100;
            --border-color: #003300;
            --border-hover: #00ff00;
            --text-dark: #00ff00;
            --text-medium: #00cc00;
            --text-light: #009900;
            --shadow-sm: 0 0 5px rgba(0, 255, 0, 0.2);
            --shadow-md: 0 0 10px rgba(0, 255, 0, 0.3);
            --shadow-lg: 0 0 20px rgba(0, 255, 0, 0.4);
            --shadow-xl: 0 0 30px rgba(0, 255, 0, 0.5);
            --shadow-color: rgba(0, 255, 0, 0.15);
            --glow-color: rgba(0, 255, 0, 0.3);
            --gradient-primary: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
            --gradient-secondary: linear-gradient(135deg, #001100 0%, #002200 100%);
            --gradient-accent: linear-gradient(135deg, #002200 0%, #003300 100%);
            --success-color: #00ff00;
            --info-color: #00ffff;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
        }

        body {
            background: #f0fdf4;
            background-attachment: fixed;
            color: var(--text-dark);
            font-family: 'IBM Plex Mono', 'Courier New', monospace;
            padding: 20px;
            overflow-x: hidden;
            min-height: 100vh;
            transition: background 0.3s ease, color 0.3s ease;
        }

        body.dark-theme {
            background: #000000;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(circle at 20% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.05) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
            transition: opacity 0.3s ease;
        }

        body.dark-theme::before {
            opacity: 0;
        }

        body > * {
            position: relative;
            z-index: 1;
        }

        /* Painel de Controle Superior */
        .control-panel {
            background: var(--bg-white);
            border: 2px solid var(--primary-color);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: var(--shadow-md);
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease;
        }

        .control-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: var(--primary-color);
            border-radius: 20px 20px 0 0;
        }

        .control-panel::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
            pointer-events: none;
        }

        @keyframes scanline {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .control-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border-color);
        }

        .control-title {
            font-size: 22px;
            color: var(--text-dark);
            font-weight: 700;
            letter-spacing: -0.3px;
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
        }





        .screen-manager {
            display: flex;
            gap: 20px;
            align-items: flex-start;
            flex-wrap: wrap;
        }

        .screen-list {
            flex: 0 0 280px;
            min-width: 250px;
            max-width: 350px;
        }

        .screen-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
            padding: 12px 16px;
            background: var(--bg-white);
            border: 2px solid var(--primary-color);
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .screen-list-header:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
        }

        .screen-list-title {
            font-size: 15px;
            color: var(--text-dark);
            font-weight: 700;
            letter-spacing: -0.2px;
            display: flex;
            align-items: center;
            gap: 8px;
        }



        .add-screen-btn {
            padding: 10px 20px;
            background: var(--primary-color);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 13px;
            border-radius: 8px;
            transition: all 0.3s ease;
            font-weight: 600;
            position: relative;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
        }

        .add-screen-btn::before {
            content: '+';
            font-size: 18px;
            font-weight: 700;
        }

        .add-screen-btn::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            transition: width 0.6s ease, height 0.6s ease;
        }

        .add-screen-btn:hover::after {
            width: 400px;
            height: 400px;
        }

        .add-screen-btn:hover {
            box-shadow: 
                var(--shadow-md),
                0 6px 24px var(--shadow-color);
            transform: translateY(-2px) scale(1.02);
        }

        .add-screen-btn:active {
            transform: translateY(0) scale(0.98);
        }

        .add-screen-btn:active {
            transform: translateY(0);
        }

        .screens-container {
            max-height: 240px;
            overflow-y: auto;
            border: 2px solid var(--border-color);
            padding: 10px;
            background: var(--bg-white);
            border-radius: 8px;
        }

        .screen-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            margin: 6px 0;
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .screen-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 4px;
            background: transparent;
            border-radius: 8px 0 0 8px;
            transition: all 0.3s;
        }

        .screen-item:hover {
            border-color: var(--primary-color);
            background: var(--bg-light);
            box-shadow: var(--shadow-sm);
        }

        .screen-item:hover::before {
            background: var(--primary-color);
        }

        .screen-item.active {
            background: var(--bg-light);
            border-color: var(--primary-color);
            box-shadow: var(--shadow-md);
        }

        .screen-item.active::before {
            background: var(--primary-color);
        }

        .screen-item-name {
            flex: 1;
            font-size: 13px;
            color: var(--text-dark);
            font-weight: 500;
        }

        .screen-item-badge {
            padding: 4px 10px;
            background: var(--primary-color);
            color: white;
            border-radius: 12px;
            font-size: 11px;
            margin-left: 10px;
            font-weight: 600;
        }
        }

        .screen-item-actions {
            display: flex;
            gap: 5px;
        }

        .screen-action-btn {
            padding: 6px 12px;
            background: var(--bg-white);
            color: var(--text-medium);
            border: 2px solid var(--border-color);
            cursor: pointer;
            font-size: 11px;
            border-radius: 6px;
            transition: all 0.3s ease;
            font-weight: 600;
        }

        .screen-action-btn:hover {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .screen-action-btn.delete {
            border-color: #fca5a5;
            color: #dc2626;
        }

        .screen-action-btn.delete:hover {
            background: #dc2626;
            color: white;
            border-color: #dc2626;
        }

        /* Navegação entre telas */
        .navigation-panel {
            flex: 1;
            min-width: 450px;
        }

        .nav-header {
            padding: 12px 16px;
            background: var(--bg-white);
            border: 2px solid var(--primary-color);
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 14px;
            font-weight: 700;
            text-align: center;
            color: var(--text-dark);
        }



        .nav-mapping {
            padding: 12px;
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            max-height: 260px;
            overflow-y: auto;
        }

        .nav-mapping::-webkit-scrollbar {
            width: 10px;
        }

        .nav-mapping::-webkit-scrollbar-track {
            background: var(--bg-gray);
            border-radius: 5px;
        }

        .nav-mapping::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 5px;
        }

        .nav-mapping::-webkit-scrollbar-thumb:hover {
            background: var(--dark-primary);
        }

        /* Aplicar scrollbar melhorada para outros elementos */
        .screens-container::-webkit-scrollbar,
        .fields-list::-webkit-scrollbar {
            width: 10px;
        }

        .screens-container::-webkit-scrollbar-track,
        .fields-list::-webkit-scrollbar-track {
            background: var(--bg-gray);
            border-radius: 5px;
        }

        .screens-container::-webkit-scrollbar-thumb,
        .fields-list::-webkit-scrollbar-thumb {
            background: var(--primary-color);
            border-radius: 5px;
        }

        .screens-container::-webkit-scrollbar-thumb:hover,
        .fields-list::-webkit-scrollbar-thumb:hover {
            background: var(--dark-primary);
        }

        .nav-rule {
            display: flex;
            align-items: center;
            margin: 12px 0;
            padding: 14px 16px;
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
        }

        .nav-rule:hover {
            background: #f0fdf4;
            border-color: var(--primary-color);
        }

        .nav-rule select {
            padding: 8px 14px;
            background: var(--bg-gray);
            color: var(--text-dark);
            border: 1px solid var(--border-color);
            margin: 0 10px;
            font-size: 13px;
            border-radius: 8px;
            transition: all 0.3s ease;
            font-family: 'IBM Plex Mono', monospace;
            font-weight: 500;
            cursor: pointer;
        }

        .nav-rule select:hover {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow-color);
            background: var(--bg-white);
        }

        .nav-rule select:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 4px var(--shadow-color);
            background: var(--bg-white);
        }

        .nav-rule button {
            padding: 6px 12px;
            background: #dc2626;
            color: white;
            border: none;
            cursor: pointer;
            font-size: 11px;
            border-radius: 6px;
            margin-left: auto;
            transition: all 0.3s ease;
            font-weight: 600;
        }

        .nav-rule button:hover {
            background: #b91c1c;
            box-shadow: var(--shadow-sm);
        }

        .add-nav-btn {
            width: 100%;
            padding: 12px;
            background: var(--primary-color);
            color: white;
            border: none;
            cursor: pointer;
            margin-top: 10px;
            border-radius: 8px;
            transition: all 0.3s ease;
            font-weight: 600;
            font-size: 13px;
        }

        .add-nav-btn::before {
            content: '+ ';
            font-size: 16px;
            font-weight: 700;
        }

        .add-nav-btn:hover {
            background: var(--dark-primary);
            box-shadow: var(--shadow-sm);
        }

        .export-btn {
            padding: 8px 16px;
            background: var(--info-color);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 13px;
            border-radius: 8px;
            transition: all 0.3s;
            font-weight: 600;
        }

        .export-btn:hover {
            background: #0e7490;
            box-shadow: var(--shadow-sm);
        }

        /* Modal de Exportação */
        .export-modal {
            width: 90%;
            max-width: 800px;
        }

        .export-options {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 20px;
        }

        .export-option-btn {
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: 8px;
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        .export-option-btn:hover {
            background: var(--bg-light);
            border-color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }

        .export-icon {
            font-size: 40px;
            margin-bottom: 10px;
        }

        .export-title {
            color: var(--text-dark);
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .export-desc {
            color: var(--text-light);
            font-size: 13px;
        }

        /* Modal de Importação */
        .import-drop-zone {
            border: 2px dashed var(--border-color);
            border-radius: 12px;
            padding: 40px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            background: #fafafa;
            color: var(--text-medium);
        }

        .import-drop-zone:hover {
            background: #f0fdf4;
            border-color: var(--primary-color);
            color: var(--text-dark);
        }

        .import-drop-zone.dragover {
            background: #ecfdf5;
            border-color: var(--primary-color);
        }

        .import-info {
            font-size: 12px;
        }

        .import-info ul {
            list-style-type: none;
            padding-left: 0;
        }

        .import-info li:before {
            content: "✓ ";
            color: #00ff00;
            font-weight: bold;
        }

        /* Painel de Validação de Campos */
        .validation-panel {
            background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
            border: 2px solid #00ff00;
            border-radius: 5px;
            padding: 15px;
            margin-bottom: 20px;
            box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
        }

        .validation-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #00ff00;
        }

        .validation-title {
            font-size: 16px;
            color: #00ff00;
            text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
            font-weight: bold;
        }

        .validation-content {
            display: grid;
            grid-template-columns: 1fr 2fr;
            gap: 20px;
        }

        .fields-list {
            background: #0a0a0a;
            border: 1px solid #003300;
            border-radius: 3px;
            padding: 10px;
            max-height: 300px;
            overflow-y: auto;
        }

        .field-item {
            padding: 8px;
            margin: 5px 0;
            background: #001100;
            border: 1px solid #003300;
            border-radius: 3px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 12px;
        }

        .field-item:hover {
            border-color: #00ff00;
            background: #002200;
        }

        .field-item.selected {
            background: #003300;
            border-color: #00ff00;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
        }

        .validation-config {
            background: #0a0a0a;
            border: 1px solid #003300;
            border-radius: 3px;
            padding: 15px;
        }

        .validation-config label {
            display: block;
            margin-bottom: 5px;
            font-size: 12px;
            color: #00ff00;
        }

        .validation-config input,
        .validation-config select {
            width: 100%;
            padding: 8px;
            background: #0a0a0a;
            color: #00ff00;
            border: 1px solid #00ff00;
            border-radius: 3px;
            font-size: 12px;
            margin-bottom: 10px;
        }

        .validation-config button {
            padding: 12px 24px;
            background: var(--primary-color);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 14px;
            border-radius: 8px;
            margin-right: 8px;
            transition: all 0.3s ease;
            font-weight: 500;
            box-shadow: var(--shadow-sm);
        }

        .validation-config button:hover {
            background: var(--dark-primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .validation-config button.delete,
        .validation-config button.danger {
            background: #dc2626;
            color: white;
        }

        .validation-config button.delete:hover,
        .validation-config button.danger:hover {
            background: #b91c1c;
        }

        .validation-rules-list {
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
        }

        .validation-rule-item {
            padding: 10px 14px;
            margin: 8px 0;
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            color: var(--text-dark);
            transition: all 0.3s;
        }

        .validation-rule-item:hover {
            border-color: var(--primary-color);
            background: #f0fdf4;
            box-shadow: var(--shadow-sm);
        }

        .toggle-validation {
            padding: 6px 12px;
            background: var(--gradient-primary);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 11px;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s;
        }

        .toggle-validation:hover {
            transform: scale(1.05);
            box-shadow: var(--shadow-sm);
        }

        .validation-panel.collapsed .validation-content {
            display: none;
        }

        /* Terminal Principal */
        .terminal-frame {
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 25px;
            box-shadow: 
                var(--shadow-lg),
                0 0 0 1px rgba(0, 0, 0, 0.02);
            position: relative;
            margin-top: 25px;
            transition: all 0.3s ease;
        }

        .terminal-frame:hover {
            box-shadow: 
                var(--shadow-lg),
                0 0 30px var(--shadow-color);
        }

        .terminal-frame::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
            border-radius: 16px 16px 0 0;
        }

        @keyframes borderGlow {
            0% { opacity: 0; transform: translateX(-100%); }
            50% { opacity: 1; }
            100% { opacity: 0; transform: translateX(100%); }
        }

        .terminal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            background: var(--bg-gray);
            border-bottom: 2px solid var(--border-color);
            margin-bottom: 15px;
            border-radius: 10px;
            box-shadow: var(--shadow-sm);
        }

        .terminal-title {
            font-size: 15px;
            color: var(--text-dark);
            font-weight: 600;
            letter-spacing: 0.3px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .terminal-title::before {
            content: '■';
            color: var(--primary-color);
            font-size: 16px;
        }

        .screen-indicator {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .current-screen-name {
            padding: 6px 18px;
            background: var(--primary-color);
            border: none;
            border-radius: 20px;
            font-size: 12px;
            color: white;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .connection-status {
            display: flex;
            align-items: center;
            gap: 10px;
            color: var(--success-color);
            font-weight: 600;
            font-size: 13px;
        }

        .status-indicator {
            width: 10px;
            height: 10px;
            background: var(--primary-color);
            border-radius: 50%;
            box-shadow: 0 0 10px var(--glow-color);
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        .terminal-screen {
            background: #1e293b;
            border: 2px solid #334155;
            padding: 15px;
            position: relative;
            font-size: 14px;
            letter-spacing: 0.5px;
            line-height: 1.3;
            min-width: 720px;
            min-height: 432px;
            box-shadow: 
                inset 0 2px 8px rgba(0, 0, 0, 0.3),
                inset 0 0 100px rgba(16, 185, 129, 0.03);
            border-radius: 8px;
        }

        .terminal-screen::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                repeating-linear-gradient(
                    0deg,
                    rgba(16, 185, 129, 0.02),
                    rgba(16, 185, 129, 0.02) 1px,
                    transparent 1px,
                    transparent 2px
                );
            pointer-events: none;
        }

        .terminal-screen::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
            pointer-events: none;
        }

        .screen-line {
            display: flex;
            white-space: pre;
            font-family: 'IBM Plex Mono', 'Courier New', monospace;
            height: 18px;
        }

        .screen-char {
            display: inline-block;
            width: 9px;
            text-align: center;
            position: relative;
        }

        .screen-char.protected {
            color: #10b981;
            text-shadow: 0 0 2px rgba(16, 185, 129, 0.5);
        }

        .screen-char.unprotected {
            background: rgba(16, 185, 129, 0.1);
            color: #34d399;
            border: 1px solid transparent;
        }

        .screen-char.numeric {
            background: rgba(59, 130, 246, 0.1);
            color: #60a5fa;
        }

        .screen-char.message-line {
            color: #e2e8f0;
            background: rgba(0, 0, 0, 0.2);
        }

        .screen-char.focused {
            background: var(--primary-color) !important;
            color: #fff !important;
            animation: blink 0.5s infinite;
        }

        .screen-char.error {
            background: #dc2626 !important;
            color: #fecaca !important;
            animation: errorBlink 0.3s 3;
        }

        @keyframes blink {
            0%, 49% { opacity: 1; }
            50%, 100% { opacity: 0.8; }
        }

        @keyframes errorBlink {
            0%, 49% { background: #dc2626; }
            50%, 100% { background: #ef4444; }
        }

        .field-highlight {
            background: rgba(16, 185, 129, 0.1) !important;
            border: 1px solid rgba(16, 185, 129, 0.3) !important;
        }

        .cursor {
            position: absolute;
            width: 9px;
            height: 18px;
            background: var(--primary-color);
            animation: cursorBlink 1s infinite;
            pointer-events: none;
            z-index: 10;
            opacity: 0.8;
        }

        @keyframes cursorBlink {
            0%, 49% { opacity: 0.8; }
            50%, 100% { opacity: 0; }
        }

        /* Barra de status */
        .status-bar {
            display: flex;
            justify-content: space-between;
            padding: 14px 20px;
            background: var(--bg-gray);
            border-top: 1px solid var(--border-color);
            margin-top: 15px;
            font-size: 12px;
            color: var(--text-medium);
            border-radius: 10px;
            box-shadow: var(--shadow-sm);
        }

        .status-item {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .screen-counter {
            padding: 4px 12px;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            font-weight: 600;
            box-shadow: var(--shadow-sm);
            color: var(--text-dark);
        }

        /* Teclas de função */
        .function-keys {
            display: flex;
            justify-content: space-between;
            margin-top: 20px;
            padding: 20px;
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            flex-wrap: wrap;
            gap: 12px;
            box-shadow: var(--shadow-sm);
        }

        .function-key {
            padding: 12px 18px;
            background: #ffffff;
            border: 2px solid var(--border-color);
            color: var(--text-dark);
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.3s ease;
            border-radius: 8px;
            text-align: center;
            min-width: 75px;
            box-shadow: var(--shadow-sm);
        }

        .function-key:hover {
            background: var(--primary-color) !important;
            color: white !important;
            border-color: var(--primary-color) !important;
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
        }

        .function-key:active {
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .function-key.pressed {
            background: var(--gradient-primary);
            color: white;
            box-shadow: var(--shadow-md);
        }

        .function-key.nav-key {
            background: #f0fdf4;
            border-color: var(--primary-color);
        }

        .function-key.nav-key:hover {
            background: var(--primary-color) !important;
            color: white !important;
            border-color: var(--primary-color) !important;
        }

        /* Modal de carregamento de arquivo */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-overlay.show {
            display: flex;
        }

        .modal {
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: 16px;
            padding: 30px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: var(--shadow-lg);
            animation: modalSlideIn 0.3s ease;
        }

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-50px) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 16px;
            border-bottom: 2px solid var(--bg-gray);
        }

        .modal-title {
            font-size: 20px;
            color: var(--text-dark);
            font-weight: 700;
        }

        .modal-close {
            width: 36px;
            height: 36px;
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            color: var(--text-medium);
            cursor: pointer;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            transition: all 0.3s;
            font-weight: 600;
        }

        .modal-close:hover {
            background: #dc2626;
            color: white;
            border-color: #dc2626;
            transform: rotate(90deg);
            box-shadow: var(--shadow-sm);
        }

        .modal-body {
            color: var(--text-medium);
            line-height: 1.6;
        }

        .file-drop-zone {
            border: 2px dashed var(--border-hover);
            border-radius: 12px;
            padding: 50px;
            text-align: center;
            margin: 20px 0;
            background: var(--bg-gray);
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .file-drop-zone::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at center, var(--shadow-color) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .file-drop-zone:hover::before {
            opacity: 1;
        }

        .file-drop-zone:hover {
            background: #f0fdf4;
            border-color: var(--primary-color);
            box-shadow: var(--shadow-md);
            transform: scale(1.02);
        }

        .file-drop-zone.dragover {
            background: #ecfdf5;
            border-color: var(--primary-color);
            box-shadow: 
                var(--shadow-md),
                0 0 0 4px var(--shadow-color);
            transform: scale(1.05);
        }

        .file-drop-icon {
            font-size: 48px;
            margin-bottom: 10px;
        }

        .file-list {
            margin-top: 20px;
        }

        .file-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            margin: 10px 0;
            transition: all 0.3s;
        }

        .file-item:hover {
            border-color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }

        .file-item-name {
            flex: 1;
            font-size: 14px;
            color: var(--text-dark);
            font-weight: 500;
        }

        .file-item-status {
            padding: 4px 12px;
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-medium);
        }

        .file-item-status.loaded {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 24px;
            padding-top: 20px;
            border-top: 2px solid var(--bg-gray);
        }

        .modal-btn {
            padding: 10px 20px;
            background: var(--bg-white);
            color: var(--text-dark);
            border: 2px solid var(--border-color);
            cursor: pointer;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.3s;
            font-size: 13px;
        }

        .modal-btn:hover {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .modal-btn.primary {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .modal-btn.primary:hover {
            background: var(--dark-primary);
        }

        /* Mensagens de status */
        .status-message {
            padding: 12px 24px;
            background: var(--bg-white);
            border: 2px solid var(--primary-color);
            color: var(--text-dark);
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10000;
            border-radius: 10px;
            display: none;
            animation: slideUp 0.3s ease;
            font-size: 14px;
            font-weight: 600;
            box-shadow: var(--shadow-lg);
        }

        @keyframes slideUp {
            from { bottom: -50px; opacity: 0; }
            to { bottom: 20px; opacity: 1; }
        }

        .status-message.show {
            display: block;
        }

        .status-message.error {
            background: #fef2f2;
            border-color: #dc2626;
            color: #dc2626;
        }

        .status-message.success {
            background: #f0fdf4;
            border-color: var(--primary-color);
            color: var(--dark-primary);
        }

        /* Loader */
        .loader {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.9);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        .loader.show {
            display: flex;
        }

        /* Painel de Validação de Campos */
        .validation-panel {
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 28px;
            margin-top: 28px;
            box-shadow: var(--shadow-lg);
            position: relative;
            overflow: hidden;
        }

        .validation-panel::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, 
                var(--primary-color) 0%, 
                var(--secondary-color) 50%, 
                var(--accent-color) 100%);
            border-radius: 20px 20px 0 0;
        }

        .validation-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
        }

        .validation-title {
            font-size: 18px;
            color: var(--text-dark);
            font-weight: 700;
            letter-spacing: -0.3px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .validation-title::before {
            content: '⚙️';
            font-size: 20px;
            margin-right: 8px;
        }

        .toggle-btn {
            padding: 8px 16px;
            background: var(--bg-gray);
            color: var(--text-dark);
            border: 1px solid var(--border-color);
            cursor: pointer;
            font-size: 12px;
            border-radius: 10px;
            transition: all 0.3s;
            font-weight: 600;
        }

        .toggle-btn:hover {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
            box-shadow: var(--shadow-sm);
        }

        .validation-content {
            display: block;
        }

        .validation-fields-section {
            display: grid;
            grid-template-columns: 300px 1fr;
            gap: 20px;
            margin-top: 20px;
        }

        .validation-panel.collapsed .validation-content {
            display: none;
        }

        .fields-list {
            background: #fafafa;
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 12px;
            max-height: 400px;
            overflow-y: auto;
        }

        .field-item-val {
            padding: 12px 14px;
            margin: 8px 0;
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s;
            font-size: 13px;
            color: var(--text-dark);
        }

        .field-item-val:hover {
            border-color: var(--primary-color);
            background: #f0fdf4;
        }

        .field-item-val.selected {
            background: #ecfdf5;
            border-color: var(--primary-color);
        }

        .field-item-val .field-label {
            font-weight: 600;
            margin-bottom: 4px;
            color: var(--text-dark);
        }

        .btn-edit-label {
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 12px;
            padding: 2px 5px;
            opacity: 0.6;
            transition: opacity 0.2s, transform 0.2s;
        }

        .btn-edit-label:hover {
            opacity: 1;
            transform: scale(1.2);
        }

        .field-item-val .field-details {
            font-size: 11px;
            color: var(--text-light);
        }

        /* Estilos para seção de validação global */
        .validation-global-config {
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 24px;
            margin-bottom: 24px;
            transition: all 0.3s;
        }

        .validation-global-config:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-hover);
        }

        .validation-keys-header {
            margin-bottom: 20px;
        }

        .validation-keys-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-dark);
            margin: 0 0 8px 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .validation-keys-subtitle {
            font-size: 12px;
            color: var(--text-light);
            font-weight: 500;
        }

        .validation-keys-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 12px;
        }

        .validation-key-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 12px 16px;
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 13px;
            font-weight: 500;
            position: relative;
            overflow: hidden;
        }

        .validation-key-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: transparent;
            transition: all 0.3s;
        }

        .validation-key-item:hover {
            border-color: var(--primary-color);
            background: #f0fdf4;
        }

        .validation-key-item:hover::before {
            background: var(--primary-color);
        }

        .validation-key-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--primary-color);
            border-radius: 4px;
        }

        .validation-key-item input[type="checkbox"]:checked + .key-name {
            color: var(--primary-color);
            font-weight: 600;
        }

        .key-name {
            color: var(--text-dark);
            transition: all 0.3s;
        }

        /* Estilos para lista de campos */
        .fields-list-header {
            margin-bottom: 16px;
            padding: 16px 20px;
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 12px;
        }

        .fields-list-title {
            font-size: 15px;
            font-weight: 700;
            color: var(--text-dark);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .fields-container {
            min-height: 200px;
        }

        .no-data-message {
            text-align: center;
            color: var(--text-light);
            padding: 40px 20px;
            font-size: 14px;
            font-weight: 500;
            background: #fafafa;
            border: 1px dashed var(--border-color);
            border-radius: 12px;
        }

        /* Estilos para configuração de validações */
        .validation-config {
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 24px;
            transition: all 0.3s;
        }

        .validation-config:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-hover);
        }

        .validation-config-header {
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border-color);
        }

        .validation-config-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-dark);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .field-config-content {
            min-height: 200px;
        }

        .field-config-content:empty {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Estilos para cabeçalho da configuração de campo */
        .field-info-header {
            background: #0f766e;
            color: white;
            padding: 20px 24px;
            border-radius: 12px;
            margin-bottom: 20px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .field-title {
            font-size: 18px;
            font-weight: 700;
            margin: 0 0 12px 0;
            color: #ffffff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
            letter-spacing: 0.5px;
        }

        .field-metadata {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            font-size: 13px;
        }

        .field-meta-item {
            background: rgba(255, 255, 255, 0.25);
            color: #ffffff;
            padding: 6px 12px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 12px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(4px);
        }

        /* Estilos para campos de formulário modernos */
        .modern-select,
        .modern-input {
            width: 100%;
            padding: 12px 16px;
            background: var(--bg-white);
            color: var(--text-dark);
            border: 2px solid var(--border-color);
            border-radius: 10px;
            font-size: 14px;
            font-family: 'IBM Plex Mono', monospace;
            transition: all 0.3s ease;
        }

        .modern-select:focus,
        .modern-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
        }

        .field-hint {
            font-size: 12px;
            color: var(--text-light);
            margin-top: 6px;
            font-style: italic;
        }

        .validation-config h3 {
            color: var(--text-dark);
            font-size: 16px;
            margin-bottom: 20px;
            font-weight: 700;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-size: 13px;
            color: var(--text-dark);
            font-weight: 600;
        }

        .form-group input,
        .form-group select {
            width: 100%;
            padding: 10px 14px;
            background: var(--bg-white);
            color: var(--text-dark);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 13px;
            transition: all 0.3s;
            font-family: 'IBM Plex Mono', monospace;
        }

        .form-group input:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px var(--shadow-color);
        }

        .form-group input[type="checkbox"] {
            width: auto;
            margin-right: 5px;
        }

        .btn-group {
            display: flex;
            gap: 12px;
            margin-top: 20px;
            justify-content: flex-start;
        }

        .btn {
            padding: 12px 24px;
            background: var(--primary-color);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 14px;
            border-radius: 8px;
            transition: all 0.3s ease;
            font-weight: 500;
            box-shadow: var(--shadow-sm);
        }

        .btn:hover {
            background: var(--dark-primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .btn.danger {
            background: #dc2626;
        }

        .btn.danger:hover {
            background: #b91c1c;
        }

        .validation-rules-list {
            margin-top: 24px;
            padding: 20px;
            background: #f8fafc;
            border: 1px solid var(--border-color);
            border-radius: 12px;
        }

        .validation-rules-title {
            color: var(--text-dark);
            font-size: 14px;
            font-weight: 700;
            margin: 0 0 16px 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .rules-container {
            min-height: 40px;
        }

        .rules-container:empty::after {
            content: 'Nenhuma validação configurada';
            display: block;
            text-align: center;
            color: var(--text-light);
            font-style: italic;
            padding: 20px;
        }

        .validation-rule-item {
            padding: 12px 16px;
            margin: 8px 0;
            background: var(--bg-white);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            font-size: 13px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s;
        }

        .validation-rule-item:hover {
            border-color: var(--primary-color);
            background: #f0fdf4;
            box-shadow: var(--shadow-sm);
        }

        .validation-rule-item .rule-info {
            flex: 1;
        }

        .validation-rule-item .rule-type {
            font-weight: 700;
            color: var(--primary-color);
        }

        .validation-rule-item .rule-message {
            color: var(--text-light);
            margin-top: 4px;
            font-size: 12px;
        }

        .rule-actions {
            display: flex;
            gap: 8px;
        }

        .btn-small {
            padding: 6px 12px;
            font-size: 11px;
            border-radius: 8px;
        }

        .loader-text {
            color: var(--primary-color);
            font-size: 20px;
            animation: loaderPulse 1s infinite;
        }

        @keyframes loaderPulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }

        /* Ajuda */
        .help-btn {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 56px;
            height: 56px;
            background: var(--gradient-primary);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 26px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
        }

        .help-btn:hover {
            transform: scale(1.1) rotate(15deg);
            box-shadow: var(--shadow-xl);
        }

        /* Botão de alternância de tema */
        .theme-toggle-btn {
            position: fixed;
            bottom: 30px;
            right: 100px;
            width: 56px;
            height: 56px;
            background: var(--gradient-secondary);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 24px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s;
            box-shadow: var(--shadow-lg);
            z-index: 1000;
        }

        .theme-toggle-btn:hover {
            transform: scale(1.1);
            box-shadow: var(--shadow-xl);
        }

        body.dark-theme .theme-toggle-btn {
            background: linear-gradient(135deg, #003300 0%, #005500 100%);
        }

        /* Estilos dark theme para botões de importar/exportar */
        body.dark-theme .export-btn {
            background: #003366;
            color: #66ccff;
            border: 1px solid #66ccff;
        }

        body.dark-theme .export-btn:hover {
            background: #66ccff;
            color: #000;
            box-shadow: 0 0 20px rgba(102, 204, 255, 0.3);
        }

        body.dark-theme .import-drop-zone {
            border: 2px dashed #00ff00;
            background: #001100;
            color: #00ff00;
        }

        body.dark-theme .import-drop-zone:hover {
            background: #003300;
            border-color: #00ff00;
            box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
        }

        body.dark-theme .import-drop-zone.dragover {
            background: #003300;
            border-color: #00ff00;
            transform: scale(1.02);
        }

        body.dark-theme .add-screen-btn {
            background: #003300;
            color: #00ff00;
            border: 1px solid #00ff00;
        }

        body.dark-theme .add-screen-btn:hover {
            background: #00ff00;
            color: #000;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
        }

        body.dark-theme .screen-item {
            background: #001100;
            border: 1px solid #003300;
        }

        body.dark-theme .screen-item:hover {
            border-color: #00ff00;
            background: #002200;
        }

        body.dark-theme .screen-item.active {
            background: #003300;
            border-color: #00ff00;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
        }

        body.dark-theme .screen-item-badge {
            background: #00ff00;
            color: #000;
        }

        body.dark-theme .screen-action-btn {
            background: transparent;
            color: #00ff00;
            border: 1px solid #00ff00;
        }

        body.dark-theme .screen-action-btn:hover {
            background: #00ff00;
            color: #000;
        }

        body.dark-theme .screen-action-btn.delete {
            border-color: #ff3333;
            color: #ff3333;
        }

        body.dark-theme .screen-action-btn.delete:hover {
            background: #ff3333;
            color: #000;
        }

        body.dark-theme .terminal-frame {
            background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
            border: 3px solid #333;
            box-shadow: 
                0 0 50px rgba(0, 255, 0, 0.2),
                inset 0 0 20px rgba(0, 0, 0, 0.5);
        }

        body.dark-theme .terminal-header {
            background: #0a0a0a;
            border-bottom: 2px solid #00ff00;
        }

        body.dark-theme .terminal-title {
            color: #00ff00;
            text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
        }

        body.dark-theme .current-screen-name {
            background: #003300;
            border: 1px solid #00ff00;
            color: #00ff00;
        }

        body.dark-theme .status-indicator {
            background: #00ff00;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
        }

        body.dark-theme .terminal-screen {
            background: #0a0a0a;
            border: 2px solid #222;
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
        }

        body.dark-theme .screen-char.protected {
            color: #00ff00;
            text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
        }

        body.dark-theme .screen-char.unprotected {
            background: #001100;
            color: #66ff66;
        }

        body.dark-theme .screen-char.numeric {
            background: #000033;
            color: #6666ff;
        }

        body.dark-theme .screen-char.focused {
            background: #00ff00 !important;
            color: #000 !important;
        }

        body.dark-theme .screen-char.error {
            background: #660000 !important;
            color: #ff6666 !important;
        }

        body.dark-theme .cursor {
            background: #00ff00;
        }

        body.dark-theme .status-bar {
            background: #000;
            border-top: 1px solid #333;
        }

        body.dark-theme .add-nav-btn {
            background: #003300;
            color: #00ff00;
            border: 1px solid #00ff00;
        }

        body.dark-theme .add-nav-btn:hover {
            background: #00ff00;
            color: #000;
        }

        body.dark-theme .screen-counter {
            background: #001100;
            border: 1px solid #00ff00;
            color: #00ff00;
        }

        body.dark-theme .function-keys {
            background: #0a0a0a;
            border: 1px solid #333;
        }

        body.dark-theme .function-key {
            background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
            border: 2px solid #00ff00;
            color: #00ff00;
            text-shadow: 0 0 3px rgba(0, 255, 0, 0.5);
        }

        body.dark-theme .function-key:hover {
            background: #00ff00;
            color: #000;
            box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
            transform: translateY(-2px);
        }

        body.dark-theme .function-key.pressed {
            background: #00ff00;
            color: #000;
        }

        body.dark-theme .function-key.nav-key {
            background: linear-gradient(135deg, #002200, #001100);
            border-color: #00cc00;
        }

        body.dark-theme .toggle-validation {
            background: #003300;
            color: #00ff00;
            border: 1px solid #00ff00;
        }

        body.dark-theme .btn {
            background: #003300;
            color: #00ff00;
            border: 1px solid #00ff00;
        }

        body.dark-theme .btn:hover {
            background: #00ff00;
            color: #000;
        }

        body.dark-theme .btn.danger {
            background: #330000;
            color: #ff6666;
            border-color: #ff3333;
        }

        body.dark-theme .btn.danger:hover {
            background: #ff3333;
            color: #000;
        }

        body.dark-theme .validation-global-config {
            background: #003300 !important;
        }

        body.dark-theme .validation-global-config h3 {
            color: #00ff00 !important;
        }

        body.dark-theme .validation-global-config label {
            color: #00ff00;
        }

        body.dark-theme .validation-global-config:hover {
            box-shadow: none;
            border-color: transparent;
        }

        body.dark-theme .validation-key-item {
            background: #001100;
            border-color: #00ff00;
            color: #00ff00;
        }

        body.dark-theme .validation-key-item:hover {
            background: #001100;
            border-color: #00ff00;
        }

        body.dark-theme .validation-key-item:hover::before {
            background: transparent;
        }

        body.dark-theme .fields-list-title {
            color: #00ff00;
        }

        body.dark-theme .fields-list {
            background: #0a0a0a;
            border: 1px solid #003300;
        }

        body.dark-theme .fields-container {
            background: transparent;
        }

        body.dark-theme .field-item-val {
            background: #001100;
            border: 1px solid #003300;
            color: #00ff00;
        }

        body.dark-theme .field-item-val:hover {
            border-color: #00ff00;
            background: #002200;
        }

        body.dark-theme .field-item-val.selected {
            background: #003300;
            border-color: #00ff00;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
        }

        body.dark-theme .field-item-val .field-label {
            color: #00ff00;
        }

        body.dark-theme .field-item-val .field-details {
            color: #00ff00;
            opacity: 0.7;
        }

        body.dark-theme .btn-edit-label {
            color: #00ff00;
        }

        body.dark-theme .btn-edit-label:hover {
            color: #00ff00;
            opacity: 1;
        }

        body.dark-theme .validation-config {
            background: #0a0a0a;
            border: 1px solid #003300;
        }

        body.dark-theme .validation-config h3 {
            color: #00ff00;
        }

        body.dark-theme .validation-config-title {
            color: #00ff00;
        }

        body.dark-theme .form-group label {
            color: #00ff00;
        }

        body.dark-theme .form-group input,
        body.dark-theme .form-group select,
        body.dark-theme .modern-input,
        body.dark-theme .modern-select {
            background: #0a0a0a;
            color: #00ff00;
            border: 1px solid #00ff00;
        }

        body.dark-theme .field-config-content:empty::after {
            color: #00ff00;
        }

        body.dark-theme .field-config-content {
            background: transparent;
        }

        body.dark-theme .no-data-message {
            color: #00ff00;
            background: transparent;
        }

        body.dark-theme .field-info-header {
            background: #0a0a0a;
            border: 1px solid #003300;
        }

        body.dark-theme .field-title {
            color: #00ff00;
            text-shadow: none;
        }

        body.dark-theme .field-metadata {
            color: #00ff00;
        }

        body.dark-theme .field-meta-item {
            background: #001100;
            color: #00ff00;
            border: 1px solid #003300;
            text-shadow: none;
        }

        body.dark-theme .nav-rule:hover {
            background: #001100;
            border-color: #003300;
        }

        body.dark-theme .validation-rules-list {
            background: #0a0a0a;
            border: 1px solid #003300;
        }

        body.dark-theme .validation-rules-title {
            color: #00ff00;
        }

        body.dark-theme .rules-container:empty::after {
            color: #00ff00;
        }

        body.dark-theme .validation-rule-item {
            background: #001100;
            border: 1px solid #003300;
            color: #00ff00;
        }

        body.dark-theme .validation-rule-item .rule-type {
            color: #00ff00;
        }

        body.dark-theme .validation-rule-item .rule-message {
            color: #00ff00;
        }

        /* Estilos modernos para modais */
        .modal-title {
            color: var(--text-dark);
            font-size: 20px;
            font-weight: 700;
            margin: 0;
        }

        .modal-description {
            margin-bottom: 20px;
            color: var(--text-medium);
            font-size: 14px;
            line-height: 1.6;
        }

        .info-title {
            color: var(--text-dark);
            font-weight: 700;
            font-size: 14px;
        }

        .info-list {
            margin: 10px 0 0 20px;
            color: var(--text-medium);
            font-size: 13px;
            line-height: 1.6;
        }

        .preview-title {
            color: var(--text-dark);
            font-size: 16px;
            font-weight: 700;
            margin: 0 0 10px 0;
        }

        .import-info {
            background: #f0fdf4;
            border: 1px solid var(--border-color);
            padding: 20px;
            border-radius: 12px;
            margin-bottom: 20px;
        }

        .import-preview-content {
            background: #f8fafc;
            border: 1px solid var(--border-color);
            padding: 20px;
            border-radius: 12px;
            max-height: 300px;
            overflow-y: auto;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            line-height: 1.4;
        }

        /* Atributos BMS - Dark Theme */
        body.dark-theme .bms-attributes-section {
            background: #0a0a0a !important;
            border: 1px solid #003300 !important;
        }

        body.dark-theme .bms-attributes-section h4 {
            color: #00ff00 !important;
        }

        body.dark-theme .bms-attributes-section label,
        body.dark-theme .bms-attributes-section span {
            color: #00ff00 !important;
        }

        body.dark-theme .bms-attributes-section > div > div:first-child {
            color: #00ff00 !important;
        }

        body.dark-theme .bms-attributes-section input[type="radio"],
        body.dark-theme .bms-attributes-section input[type="checkbox"] {
            accent-color: #00ff00;
        }

        .bms-attributes-section input[type="checkbox"] {
            width: auto !important;
            float: left !important;
            margin-right: 8px !important;
            margin-left: 0 !important;
            margin-top: 2px !important;
        }

        .bms-attributes-section span {
            display: inline !important;
            margin-left: 0 !important;
            line-height: 1.5 !important;
        }

        body.dark-theme .bms-attributes-section code {
            background: #001100 !important;
            color: #00ff00 !important;
            border: 1px solid #003300;
            padding: 2px 6px;
            border-radius: 3px;
        }

        body.dark-theme .bms-attributes-section > div:last-child {
            background: #001100 !important;
            border: 1px solid #003300 !important;
            color: #00ff00 !important;
        }

        body.dark-theme .bms-attributes-section strong {
            color: #00ff00 !important;
        }

        /* Modal de Ajuda */
        .help-modal {
            max-width: 900px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
        }

        .help-body {
            overflow-y: auto;
            padding: 25px 30px;
        }

        .help-section {
            margin-bottom: 35px;
            padding-bottom: 25px;
            border-bottom: 1px solid var(--border-color);
        }

        .help-section:last-child {
            border-bottom: none;
        }

        .help-section-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--primary-color);
            margin: 0 0 15px 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .help-content {
            color: var(--text-medium);
            line-height: 1.7;
        }

        .help-content p {
            margin: 12px 0;
        }

        .help-content ul,
        .help-content ol {
            margin: 12px 0;
            padding-left: 25px;
        }

        .help-content li {
            margin: 8px 0;
        }

        .help-content ul ul {
            margin: 5px 0;
        }

        .help-content strong {
            color: var(--text-dark);
            font-weight: 600;
        }

        .help-content code {
            background: var(--bg-gray);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 13px;
            color: var(--accent-color);
        }

        .code-example {
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 12px 15px;
            margin: 12px 0;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 13px;
            overflow-x: auto;
            color: var(--text-dark);
        }

        .help-tip {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
            border-left: 4px solid var(--primary-color);
            padding: 12px 15px;
            border-radius: 6px;
            margin: 15px 0;
            font-size: 14px;
        }

        .shortcuts-table {
            width: 100%;
            border-collapse: collapse;
            margin: 15px 0;
        }

        .shortcuts-table tr {
            border-bottom: 1px solid var(--border-color);
        }

        .shortcuts-table td {
            padding: 10px 15px;
        }

        .shortcuts-table td:first-child {
            width: 150px;
            font-weight: 600;
        }

        kbd {
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 4px;
            padding: 3px 8px;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 12px;
            box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
            display: inline-block;
            min-width: 35px;
            text-align: center;
        }

        .help-footer {
            text-align: center;
            padding: 20px;
            margin-top: 20px;
            border-top: 2px solid var(--border-color);
            background: var(--bg-gray);
            border-radius: 8px;
        }

        .help-footer p {
            margin: 5px 0;
            color: var(--text-medium);
        }

        /* Dark Theme para Help Modal */
        body.dark-theme .help-section {
            border-bottom-color: #003300;
        }

        body.dark-theme .help-content code {
            background: #001100;
            color: #00ff00;
            border: 1px solid #003300;
        }

        body.dark-theme .code-example {
            background: #001100;
            border-color: #003300;
            color: #00ff00;
        }

        body.dark-theme .help-tip {
            background: rgba(0, 255, 0, 0.1);
            border-left-color: #00ff00;
        }

        body.dark-theme .shortcuts-table tr {
            border-bottom-color: #003300;
        }

        body.dark-theme kbd {
            background: #001100;
            border-color: #003300;
            color: #00ff00;
        }

        body.dark-theme .help-footer {
            background: #001100;
            border-top-color: #003300;
        }
    
