* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f4f2;
    color: #1f1f1e;
}
.container { max-width: 720px; margin: 0 auto; padding: 20px 16px 60px; }
.center-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.card { background: #fff; border: 1px solid #e2e0d8; border-radius: 12px; padding: 24px; margin: 16px 0; }
.login-card { width: 100%; max-width: 360px; }

h1 { font-size: 22px; font-weight: 500; margin: 8px 0 20px; }
h2 { font-size: 17px; font-weight: 500; margin: 28px 0 12px; }

label { display: block; font-size: 13px; color: #555; margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=date], select {
    width: 100%; padding: 10px 12px; border: 1px solid #d5d3c8;
    border-radius: 8px; font-size: 15px;
}
button {
    margin-top: 16px; width: 100%; padding: 12px; border: none;
    border-radius: 8px; background: #1f6f54; color: #fff; font-size: 15px;
    font-weight: 500; cursor: pointer;
}
button:hover { background: #185b45; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.alert-error { background: #fdecec; color: #a32d2d; }
.alert-success { background: #eaf3de; color: #3b6d11; }

.topnav {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border-bottom: 1px solid #e2e0d8; padding: 12px 20px;
}
.nav-brand { font-weight: 500; }
.nav-links a { margin-left: 16px; color: #1f1f1e; text-decoration: none; font-size: 14px; }
.nav-links a:hover { text-decoration: underline; }
.nav-user { margin-left: 16px; color: #888780; font-size: 14px; }

.settings-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.status-idle { padding: 4px 10px; border-radius: 6px; background: #e2e0d8; }
.status-recording { padding: 4px 10px; border-radius: 6px; background: #f7c1c1; color: #791f1f; }
.status-uploading { padding: 4px 10px; border-radius: 6px; background: #fac775; color: #633806; }

.alert-double-banner {
    background: #e24b4a; color: #fff; padding: 14px; border-radius: 8px;
    font-weight: 500; margin-bottom: 12px; text-align: center;
}

video#camera-view, video#search-scanner {
    width: 100%; border-radius: 12px; background: #000; margin-bottom: 12px;
}

.controls button { margin-bottom: 10px; }
.manual-fields { margin: 16px 0; }
.last-scan { font-size: 14px; color: #5f5e5a; margin-top: 8px; }

.search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-form input[type=text] { flex: 1; }
.search-form button { width: auto; margin-top: 0; padding: 10px 16px; }

.results-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.result-card p { margin: 4px 0; font-size: 14px; }
.result-card.is-double { border-color: #e24b4a; }
.badge-double { color: #a32d2d; font-weight: 500; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ece9df; font-size: 14px; }
.data-table th { background: #f1efe8; font-weight: 500; }
