* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f4f6f9; color: #1a1a2e; }

.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* LOGIN */
#login-screen { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); }
.login-box { background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.logo { font-size: 2rem; margin-bottom: 8px; }
.login-box h2 { color: #1a1a2e; margin-bottom: 24px; font-size: 1.2rem; font-weight: 600; }
.login-box input { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 1rem; margin-bottom: 12px; transition: border-color .2s; }
.login-box input:focus { border-color: #4361ee; outline: none; }
.login-box button { width: 100%; padding: 12px; background: #4361ee; color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s; }
.login-box button:hover { background: #3451d1; }
.error-msg { background: #fee2e2; color: #dc2626; padding: 10px; border-radius: 8px; margin-bottom: 12px; font-size: .9rem; }

/* HEADER */
header { background: #1a1a2e; color: white; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.header-title { font-size: 1.1rem; font-weight: 600; }
.header-actions { display: flex; gap: 10px; }
.btn-add { background: #4361ee; color: white; border: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.btn-add:hover { background: #3451d1; }
.btn-logout { background: transparent; color: #aaa; border: 1px solid #444; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: .85rem; }
.btn-logout:hover { color: white; border-color: white; }

/* CONTAINER */
.container { padding: 24px; max-width: 1400px; margin: 0 auto; }
.alerta { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.alerta.ok { background: #d1fae5; color: #065f46; }
.alerta.erro { background: #fee2e2; color: #dc2626; }

/* TABELA */
#tabela-wrapper { overflow-x: auto; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
table { width: 100%; border-collapse: collapse; background: white; }
thead { background: #1a1a2e; color: white; }
th { padding: 12px 14px; text-align: left; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; font-size: .9rem; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8f9ff; }

.badge-estoque { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-sim { background: #d1fae5; color: #065f46; }
.badge-nao { background: #fee2e2; color: #dc2626; }

.condicao-chip { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.chip-novo { background: #dbeafe; color: #1d4ed8; }
.chip-semi { background: #fef3c7; color: #92400e; }

.btn-edit { background: #4361ee; color: white; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: .8rem; margin-right: 4px; }
.btn-del { background: #fee2e2; color: #dc2626; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: .8rem; }
.btn-edit:hover { background: #3451d1; }
.btn-del:hover { background: #fca5a5; }

/* MODAL */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: white; border-radius: 16px; padding: 32px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-bottom: 20px; color: #1a1a2e; font-size: 1.1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 500; color: #555; }
.form-grid input, .form-grid select { padding: 10px 12px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: .95rem; transition: border-color .2s; }
.form-grid input:focus, .form-grid select:focus { border-color: #4361ee; outline: none; }
.form-grid .full { grid-column: 1 / -1; }
.check-label { flex-direction: row !important; align-items: center; gap: 10px !important; }
.check-label input[type=checkbox] { width: 18px; height: 18px; accent-color: #4361ee; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }
.btn-cancelar { background: #f4f6f9; color: #555; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.btn-salvar { background: #4361ee; color: white; border: none; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-salvar:hover { background: #3451d1; }

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