
:root {
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-color: #f4f6f9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    color: var(--primary-color);
    font-size: 24px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.input-action {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #6c757d; color: white; width: 100%; }
.btn-secondary:hover { background: #5a6268; }

.btn-danger { background: var(--danger-color); color: white; width: 100%; }
.btn-danger:hover { background: #c82333; }

.help-text {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Scanner */
.scanner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.scanner-header h2 { font-size: 18px; }

#reader {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.feedback-msg {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    display: none;
}
.feedback-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
.feedback-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }

/* List */
.stats {
    display: flex;
    justify-content: space-around;
    background: #e9ecef;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.stat-box { text-align: center; }
.stat-label { display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase;}
.stat-value { font-size: 20px; font-weight: bold; color: var(--primary-color);}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}
.filter-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 6px;
    font-size: 14px;
}
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.bens-lista {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.bens-lista li {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.bens-lista li:last-child { border-bottom: none; }

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-codigo { font-weight: bold; font-family: monospace; font-size: 15px;}
.item-desc { font-size: 14px; color: var(--text-muted); }

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pendente .status-badge { background: #ffeeba; color: #856404; }
.status-pendente { border-left: 4px solid var(--warning-color); }

.status-encontrado .status-badge { background: #d4edda; color: #155724; }
.status-encontrado { border-left: 4px solid var(--success-color); background-color: #f8fff9;}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--primary-color);
}

@media (max-width: 600px) {
    .filters { flex-direction: column; }
    .scanner-header { flex-direction: column; gap: 10px; align-items: stretch; }
    .camera-controls { display: flex; flex-direction: column; }
}
