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

:root {
  --ink: #232326;
  --ink-soft: #55565f;
  --paper: #f6f4ef;
  --panel: #ffffff;
  --line: #dfdccf;
  --navy: #1f2a44;
  --navy-deep: #141b2e;
  --gold: #b9873c;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 27, 46, 0.06), 0 6px 20px rgba(20, 27, 46, 0.05);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
}
h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; color: var(--navy-deep); }
.wrap { max-width: 700px; margin: 0 auto; padding: 24px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.center { text-align: center; }
label { display: block; font-size: 0.85rem; font-weight: 500; margin: 12px 0 4px; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem;
}
.btn {
  display: inline-block; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; font-weight: 500; cursor: pointer; font-size: 0.95rem;
}
.btn-primary { background: var(--navy); color: #fdfcf9; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-danger { background: transparent; border-color: #a4472f; color: #a4472f; }
.btn-row { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.notice-error { background: #f6e4de; color: #a4472f; border: 1px solid #e3bba9; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.notice-info { background: #eaf0e9; color: #3f6b4f; border: 1px solid #c3d9c4; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.app-footer { text-align: center; color: var(--ink-soft); font-size: 0.75rem; opacity: 0.7; padding: 20px; }

textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 1rem;
}
textarea { min-height: 90px; resize: vertical; }
.field-row { display: flex; gap: 16px; }
.field-row > div { flex: 1; }
.helptext { color: var(--ink-soft); font-size: 0.85rem; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
th { color: var(--ink-soft); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #fbfaf6; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-draft { background: #e9e6dc; color: #55565f; }
.badge-sent { background: #dde6f0; color: #1f2a44; }
.badge-viewed { background: #e8d4ad; color: #6a4d1c; }
.badge-accepted, .badge-contract, .badge-checkin, .badge-payment, .badge-complete { background: #dcead6; color: #3f6b4f; }
.badge-expired { background: #f2ded7; color: #a4472f; }
.badge-rejected, .badge-cancelled { background: #f6e4de; color: #a4472f; }

.topnav { display: flex; gap: 18px; margin-bottom: 20px; font-size: 0.9rem; }
.topnav a { color: var(--ink-soft); text-decoration: none; }
.topnav a:hover { color: var(--navy); text-decoration: underline; }

.history-list { list-style: none; margin: 0; padding: 0; }
.history-list li { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.history-list li:last-child { border-bottom: none; }
.history-time { flex: 0 0 auto; color: var(--ink-soft); font-size: 0.78rem; min-width: 150px; white-space: nowrap; }

.letterhead { text-align: center; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 3px solid var(--gold); }
.letterhead-logo { width: 90px; height: auto; margin-bottom: 14px; }
.term { margin-bottom: 14px; }
.term dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); margin-bottom: 2px; }
.term dd { margin: 0; }
