:root {
  --red: #ed111c;
  --red-dark: #c9000b;
  --red-soft: #ffe6e8;
  --ink: #171719;
  --muted: #73767f;
  --line: #e9eaee;
  --surface: #ffffff;
  --bg: #f7f8fb;
  --green: #27b765;
  --amber: #f6a623;
  --blue: #4d7cfe;
  --violet: #8b5cf6;
  --shadow: 0 16px 42px rgba(24, 28, 38, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(237, 17, 28, .14), transparent 30%),
    linear-gradient(135deg, #ffffff 0%, #f6f7fb 48%, #ffecef 100%);
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(237, 17, 28, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-brand {
  margin-bottom: 24px;
}

.login-panel h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.login-panel p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.login-panel form {
  display: grid;
  gap: 14px;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: #2c2f36;
  font-size: 13px;
  font-weight: 700;
}

.login-panel input,
.login-panel select,
.search input,
.panel select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.login-submit,
.add-button,
.primary-small {
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(237, 17, 28, .2);
}

.login-submit {
  min-height: 46px;
  margin-top: 8px;
}

.forgot-button,
.text-action,
.metric-card button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 700;
}

.forgot-button {
  margin-top: 16px;
  padding: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  box-shadow: 10px 0 34px rgba(20, 26, 36, .04);
}

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

.brand-mark {
  display: grid;
  width: 78px;
  height: 58px;
  place-items: center;
  color: var(--red);
  font-size: 33px;
  font-weight: 900;
  letter-spacing: 0;
  border: 3px solid var(--red);
  border-radius: 24px 8px 24px 8px;
}

.brand strong {
  display: block;
  letter-spacing: .12em;
  font-size: 14px;
}

.brand span,
.profile span,
.date-box span,
.section-header p {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #26282d;
  text-align: left;
  font-weight: 700;
}

.nav-item svg,
.icon-button svg,
.primary-small svg,
.text-action svg,
.metric-card svg {
  width: 18px;
  height: 18px;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #f82835);
  box-shadow: 0 10px 20px rgba(237, 17, 28, .18);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  font-weight: 800;
}

.profile strong {
  display: block;
  font-size: 13px;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
}

.topbar-title,
.topbar-actions,
.date-box,
.search,
.metric-card,
.panel-header,
.section-header {
  display: flex;
  align-items: center;
}

.topbar-title {
  gap: 14px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

.topbar-actions {
  gap: 14px;
}

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.notification span {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.search {
  width: min(360px, 34vw);
  min-height: 42px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  padding: 0;
}

.date-box {
  gap: 12px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.date-box strong {
  display: block;
  font-size: 14px;
}

.add-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
}

.view {
  display: none;
  padding: 20px 24px 30px;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 18px;
}

.metric-card,
.panel,
.kanban-column,
.phone-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  gap: 18px;
  min-height: 145px;
  padding: 22px;
}

.metric-icon {
  display: grid;
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
}

.metric-icon svg {
  width: 34px;
  height: 34px;
}

.metric-card span {
  color: #30333a;
  font-weight: 500;
}

.metric-card strong {
  display: block;
  margin: 8px 0 10px;
  font-size: clamp(26px, 2vw, 32px);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.1fr 1.05fr;
  gap: 18px;
  margin-top: 18px;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.panel h2,
.section-header h2 {
  margin: 0;
  font-size: 18px;
}

.panel-header,
.section-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.line-chart {
  position: relative;
  min-height: 285px;
}

.line-chart svg {
  width: 100%;
  height: 255px;
}

.grid-lines {
  position: absolute;
  inset: 15px 0 44px;
  background: repeating-linear-gradient(to bottom, transparent 0 53px, #e8e9ef 54px 55px);
  pointer-events: none;
}

.chart-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.donut-wrap {
  display: grid;
  grid-template-columns: minmax(180px, 230px) 1fr;
  gap: 22px;
  align-items: center;
}

.donut {
  display: grid;
  width: 210px;
  height: 210px;
  place-items: center;
  align-content: center;
  margin: auto;
  border-radius: 50%;
  background: conic-gradient(#e90714 0 31%, #ff5258 31% 52%, #ff8588 52% 76%, #ffb8ba 76% 88%, #ffdadd 88% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 56px;
  border-radius: 50%;
  background: #fff;
}

.donut strong,
.donut span {
  position: relative;
  z-index: 1;
}

.donut strong {
  font-size: 34px;
}

.donut span {
  color: var(--muted);
  font-size: 13px;
}

.legend {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.legend li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 8px;
  align-items: center;
}

.legend li span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot);
}

.delivery-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.delivery {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.delivery:last-child {
  border-bottom: 0;
}

.delivery time {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-right: 1px solid var(--line);
  color: #111;
  font-size: 22px;
  font-weight: 800;
}

.delivery time span {
  color: var(--red);
  font-size: 11px;
}

.delivery strong,
.delivery span,
.delivery small {
  display: block;
}

.delivery span,
.delivery small {
  color: var(--muted);
}

mark,
.status-pill {
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.primary-small {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #343842;
  background: #fbfbfd;
  font-size: 12px;
}

td {
  color: #2a2d34;
}

.actions {
  display: inline-flex;
  gap: 9px;
}

.actions button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #f6f7f9;
  color: #333;
}

.section-header {
  margin-bottom: 18px;
}

.section-header p {
  margin: 0 0 5px;
}

.full {
  min-height: 560px;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(190px, 1fr));
  gap: 14px;
  overflow: auto;
  padding-bottom: 10px;
}

.kanban-column {
  min-height: 500px;
  padding: 14px;
}

.kanban-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 800;
}

.kanban-count {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  text-align: center;
  line-height: 24px;
  font-size: 12px;
}

.job-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  background: #fff;
}

.job-card strong {
  font-size: 13px;
}

.job-card span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-grid,
.report-grid,
.settings-grid,
.role-grid,
.ai-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
}

.inventory-card,
.report-card,
.setting-card,
.role-card,
.ai-card,
.feature-card {
  display: grid;
  gap: 10px;
}

.inventory-card svg,
.report-card svg,
.setting-card svg,
.role-card svg,
.ai-card svg,
.feature-card svg {
  width: 28px;
  height: 28px;
  color: var(--red);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eff1f5;
}

.progress span {
  display: block;
  width: var(--value);
  height: 100%;
  background: var(--red);
}

.ar-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 360px;
  gap: 18px;
}

.ar-stage {
  min-height: 600px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(255, 255, 255, .86), rgba(255, 255, 255, .92)),
    repeating-linear-gradient(90deg, #edf0f6 0 1px, transparent 1px 48px),
    repeating-linear-gradient(#edf0f6 0 1px, transparent 1px 48px);
}

.scan-frame {
  position: relative;
  display: grid;
  width: min(620px, 90%);
  aspect-ratio: 1 / .78;
  place-items: center;
  border: 2px solid rgba(237, 17, 28, .28);
  border-radius: 8px;
  overflow: hidden;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 16%;
  height: 3px;
  background: var(--red);
  box-shadow: 0 0 24px rgba(237, 17, 28, .6);
  animation: scan 2.8s infinite ease-in-out;
}

.tooth-model {
  position: relative;
  width: 190px;
  height: 260px;
  transform-style: preserve-3d;
  animation: floatTooth 6s infinite ease-in-out;
}

.tooth {
  position: absolute;
  background: linear-gradient(135deg, #fff, #d9dde3 50%, #ffffff);
  border: 1px solid #cbd1d9;
  box-shadow: inset -18px -20px 30px rgba(100, 110, 130, .16), 0 28px 60px rgba(27, 34, 45, .16);
}

.crown {
  left: 20px;
  top: 10px;
  width: 150px;
  height: 150px;
  border-radius: 45% 45% 38% 38%;
}

.root {
  top: 132px;
  width: 70px;
  height: 122px;
  border-radius: 0 0 45px 45px;
}

.root.left {
  left: 36px;
  transform: rotate(8deg);
}

.root.right {
  right: 36px;
  transform: rotate(-8deg);
}

.anchor {
  position: absolute;
  border: 1px solid rgba(237, 17, 28, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  color: var(--red);
  padding: 8px 12px;
  font-weight: 800;
}

.a1 { left: 18%; top: 24%; }
.a2 { right: 18%; top: 34%; }
.a3 { right: 24%; bottom: 20%; }

.ar-side dl {
  display: grid;
  gap: 12px;
}

.ar-side dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.ar-side dt {
  color: var(--muted);
}

.ar-side dd {
  margin: 0;
  font-weight: 800;
}

.quality-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.quality-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #343842;
}

.mobile-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 22px;
  align-items: start;
}

.phone-preview {
  width: 320px;
  min-height: 620px;
  padding: 24px;
  border-radius: 34px;
  background: #15171c;
  color: #fff;
}

.phone-top {
  width: 86px;
  height: 8px;
  margin: 0 auto 34px;
  border-radius: 999px;
  background: #333844;
}

.phone-card {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #232833;
}

.phone-card span {
  color: #c2c8d4;
}

.phone-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 30px;
}

.phone-actions button {
  display: grid;
  height: 52px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
}

.sales-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(240px, 340px);
  gap: 24px;
  align-items: end;
  min-height: clamp(520px, 68vh, 760px);
  margin: -20px -24px 22px;
  padding: clamp(32px, 6vw, 76px) 24px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(11, 13, 18, .84) 0%, rgba(11, 13, 18, .62) 38%, rgba(11, 13, 18, .16) 72%),
    url("assets/landing-lab-team.png") center right / cover no-repeat;
}

.sales-copy {
  max-width: 680px;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sales-copy h2 {
  max-width: 640px;
  margin: 0 0 16px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: .98;
  letter-spacing: 0;
}

.sales-copy p {
  max-width: 570px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.sales-proof {
  justify-self: end;
  width: min(330px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.sales-proof strong {
  display: block;
  color: var(--red);
  font-size: 42px;
}

.sales-proof span,
.sales-proof small {
  display: block;
  color: #333842;
  line-height: 1.45;
}

.pricing-grid,
.onboarding-grid,
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.price-card {
  display: grid;
  gap: 12px;
}

.price-card.featured {
  border-color: rgba(237, 17, 28, .35);
  box-shadow: 0 18px 50px rgba(237, 17, 28, .12);
}

.price-card > span {
  color: var(--muted);
  font-weight: 800;
}

.price-card > strong {
  font-size: 34px;
}

.price-card p,
.onboarding-card span,
.portal-summary p,
.portal-summary span {
  color: var(--muted);
  line-height: 1.5;
}

.onboarding-card,
.portal-summary {
  display: grid;
  gap: 10px;
}

.onboarding-card svg,
.portal-summary svg {
  width: 30px;
  height: 30px;
  color: var(--red);
}

.modal {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 26px 90px rgba(0, 0, 0, .28);
}

.modal::backdrop {
  background: rgba(11, 13, 18, .46);
}

.modal form {
  padding: 22px;
}

.modal header,
.modal menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.modal header {
  margin-bottom: 18px;
}

.modal h2 {
  margin: 0;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

.modal-grid label {
  display: grid;
  gap: 7px;
  color: #2c2f36;
  font-size: 13px;
  font-weight: 800;
}

.modal-grid input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.modal menu {
  margin-top: 20px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 16px;
  border-radius: 8px;
  background: #171719;
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@keyframes scan {
  0%, 100% { transform: translateY(0); opacity: .7; }
  50% { transform: translateY(310px); opacity: 1; }
}

@keyframes floatTooth {
  0%, 100% { transform: rotateY(-12deg) rotateX(4deg) translateY(0); }
  50% { transform: rotateY(16deg) rotateX(-3deg) translateY(-12px); }
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid,
  .lower-grid,
  .ar-layout,
  .mobile-layout {
    grid-template-columns: 1fr;
  }

  .kanban {
    grid-template-columns: repeat(6, 220px);
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 15;
    left: 0;
    transform: translateX(-105%);
    transition: transform .2s ease;
    width: 280px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar,
  .topbar-actions {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    padding: 14px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search {
    width: 100%;
  }

  .metrics-grid,
  .inventory-grid,
  .report-grid,
  .settings-grid,
  .role-grid,
  .ai-grid,
  .feature-grid,
  .pricing-grid,
  .onboarding-grid,
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .sales-hero {
    grid-template-columns: 1fr;
    margin: -16px -16px 18px;
    background:
      linear-gradient(180deg, rgba(11, 13, 18, .84) 0%, rgba(11, 13, 18, .62) 55%, rgba(11, 13, 18, .2) 100%),
      url("assets/landing-lab-team.png") center / cover no-repeat;
  }

  .sales-proof {
    justify-self: start;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .view {
    padding: 16px;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .delivery {
    grid-template-columns: 52px 1fr;
  }

  .delivery mark {
    grid-column: 2;
    justify-self: start;
  }
}
