:root {
    --blue: #222F86;
    --yellow: #FFC400;
    --bg: #f4f6f8;
    --white: #ffffff;
    --text: #333;
    --gray: #666;
}

* { box-sizing: border-box; font-family: 'Segoe UI', Roboto, sans-serif; }

body { margin: 0; background: var(--bg); overflow: hidden; }

/* TELAS */
.screen { display: none; height: 100vh; width: 100vw; flex-direction: column; overflow-y: auto; }
.screen.active { display: flex; animation: fade 0.3s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* LOADING */
#screen-loading { background: var(--blue); color: white; justify-content: center; align-items: center; }
.logo-anim { font-size: 3rem; font-weight: 900; }
.logo-anim span { color: var(--yellow); }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3); border-top-color: var(--yellow); border-radius: 50%; animation: spin 1s linear infinite; margin-top: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* LOGIN */
#screen-login { justify-content: center; align-items: center; background: #eef2f5; padding: 20px; }
.login-box { background: white; padding: 30px; border-radius: 12px; width: 100%; max-width: 400px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }

/* HEADER HOME */
.app-header { background: var(--blue); padding: 15px; display: flex; justify-content: space-between; align-items: center; color: white; }
.user-greeting { font-size: 1.1rem; display: block; }
.user-team { font-size: 0.8rem; color: var(--yellow); display: block; }
.btn-icon { background: none; border: none; color: white; font-size: 1.5rem; }

/* MENU GRID */
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; }
.card-menu { background: white; padding: 20px; border-radius: 10px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); cursor: pointer; border-bottom: 4px solid var(--blue); }
.card-menu:active { transform: scale(0.98); background: #eee; }
.card-menu .icon { font-size: 2.5rem; margin-bottom: 10px; }

/* FORMULARIOS */
.page-header { background: white; padding: 15px; border-bottom: 1px solid #ddd; display: flex; align-items: center; gap: 15px; }
.btn-back { border: none; background: #eee; padding: 8px 15px; border-radius: 20px; font-weight: bold; color: var(--blue); }
.form-container { padding: 20px; padding-bottom: 100px; }
.input-modern { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; margin-bottom: 15px; background: white; font-size: 1rem; }
.btn-primary { width: 100%; padding: 15px; background: var(--blue); color: white; border: none; border-radius: 8px; font-weight: bold; font-size: 1rem; }
.btn-primary:disabled { background: #ccc; }

/* BUSCA */
.search-box { position: relative; }
.results-list { position: absolute; background: white; width: 100%; max-height: 200px; overflow-y: auto; border: 1px solid #eee; z-index: 10; display: none; }
.result-item { padding: 10px; border-bottom: 1px solid #eee; }
.result-item:active { background: #f0f0f0; }

/* CARRINHO */
.cart-section { background: white; padding: 15px; border-radius: 8px; margin-bottom: 15px; border: 1px solid #eee; }
.cart-item { display: flex; justify-content: space-between; border-bottom: 1px solid #eee; padding: 10px 0; align-items: center; }
.cart-btn-remove { color: red; font-weight: bold; padding: 5px 10px; }
.cart-total { text-align: right; font-size: 1.1rem; font-weight: bold; color: var(--blue); margin-top: 10px; }

/* TOAST */
#toast-container { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 10px 20px; border-radius: 20px; opacity: 0; transition: 0.3s; pointer-events: none; }
#toast-container.show { opacity: 1; bottom: 40px; }

/* TABS ARMAZEM */
.tabs-container { display: flex; overflow-x: auto; gap: 10px; margin-bottom: 15px; padding-bottom: 5px; }
.tab-btn { background: #e0e0e0; border: none; padding: 8px 15px; border-radius: 20px; white-space: nowrap; font-weight: bold; color: #555; cursor: pointer; }
.tab-btn.active { background: var(--blue); color: var(--yellow); border: 1px solid var(--yellow); }

/* RESULTADOS BUSCA */
.result-item { padding: 12px; border-bottom: 1px solid #eee; background: white; }
.prod-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.prod-code { font-weight: bold; color: var(--blue); font-size: 0.9rem; }
.prod-stock { font-size: 0.8rem; padding: 2px 6px; border-radius: 4px; }
.stock-ok { background: #e6fffa; color: #00b894; }
.stock-low { background: #fff5f5; color: #f56565; }
.prod-desc { font-size: 0.95rem; color: #333; margin-bottom: 4px; }
.prod-price { font-weight: bold; color: #333; font-size: 0.9rem; }

/* CARRINHO NOVO */
.cart-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding: 12px 0; }
.cart-info { flex: 1; }
.cart-title { font-size: 0.95rem; margin-bottom: 2px; }
.cart-sub { font-size: 0.75rem; color: #888; }
.cart-price { font-size: 0.85rem; color: var(--blue); font-weight: bold; margin-top: 2px; }
.cart-actions { display: flex; gap: 8px; }
.cart-actions button { background: #f0f0f0; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.cart-actions button.remove { background: #ffebeb; color: red; }