:root {
    /* PALETA CYBER DARK */
    --blue: #222F86;
    --yellow: #FFC400;
    --white: #ffffff;
    --green-whatsapp: #00e676; 
    --red-error: #ff5252;
    --orange-warning: #ffab40;
    --bg-app: #0b1021;       /* Azul Marinho Profundo */
    --bg-card: #161f36;      /* Azul Petróleo */
    --border-color: #2c3e50; /* Bordas sutis */
    --text-main: #f0f4f8;    /* Branco Gelo */
    --text-muted: #94a3b8;   /* Cinza Azulado */
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Roboto', sans-serif; }
body { background-color: var(--bg-app); color: var(--text-main); font-size: 16px; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }

.hidden { display: none !important; }
.active { display: block; }
.mb-10 { margin-bottom: 15px; }
.mt-10 { margin-top: 15px; }
.mt-header { margin-top: 70px; padding-bottom: 80px; }
.container { padding: 15px; }

/* === HEADER GLOBAL === */
.app-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background: var(--bg-card); border-bottom: 2px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.logo { font-size: 1.3rem; font-weight: 900; color: var(--white); text-shadow: 0 0 5px rgba(255,255,255,0.3); }
.logo span { color: var(--yellow); }
.header-info { font-size: 0.9rem; font-weight: bold; color: var(--yellow); }
.btn-icon { background: none; border: none; font-size: 1.3rem; color: var(--white); padding: 5px; cursor: pointer; transition: 0.2s; }
.btn-icon:active { transform: scale(0.8); }

/* === TELA DE LOGIN (CYBER) === */
.login-container {
    height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: radial-gradient(circle at center, #1a237e 0%, var(--bg-app) 100%);
    position: relative; overflow: hidden; perspective: 800px;
}
.bg-grid {
    position: absolute; bottom: -30%; left: -50%; width: 200%; height: 100%;
    background-image: linear-gradient(rgba(0, 255, 255, 0.15) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px; transform: rotateX(60deg); animation: gridMove 10s linear infinite;
    opacity: 0.4; z-index: 0; mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 60%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 60%);
}
@keyframes gridMove { 0% { transform: rotateX(60deg) translateY(0); } 100% { transform: rotateX(60deg) translateY(40px); } }

.login-animation-wrapper { margin-bottom: 40px; z-index: 2; position: relative; text-align: center;}
.logo-container-anim { font-size: 4rem; font-weight: 900; color: white; display: flex; justify-content: center; gap: 5px; text-shadow: 2px 2px 0px rgba(0,255,255,0.5), -2px -2px 0px rgba(255,0,255,0.5); }
.logo-part-1 { animation: glitch-anim-1 2.5s infinite linear alternate-reverse; }
.logo-part-2 { color: var(--yellow); animation: neonFlicker 2s infinite alternate; }

.typing-text { font-weight: 900; font-size: 1.1rem; color: #ffffff; letter-spacing: 2px; margin-top: 15px; border-right: 3px solid var(--yellow); white-space: nowrap; overflow: hidden; width: 0; animation: typing 2s steps(25, end) forwards 0.5s, blinkCursor 0.5s step-end infinite; }
@keyframes typing { to { width: 100%; } }
@keyframes blinkCursor { 50% { border-color: transparent; } }

.login-box {
    background: rgba(22, 31, 54, 0.95); padding: 25px; border-radius: 16px; width: 90%; max-width: 350px; text-align: center; border: 1px solid var(--border-color); box-shadow: 0 20px 50px rgba(0,0,0,0.6); z-index: 5; opacity: 0; transform: translateY(50px); animation: fadeInBox 0.8s ease-out forwards 1.5s;
}
@keyframes fadeInBox { to { opacity: 1; transform: translateY(0); } }

.login-box p { font-weight: 900; margin-bottom: 20px; color: var(--text-muted); font-size: 0.9rem; letter-spacing: 2px; }
.input-login {
    width: 100%; padding: 15px; margin-bottom: 20px; border-radius: 8px; background: rgba(0,0,0,0.3); border: 2px solid var(--border-color); color: var(--white); text-align: center; font-size: 1.8rem; font-weight: bold; letter-spacing: 8px; transition: 0.3s;
}
.input-login:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 10px rgba(255,196,0,0.2); }

/* === BOTÕES GERAIS === */
.btn-submit { width: 100%; padding: 16px; border-radius: 8px; border: none; font-size: 1rem; font-weight: 900; cursor: pointer; background: var(--blue); color: var(--white); letter-spacing: 1px; transition: 0.2s; text-transform: uppercase; }
.btn-login-glow { background: var(--yellow); color: var(--bg-app); box-shadow: 0 0 20px rgba(255, 196, 0, 0.3); }
.btn-login-glow:active { transform: scale(0.97); box-shadow: 0 0 10px rgba(255, 196, 0, 0.8); }

.btn-scan {
    width: 100%; padding: 20px; font-size: 1.1rem; font-weight: 900; background: var(--bg-card); color: var(--white); border: 2px solid var(--yellow); border-radius: 12px; margin-bottom: 10px; display: flex; align-items: center; justify-content: center; transition: 0.2s; box-shadow: inset 0 0 10px rgba(255,196,0,0.1);
}
.btn-scan:active { background: var(--yellow); color: var(--bg-app); transform: scale(0.98); }

/* === COMPONENTES E CARDS === */
.section-title { font-size: 1.1rem; font-weight: 900; margin-bottom: 15px; color: var(--yellow); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.label-muted { font-size: 0.8rem; color: var(--text-muted); font-weight: bold; margin-bottom: 5px; display: block; }
.grid-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.card-menu { background: var(--bg-card); padding: 25px 10px; border-radius: 12px; text-align: center; border: 1px solid var(--border-color); color: var(--white); font-weight: 900; font-size: 0.9rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: 0.2s; cursor: pointer; }
.card-menu:active { background: rgba(34, 47, 134, 0.5); border-color: var(--yellow); transform: translateY(2px); }

.card-dark { background: var(--bg-card); padding: 15px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.input-dark { width: 100%; padding: 14px; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); color: var(--white); border-radius: 8px; font-size: 1rem; appearance: none; }
.input-dark:focus { outline: none; border-color: var(--blue); }

.header-flex { display: flex; justify-content: space-between; align-items: center; }
.badge { background: var(--blue); color: var(--white); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; border: 1px solid var(--yellow); }

/* === TABELAS E TABS === */
.tabs { display: flex; gap: 8px; background: rgba(0,0,0,0.2); padding: 5px; border-radius: 10px; }
.tab-btn { flex: 1; padding: 12px 5px; background: transparent; color: var(--text-muted); border: none; font-weight: bold; font-size: 0.85rem; border-radius: 8px; transition: 0.3s; }
.tab-btn.active { background: var(--bg-card); color: var(--yellow); box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

.table-dark { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table-dark th { background: rgba(0,0,0,0.3); color: var(--text-muted); padding: 12px; text-align: left; }
.table-dark td { padding: 12px; border-bottom: 1px solid var(--border-color); }
.table-dark tr:last-child td { border-bottom: none; }

/* === INVENTARIO CARDS === */
.item-card { background: var(--bg-card); padding: 15px; border-radius: 8px; margin-bottom: 10px; border-left: 4px solid var(--red-error); box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.item-card.ok { border-left-color: var(--green-whatsapp); }
.item-title { font-weight: 900; display: block; margin-bottom: 5px; color: var(--white); }
.item-id { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }
.progress-bar-bg { width: 100%; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--yellow); width: 0%; transition: width 0.3s; }
.fixed-bottom { position: fixed; bottom: 0; left: 0; width: 100%; padding: 15px; background: var(--bg-card); border-top: 1px solid var(--border-color); z-index: 50; }

/* === ALERTA CARD (Ressuprimento) === */
.alerta-card { background: var(--bg-card); border: 1px solid var(--orange-warning); border-radius: 8px; padding: 15px; margin-bottom: 10px; }
.alerta-header { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 5px; }
.alerta-btn-group { display: flex; gap: 10px; margin-top: 10px; }
.btn-small { padding: 8px; flex: 1; border: none; border-radius: 5px; font-weight: bold; font-size: 0.8rem; cursor: pointer; color: white;}
.btn-small.green { background: var(--green-whatsapp); color: black;}
.btn-small.red { background: var(--red-error); }

/* === MODAL CUSTOMIZADO === */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 900; padding: 20px; backdrop-filter: blur(5px); }
.modal-box { background: var(--bg-card); padding: 25px; border-radius: 12px; width: 100%; max-width: 350px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.8); text-align: center; }
.modal-box h3 { color: var(--yellow); margin-bottom: 15px; font-size: 1.2rem; text-transform: uppercase; }
.modal-box p { color: var(--white); font-size: 1rem; margin-bottom: 25px; line-height: 1.4; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; }

/* === MARCA D'ÁGUA FIXA === */
.login-footer {
    position: fixed; bottom: 15px; left: 0; width: 100%; display: flex; justify-content: space-between;
    padding: 0 20px; font-size: 0.75rem; color: rgba(255,255,255,0.3); font-weight: bold; pointer-events: none; z-index: 200; transition: opacity 0.2s;
}
/* Magia para ocultar rodapé quando o teclado sobe no celular */
body:focus-within .login-footer { opacity: 0; display: none !important; }
.brand-felipe { color: var(--white); text-shadow: 0 0 5px rgba(255,255,255,0.2); animation: blink-glitch 3s infinite; }

/* === ANIMAÇÕES GLITCH & SPEEDER === */
@keyframes glitch-anim-1 {
  0% { clip-path: inset(20% 0 80% 0); } 20% { clip-path: inset(60% 0 10% 0); }
  40% { clip-path: inset(40% 0 50% 0); } 60% { clip-path: inset(80% 0 5% 0); }
  80% { clip-path: inset(10% 0 70% 0); } 100% { clip-path: inset(30% 0 20% 0); }
}
@keyframes neonFlicker { 0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px var(--yellow), 0 0 40px var(--yellow); } 20%, 24%, 55% { text-shadow: none; } }
@keyframes blink-glitch { 0%, 90% { opacity: 1; transform: translateX(0); } 92% { opacity: 0; } 94% { opacity: 1; transform: translateX(2px); } 96% { opacity: 1; transform: translateX(-2px); } 98% { opacity: 0; } 100% { opacity: 1; } }

/* SPEEDER ORIGINAL REFEITO */
.speeder-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--blue); display: flex; justify-content: center; align-items: center; z-index: 999; flex-direction: column; }
.loader { position: relative; margin-bottom: 40px; transform: scale(0.6); }
.loader > span { height: 5px; width: 35px; background: var(--yellow); position: absolute; border-radius: 2px 10px 1px 0; top: -19px; left: 60px; }
.base span { position: absolute; width: 0; height: 0; border-top: 6px solid transparent; border-right: 100px solid var(--yellow); border-bottom: 6px solid transparent; }
.base span:before { content: ""; height: 22px; width: 22px; border-radius: 50%; background: var(--yellow); position: absolute; right: -110px; top: -16px; }
.base span:after { content: ""; position: absolute; width: 0; height: 0; border-right: 55px solid var(--yellow); border-bottom: 16px solid transparent; top: -16px; right: -98px; }
.face { position: absolute; height: 12px; width: 20px; background: var(--yellow); border-radius: 20px 20px 0 0; transform: rotate(-40deg); right: -125px; top: -15px; }
.face:after { content: ""; height: 12px; width: 12px; background: var(--yellow); right: 4px; top: 7px; position: absolute; transform: rotate(40deg); transform-origin: 50% 50%; border-radius: 0 0 0 2px; }
.loader > span > span:nth-child(1), .loader > span > span:nth-child(2), .loader > span > span:nth-child(3), .loader > span > span:nth-child(4) { width: 30px; height: 1px; background: var(--yellow); position: absolute; animation: fazer1 0.2s linear infinite; }
.loader > span > span:nth-child(2) { top: 3px; animation: fazer2 0.4s linear infinite; }
.loader > span > span:nth-child(3) { top: 1px; animation: fazer3 0.4s linear infinite; animation-delay: -1s; }
.loader > span > span:nth-child(4) { top: 4px; animation: fazer4 1s linear infinite; animation-delay: -1s; }
.longfazers { position: absolute; width: 100%; height: 100%; top: 0; left: 0; z-index: 15; }
.longfazers span { position: absolute; height: 2px; width: 20%; background: rgba(255, 255, 255, 0.3); }
.longfazers span:nth-child(1) { top: 20%; animation: lf 0.6s linear infinite; animation-delay: -5s; }
.longfazers span:nth-child(2) { top: 40%; animation: lf2 0.8s linear infinite; animation-delay: -1s; }
.longfazers span:nth-child(3) { top: 60%; animation: lf3 0.6s linear infinite; }
.longfazers span:nth-child(4) { top: 80%; animation: lf4 0.5s linear infinite; animation-delay: -3s; }
.loading-text { color: var(--yellow); font-weight: 900; letter-spacing: 2px; animation: pulseText 1s infinite alternate; font-size: 0.9rem; text-transform: uppercase; z-index: 20; position: relative;}
@keyframes fazer1 { 0% { left: 0; } 100% { left: -80px; opacity: 0; } }
@keyframes fazer2 { 0% { left: 0; } 100% { left: -100px; opacity: 0; } }
@keyframes fazer3 { 0% { left: 0; } 100% { left: -50px; opacity: 0; } }
@keyframes fazer4 { 0% { left: 0; } 100% { left: -150px; opacity: 0; } }
@keyframes lf { 0% { left: 200%; } 100% { left: -200%; opacity: 0; } }
@keyframes lf2 { 0% { left: 200%; } 100% { left: -200%; opacity: 0; } }
@keyframes lf3 { 0% { left: 200%; } 100% { left: -100%; opacity: 0; } }
@keyframes lf4 { 0% { left: 200%; } 100% { left: -100%; opacity: 0; } }
@keyframes pulseText { from { opacity: 0.5; } to { opacity: 1; text-shadow: 0 0 10px rgba(255,196,0,0.8); } }