body {
  background: #f4f6f8;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.app-header .brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#appScreen.lo-split {
  --lo-side-width: 340px;
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
}

#appScreen.lo-split.lo-side-collapsed .lo-pane-side {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}

#appScreen.lo-split.lo-side-collapsed .lo-pane-resizer {
  display: none;
}

#appScreen.lo-split .lo-pane {
  min-width: 0;
}

#appScreen.lo-split .lo-pane-main {
  flex: 1 1 auto;
}

#appScreen.lo-split .lo-pane-side {
  flex: 0 0 var(--lo-side-width);
  width: var(--lo-side-width);
  min-width: 280px;
  max-width: 560px;
  position: relative;
}

#appScreen.lo-split .lo-pane-resizer {
  flex: 0 0 10px;
  width: 10px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.35), rgba(148, 163, 184, 0.1));
  border: 1px solid rgba(148, 163, 184, 0.35);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#appScreen.lo-split .lo-pane-resizer:hover {
  background: linear-gradient(180deg, rgba(244, 176, 0, 0.35), rgba(244, 176, 0, 0.16));
  border-color: rgba(244, 176, 0, 0.45);
}

body.lo-resize-active {
  cursor: col-resize !important;
}

body.lo-resize-active * {
  user-select: none !important;
}

.drawing-grid-wrap {
  min-width: 300px;
  max-width: 420px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawing-grid-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.drawing-grid-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 25;
  border: 1px solid rgba(173, 184, 196, 0.5);
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}

.drawing-grid-empty {
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #64748b;
}

.drawing-grid-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  padding: 6px 8px;
}

.drawing-grid-row:last-child {
  border-bottom: none;
}

.drawing-grid-row.is-upload-link {
  background: #f8fafc;
}

.drawing-grid-row.is-active {
  background: rgba(244, 176, 0, 0.1);
}

.drawing-grid-main {
  border: none;
  background: transparent;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  font-size: 0.8rem;
  color: #0f172a;
  line-height: 1.25;
}

.drawing-grid-main:hover {
  color: #0b5ed7;
}

.drawing-grid-main-name {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.drawing-grid-main-file {
  color: #64748b;
  font-weight: 400;
}

.drawing-grid-main-meta {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
}

.drawing-grid-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drawing-grid-actions .btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body[data-base-path] .btn-group .btn-check + .btn-outline-secondary {
  color: #1f3449;
}

body[data-base-path] .btn-group .btn-check:checked + .btn-outline-secondary,
body[data-base-path] .btn-group .btn-check:active + .btn-outline-secondary {
  color: #1f3449;
  background: linear-gradient(180deg, #ffffff 0%, #eef6fb 100%);
  border-color: rgba(119, 153, 181, 0.42);
}

body[data-base-path] .btn-group .btn-outline-secondary i,
body[data-base-path] .btn-group .btn-outline-secondary svg {
  color: #1f3449;
  fill: currentColor;
  opacity: 1;
}

.lo-side-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.lo-side-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
}

.lo-side-collapsed-label {
  display: none;
}

#sidePane.is-collapsed #sidePaneContent {
  display: none;
}

#sidePane.is-collapsed .lo-side-controls {
  height: 100%;
  margin-bottom: 0;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

#sidePane.is-collapsed .lo-side-collapsed-label {
  display: flex;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b7280;
  user-select: none;
}

.pdf-wrapper {
  position: relative;
  width: 100%;
  min-height: 400px;
  background: #fff;
  border: 1px solid #dee2e6;
  overflow: hidden;
}

.pdf-wrapper.is-pan {
  cursor: grab;
}

.pdf-wrapper.is-pan.is-panning {
  cursor: grabbing;
}

#pdfCanvas,
#overlayCanvas {
  display: block;
  margin: 0;
}

#overlayCanvas {
  position: absolute;
  left: 0;
  top: 0;
}

.wall-item {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
}

.wall-item.active {
  border-color: #d89a00;
  box-shadow: 0 0 0 1px #d89a00;
}

.measure-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.measure-title {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1 1 auto;
}

.measure-value {
  font-size: 0.8rem;
  color: #6c757d;
  margin-left: 4px;
  white-space: nowrap;
}

.measure-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.measure-actions .btn {
  padding: 2px 6px;
  font-size: 0.75rem;
}

.measure-actions .measure-group {
  display: flex;
  gap: 4px;
}

.measure-actions .measure-divider {
  width: 1px;
  height: 18px;
  background: #dee2e6;
  margin: 0 2px;
}

.measure-toggle {
  padding: 2px 6px;
}

.wall-bar {
  display: none;
  height: 6px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}

.wall-bar > span {
  display: block;
  height: 100%;
  background: #d89a00;
}

.wall-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.wall-actions .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.service-results {
  max-height: 320px;
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 6px;
}

.service-selection-table td {
  vertical-align: middle;
}

.service-selection-table input[type="number"] {
  min-width: 120px;
}

.service-selection-table input[type="text"] {
  min-width: 180px;
}

.service-selection-table select {
  min-width: 160px;
}

.project-lookup {
  display: grid;
  gap: 6px;
}

.project-lookup-results {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

body[data-base-path] .container-fluid.py-3 {
  padding-top: 1.25rem !important;
  padding-bottom: 1.5rem !important;
}

body[data-base-path] .card {
  border-radius: 24px;
  overflow: hidden;
}

body[data-base-path] .card-header {
  background: linear-gradient(135deg, rgba(244, 176, 0, 0.08), rgba(255, 255, 255, 0.98));
  border-bottom-color: rgba(173, 184, 196, 0.28);
  font-weight: 700;
}

body[data-base-path] .project-item {
  border: 1px solid rgba(173, 184, 196, 0.3) !important;
  border-radius: 24px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 34px rgba(31, 49, 79, 0.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

body[data-base-path] .project-item:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 176, 0, 0.34) !important;
  box-shadow: 0 22px 40px rgba(31, 49, 79, 0.1);
}

body[data-base-path] .project-item.bg-light {
  background: linear-gradient(135deg, rgba(244, 176, 0, 0.08), rgba(255, 255, 255, 0.98)) !important;
}

body[data-base-path] .pdf-wrapper {
  border-radius: 22px;
  border-color: rgba(173, 184, 196, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8), 0 16px 34px rgba(31, 49, 79, 0.06);
}

body[data-base-path] .wall-item {
  border-color: rgba(173, 184, 196, 0.3);
  border-radius: 14px;
  box-shadow: 0 10px 20px rgba(31, 49, 79, 0.05);
}

body[data-base-path] .wall-item.active {
  border-color: #f4b000;
  box-shadow: 0 0 0 2px rgba(244, 176, 0, 0.16);
}

body[data-base-path] .wall-bar {
  background: #e8f2f8;
}

body[data-base-path] .wall-bar > span {
  background: linear-gradient(135deg, #f4b000, #d89a00);
}

@media (max-width: 991.98px) {
  #appScreen.lo-split {
    display: block;
  }

  #appScreen.lo-split.lo-side-collapsed .lo-pane-side {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  #appScreen.lo-split .lo-pane-side {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 0.75rem;
  }

  #appScreen.lo-split .lo-pane-resizer {
    display: none;
  }

  .drawing-grid-wrap {
    min-width: 100%;
    max-width: none;
  }
}
