:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #5a6572;
  --brand: #1e3a5f;
  --brand-2: #2f7d6b;
  --danger: #b81e1e;
  --danger-bg: #fdeaea;
  --line: #e2e7ee;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.disclaimer-banner {
  background: var(--danger-bg);
  color: var(--danger);
  border-bottom: 2px solid var(--danger);
  font-weight: 700;
  padding: 10px 16px;
  text-align: center;
  font-size: 0.95rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

header.app-header {
  padding: 20px 16px 6px;
  text-align: center;
}
header.app-header h1 { margin: 0; color: var(--brand); font-size: 1.5rem; }
header.app-header p.sub { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

.container { max-width: 860px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(20, 30, 50, 0.05);
}

.card h2 { margin-top: 0; color: var(--brand); font-size: 1.2rem; }

.hidden { display: none !important; }

/* consent */
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; }
.consent-row input { margin-top: 6px; width: 18px; height: 18px; }
.consent-row label { font-weight: 600; }

button, .btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .05s;
}
button:hover { opacity: .92; }
button:active { transform: translateY(1px); }
button:disabled { background: #9aa6b4; cursor: not-allowed; }
button.secondary { background: var(--brand-2); }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }

.ai-note {
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  color: #234;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .9rem;
  margin-bottom: 12px;
}

/* nav tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tabs button { background: #fff; color: var(--brand); border: 1px solid var(--line); }
.tabs button.active { background: var(--brand); color: #fff; }

/* chat */
.chat-log {
  min-height: 220px;
  max-height: 46vh;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg { padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; max-width: 88%; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #eef1f6; color: var(--ink); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; margin-top: 12px; }
.chat-input input { flex: 1; }

input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

.result {
  margin-top: 14px;
  background: #f0f7f4;
  border: 1px solid #cbe6db;
  border-radius: 10px;
  padding: 14px;
}
.result .big { font-size: 1.3rem; font-weight: 700; color: var(--brand-2); }
.result .formula { font-family: ui-monospace, monospace; font-size: .85rem; color: var(--muted); margin-top: 8px; }
.result .est-note { color: var(--danger); font-weight: 700; margin-top: 8px; }

ul.clean { margin: 6px 0; padding-left: 20px; }

.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; }
.status-pending { background: #fff3d6; color: #8a6100; }
.status-approved { background: #dff3e6; color: #1c7a3f; }
.status-rejected { background: #fde3e3; color: #a51e1e; }

footer.app-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; }
footer.app-footer a { color: var(--brand); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 8px; border-bottom: 1px solid var(--line); font-size: .92rem; }
th:first-child, td:first-child { text-align: left; }
