:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #1B2A4A;
  --accent-hover: #15213a;
  --gold: #C9A84C;
  --gold-hover: #b8963f;
  --danger: #c0392b;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 24px;
  margin: 0 0 16px;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.navbar {
  background: var(--accent);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-meta {
  color: var(--gold);
  font-size: 13px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 320px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin: 12px 0 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="time"],
input[type="file"],
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.editor-toolbar button {
  padding: 4px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.editor-toolbar button:hover {
  background: var(--bg);
}

.editor-emoji-wrap {
  position: relative;
  display: inline-block;
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-picker {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 6px;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.emoji-picker button {
  padding: 4px;
  font-size: 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.emoji-picker button:hover {
  background: var(--bg);
}

.editor-surface {
  min-height: 200px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  margin-top: 4px;
  overflow-y: auto;
}

.editor-surface:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}

button:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

button.secondary:hover {
  background: var(--bg);
}

button.gold {
  background: var(--gold);
  color: var(--accent);
}

button.gold:hover {
  background: var(--gold-hover);
}

form.inline {
  display: inline;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
}

.info {
  color: var(--accent);
  font-size: 13px;
  margin: 8px 0 0;
}

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

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

.field-group {
  margin-bottom: 4px;
}

.form-section {
  margin-bottom: 16px;
}

.form-section h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.meta {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 16px;
}

.stat-total {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.pill {
  display: inline-block;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  margin-right: 4px;
  white-space: nowrap;
}

.pill-sent {
  background: #eef2ff;
  color: var(--accent);
}

.pill-opened {
  background: #ecfdf5;
  color: #15803d;
}

.pill-bounced {
  background: #fef2f2;
  color: #b91c1c;
}

.pill-pending {
  background: #f3f4f6;
  color: var(--text-muted);
}
