*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 44px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.toolbar .logo {
  font-weight: bold;
  color: #e94560;
  font-size: 16px;
}

.toolbar .nav-link {
  color: #a0a0b8;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 4px;
}

.toolbar .nav-link.active {
  background: #0f3460;
  color: #fff;
}

.toolbar .spacer {
  flex: 1;
}

#clock {
  color: #888;
  font-size: 13px;
}

.page {
  display: none;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.page.active {
  display: block;
}

.card {
  background: #16213e;
  border-radius: 8px;
  padding: 16px;
}

.card h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.form-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.form-inline input,
.form-inline select,
.form-inline button {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #0f3460;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 13px;
}

.form-inline button {
  background: #e94560;
  border: none;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.form-inline button:hover {
  background: #c73650;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #0f3460;
}

th {
  color: #888;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.status-online { background: #2ecc71; }
.status-offline { background: #e74c3c; }
.status-connecting { background: #f39c12; }

.delete-btn {
  padding: 2px 8px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}

/* --- Playback Layout --- */
.playback-layout {
  display: flex;
  gap: 16px;
}

.playback-player {
  flex: 1;
  min-width: 0;
}

.player-container {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.player-container video {
  width: 100%;
  height: 100%;
  display: none;
}

.player-container video.active {
  display: block;
}

#player-placeholder {
  color: #555;
  font-size: 14px;
}

.player-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}

.player-controls button {
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #0f3460;
  background: #1a1a2e;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 14px;
}

.player-controls button:hover:not(:disabled) {
  background: #0f3460;
}

.player-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}

#stream-status {
  font-size: 12px;
  color: #888;
  margin-left: 8px;
}

/* --- Sidebar --- */
.playback-sidebar {
  width: 310px;
  flex-shrink: 0;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
}

.form-group select {
  width: 100%;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #0f3460;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 13px;
}

/* --- Calendar --- */
.calendar {
  background: #16213e;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.calendar-header button {
  background: none;
  border: none;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 8px;
}

.calendar-header span {
  font-size: 13px;
  font-weight: bold;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-grid button {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
}

.calendar-grid button:hover {
  background: #0f3460;
}

.calendar-grid button.selected {
  background: #e94560;
}

.calendar-grid button.has-recording {
  position: relative;
}

.calendar-grid button.has-recording::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2ecc71;
}

.calendar-grid button.other-month {
  color: #444;
}

/* --- Timeline --- */
.timeline-section h4 {
  font-size: 13px;
  margin-bottom: 8px;
}

.timeline-section canvas {
  width: 100%;
  border-radius: 4px;
  background: #0a0a14;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #666;
  padding: 0 2px;
}
