:root{--bg:#f4f6f9;--surface:#fff;--line:#e1e6ee;--text:#18202d;--muted:#727b8a;--blue:#3869b5;--blue-soft:#eaf1ff;--green:#8bc83e;--shadow:0 10px 30px rgba(36,49,71,.08)}
#live-view .period-select{display:none!important}
.auth-checking .topbar,.auth-checking .app-shell{visibility:hidden}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}button,input,select{font:inherit}.icon{font-size:18px;line-height:1}.topbar{height:64px;background:#17191b;color:#cfd2d7;display:flex;align-items:center;padding:0 6.8%;gap:46px}.topbar__brand{font-size:16px;font-weight:700;color:#fff;display:flex;align-items:center;gap:10px;min-width:170px}.brand-mark{width:30px;height:30px;border:2px solid #fff;border-radius:8px;display:grid;place-items:center;font-weight:800}.main-nav{display:flex;align-self:stretch;gap:30px}.nav-item{border:0;border-bottom:3px solid transparent;background:transparent;color:#aeb2b9;padding:0 4px;display:flex;align-items:center;gap:9px;cursor:pointer}.nav-item:hover,.nav-item.is-active{color:#fff}.nav-item.is-active{border-color:#fff}.nav-item .icon{font-size:20px}.topbar__account{margin-left:auto;display:flex;align-items:center;gap:9px}.account-avatar{width:30px;height:30px;border:1px solid #b9bec5;border-radius:50%;display:grid;place-items:center}.chevron{font-size:20px;line-height:12px}.app-shell{display:grid;grid-template-columns:244px minmax(0,1fr);gap:28px;max-width:1440px;margin:0 auto;padding:28px 32px}.sidebar{background:rgba(255,255,255,.66);border-radius:8px;min-height:calc(100vh - 120px);padding:28px 14px 14px;display:flex;flex-direction:column}.sidebar__title{font-size:18px;font-weight:700;padding:0 10px 22px}.objects{display:flex;flex-direction:column;gap:3px}.object{display:flex;align-items:center;gap:12px;padding:13px 10px;border-left:3px solid transparent;border-radius:0 6px 6px 0;text-align:left;background:transparent;color:var(--text);cursor:pointer}.object:hover,.object.is-active{background:var(--blue-soft);border-left-color:var(--blue)}.object-icon{width:27px;height:27px;display:grid;place-items:center;color:#7c8794;flex:none}.object-icon .object-shield{display:block}.object.is-active .object-icon{color:var(--blue)}.object-name{font-weight:650}.object-count{display:block;color:var(--muted);font-size:12px;margin-top:2px}.sidebar-empty{color:var(--muted);font-size:12px;line-height:1.7;padding:12px 10px}.sidebar__footer{margin-top:auto;background:var(--blue);color:#fff;border-radius:7px;padding:13px;text-align:center}.content{min-width:0;padding-top:8px}.content-head{display:flex;justify-content:space-between;gap:24px;align-items:flex-start}.eyebrow{color:var(--muted);font-size:12px;display:flex;align-items:center;gap:7px;text-transform:uppercase;letter-spacing:.04em}.status-dot{width:8px;height:8px;border-radius:50%;background:#e3a52b}.status-dot.is-open{background:var(--green);box-shadow:0 0 8px var(--green)}.status-dot.is-closed{background:#dc5a5a}.content h1{font-size:28px;margin:7px 0 2px}.content-subtitle{color:var(--muted);margin:0}.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;margin-top:22px}.search,.period-select,.segmented,.tool-button{height:38px;border:1px solid #cbd3df;background:var(--surface);border-radius:8px;color:#485467;display:flex;align-items:center}.search{padding:0 11px;gap:8px}.search input{width:155px;border:0;outline:0;color:var(--text);background:transparent}.segmented{padding:3px}.segmented button{height:30px;border:0;background:transparent;border-radius:6px;padding:0 11px;color:var(--muted);cursor:pointer}.segmented button.is-active{background:var(--blue);color:#fff}.tool-button{padding:0 13px;cursor:pointer}.period-select{padding:0 10px;gap:6px}.period-select select{border:0;background:transparent;outline:0;color:#485467;appearance:none}.filter-panel{margin:20px 0 0;padding:12px 14px;border:1px solid var(--line);background:#fff;border-radius:8px;display:flex;align-items:center;gap:8px;color:var(--muted)}.filter-chip,.pause-button{border:1px solid var(--line);background:#fff;border-radius:16px;padding:5px 12px;color:#596476;cursor:pointer}.filter-chip.is-active{background:var(--blue-soft);border-color:#b9cff7;color:var(--blue)}.pause-button{margin-left:auto}.events-section{margin-top:32px}.section-heading{display:flex;align-items:center;gap:15px;margin-bottom:14px}.section-heading h2{font-size:19px;margin:0}.section-heading h2 span{font-weight:500;color:var(--muted)}.live-label{color:#7eaf39;font-size:11px;font-weight:700;letter-spacing:.08em}.event-grid{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:16px}.event-grid.list-view{grid-template-columns:1fr}.event-card{background:var(--surface);border:1px solid var(--line);border-radius:9px;overflow:hidden;box-shadow:var(--shadow);cursor:pointer;animation:appear .22s ease-out}.event-card:hover{border-color:#a9c2e9;transform:translateY(-2px)}.event-grid.list-view .event-card{display:grid;grid-template-columns:230px 1fr}.event-visual{height:145px;background:#e8ebef;position:relative}.list-view .event-visual{height:100%}.event-visual img{width:100%;height:100%;object-fit:cover;display:block}.no-frame{height:100%;display:grid;place-items:center;color:var(--muted);font-size:28px}.event-badge{position:absolute;top:10px;right:10px;background:#fff;border-radius:12px;padding:4px 9px;font-size:11px;color:#4e5763;box-shadow:0 2px 8px #0001}.event-badge::before{content:"";display:inline-block;width:8px;height:8px;background:var(--green);border-radius:50%;margin-right:5px}.event-body{padding:13px 15px}.event-title{font-size:15px;font-weight:700;margin:0 0 7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.event-meta,.event-time{color:var(--muted);font-size:12px}.event-time{margin-top:7px}.event-kind{color:var(--blue);font-size:12px;margin-top:7px;font-weight:600}.state-card{background:var(--surface);border:1px dashed #ccd5e2;border-radius:9px;padding:35px;text-align:center;color:var(--muted)}.state-card strong,.state-card span{display:block}.empty-icon{font-size:32px;margin-bottom:8px}.modal-backdrop{position:fixed;inset:0;background:rgba(22,29,39,.46);backdrop-filter:blur(3px);display:grid;place-items:center;padding:24px;z-index:20}.modal{width:min(900px,100%);max-height:calc(100vh - 48px);overflow:auto;background:#fff;border-radius:14px;padding:28px;position:relative;box-shadow:0 22px 70px #17223655}.modal-close{position:absolute;right:18px;top:13px;border:0;background:transparent;font-size:28px;color:#677385;cursor:pointer}.modal-main{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr);gap:26px;padding-top:22px}.modal-media{min-height:250px;background:#edf0f3;border-radius:8px;overflow:hidden;display:grid;place-items:center;color:var(--muted)}.modal-media img{width:100%;max-height:380px;object-fit:contain;display:block}.modal-info h2{font-size:23px;margin:9px 0 18px}.event-status{color:#7aae39;font-size:13px}.detail-list{display:grid;gap:12px;color:#596476}.detail-row{display:grid;grid-template-columns:24px 100px 1fr;gap:6px}.detail-row b{font-weight:500;color:var(--text);overflow-wrap:anywhere}.modal-bottom{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:24px}.modal-bottom>div{border:1px solid var(--line);border-radius:8px;padding:15px}.detail-label{font-weight:700}.modal-bottom p{color:#596476;margin-bottom:0}.modal-bottom pre{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted);font-size:12px;max-height:150px;overflow:auto;margin-bottom:0}@keyframes appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}[hidden]{display:none!important}@media(max-width:1050px){.topbar{padding:0 24px;gap:20px}.app-shell{grid-template-columns:210px 1fr;padding:22px}.event-grid{grid-template-columns:repeat(2,minmax(220px,1fr))}}@media(max-width:760px){.topbar{height:auto;min-height:60px;flex-wrap:wrap;padding:10px 16px}.topbar__brand{min-width:auto}.main-nav{order:3;width:100%;height:38px;gap:16px}.topbar__account{margin-left:auto}.app-shell{display:block;padding:15px}.sidebar{min-height:0;margin-bottom:20px;padding:18px 10px}.sidebar__footer{display:none}.objects{display:grid;grid-template-columns:repeat(2,1fr)}.content-head{display:block}.toolbar{justify-content:flex-start;margin-top:18px}.event-grid{grid-template-columns:1fr}.modal{padding:18px}.modal-main,.modal-bottom{grid-template-columns:1fr}.modal-main{padding-top:20px}.modal-media{min-height:180px}}

@font-face {
  font-family: HelveticaNeueCyr;
  font-style: normal;
  font-weight: 400;
  src: url('assets/fonts/HelveticaNeueCyr-Roman.otf') format('opentype');
}
@font-face {
  font-family: HelveticaNeueCyr;
  font-style: normal;
  font-weight: 600;
  src: url('assets/fonts/HelveticaNeueCyr-Medium.otf') format('opentype');
}
@font-face {
  font-family: HelveticaNeueCyr;
  font-style: normal;
  font-weight: 700;
  src: url('assets/fonts/HelveticaNeueCyr-Bold.otf') format('opentype');
}

/* Reference navigation styling */
.topbar {
  height: 60px;
  background: #2d2d2d;
  padding: 0 6.8%;
  gap: 42px;
}
.main-nav {
  gap: 0;
  height: 60px;
}
.nav-item {
  min-height: 60px;
  padding: 0 22px;
  border-bottom: 3px solid transparent;
  color: #bdbdbd;
  font-family: HelveticaNeueCyr, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  gap: 10px;
}
.nav-item:hover,
.nav-item.is-active {
  color: #d2d2d2;
}
.nav-item.is-active {
  border-bottom-color: #d2d2d2;
}
.nav-item .nav-icon {
  width: 20px;
  height: 24px;
  flex: none;
  filter: invert(78%);
}
.nav-item .nav-icon--calendar {
  width: 22px;
  height: 22px;
}
@media(max-width:760px) {
  .main-nav { height: 38px; }
  .nav-item { min-height: 38px; padding: 0 10px; }
}

.llm-balance {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  color: #f0f1f2;
}
.llm-balance__body {
  display: grid;
  line-height: 1.2;
}
.llm-balance__label,
.llm-balance__budget,
.llm-balance__meta {
  color: #aeb2b9;
  font-size: 10px;
}
.llm-balance__line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 18px;
}
.llm-balance__stale {
  border: 1px solid #c99b45;
  border-radius: 8px;
  padding: 1px 5px;
  color: #e7bc67;
  font-size: 9px;
  white-space: nowrap;
}
.llm-balance__refresh {
  width: 30px;
  height: 30px;
  border: 1px solid #60646a;
  border-radius: 6px;
  background: transparent;
  color: #d2d4d7;
  cursor: pointer;
}
.llm-balance__refresh:hover {
  border-color: #92979e;
  color: #fff;
}
.llm-balance__refresh:disabled {
  cursor: wait;
  opacity: .5;
}
.llm-balance[data-state="unavailable"],
.llm-balance[data-state="error"] {
  color: #c1c4c8;
}
.llm-balance[data-state="loading"] #llm-balance-value {
  display: inline-block;
  min-width: 92px;
  color: transparent;
  border-radius: 4px;
  background: linear-gradient(90deg, #4b4f55 25%, #70757b 50%, #4b4f55 75%);
  background-size: 200% 100%;
  animation: llm-skeleton 1.2s ease-in-out infinite;
}
@keyframes llm-skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media(max-width:900px) {
  .llm-balance {
    min-width: 0;
  }
  .llm-balance__label,
  .llm-balance__budget,
  .llm-balance__meta,
  .llm-balance__stale {
    display: none;
  }
}

.modal-media img {
  cursor: zoom-in;
}
.modal-media img:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}
.modal-history {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.modal-history-items {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 8px;
  padding-bottom: 2px;
}
.modal-history-item {
  display: grid;
  gap: 4px;
  min-width: 92px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}
.modal-history-item:hover { border-color: var(--blue); color: var(--blue); }
.modal-history-item img { width: 82px; height: 48px; object-fit: cover; border-radius: 4px; }
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0a0d1240;
}
.image-modal__stage {
  position: relative;
  display: inline-flex;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
}
.image-modal__content {
  display: block;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 18px 60px rgba(10, 13, 18, .24);
}
.image-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: rgba(20, 24, 30, .72);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
.image-modal__close:hover,
.image-modal__close:focus-visible {
  background: rgba(255, 255, 255, .18);
  border-color: #fff;
  outline: none;
}

.sidebar__footer,
.segmented button.is-active {
  background: #557ebe;
}

.period-select {
  position: relative;
  display: block;
  min-width: 164px;
  height: 40px;
  padding: 0;
  border-color: #c7d0dd;
  border-radius: 9px;
  background: #fff;
  color: #53627a;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.period-select:hover {
  border-color: #9daec5;
}
.period-select:focus-within {
  border-color: #557ebe;
  box-shadow: 0 0 0 3px rgba(85, 126, 190, .14);
}
.period-select .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}
.period-select select {
  width: 100%;
  height: 100%;
  padding: 0 36px 0 42px;
  color: #35445b;
  font-weight: 500;
  line-height: 40px;
  cursor: pointer;
}
.period-select .chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid #68778c;
  border-bottom: 1.5px solid #68778c;
  font-size: 0;
  line-height: 0;
  transform: rotate(45deg);
  pointer-events: none;
}

.confidence {
  margin-top: 10px;
}
.confidence__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #68758a;
  font-size: 11px;
}
.confidence__header strong {
  color: #69758a;
  font-size: 12px;
}
.confidence__track {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #e8ecf2;
}
.confidence__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}
.confidence--high .confidence__header strong {
  color: #557ebe;
}
.confidence--high .confidence__fill {
  background: #557ebe;
}
.confidence--medium .confidence__header strong {
  color: #a97a17;
}
.confidence--medium .confidence__fill {
  background: #e0aa35;
}
.confidence--low .confidence__header strong {
  color: #c05050;
}
.confidence--low .confidence__fill {
  background: #d96363;
}
.confidence--none .confidence__track {
  display: none;
}
.modal-evidence {
  grid-column: auto;
  background: #f7f9fc;
}
.modal-evidence p {
  white-space: pre-wrap;
}
.modal-review-actions {
  grid-column: 1 / -1;
}
.modal-review-actions .event-actions {
  margin-top: 10px;
}
#live-action-error {
  padding: 12px 16px;
}
.content-head {
  align-items: center;
}
.content h1 {
  margin-top: 3px;
  font-size: 26px;
}
.toolbar {
  margin-top: 0;
}
.camera-stats {
  margin-top: 4px;
}
.events-section {
  margin-top: 20px;
}
.archive-head {
  display: block;
}
.archive-head .content-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.archive-head .content-heading .eyebrow {
  flex-basis: 100%;
}
.archive-head .content-heading h1,
.archive-head .content-heading p {
  margin-top: 0;
}
.archive-toolbar {
  justify-content: flex-start;
  margin-top: 10px;
}
.archive-date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-date-range label {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #cbd3df;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}
.archive-date-range input {
  min-width: 152px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #485467;
}

.modal-media-panel {
  min-width: 0;
}
.modal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f6f9;
}
.modal-tab {
  min-width: 0;
  flex: 1;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #68758a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.modal-tab:hover {
  color: #35445b;
}
.modal-tab.is-active {
  background: #557ebe;
  color: #fff;
  box-shadow: 0 2px 7px rgba(55, 83, 125, .18);
}
.modal-tab:focus-visible {
  outline: 2px solid #557ebe;
  outline-offset: 2px;
}
.modal-media video {
  display: block;
  width: 100%;
  max-height: 380px;
  background: #111820;
}
.modal-media-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  color: #7c8796;
}
.modal-video-actions {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding: 12px 0 0;
}
.modal-video-download {
  color: #485467;
  text-decoration: none;
}
.modal-video-download:hover {
  border-color: #557ebe;
  color: #557ebe;
}
.modal-media-empty strong,
.modal-media-empty span {
  display: block;
}
.modal-media-empty__icon {
  width: 42px;
  height: 42px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  background: #dde5f1;
  color: #557ebe;
  font-size: 16px;
}
.event-status--archive {
  color: #68758a;
}
.event-badge--archive::before {
  background: #8a94a3;
}
@media(max-width:760px) {
  .modal-tabs {
    flex-direction: column;
  }
}
.archive-camera { height: 38px; border: 1px solid #cbd3df; border-radius: 8px; background: #fff; color: #485467; padding: 0 10px; }
.probe-form { display: grid; grid-template-columns: auto minmax(150px, .8fr) 130px minmax(220px, 1.5fr) auto; align-items: center; gap: 10px; margin-top: 22px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.probe-form input, .probe-form select, .probe-form textarea { width: 100%; border: 1px solid #cbd3df; border-radius: 7px; padding: 8px 10px; color: var(--text); background: #fff; }
.probe-form textarea { resize: vertical; min-height: 38px; }
.probe-status { color: var(--muted); font-size: 12px; }
.probe-status[data-state="error"] { color: #b24b4b; }
.probe-status[data-state="success"] { color: #5f9635; }
.event-evidence { margin-top: 7px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-repeats { margin-top: 7px; color: var(--blue); font-size: 12px; font-weight: 600; }
.event-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.event-feedback { height: 36px; border: 0; border-radius: 18px; background: transparent; color: #1f2937; padding: 0 13px; cursor: pointer; font-size: 12px; }
.event-feedback--confirm { color: #1f2937; }
.event-feedback--false { color: #d84c4c; }
.event-feedback:hover { background: #d4d4d4; }
.event-feedback:disabled { cursor: wait; opacity: .55; }
.review-status { display: inline-block; margin-top: 8px; padding: 3px 7px; border-radius: 10px; font-size: 11px; color: #68758a; background: #eef1f5; }
.review-status--confirmed { color: #4d8c35; background: #edf7e8; }
.review-status--pending { color: #557ebe; background: #edf3ff; }
.review-status--false_positive { color: #9b702c; background: #fff6df; }
.review-status--likely_false_positive { color: #7a5aa6; background: #f2ecfb; }
.archive-error { margin-top: 12px; color: #b24b4b; }
@media(max-width:900px) { .probe-form { grid-template-columns: 1fr 1fr; } .probe-form strong, .probe-status { grid-column: 1 / -1; } }
@media(max-width:560px) { .probe-form { grid-template-columns: 1fr; } .probe-form strong, .probe-status { grid-column: auto; } }
.auth-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.auth-controls button { border: 1px solid #cbd3df; border-radius: 6px; background: #fff; color: #485467; padding: 6px 10px; cursor: pointer; }
.auth-controls button:hover { background: #f3f6fb; }
.auth-controls span { max-width: 150px; overflow: hidden; color: #e7e9ec; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.llm-balance { margin-left: 0; flex: none; }
.auth-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(10, 13, 18, .25); }
.auth-modal[hidden] { display: none; }
.auth-modal__panel { position: relative; width: min(100%, 390px); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 55px rgba(26, 39, 57, .22); }
.auth-modal__panel h2 { margin: 0 0 20px; color: var(--text); }
.auth-form { display: grid; gap: 13px; }
.auth-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.auth-form input { width: 100%; box-sizing: border-box; border: 1px solid #cbd3df; border-radius: 7px; padding: 10px; color: var(--text); background: #fff; }
.auth-form input:focus { outline: 2px solid rgba(85, 126, 190, .25); border-color: #557ebe; }
.auth-form .tool-button { justify-self: start; min-width: 100px; }
.auth-status { min-height: 18px; margin: 0; color: var(--muted); font-size: 13px; }
.auth-status[data-state="error"] { color: #b24b4b; }
.auth-status[data-state="success"] { color: #5f9635; }
.auth-status[data-state="loading"] { color: #557ebe; }
.login-page { min-height: 100vh; background: linear-gradient(145deg, #eef2f7 0%, #f8f9fb 58%, #e8edf5 100%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 20px; padding: 32px 20px; }
.login-card { width: min(100%, 430px); padding: 34px 38px 36px; border: 1px solid #dce3ed; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(36, 49, 71, .12); }
.login-brand { display: flex; justify-content: center; margin-bottom: 28px; padding: 16px 22px; border-radius: 9px; background: #17191b; }
.login-brand img { width: 188px; height: 64px; display: block; }
.login-heading { margin-bottom: 24px; }
.login-eyebrow { color: #557ebe; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.login-heading h1 { margin: 5px 0 6px; color: var(--text); font-size: 26px; line-height: 1.2; }
.login-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 8px; }
.login-form label { margin-top: 7px; color: #485467; font-size: 13px; font-weight: 600; }
.login-form input { width: 100%; min-height: 42px; border: 1px solid #cbd3df; border-radius: 8px; padding: 0 12px; color: var(--text); background: #fff; outline: 0; }

@media(min-width:761px) {
  html, body { height: 100%; overflow: hidden; }
  .app-shell { height: calc(100vh - 64px); min-height: 0; }
  .sidebar { min-height: 0; height: 100%; overflow-y: auto; }
  .content { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .events-section { min-height: 0; flex: 1; display: flex; flex-direction: column; }
  .event-grid { min-height: 0; overflow-y: auto; align-content: start; padding-right: 8px; }
}

@media(max-width:760px) {
  .event-grid { overflow: visible; }
}

/* Keep event cards at their content height inside the independently scrolling grid. */
.event-grid { grid-auto-rows: max-content; }
.event-grid:not(.list-view) .event-card { min-height: 330px; display: flex; flex-direction: column; }
.event-grid:not(.list-view) .event-visual { flex: 0 0 145px; min-height: 145px; }
.event-grid:not(.list-view) .event-body { flex: 1 1 auto; min-height: 184px; }

.login-form input:focus { border-color: #557ebe; box-shadow: 0 0 0 3px rgba(85, 126, 190, .16); }
.login-submit { min-height: 42px; margin-top: 14px; border: 0; border-radius: 8px; background: #557ebe; color: #fff; font-weight: 650; cursor: pointer; box-shadow: 0 5px 12px rgba(85, 126, 190, .2); }
.login-submit:hover { background: #496fa9; }
.login-submit:disabled { cursor: wait; opacity: .65; }
.login-status { min-height: 20px; margin: 7px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.login-status[data-state="error"] { color: #b24b4b; }
.login-status[data-state="success"] { color: #5f9635; }
.login-status[data-state="loading"] { color: #557ebe; }
.object {
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 7px;
  appearance: none;
  box-shadow: none;
}
.object:hover,
.object.is-active {
  border-color: #d4e1f6;
  border-left-color: var(--blue);
}
.object:focus { outline: 0; }
.object:focus-visible { outline: 2px solid #557ebe; outline-offset: 1px; }
.llm-balance { order: 3; margin-left: auto; }
.auth-controls { order: 4; margin-left: 0; }
@media(max-width:760px) {
  .auth-controls { order: 2; margin-left: auto; }
  .llm-balance { order: 4; width: 100%; margin-left: 0; justify-content: flex-end; }
}
.login-footer { margin: 0; color: #8993a2; font-size: 12px; text-align: center; }
@media(max-width:480px) { .login-card { padding: 26px 22px 28px; } .login-brand { margin-bottom: 22px; } }
.camera-stats { display:flex; flex-wrap:wrap; gap:8px 18px; margin-top:8px; color:var(--muted); font-size:12px; }
.camera-stats span { white-space:nowrap; }
.camera-stats b { color:var(--text); font-weight:700; }
