:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #697586;
  --line: #d9dee7;
  --accent: #7c3aed;
  --accent-dark: #6d28d9;
  --soft: #f5f3ff;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 34px;
  padding: 0 12px;
}

button:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12px; }

.sso-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.sso-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #ddd; }
.sso-name { font-weight: 600; font-size: 14px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}

.eyebrow { margin: 0 0 2px; color: var(--accent-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; font-weight: 700; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions button:last-of-type:not(:first-of-type) { background: var(--accent); border-color: var(--accent); color: #fff; }

.workspace { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.status-bar { color: var(--muted); font-size: 13px; }

.expense-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid { display: grid; gap: 10px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 36px;
  padding: 6px 10px;
  text-transform: none;
  font-size: 14px;
}

textarea { resize: vertical; }

.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#saveExpenseButton { background: var(--accent); border-color: var(--accent); color: #fff; }
#expenseFormStatus { font-size: 12px; color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--soft); }

.status-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; }

#emptyState { text-align: center; color: var(--muted); padding: 32px 16px; }

[hidden] { display: none; }

@media (max-width: 860px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; align-items: stretch; }
  table { font-size: 12px; }
  thead th, tbody td { padding: 8px; }
}
