/* ==========================================================================
   Dear Result — shared styles
   Palette: ink navy / brass gold / bulletin ivory / vermilion (win highlight)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Spectral:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #16223a;
  --ink-soft: #2c3b57;
  --brass: #b8893f;
  --brass-bright: #d4a45c;
  --paper: #f6f1e6;
  --paper-line: #e2d8c2;
  --card: #fffdf8;
  --vermilion: #a6362b;
  --ink-text: #2a2f3a;
  --muted: #6b7180;
  --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink-text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 32px;
  background-attachment: local;
  min-height: 100vh;
}

.masthead {
  border-bottom: 3px double var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 22px 24px 18px;
}

.masthead .wrap {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.masthead h1 {
  font-family: 'Spectral', serif;
  font-weight: 600;
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: 0.2px;
}

.masthead .tag {
  font-size: 0.82rem;
  color: var(--brass-bright);
  font-weight: 500;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.card {
  background: var(--card);
  border: 1px solid var(--paper-line);
  border-left: 4px solid var(--brass);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 0 rgba(22, 34, 58, 0.03);
}

.card h2 {
  font-family: 'Spectral', serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}

.card .sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  padding: 10px 12px;
  border: 1px solid #cbbfa1;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink-text);
}

textarea { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }

input:focus, textarea:focus, button:focus {
  outline: 2px solid var(--brass-bright);
  outline-offset: 1px;
}

.field { margin-bottom: 16px; }
.row { display: flex; gap: 14px; }
.row > .field { flex: 1; }

button {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper);
}
button:hover { background: var(--ink-soft); }
button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
button.secondary:hover { background: rgba(22,34,58,0.05); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.status {
  margin-top: 14px;
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: var(--radius);
  display: none;
}
.status.show { display: block; }
.status.ok { background: #eef4ea; color: #33552e; border: 1px solid #cadfc0; }
.status.err { background: #f7e9e7; color: var(--vermilion); border: 1px solid #e5c2bc; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--paper-line);
}
th {
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: none;
  border-bottom: 2px solid var(--ink);
}
td.num, th.num { font-family: 'IBM Plex Mono', monospace; }
td.prize { color: var(--vermilion); font-weight: 600; font-family: 'IBM Plex Mono', monospace; }

.editable-cell {
  font-family: 'IBM Plex Mono', monospace;
  border: 1px solid transparent;
  padding: 3px 5px;
  border-radius: 2px;
}
.editable-cell:focus { border-color: var(--brass); outline: none; background: #fffaf0; }

.result-ticket {
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  position: relative;
}
.result-ticket::before {
  content: "";
  position: absolute;
  left: -6px; top: 50%;
  width: 11px; height: 11px;
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: 50%;
  transform: translateY(-50%);
}
.result-ticket .date {
  font-family: 'Spectral', serif;
  font-size: 1.05rem;
  color: var(--ink);
}
.result-ticket .prize {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--vermilion);
  font-size: 1.05rem;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 28px 10px;
  font-size: 0.92rem;
}

.remove-link {
  color: var(--vermilion);
  font-size: 0.82rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 6px;
}

tr.flagged-row { background: #fbeeea; }
.flag-note {
  color: var(--vermilion);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

footer.note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 0;
  position: relative;
  top: 2px;
}
.tab-btn.active {
  color: var(--ink);
  border-bottom: 2px solid var(--brass);
}
.tab-btn:hover:not(.active) { color: var(--ink-soft); }
