:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --accent: #2563eb;
    --danger: #b91c1c;
    --success: #15803d;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}
header {
    background: #111827;
    color: white;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}
header a { color: white; text-decoration: none; }
.container {
    width: min(1200px, calc(100% - 2rem));
    margin: 0 auto;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
nav a { margin-left: 1rem; }
.panel {
    background: var(--panel);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    margin-bottom: 1rem;
}
.grid-form, .inline-form {
    display: grid;
    gap: .75rem;
}
.grid-form { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: flex; flex-direction: column; gap: .35rem; }
input, select, button {
    padding: .65rem .8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}
button {
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
}
button.danger { background: var(--danger); }
.camera-grid, .capture-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.camera-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stream-image {
    width: 100%;
    border-radius: 8px;
    background: #d1d5db;
    min-height: 180px;
    object-fit: cover;
}
.stream-image.large { max-width: 960px; }
.capture-card img {
    width: 100%;
    border-radius: 8px;
}
.status {
    font-size: .9rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    color: white;
}
.status.online { background: var(--success); }
.status.offline { background: var(--danger); }
.flash-wrap { margin-bottom: 1rem; }
.flash {
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: .5rem;
}
.flash.success { background: #dcfce7; }
.flash.error { background: #fee2e2; }
.checkbox { flex-direction: row; align-items: center; }

:root { --border: #dbe3ea; }
button.secondary { background: #475569; }
.camera-grid, .capture-grid, .user-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.muted { color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; margin-top: .75rem; }
.metric { background: #f8fafc; border: 1px solid var(--border); padding: .6rem; border-radius: 8px; }
.login-panel { max-width: 420px; margin: 8vh auto; }
.table-like { width: 100%; border-collapse: collapse; }
.table-like th, .table-like td { padding: .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.small { font-size: .92rem; }


.capture-day-group { margin-bottom: 1.5rem; }
.capture-day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 .75rem 0;
    padding: 0 .15rem;
}
.capture-day-header h3 { margin: 0; }
.capture-actions { margin-top: .85rem; }


.preview-wrap {
    position: relative;
    width: 100%;
}
.preview-wrap .stream-image {
    display: block;
}
.roi-overlay {
    position: absolute;
    border: 3px solid #facc15;
    background: rgba(250, 204, 21, 0.12);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    border-radius: 6px;
}

.button-link { display: inline-block; padding: .65rem 1rem; border-radius: .5rem; background: #2563eb; color: #fff; text-decoration: none; }
button.danger, .danger { background: #b91c1c; color: #fff; }
.mfa-setup { margin: 1rem 0; }
.mfa-qr { max-width: 260px; background: #fff; padding: 1rem; border-radius: .5rem; }
code { background: rgba(0,0,0,.08); padding: .15rem .3rem; border-radius: .25rem; }
