/* Net Cad - Dental Orthodontic CAD & Cloud Suite (1:1 Deltaface Wallet UI + Cloud Enhancements) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  color: #2b2d30;
  background-color: #d0d5d4;
}

/* ==================== TOP WINDOW & MENU BAR ==================== */
.top-menubar {
  height: 36px;
  background: #f4f5f6;
  border-bottom: 1px solid #c5c8cc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #23272b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.brand-title {
  font-weight: 700;
  font-size: 13px;
  color: #1f2428;
  letter-spacing: 0.3px;
}

.case-header-title {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #cfd3d7;
  font-size: 11.5px;
  color: #444950;
  font-weight: 500;
}

.quick-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
}

.icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d9d78;
  font-size: 14px;
}
.icon-btn:hover {
  background: #e3e7ea;
  border-color: #c2c7cc;
}

.top-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-top {
  height: 24px;
  padding: 0 10px;
  border: none;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  color: #ffffff;
  background: #43474d;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s;
}
.btn-top:hover {
  background: #f2b705;
  color: #1d1f22;
}

.btn-top.btn-purple {
  background: #6f2586;
}
.btn-top.btn-purple:hover, .btn-top.btn-purple.active {
  background: #f2b705;
  color: #1d1f22;
}

.credit-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #3a3f45;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #49b870;
  display: inline-block;
  border: 1px solid #359456;
}

/* ====================RIBBON / ASSISTANTS BAR ==================== */
.ribbon-bar {
  background: #e6e8ea;
  border-bottom: 1px solid #c2c6ca;
  padding: 4px 10px 0 10px;
}

.ribbon-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ribbon-tab {
  padding: 4px 14px;
  background: #d8dcdf;
  border: 1px solid #c0c4c8;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: #3b4046;
  cursor: pointer;
}
.ribbon-tab.active {
  background: #f4f5f6;
  color: #1c2024;
}

.ribbon-cards {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  background: #f4f5f6;
}

.assistant-card {
  width: 96px;
  height: 62px;
  background: #43474d;
  color: #ffffff;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.12s, transform 0.1s;
}
.assistant-card:hover, .assistant-card.active {
  background: #2d8b6f;
}
.assistant-card .card-icon {
  font-size: 16px;
  margin-bottom: 4px;
  color: #5ee2b3;
}

/* ==================== MAIN WORKSPACE SPLIT ==================== */
.workspace-container {
  display: flex;
  width: 100%;
  height: calc(100vh - 36px);
  position: relative;
}
.workspace-container.with-ribbon {
  height: calc(100vh - 130px);
}

/* ==================== LEFT PANEL ==================== */
.left-panel {
  width: 416px;
  min-width: 416px;
  height: 100%;
  background: #efefef;
  border-right: 1px solid #bfc3c7;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px;
}

/* Home Tree Panel */
.tree-box {
  background: #ffffff;
  border: 1px solid #c8ccd0;
  height: 55%;
  padding: 8px;
  font-size: 12px;
}
.tree-item {
  padding: 3px 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tree-item:hover {
  background: #e8f0fe;
}
.tree-item.selected {
  background: #f4c400;
  font-weight: 600;
}

.props-box {
  margin-top: 8px;
  background: #efefef;
  border-top: 1px solid #c8ccd0;
  padding-top: 8px;
  font-size: 11.5px;
}
.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.prop-row input[type="text"] {
  width: 170px;
  height: 21px;
  border: 1px solid #b0b5ba;
  padding: 0 5px;
  font-size: 11px;
}

/* Wizard Step Header */
.step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 6px;
}

.btn-step {
  background: #43474d;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.15;
  text-align: center;
}
.btn-step:hover {
  background: #f2b705;
  color: #1c1e21;
}
.btn-step.highlight {
  background: #f2b705;
  color: #1c1e21;
}

.step-title {
  font-size: 11.5px;
  font-weight: 600;
  color: #4a4f55;
  text-align: center;
  flex: 1;
}

/* 2D Arch Diagram Box */
.arch-diagram-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 4px 0 8px 0;
}

.arch-svg {
  width: 240px;
  height: 225px;
  overflow: visible;
}
.arch-svg.compact {
  width: 175px;
  height: 165px;
}

.tooth-node {
  cursor: pointer;
  transition: opacity 0.12s;
}
.tooth-node:hover {
  opacity: 0.85;
}
.tooth-node .tooth-shape {
  fill: #54623d;
  stroke: #2c3520;
  stroke-width: 2.0px;
}
.tooth-node.disabled .tooth-shape {
  fill: #f0f2f4;
  stroke: #484c52;
}
.tooth-node.selected .tooth-shape {
  fill: #d4a827;
  stroke: #1b6ef3;
  stroke-width: 2.6px;
}
.tooth-node.seg-selected .tooth-shape {
  fill: #8cd92b;
  stroke: #2b6b0e;
  stroke-width: 2.6px;
}
.tooth-node.closest .tooth-shape {
  stroke: #2484ff;
  stroke-width: 2.5px;
}
.tooth-label {
  font-size: 10.5px;
  font-weight: 700;
  fill: #1f2327;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Mode full-width bars */
.mode-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}
.btn-mode-bar {
  width: 100%;
  height: 24px;
  background: #43474d;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.btn-mode-bar.active, .btn-mode-bar:hover {
  background: #358a73;
  color: #ffffff;
}

.help-instructions {
  font-size: 10.5px;
  color: #454a50;
  line-height: 1.42;
}
.help-instructions h4 {
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  margin-bottom: 2px;
  color: #2c3035;
}

/* Step 3: Bracket Placement Grid */
.bp-top-grid {
  display: grid;
  grid-template-columns: 192px 1fr;
  gap: 6px;
  align-items: start;
}

.movement-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 6px;
}

.input-grp label {
  display: block;
  font-size: 10px;
  color: #555a60;
  margin-bottom: 1px;
}
.input-grp input {
  width: 100%;
  height: 21px;
  border: 1px solid #b5bac0;
  border-radius: 2px;
  padding: 0 4px;
  font-size: 10.5px;
  background: #f8f9fa;
  color: #2b2e33;
}

.stripping-row {
  display: grid;
  grid-template-columns: 92px 92px 86px 86px;
  gap: 5px;
  align-items: end;
  margin-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cfd3d7;
}

.action-trio {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 7px 0;
}
.btn-dark {
  background: #43474d;
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 5px 6px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  line-height: 1.15;
}
.btn-dark:hover {
  background: #f2b705;
  color: #1a1c1e;
}
.btn-dark:disabled {
  background: #b5b9be;
  color: #efefef;
  cursor: default;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid #cfd3d7;
}
.timeline-slider-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  color: #3a8c73;
  margin-bottom: 2px;
}
.timeline-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: #2f3439;
}
.seq-btns {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  font-size: 10px;
}
.seq-btns button {
  width: 34px;
  height: 18px;
  border: none;
  background: #43474d;
  color: #fff;
  border-radius: 2px;
  cursor: pointer;
}

/* Bracket Lower Split: Arch Tabs (Left) + Visibility Toggles (Right) */
.bp-bottom-split {
  display: grid;
  grid-template-columns: 266px minmax(112px, 1fr);
  gap: 8px;
  align-items: start;
}

.arch-subtabs {
  display: flex;
  border-bottom: 1px solid #c2c6ca;
  margin-bottom: 6px;
}
.arch-subtab {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #555a60;
  background: #e2e5e8;
  border: 1px solid #c2c6ca;
  border-bottom: none;
  cursor: pointer;
  border-radius: 3px 3px 0 0;
}
.arch-subtab.active {
  background: #f8f9fa;
  color: #1f2327;
}

.arch-tab-body {
  background: #f8f9fa;
  border: 1px solid #c2c6ca;
  border-top: none;
  padding: 7px;
  border-radius: 0 0 3px 3px;
  overflow: hidden;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
}
.radio-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.form-line {
  display: grid;
  grid-template-columns: 64px 74px minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 10.2px;
}
.form-line select {
  width: 100%;
  min-width: 0;
  height: 22px;
  border: 1px solid #9da3a9;
  border-radius: 2px;
  background: #43474d;
  color: #ffffff;
  font-size: 10.2px;
  font-weight: 600;
  padding: 0 2px;
}
.form-line select:focus {
  outline: 1px solid #f2b705;
}

/* Visibility Panel */
.visibility-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}
.vis-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #3a3f45;
  cursor: pointer;
}
.vis-eye-btn {
  width: 22px;
  height: 19px;
  border: none;
  border-radius: 3px;
  background: #43474d;
  color: #5ee2b3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}
.vis-item.off .vis-eye-btn {
  background: #767b82;
  color: #9da2a8;
}
.vis-item.off span {
  color: #8c9197;
}

/* Step 4: Indirect Bonding Panel */
.idb-card {
  background: #f8f9fa;
  border: 1px solid #c5c9cd;
  padding: 10px;
  border-radius: 3px;
}
.idb-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #454a50;
  margin: 8px 0 6px 0;
}
.idb-param-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
}
.idb-param-row input[type="number"] {
  width: 72px;
  height: 22px;
  border: 1px solid #9da3a9;
  border-radius: 2px;
  padding: 0 4px;
  font-size: 11px;
}
.idb-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 12px 0;
  font-size: 11px;
}
.idb-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ==================== RIGHT 3D VIEWPORT ==================== */
.viewport-panel {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #cbd0cf;
}

.viewport-toolbar {
  height: 28px;
  background: #e1e4e6;
  border-bottom: 1px solid #bfc4c8;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 5px;
  font-size: 11.5px;
  color: #454a50;
}

.view-btn {
  width: 22px;
  height: 22px;
  border: 1px solid #9fa6ac;
  background: #d3d8dc;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #1f5e50;
}
.view-btn:hover, .view-btn.active {
  background: #49b895;
  color: #ffffff;
}

.canvas-holder {
  flex: 1;
  width: 100%;
  height: calc(100% - 28px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #cfd4d3 0%, #c4c9c8 100%);
}

#cadCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* 2D Overlay for Real-Time Distance Callout Boxes (2.26mm, 4.75mm, etc.) */
.measurement-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.measure-tag {
  position: absolute;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #30343a;
  border-radius: 2px;
  padding: 1px 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #151719;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.22);
  transform: translate(-50%, -50%);
}

/* Viewport Bottom Status & Hints */
.viewport-hud {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}
.hud-pill {
  background: rgba(33, 37, 41, 0.78);
  color: #f1f3f5;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  pointer-events: auto;
}

/* ==================== PROGRESS MODAL (Separating teeth / Loading / Compute models) ==================== */
.progress-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.12);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.progress-modal-box {
  width: 340px;
  background: #f8f9fa;
  border: 1px solid #adb3b9;
  box-shadow: 0 4px 16px rgba(0,0,0,0.22);
  padding: 12px 16px;
  text-align: center;
}
.progress-modal-title {
  font-size: 11.5px;
  color: #33383e;
  margin-bottom: 8px;
}
.progress-track {
  width: 100%;
  height: 20px;
  background: #d5d8dc;
  border: 1px solid #b8bdc2;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: #f3c300;
  transition: width 0.08s linear;
}
.progress-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #1f2328;
}

/* ==================== LIST OF CASES FULL OVERLAY ==================== */
.overlay-screen {
  position: fixed;
  inset: 36px 0 0 0;
  background: #efefef;
  z-index: 100;
  display: none;
  flex-direction: column;
  padding: 14px 20px;
  overflow-y: auto;
}

.cases-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.cases-search-input {
  width: 380px;
  height: 26px;
  border: 1px solid #8c9298;
  padding: 0 8px;
  font-size: 12px;
  background: #ffffff;
}

.cases-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  flex: 1;
}

.cases-table-wrap {
  background: #efefef;
  overflow-y: auto;
}
.cases-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #454a50;
  margin-bottom: 8px;
}

.cases-table {
  width: 100%;
  border-collapse: collapse;
  background: #f7f7f7;
}
.cases-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11.5px;
  color: #555a60;
  border-bottom: 1px solid #cfd3d7;
  font-weight: 600;
}
.cases-table td {
  padding: 7px 10px;
  font-size: 11.5px;
  color: #2f3338;
  border-bottom: 1px solid #e1e4e7;
}
.cases-table tr:hover td {
  background: #eceff2;
}
.cases-table tr.selected-row td {
  background: #e2e8f0;
}

.btn-case-open {
  width: 115px;
  height: 28px;
  background: #671f49;
  color: #ffffff;
  border: none;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-case-open:hover {
  background: #f2b705;
  color: #1c1e21;
}

.btn-case-details {
  width: 115px;
  height: 28px;
  background: #43474d;
  color: #ffffff;
  border: none;
  border-radius: 2px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-case-details:hover {
  background: #5b6068;
}

.info-side-box {
  background: #f5f6f7;
  border: 1px solid #d0d4d8;
  padding: 12px;
  margin-bottom: 14px;
}
.info-side-row {
  display: grid;
  grid-template-columns: 95px 1fr;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11.5px;
}
.info-side-row input, .info-side-row textarea {
  width: 100%;
  border: 1px solid #9da3a9;
  padding: 4px 6px;
  font-size: 11.5px;
  background: #ffffff;
}
.info-side-row textarea {
  height: 90px;
  resize: none;
}

/* ==================== MODALS (New Case, Export Explorer & 3D Wire Viewer, Cloud Admin, Login) ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 28, 0.58);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-window {
  background: #f4f5f7;
  border: 1px solid #7a8086;
  border-radius: 4px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.38);
  width: 760px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  height: 34px;
  background: #2b3036;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
}
.modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}

/* Login Fullscreen Overlay */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1b222c 0%, #283545 55%, #1f4e43 100%);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 430px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  padding: 28px 30px;
}
.login-card h2 {
  font-size: 20px;
  color: #1d232a;
  margin-bottom: 4px;
}
.login-card p.sub {
  font-size: 12px;
  color: #636b74;
  margin-bottom: 18px;
}
.login-field {
  margin-bottom: 12px;
}
.login-field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #373d44;
  margin-bottom: 4px;
}
.login-field input {
  width: 100%;
  height: 34px;
  border: 1px solid #b8bfc6;
  border-radius: 4px;
  padding: 0 10px;
  font-size: 13px;
}
.btn-login-submit {
  width: 100%;
  height: 36px;
  background: #2b8a6e;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}
.btn-login-submit:hover {
  background: #237059;
}
.quick-login-chips {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e3e6ea;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-btn {
  flex: 1;
  padding: 6px 8px;
  background: #eef2f5;
  border: 1px solid #cfd6dd;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #2c353d;
  cursor: pointer;
}
.chip-btn:hover {
  background: #dce5ec;
}
