﻿body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  margin: 0;
  color: #111827;
}

.container {
  width: min(1200px, 95%);
  margin: 30px auto;
}

.card {
  width: min(640px, 100%);
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  margin: 16px auto;
}

.wide-card {
  width: min(1120px, 100%);
}

h1 {
  font-size: 22px;
  margin: 0 0 8px;
}

h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

h3 {
  font-size: 16px;
  margin: 0;
}

.sub {
  margin: 0 0 14px;
  color: #6b7280;
  font-size: 13px;
}

label {
  display: block;
  margin: 8px 0 6px;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

textarea {
  margin-top: 8px;
}

button {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  cursor: pointer;
}

.msg {
  margin-top: 12px;
  color: #b91c1c;
  font-size: 13px;
  min-height: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: #111827;
  white-space: nowrap;
}

.topbar-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-links a {
  text-decoration: none;
  color: #111827;
  padding: 8px 10px;
  border-radius: 10px;
}

.topbar-links a:hover {
  background: #f3f4f6;
}

.table-wrap {
  overflow-x: auto;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.list-table th,
.list-table td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 8px;
  vertical-align: top;
  white-space: nowrap;
}

.list-table th {
  background: #f9fafb;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kv-item {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.space-top {
  margin-top: 16px;
}

.page-info {
  font-size: 13px;
  color: #4b5563;
}

.btn-inline {
  width: auto;
  min-width: 90px;
  margin-top: 0;
}

.btn-secondary {
  background: #374151;
}

.btn-danger {
  background: #b91c1c;
}

.inline-check {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
}

.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 99;
}

.camera-panel {
  width: min(760px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 14px;
}

.camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.camera-video-wrap {
  margin-top: 10px;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
}

.camera-video-wrap video {
  width: 100%;
  max-height: min(70vh, 460px);
  object-fit: cover;
  display: block;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .container {
    width: 96%;
    margin: 16px auto;
  }

  .card {
    padding: 14px;
    margin: 10px auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-links {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .topbar-links a {
    border: 1px solid #e5e7eb;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .grid-2,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .btn-inline {
    width: 100%;
  }

  .camera-panel {
    padding: 12px;
  }

  .camera-head {
    flex-wrap: wrap;
  }
}
