@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --brand-500: #c20016;
  --brand-600: #a80013;
  --brand-soft: rgba(194, 0, 22, 0.08);
  --accent-500: #c20016;
  --accent-600: #a80013;
  --text-muted: #79786e;
  --harvia-bg: #f8f8f5;
  --harvia-header: #eae8e0;
  --harvia-text: #505045;
  --harvia-border: #d4d0c8;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--harvia-bg);
  color: var(--harvia-text);
}

::selection {
  background: rgba(194, 0, 22, 0.25);
  color: #fff;
}

.card {
  background: #ffffff;
  border-radius: 2px;
  border: 1px solid var(--harvia-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.card-soft {
  background: var(--harvia-bg);
  border: 1px solid var(--harvia-border);
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 2px;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.25rem;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.btn-sm {
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
}

.btn:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
}

.btn-primary {
  background: #c20016;
  color: #fff;
  box-shadow: none;
  border: none;
}

.btn-primary:hover {
  background: #a80013;
}

.btn-success {
  background: #c20016;
  color: #fff;
  box-shadow: none;
}

.btn-success:hover {
  background: #a80013;
}

.btn-outline {
  background: #fff;
  color: var(--harvia-text);
  border-color: var(--harvia-border);
}

.btn-outline:hover {
  border-color: #a8a49c;
  background: var(--harvia-header);
}

.btn-lg {
  font-size: 1rem;
  padding: 0.8rem 1.75rem;
}

.alert {
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.3rem;
}

.alert-warning {
  background: #fdf8ee;
  border-color: #e6c96a;
  color: #6b4c00;
}

.alert-info {
  background: #edf3fb;
  border-color: #9db8d9;
  color: #1d3a5e;
}

.alert-success {
  background: #edf7f1;
  border-color: #8ecba5;
  color: #1a5733;
}

.alert-error,
.alert-danger {
  background: #fdf0f1;
  border-color: #e8a0a8;
  color: #7a000f;
}

.upload-area {
  border: 1px solid var(--harvia-border);
  border-radius: 2px;
  padding: 2.75rem;
  text-align: center;
  transition: 0.2s ease;
  background: #fdfdfa;
  box-shadow: none;
}

.upload-area.dragover {
  background: #fdf0f1;
  border-color: #c20016;
  box-shadow: 0 0 0 2px rgba(194, 0, 22, 0.15);
}

.upload-area.processing {
  border-color: transparent;
  background: #fdfdfa;
  pointer-events: none;
}

.upload-status {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(248, 248, 245, 0.97);
  color: var(--harvia-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.upload-status.visible {
  opacity: 1;
}

.upload-status .spinner {
  width: 5rem;
  height: 5rem;
  border: 5px solid rgba(194, 0, 22, 0.15);
  border-top-color: #c20016;
  border-radius: 999px;
  animation: spin 1.5s linear infinite;
  margin-bottom: 2rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(194, 0, 22, 0.2); }
  50%  { box-shadow: 0 0 24px 8px rgba(194, 0, 22, 0.1); }
  100% { box-shadow: 0 0 0 0 rgba(194, 0, 22, 0.2); }
}

.autoprocess-hint {
  transition: opacity 0.2s ease;
}

.autoprocess-hint.hidden {
  opacity: 0;
  visibility: hidden;
}

.text-muted-foreground {
  color: var(--text-muted);
}

.input-hidden {
  display: none;
}

.feature-card {
  border: 1px solid var(--harvia-border);
  background: #ffffff;
  box-shadow: none;
}

.status-chip {
  padding: 0.2rem 0.75rem;
  border-radius: 2px;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(194, 0, 22, 0.08);
  color: #c20016;
  font-weight: 600;
}

.status-bar {
  padding: 0.65rem 1rem;
  border-radius: 2px;
  background: rgba(80, 80, 69, 0.06);
  border: 1px solid rgba(80, 80, 69, 0.2);
  color: var(--harvia-text);
  font-size: 0.75rem;
}

.logo-hero {
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.12));
}

.brand-wordmark {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--harvia-text);
}

.brand-kicker {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.harvia-header-logo {
  width: 2.75rem;
  height: auto;
}

.aimo-header-logo {
  width: clamp(8rem, 12vw, 10rem);
  max-width: calc(100vw - 3rem);
  max-height: 4.75rem;
  height: auto;
  object-fit: contain;
}

.aimo-header-logo-upload {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
}

.harvia-header-logo-upload {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
}

.editable-field {
  border: 1px solid var(--harvia-border);
  background: var(--harvia-bg);
  border-radius: 2px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.35rem;
  min-height: 2.5rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.editable-field:hover {
  background: var(--harvia-header);
}

.editable-field:focus,
.editable-field[contenteditable="true"] {
  outline: 2px solid rgba(194, 0, 22, 0.45);
  border-color: #c20016;
  background: #fff;
}

.confidence-high {
  color: #1a7a3e;
}

.confidence-medium {
  color: #b05c00;
}

.confidence-low {
  color: #c20016;
}

.pdf-shell {
  height: 100%;
}

.table thead th {
  text-align: left;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--harvia-header);
  padding: 0.65rem 0.9rem;
}

.table tbody td {
  padding: 0.75rem 0.75rem;
  border-bottom: 1px solid var(--harvia-border);
}

tbody tr:nth-child(even) {
  background: var(--harvia-bg);
}

.table-wrapper {
  border-radius: 0;
  overflow: hidden;
  margin: 0 -1.25rem;
}

.unit-search-results[data-overlay-open="1"] {
  position: fixed;
  z-index: 60;
}

.input {
  border: 1px solid var(--harvia-border);
  border-radius: 2px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4rem;
  background: #fff;
}

.input:focus {
  outline: 2px solid rgba(194, 0, 22, 0.45);
  border-color: #c20016;
}

.sticky-panel {
  border-radius: 2px;
  border: 1px solid var(--harvia-border);
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.08);
}
