* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, Roboto, Arial, sans-serif;
  background: #f4f5f7;
  color: #1a1a1a;
  font-size: 17px;
}
#app { max-width: 720px; margin: 0 auto; padding: 12px; padding-bottom: 90px; }

h1, h2, h3 { margin: 0 0 8px; }
.doc-title { font-size: 19px; font-weight: 700; }
.muted { color: #6b6b6b; font-size: 14px; }

.card {
  background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

input[type=text], input[type=number], input[type=password], textarea {
  width: 100%; padding: 12px; font-size: 17px; border: 1px solid #ccc;
  border-radius: 8px; margin-bottom: 8px; background: #fff;
}

button {
  font-size: 17px; padding: 14px 16px; border: none; border-radius: 8px;
  background: #1565c0; color: #fff; cursor: pointer; width: 100%;
  margin-bottom: 8px;
}
button.secondary { background: #616161; }
button.danger { background: #c62828; }
button.small { width: auto; padding: 8px 14px; font-size: 15px; }
button:disabled { background: #bdbdbd; }

.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.row > button.fixed { flex: none; }

.line-item {
  background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08); cursor: pointer;
}
.line-item.status-closed { border-left: 5px solid #2e7d32; }
.line-item.status-closed.short { border-left: 5px solid #ef6c00; }
.line-item.status-in_progress { border-left: 5px solid #1565c0; }
.line-item.status-pending { border-left: 5px solid #bdbdbd; }
.line-product { font-weight: 600; margin-bottom: 4px; }
.line-meta { font-size: 14px; color: #555; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; margin-left: 6px;
}
.badge.ok { background: #e8f5e9; color: #2e7d32; }
.badge.warn { background: #fff3e0; color: #ef6c00; }
.badge.info { background: #e3f2fd; color: #1565c0; }

.cell-block { margin: 10px 0; }
.cell-label { font-size: 13px; color: #6b6b6b; text-transform: uppercase; letter-spacing: 0.03em; }
.cell-main-value { font-size: 34px; font-weight: 700; line-height: 1.15; color: #1a1a1a; }
.cell-extra-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 19px; font-weight: 600; }
.cell-extra-row button { width: auto; }

.comment-box {
  background: #fff9c4; padding: 10px; border-radius: 8px; margin: 8px 0;
  font-size: 15px;
}

.sync-bar {
  position: fixed; bottom: 0; left: 0; right: 0; background: #263238; color: #fff;
  padding: 8px 12px; font-size: 13px; text-align: center; z-index: 20;
}
.sync-bar.ok { background: #2e7d32; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.topbar button { width: auto; }

.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex;
  align-items: flex-end; justify-content: center; z-index: 30;
}
.sheet {
  background: #fff; width: 100%; max-width: 720px; border-radius: 16px 16px 0 0;
  padding: 18px; max-height: 85vh; overflow-y: auto;
}

.match-article { font-size: 16px; color: #1565c0; }

.error-text { color: #c62828; font-size: 14px; margin-top: 4px; }
.scan-focus-hint { font-size: 13px; color: #888; text-align: center; margin: 6px 0; }
