:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --ink: #14211f;
  --muted: #63706c;
  --line: #d8e1dd;
  --brand: #0f766e;
  --brand-strong: #0b4f49;
  --accent: #c2410c;
  --soft: #e8f3f1;
  --warn-soft: #fff3e8;
  --shadow: 0 18px 55px rgba(20, 33, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.11), rgba(194, 65, 12, 0.07)),
    var(--bg);
  color: var(--ink);
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: center;
}

.lookup-panel,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lookup-panel {
  padding: 28px;
}

.result-panel {
  min-height: 520px;
  padding: 28px;
  display: flex;
}

.brand-row,
.result-header,
.bill-top,
.payment-box {
  display: flex;
  align-items: center;
}

.brand-row {
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-weight: 800;
  font-size: 24px;
}

.eyebrow,
.label-small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.2;
}

.lookup-form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  color: var(--ink);
  background: #fbfdfc;
  outline: none;
}

input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

button {
  height: 48px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

#submit-button {
  margin-top: 12px;
  background: var(--brand);
  color: white;
}

#submit-button:hover,
#submit-button:focus {
  background: var(--brand-strong);
}

#submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-icon {
  font-size: 22px;
  line-height: 1;
}

.form-message {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-message.error {
  color: #9a3412;
}

.empty-state {
  width: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

.receipt-visual {
  width: 112px;
  height: 142px;
  margin: 0 auto 20px;
  padding: 24px 18px;
  display: grid;
  gap: 14px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--soft));
}

.receipt-visual span {
  height: 10px;
  border-radius: 99px;
  background: #9bc9c3;
}

.receipt-visual span:nth-child(2) {
  width: 72%;
  background: #e0a47f;
}

.receipt-visual span:nth-child(3) {
  width: 88%;
}

.result-state {
  width: 100%;
}

.hidden {
  display: none;
}

.result-header {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.status-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--warn-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.bill-list {
  display: grid;
  gap: 14px;
}

.bill-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfdfc;
}

.bill-top {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.amount {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
}

.period {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 700;
}

.payment-box {
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft);
}

.briva {
  margin: 3px 0 0;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.copy-button {
  width: 44px;
  min-width: 44px;
  background: var(--panel);
  color: var(--brand);
  border: 1px solid #b9d7d2;
}

.copy-button:hover,
.copy-button:focus {
  border-color: var(--brand);
}

.instructions {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 20px 0;
  }

  .result-panel {
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
  }

  .lookup-panel,
  .result-panel {
    padding: 20px;
  }

  .result-header,
  .bill-top,
  .payment-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .briva {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .copy-button {
    width: 100%;
  }
}

.admin-shell {
  width: min(980px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 36px 0;
}

.admin-header,
.admin-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-header {
  margin-bottom: 20px;
}

.admin-card {
  margin-bottom: 18px;
}

.ghost-button {
  width: auto;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.summary-grid > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
}

.preview-state h3 {
  margin: 18px 0 10px;
  font-size: 18px;
}

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

.table-mini table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.error-list {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
}

.error-list p {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: #7c2d12;
}

#commit-button {
  margin-top: 18px;
  width: 100%;
  background: var(--accent);
  color: white;
}
