:root {
  --dori-bg: #060708;
  --dori-panel: #121417;
  --dori-panel-alt: #171a1f;
  --dori-border: #2b2f36;
  --dori-text: #f5f7fa;
  --dori-muted: #9ba4b3;
  --dori-accent: #ff6b1a;
}

body {
  background: radial-gradient(circle at top, #0e1014 0%, var(--dori-bg) 65%);
  color: var(--dori-text);
  min-height: 100vh;
  font-family: Inter, "Segoe UI", sans-serif;
}

.dori-navbar {
  background: rgba(6, 7, 8, 0.97);
  border-bottom: 1px solid #1f232a;
}

.dori-logo { height: 1em; width: auto; display: block; }

.content-panel {
  background: linear-gradient(180deg, var(--dori-panel-alt), var(--dori-panel));
  border: 1px solid var(--dori-border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
  padding: 1rem 1.1rem;
}

.table { --bs-table-bg: transparent; --bs-table-color: var(--dori-text); --bs-table-border-color: #2a303c; }
.table thead th { color: #dce5f5; }

a { color: #ff9a66; }
a:hover { color: #ffb58f; }

.form-control, .form-select {
  background-color: #0f1216;
  border-color: #313640;
  color: var(--dori-text);
}
.form-control:focus, .form-select:focus {
  background-color: #11151b;
  color: #fff;
  border-color: var(--dori-accent);
  box-shadow: 0 0 0 .2rem rgba(255, 107, 26, .2);
}

.btn-primary { background: var(--dori-accent); border-color: var(--dori-accent); color: #111; font-weight: 600; }
.btn-primary:hover, .btn-primary:focus { background: #ff7f3f; border-color: #ff7f3f; color: #111; }
.btn-outline-primary { color: var(--dori-accent); border-color: var(--dori-accent); }
.btn-outline-primary:hover { background: var(--dori-accent); border-color: var(--dori-accent); color: #111; }

.list-group-item { background:#11151b; color:#d7deeb; border-color:#2b2f36; }

.dori-nav-button { border: 0; background: transparent; line-height: inherit; }
.dori-nav-button:hover { color: #ffb58f !important; }

.annotation-page {
  min-height: calc(100vh - 61px);
}

.annotation-workspace {
  display: flex;
  gap: 1rem;
  min-height: calc(100vh - 61px);
  padding: 1.2rem 1.4rem;
}

.annotation-sidebar {
  flex: 0 0 22rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
}

.annotation-sidebar .list-group {
  max-height: calc(100vh - 17.5rem);
  overflow: auto;
}

.annotation-hint {
  color: var(--dori-muted);
  font-size: .82rem;
  margin: -.25rem 0 .75rem;
}

.annotation-sidebar .list-group-item {
  cursor: pointer;
}

.annotation-sidebar .list-group-item.active {
  background: rgba(64, 255, 217, .12);
  border-color: #40ffd9;
  color: var(--dori-text);
}

.box-list-label {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
}

.box-list-select {
  min-width: 0;
}

.annotation-stage {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.annotation-canvas-wrap {
  max-height: calc(100vh - 9.5rem);
  overflow: auto;
  overscroll-behavior: contain;
  width: 100%;
}

.annotation-canvas-wrap .canvas-container {
  background: #050607;
  border: 1px solid var(--dori-border);
}

.annotation-canvas-wrap canvas {
  display: block;
}

.annotation-canvas-wrap.is-drawing .canvas-container {
  cursor: crosshair;
}

.annotation-canvas-wrap .canvas-container.show-crosshair::before,
.annotation-canvas-wrap .canvas-container.show-crosshair::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 20;
}

.annotation-canvas-wrap .canvas-container.show-crosshair::before {
  border-left: 2px dashed rgba(255, 255, 255, .78);
  bottom: 0;
  left: var(--crosshair-x, 0);
  top: 0;
}

.annotation-canvas-wrap .canvas-container.show-crosshair::after {
  border-top: 2px dashed rgba(255, 255, 255, .78);
  left: 0;
  right: 0;
  top: var(--crosshair-y, 0);
}

.zoom-toolbar {
  align-items: center;
  background: rgba(5, 6, 7, .86);
  border: 1px solid #183d42;
  border-radius: 6px;
  display: inline-flex;
  gap: .35rem;
  margin-top: .75rem;
  padding: .35rem;
}

.zoom-toolbar button,
.zoom-toolbar span {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--dori-text);
  display: inline-flex;
  font-size: .85rem;
  font-weight: 700;
  height: 2rem;
  justify-content: center;
  min-width: 2rem;
  padding: 0 .55rem;
}

.zoom-toolbar button {
  border-radius: 5px;
  color: #40ffd9;
}

.zoom-toolbar button:hover,
.zoom-toolbar button:focus {
  background: rgba(64, 255, 217, .14);
  outline: 0;
}

#zoomLevel {
  min-width: 3.4rem;
}

.settings-table-wrap {
  border: 1px solid var(--dori-border);
  border-radius: 6px;
  overflow: auto;
}

.settings-table {
  --bs-table-bg: #202327;
  --bs-table-striped-bg: #25292e;
  --bs-table-hover-bg: #2a2f35;
}

.settings-table thead th {
  background: #272c31;
  border-bottom: 1px solid #3b4149;
  color: var(--dori-text);
  font-weight: 700;
  white-space: nowrap;
}

.settings-table tbody td {
  border-color: #363c43;
  color: #eef2f7;
  white-space: nowrap;
}

.settings-modal {
  background: #14181e;
  border: 1px solid var(--dori-border);
  color: var(--dori-text);
}

.settings-modal .modal-header,
.settings-modal .modal-footer {
  border-color: var(--dori-border);
}

@media (max-width: 991.98px) {
  .annotation-workspace {
    flex-direction: column;
    padding: 1rem;
  }

  .annotation-sidebar {
    flex-basis: auto;
    max-height: none;
  }

  .annotation-sidebar .list-group {
    max-height: 16rem;
  }
}
