:root {
  color-scheme: light only;
  font-family: "Open Sans", "Segoe UI", sans-serif;
  --bg: #f6f8fc;
  --surface: rgba(255, 255, 255, 0.96);
  --panel: #ffffff;
  --panel-soft: #f5f7fb;
  --line: rgba(11, 21, 75, 0.08);
  --text: #111827;
  --muted: #5b6475;
  --accent: #0b154b;
  --accent-2: #0fa4e5;
  --button-text: #ffffff;
  --shadow: 0 12px 28px rgba(11, 21, 75, 0.08);
  --radius-xl: 22px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light only;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(15, 164, 229, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(15, 164, 229, 0.04) 0%, transparent 24%),
    var(--bg);
  background-attachment: fixed;
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.95rem 1rem 2rem;
  display: grid;
  gap: 0.8rem;
}

.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.shell-brand,
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-logo__text {
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.shell-main,
.page {
  display: grid;
  gap: 0.7rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.95rem;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  padding-inline: 0.15rem;
  border-bottom: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

.card,
.hero-panel {
  border: 1px solid rgba(11, 21, 75, 0.08);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.quote-section {
  overflow: visible !important;
}

.hero-panel {
  padding: 1.05rem 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.hero-panel--compact {
  padding: 0.85rem 0.95rem;
}

.hero-panel h1,
.card h2 {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-panel h1 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.hero-panel__title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.hero-panel__title-row h1 {
  flex: 1 1 auto;
  min-width: 0;
}

.workflow-steps {
  margin: 0.15rem 0 0;
  padding: 0.65rem 0.85rem 0.65rem 2rem;
  border-radius: calc(var(--radius-lg) - 2px);
  background: rgba(15, 164, 229, 0.07);
  border: 1px solid rgba(15, 164, 229, 0.14);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
  display: grid;
  gap: 0.25rem;
}

.workflow-steps li {
  padding-left: 0.15rem;
}

.workflow-steps li::marker {
  color: var(--accent-2);
  font-weight: 800;
}

.help-info-trigger {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.help-info-trigger--inline {
  vertical-align: middle;
  margin-left: 0.35rem;
}

.help-info-icon {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(11, 21, 75, 0.08);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  font-style: italic;
  cursor: help;
  border: 1px solid rgba(11, 21, 75, 0.12);
  user-select: none;
}

.help-info-icon--small {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.62rem;
  font-style: normal;
}

.help-info-tooltip {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: 0.85rem 0.95rem;
  background: var(--text);
  color: var(--surface);
  border-radius: 11px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 160ms ease;
  min-width: 220px;
  max-width: min(360px, 90vw);
  white-space: normal;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.help-info-tooltip--below {
  top: calc(100% + 10px);
  transform: translateX(-50%);
}

.help-info-tooltip__body {
  display: grid;
  gap: 0.4rem;
}

.help-info-tooltip__heading {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.help-info-tooltip__list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.45;
}

.help-info-tooltip__message {
  font-size: 0.8rem;
  line-height: 1.45;
}

.help-info-trigger:hover .help-info-tooltip,
.help-info-trigger:focus-visible .help-info-tooltip,
.help-info-tooltip:hover {
  opacity: 1;
  pointer-events: auto;
}

.card-header__title {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.muted,
.hero-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.home-page--compact {
  max-width: 620px;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quote-page {
  gap: 0.7rem;
}

.browser-warning {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(254, 226, 226, 0.85);
  color: #991b1b;
  font-size: 0.85rem;
  line-height: 1.45;
}

.card {
  padding: 0.9rem 0.95rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.primary-button,
.secondary-button {
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  background: linear-gradient(135deg, var(--accent), #122a78);
  color: var(--button-text);
  box-shadow: 0 10px 20px rgba(11, 21, 75, 0.14);
}

.secondary-button {
  background: rgba(11, 21, 75, 0.06);
  color: var(--accent);
  padding: 0.48rem 0.8rem;
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upload-zone {
  display: grid;
  gap: 0.45rem;
  border: 1px dashed rgba(15, 164, 229, 0.28);
  border-radius: var(--radius-lg);
  background: rgba(15, 164, 229, 0.05);
}

.upload-zone--single {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.upload-zone__surface {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  min-height: 220px;
}

.upload-zone--single .upload-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-zone__summary {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.5rem;
}

.upload-zone__tiles {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.upload-zone__empty {
  min-height: 110px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(15, 164, 229, 0.18);
  border-radius: calc(var(--radius-lg) - 4px);
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.upload-tile {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) - 4px);
  background: rgba(255, 255, 255, 0.35);
  width: 140px;
  max-width: 100%;
}

.upload-tile__preview,
.upload-tile__preview-image {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(11, 21, 75, 0.04), rgba(11, 21, 75, 0.08));
}

.upload-tile__preview-wrap {
  position: relative;
}

.upload-tile__pdf-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: #c62828;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.quote-pending-meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.ra-input {
  width: 72px;
}

.upload-tile__preview {
  min-height: 60px;
  display: grid;
  place-items: center;
  color: #3d4c78;
  font-size: 0.75rem;
  font-weight: 700;
}

.upload-tile__name {
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-tile__meta,
.upload-zone__button {
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.4;
}

.upload-zone__button {
  font-weight: 800;
  color: var(--accent);
}

.table-wrapper {
  overflow-x: auto;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ddd;
  font-size: 0.85rem;
}

.quote-table th,
.quote-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.quote-table thead {
  background-color: #f5f5f5;
}

.qty-input,
.meta-input {
  width: 100%;
  max-width: 72px;
  padding: 4px 6px;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
}

.meta-input {
  max-width: 88px;
}

.material-select {
  max-width: 140px;
  min-width: 120px;
  color: #111827;
  background-color: #ffffff;
  border: 1px solid #c8ced8;
}

.material-select:disabled {
  color: #5b6475;
  background-color: #f5f7fb;
  opacity: 1;
}

.material-select option {
  color: #111827;
  background-color: #ffffff;
}

.price-cell {
  white-space: nowrap;
}

.price-display-table {
  font-weight: 800;
  color: var(--accent);
}

.secondary-button {
  cursor: pointer;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.48rem 0.8rem;
  font-weight: 700;
}

.card:has(.price-tooltip-table) {
  overflow: visible;
}

.quote-section {
  overflow: visible !important;
}

.quote-section *,
.quote-section tbody,
.quote-section tr,
.quote-section td {
  overflow: visible !important;
}

.quote-manual-label {
  color: #e65100;
  font-weight: 600;
  font-size: 0.9rem;
}

.quote-table th,
.quote-table td {
  border: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

.quote-table thead {
  background-color: var(--panel-soft);
}

.qty-input,
.meta-input {
  width: 72px;
  padding: 4px 6px;
  border: 1px solid #c8ced8;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
}

.price-cell {
  position: relative;
}

.price-breakdown {
  display: grid;
  gap: 0.6rem;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.breakdown-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.breakdown-value {
  font-weight: 700;
  color: rgba(15, 164, 229, 0.85);
  text-align: right;
  min-width: 90px;
}

.breakdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0.3rem 0;
}

.breakdown-total .breakdown-label {
  color: rgba(255, 255, 255, 0.95);
}

.breakdown-total .breakdown-value {
  color: #4ade80;
  font-weight: 700;
}

.table-wrapper {
  overflow-x: auto;
  overflow-clip-margin: 64px;
}

.table-wrapper table {
  border-collapse: collapse;
  width: 100%;
  position: relative;
}

.price-display-table {
  cursor: help;
  border-bottom: 2px dotted rgba(15, 164, 229, 0.5);
  display: inline-block;
  position: relative;
}

.price-tooltip-table {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: 0.9rem;
  background: var(--text);
  color: var(--surface);
  border-radius: 11px;
  box-shadow: 0 16px 40px rgba(11, 21, 75, 0.24);
  z-index: 99999;
  opacity: 0;
  transition: opacity 160ms ease;
  font-size: 0.85rem;
  min-width: 220px;
  white-space: nowrap;
  pointer-events: none;
}

.price-display-table:hover + .price-tooltip-table,
.price-tooltip-table:hover {
  opacity: 1;
  pointer-events: auto;
}

.status-error-trigger {
  position: relative;
  display: inline-block;
}

.status-error-label {
  cursor: help;
  color: #c62828;
  font-weight: 600;
  border-bottom: 2px dotted rgba(198, 40, 40, 0.55);
  display: inline-block;
}

.status-error-tooltip {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  padding: 0.9rem;
  background: var(--text);
  color: var(--surface);
  border-radius: 11px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 160ms ease;
  min-width: 200px;
  max-width: 320px;
  white-space: normal;
  pointer-events: none;
}

.status-error-tooltip__body {
  display: grid;
  gap: 0.35rem;
}

.status-error-tooltip__heading {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-error-label:hover + .status-error-tooltip,
.status-error-tooltip:hover {
  opacity: 1;
  pointer-events: auto;
}

.auth-page {
  width: min(100%, 520px);
  margin-inline: auto;
  gap: 0.8rem;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(11, 21, 75, 0.08);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.alert-warning {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: rgba(254, 243, 199, 0.55);
  color: #7c2d12;
}

.browser-warning {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.language-switcher__select {
  width: auto;
  min-width: 50px;
  border: 0;
  background: transparent;
}

.shell-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.shell-logout-form {
  margin: 0;
}

.nav-link--button {
  cursor: pointer;
  background: transparent;
  border: 0;
}

#blazor-error-ui {
  color-scheme: light only;
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.blazor-error-boundary {
  background: #b32121;
  padding: 1rem;
  color: white;
}

.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: #e0e0e0;
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: #1b6ec2;
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: bold;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Loading");
}
