:root { color-scheme: dark; font-family: "Segoe UI", system-ui, sans-serif; background: #202326; color: #f4f5f6; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top right, #313a4a 0, #202326 46%, #191b1e 100%); }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
[hidden] { display: none !important; }
.shell { width: min(1060px, calc(100% - 28px)); margin: 28px auto 56px; }
.card { background: rgba(34, 37, 41, .94); border: 1px solid #3b4048; border-radius: 18px; box-shadow: 0 18px 55px rgba(0,0,0,.25); }
.login-card { width: min(400px, 100%); margin: 10vh auto 0; padding: 34px; }
.brand-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: #2f6fca; font-size: 34px; box-shadow: 0 8px 24px rgba(47,111,202,.3); }
.brand-mark.small { width: 44px; height: 44px; border-radius: 13px; font-size: 24px; }
.eyebrow { margin: 0 0 6px; color: #9ca7b8; font-size: 11px; letter-spacing: .16em; font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 28px; }
h2 { margin-bottom: 0; font-size: 22px; }
h3 { margin: 0 0 14px; font-size: 16px; }
.muted { color: #adb3bd; line-height: 1.5; }
.stack { display: grid; gap: 14px; margin-top: 24px; }
.stack.compact { gap: 10px; margin-top: 12px; }
label { display: grid; gap: 7px; color: #d9dde3; font-size: 13px; }
input { width: 100%; padding: 11px 12px; color: #f4f5f6; background: #191b1e; border: 1px solid #4a5059; border-radius: 9px; outline: none; }
input:focus { border-color: #619bea; box-shadow: 0 0 0 3px rgba(97,155,234,.18); }
button { border-radius: 9px; padding: 10px 15px; color: #fff; background: #4b5360; transition: filter .15s ease, transform .15s ease; }
button:hover:not(:disabled) { filter: brightness(1.13); transform: translateY(-1px); }
button.primary { background: #3676d0; }
button.success { background: #3b9966; }
button.danger { background: #85494e; }
.status { min-height: 20px; margin: 12px 0 0; color: #aeb7c4; font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.title-wrap, .top-actions { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 23px; }
.user-label { color: #c3cad4; font-size: 13px; }
.icon-button { width: 40px; height: 40px; padding: 0; border: 1px solid #4a5059; background: #2a2e34; font-size: 21px; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 12px; }
.empty-card { padding: 36px; text-align: center; }
.gate-card { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; padding: 17px; }
.gate-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: #2e3540; font-size: 29px; }
.gate-name { margin: 0 0 5px; font-size: 17px; }
.gate-meta { color: #9fa8b5; font-size: 12px; }
.gate-state { display: inline-flex; align-items: center; gap: 6px; color: #72d290; font-size: 12px; }
.gate-state.offline { color: #e19d72; }
.gate-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.open-button { min-width: 92px; background: #3676d0; }
.camera-panel { margin-top: 18px; padding: 18px; }
.camera-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.camera-heading h2 { font-size: 18px; }
.camera-state { color: #72d290; font-size: 12px; }
.camera-frame-wrap { position: relative; overflow: hidden; min-height: 190px; border-radius: 12px; background: #15171a; border: 1px solid #3b4048; }
#cameraFrame { display: block; width: 100%; min-height: 190px; max-height: 460px; object-fit: contain; background: #15171a; }
.camera-placeholder { display: grid; place-items: center; min-height: 190px; padding: 28px; color: #adb3bd; text-align: center; }
.camera-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; align-items: end; }
.camera-form button { min-height: 43px; }
.camera-settings-block { margin-top: 18px; }
.camera-settings-block .muted { margin-bottom: 15px; font-size: 13px; }
.camera-form select { width: 100%; padding: 11px 12px; color: #f4f5f6; background: #191b1e; border: 1px solid #4a5059; border-radius: 9px; outline: none; }
.admin-panel { margin-top: 18px; padding: 22px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.admin-badge { padding: 5px 9px; border: 1px solid #527fc4; border-radius: 999px; color: #a6c8ff; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.settings-block, .users-block { padding: 17px; border: 1px solid #3b4048; border-radius: 13px; background: #292c31; }
.device-list { display: grid; gap: 8px; margin-top: 16px; }
.device-row, .assignment-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 9px; background: #1d2024; border: 1px solid #3a4048; }
.device-row strong { display: block; font-size: 13px; }
.device-row small { color: #9da6b2; }
.device-row button { padding: 7px 10px; font-size: 12px; }
.users-block { margin-top: 18px; }
.create-user-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; }
.assignments { display: grid; gap: 9px; }
.assignment-row { align-items: flex-start; flex-wrap: wrap; }
.assignment-main { min-width: 120px; }
.assignment-main strong { display: block; }
.assignment-main small { color: #9da6b2; }
.assignment-checkboxes { display: flex; flex: 1; flex-wrap: wrap; gap: 7px 13px; }
.tick { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 6px; color: #cfd5dc; font-size: 12px; }
.tick input { width: auto; accent-color: #4e8de3; }
@media (max-width: 900px) { .camera-form { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .admin-grid { grid-template-columns: 1fr; } .create-user-form { grid-template-columns: 1fr; } .topbar { align-items: flex-start; } .user-label { display: none; } }
@media (max-width: 500px) { .shell { width: min(100% - 18px, 1060px); margin-top: 12px; } .login-card { padding: 25px; margin-top: 5vh; } .gate-card { grid-template-columns: 46px 1fr; } .gate-icon { width: 46px; height: 46px; font-size: 24px; } .open-button { grid-column: 1 / -1; width: 100%; } }
