:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #16202a;
  --muted: #647181;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-strong: #0b5e59;
  --bad: #b42318;
  --warn: #b45309;
  --review: #4f46e5;
  --ok: #15803d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef2f7;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
}

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

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  margin-bottom: 16px;
}

.login-form button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.login-form button {
  width: 100%;
}

.login-form button:hover,
.secondary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: #273445;
}

.secondary-button.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.notice,
.error {
  margin: 0 0 16px;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.notice {
  background: #ecfdf5;
  color: #065f46;
}

.error {
  background: #fef2f2;
  color: var(--bad);
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.workspace {
  height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 38vw);
  overflow: hidden;
}

.invoice-scroll {
  overflow: auto;
  padding: 20px 24px 48px;
}

.invoice-page {
  position: relative;
  width: min(100%, 960px);
  margin: 0 auto 18px;
  background: #fff;
  border: 1px solid #d7dde5;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.invoice-page img {
  display: block;
  width: 100%;
  height: auto;
}

.hotspot {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 3px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.active {
  outline: none;
  background: rgba(15, 118, 110, 0.08);
  border-color: var(--accent);
}

.hotspot.bad:hover,
.hotspot.bad:focus-visible,
.hotspot.bad.active {
  background: rgba(180, 35, 24, 0.08);
  border-color: var(--bad);
}

.hotspot.warn:hover,
.hotspot.warn:focus-visible,
.hotspot.warn.active {
  background: rgba(180, 83, 9, 0.08);
  border-color: var(--warn);
}

.hotspot.review:hover,
.hotspot.review:focus-visible,
.hotspot.review.active {
  background: rgba(79, 70, 229, 0.08);
  border-color: var(--review);
}

.preview-panel {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.preview-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.preview-header h2 {
  margin: 0;
  font-size: 16px;
}

.details {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 12px;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

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

.details dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok {
  background: var(--ok);
}

.status-pill.bad {
  background: var(--bad);
}

.status-pill.warn {
  background: var(--warn);
}

.status-pill.review {
  background: var(--review);
}

#documentFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef2f7;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(60vh, 1fr) minmax(420px, 45vh);
  }

  .preview-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
