* { box-sizing: border-box; }

.admin {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  color: #2d3748;
}

/* --- Layout --- */
.admin-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem 1.25rem;
  background: #1a365d;
  border-radius: 12px;
}
.admin-header a:first-child {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.admin-header .btn-ghost {
  color: #bee3f8;
  font-size: 0.85rem;
}
.admin-header .btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.admin-main {
  background: #fff;
  padding: 1.75rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  line-height: 1.5;
}

.admin-main h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  color: #1a365d;
}

/* --- Navigation bar below h1 --- */
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}
.admin-nav .nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: #4a5568;
  background: #edf2f7;
  transition: background 0.15s, color 0.15s;
  min-height: 38px;
}
.admin-nav .nav-item:hover {
  background: #e2e8f0;
  color: #2d3748;
}
.admin-nav .nav-item.active {
  background: #3182ce;
  color: #fff;
}
.admin-nav .nav-item .nav-icon {
  font-size: 1rem;
  line-height: 1;
}
.admin-nav .nav-sep {
  flex: 1;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: #718096;
}
.breadcrumb a {
  color: #3182ce;
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover {
  text-decoration: underline;
}
.breadcrumb .sep {
  color: #cbd5e0;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.925rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
  line-height: 1.2;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #3182ce; color: #fff; }
.btn-primary:hover { background: #2b6cb0; }
.btn-ghost { background: transparent; color: #4a5568; }
.btn-ghost:hover { background: #edf2f7; }
.btn-small { padding: 0.35rem 0.75rem; font-size: 0.85rem; min-height: 36px; }
.btn-danger { background: #e53e3e; color: #fff; }
.btn-danger:hover { background: #c53030; }

/* --- Cards (camera list) --- */
.camera-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.camera-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.camera-card:hover {
  border-color: #cbd5e0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.camera-card-info {
  flex: 1;
  min-width: 0;
}
.camera-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: #2d3748;
  margin-bottom: 0.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.camera-card-meta {
  font-size: 0.8rem;
  color: #718096;
}
.camera-card-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

/* --- Status badge --- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status.on { background: #c6f6d5; color: #276749; }
.status.off { background: #fed7d7; color: #c53030; }
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.status.on .status-dot { background: #276749; }
.status.off .status-dot { background: #c53030; }

/* --- Tables (users) --- */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.75rem; border-bottom: 1px solid #e2e8f0; }
.admin-table th { font-weight: 600; color: #718096; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table td { color: #2d3748; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f7fafc; }

/* --- Motion preset select --- */
.motion-preset-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  cursor: pointer;
}
.motion-preset-select:focus {
  outline: none;
  border-color: var(--leaf);
}

/* --- Forms --- */
.admin-form { margin-top: 0.5rem; }
.admin-form label {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d3748;
}
.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  margin-bottom: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fff;
}
.admin-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}
.admin-form input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49,130,206,0.15);
}
.admin-form input::placeholder { color: #a0aec0; }
.admin-form .form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.admin-form button, .admin-form .btn { margin-right: 0; }

/* Form section grouping */
.form-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #edf2f7;
}
.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.form-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin: 0 0 0.75rem;
}
.form-row {
  display: flex;
  gap: 0.75rem;
}
.form-row > * { flex: 1; min-width: 0; }
.form-row .form-col-sm { flex: 0 0 120px; }

/* --- Messages --- */
.admin-msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  background: #fed7d7;
  color: #c53030;
}
.admin-msg-ok {
  background: #c6f6d5;
  color: #276749;
}

/* --- Hints --- */
.field-hint {
  margin: 0.15rem 0 0.9rem;
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.4;
}
.field-hint code {
  background: #edf2f7;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* --- Settings --- */
.settings-group {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.settings-group legend {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a365d;
  padding: 0 0.5rem;
}
.settings-danger-zone {
  border-color: rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.02);
}
.settings-danger-zone legend {
  color: #c53030;
}
.danger-zone-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}
.danger-zone-desc {
  flex: 1;
  font-size: 0.9rem;
  color: #2d3748;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  color: #2d3748;
  cursor: pointer;
  margin-bottom: 0.5rem;
}
.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #3182ce;
  flex-shrink: 0;
}
.checkbox-label + .field-hint {
  padding-left: 0;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #a0aec0;
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.empty-state-text {
  font-size: 1rem;
  margin: 0 0 1rem;
  color: #718096;
}

/* --- Login / Setup --- */
.login-box {
  max-width: 380px;
  margin: 2rem auto 0;
}
.login-box h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}
.admin-login-icon {
  display: block;
  margin: 0 auto 1.25rem;
  height: 10rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.login-icon {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #a0aec0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.login-divider span {
  padding: 0 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.webauthn-icon {
  margin-right: 0.5rem;
}

.btn-secondary {
  background: #4a5568;
  color: #fff;
  border: none;
}
.btn-secondary:hover {
  background: #2d3748;
}

/* --- Debug --- */
.debug-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.75rem; }
.debug-select { padding: 0.4rem 0.6rem; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 16px; }
.debug-select:focus { outline: none; border-color: #3182ce; }
.debug-toggle { display: flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; color: #4a5568; white-space: nowrap; }
.debug-log { background: #1a202c; color: #68d391; font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: 0.8rem; padding: 1rem; border-radius: 8px; max-height: 400px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; line-height: 1.4; }
.debug-log-sticky { position: fixed; bottom: 0; left: 0; right: 0; max-height: 50vh; border-radius: 8px 8px 0 0; z-index: 100; margin: 0; }
.debug-panel { margin-top: 0.75rem; background: #f7fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem; }
.debug-panel h3 { margin: 1rem 0 0.5rem; font-size: 0.85rem; color: #718096; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.debug-panel h3:first-child { margin-top: 0; }
.debug-table { font-size: 0.85rem; }
.debug-table td:first-child { font-weight: 500; color: #4a5568; white-space: nowrap; width: 40%; }

/* --- Visitor stats --- */
.visitors-desc {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: #718096;
}

.visitor-stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.visitor-card {
  background: linear-gradient(145deg, #f0fff4 0%, #c6f6d5 100%);
  border: 2px solid rgba(72, 187, 120, 0.4);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.15s, box-shadow 0.15s;
}

.visitor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.visitor-card-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #276749;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.visitor-card-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2f855a;
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.visitor-chart-wrap {
  margin-top: 0.5rem;
}

.visitor-chart-wrap h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  margin: 0 0 1rem;
}

#visitor-chart {
  max-width: 100%;
  height: auto;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .admin-wrap { padding: 0.5rem; }
  .admin-header { border-radius: 8px; padding: 0.6rem 1rem; }
  .admin-main { padding: 1.1rem; border-radius: 8px; }
  .admin-main h1 { font-size: 1.2rem; }
  .admin-nav { gap: 0.35rem; margin-bottom: 1rem; padding-bottom: 0.75rem; }
  .admin-nav .nav-item { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .admin-table th, .admin-table td { padding: 0.5rem 0.4rem; font-size: 0.85rem; }
  .admin-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .btn-small { padding: 0.4rem 0.65rem; }
  .form-row { flex-direction: column; gap: 0; }
  .form-row .form-col-sm { flex: 1; }
  .camera-card { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .camera-card-actions { justify-content: flex-end; }
  .login-box { margin-top: 1rem; }
  .visitor-stats-cards { grid-template-columns: 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }
  .visitor-card-value { font-size: 1.6rem; }
}

/* --- Snapshots admin --- */
.snap-bulk-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.75rem;
  background: #f8f8f8;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.snap-bulk-select-all {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.snap-admin-check-wrap {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 2;
  cursor: pointer;
}
.snap-admin-check-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #e53e3e;
}
.snap-admin-card {
  position: relative;
}
.snap-admin-card:has(.snap-admin-check:checked) {
  outline: 3px solid #e53e3e;
  outline-offset: 2px;
}
.snap-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.snap-admin-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.snap-admin-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.snap-admin-card.starred {
  border-color: #ecc94b;
  box-shadow: 0 0 0 3px rgba(236,201,75,0.3);
}
.snap-admin-thumb-link {
  display: block;
  position: relative;
}
.snap-admin-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.snap-admin-starred-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.6);
  color: #ecc94b;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}
.snap-admin-meta {
  padding: 0.5rem 0.6rem;
  flex: 1;
}
.snap-admin-nick {
  font-weight: 600;
  font-size: 0.85rem;
  color: #2d3748;
}
.snap-admin-cam {
  font-size: 0.75rem;
  color: #718096;
  margin-top: 0.1rem;
}
.snap-admin-time {
  font-size: 0.7rem;
  color: #a0aec0;
  margin-top: 0.1rem;
}
.snap-admin-actions {
  padding: 0.4rem 0.6rem;
  display: flex;
  gap: 0.4rem;
  border-top: 1px solid #e2e8f0;
  background: #f7fafc;
}

/* --- Camera Edit Form --- */
.camera-edit-form {
  margin-top: 0;
}

.camera-edit-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.camera-edit-grid-single {
  grid-template-columns: 1fr;
}

.camera-edit-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.camera-edit-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-card {
  background: #f7fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
}

.form-card-compact {
  padding: 1rem;
}

.form-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a365d;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.form-card-compact .form-card-title {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.form-card-desc {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: #718096;
}

.form-field {
  margin-bottom: 0.75rem;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #4a5568;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49,130,206,0.15);
}

.form-field input::placeholder {
  color: #a0aec0;
}

.form-field-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #718096;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.form-grid-2:last-child,
.form-grid-3:last-child {
  margin-bottom: 0;
}

.form-field-small {
  max-width: 120px;
}

/* FFmpeg collapsible section */
.ffmpeg-details {
  border: 2px solid #e2e8f0;
  background: #fff;
}

.ffmpeg-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  margin: -1.25rem -1.25rem 0;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(to bottom, #f7fafc, #edf2f7);
  transition: background 0.15s;
  list-style: none;
}

.ffmpeg-summary::-webkit-details-marker {
  display: none;
}

.ffmpeg-summary::after {
  content: '\u25BC';
  font-size: 0.7rem;
  color: #718096;
  transition: transform 0.2s;
}

.ffmpeg-details[open] .ffmpeg-summary::after {
  transform: rotate(180deg);
}

.ffmpeg-summary:hover {
  background: linear-gradient(to bottom, #edf2f7, #e2e8f0);
}

.ffmpeg-summary span:first-child {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a365d;
}

.ffmpeg-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #bee3f8;
  color: #2b6cb0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.ffmpeg-content {
  padding-top: 1rem;
}

.ffmpeg-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ffmpeg-subsection-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin: 0.75rem 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.ffmpeg-subsection-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Sidebar actions */
.action-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-form {
  margin: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.action-btn:hover {
  border-color: #3182ce;
  background: #f0f7ff;
}

.action-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.action-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.action-text strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d3748;
}

.action-text small {
  font-size: 0.75rem;
  color: #718096;
}

/* Danger zone */
.form-card-danger {
  border-color: #feb2b2;
  background: #fff5f5;
}

.form-card-danger .form-card-title {
  color: #c53030;
  border-bottom-color: #feb2b2;
}

.btn-block {
  width: 100%;
}

/* Sticky form actions */
.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: #fff;
  margin: 0 -1.75rem -1.75rem;
  padding: 1rem 1.75rem;
  border-top: 2px solid #e2e8f0;
  border-radius: 0 0 12px 12px;
  z-index: 10;
}

/* Responsive camera edit */
@media (max-width: 800px) {
  .camera-edit-grid {
    grid-template-columns: 1fr;
  }
  
  .camera-edit-sidebar {
    order: -1;
  }
  
  .form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .form-field-small {
    max-width: none;
  }
  
  .form-actions-sticky {
    margin: 0 -1.1rem -1.1rem;
    padding: 0.75rem 1.1rem;
  }
}

/* --- Camera Info & Debug --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.info-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: #edf2f7;
  font-weight: 600;
  color: #4a5568;
  width: 40%;
  border-bottom: 1px solid #e2e8f0;
}

.info-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  color: #2d3748;
  word-break: break-word;
}

.info-muted {
  color: #a0aec0;
  font-style: italic;
}

.info-json {
  background: #f7fafc;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  overflow-x: auto;
  margin: 0;
}

.debug-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.debug-log-wrap {
  background: #1a202c;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.debug-log-wrap h2 {
  color: #a0aec0;
  font-size: 0.85rem;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.debug-log-full {
  color: #68d391;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  font-size: 0.8rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

.action-link {
  text-decoration: none;
}

.action-btn-danger {
  border-color: #feb2b2;
  background: #fff5f5;
}

.action-btn-danger:hover {
  border-color: #fc8181;
  background: #fed7d7;
}

.action-btn-danger .action-text strong {
  color: #c53030;
}
