:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e2e4e9;
  --text: #1f2430;
  --muted: #6b7280;
  --accent: #2354e6;
  --accent-hover: #1a41bd;
  --danger: #d3423e;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

header.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.topbar h1 { font-size: 17px; margin: 0; }

nav a {
  margin-left: 18px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}
nav a.active, nav a:hover { color: var(--accent); }

main {
  max-width: 960px;
  margin: 28px auto;
  padding: 0 20px 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

h2 { font-size: 16px; margin: 0 0 14px; }
h3 { font-size: 14px; margin: 0 0 10px; color: var(--muted); font-weight: 600; }

label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin: 10px 0 4px;
}

input, textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 44px; }

.row { display: flex; gap: 14px; }
.row > * { flex: 1; }

button {
  cursor: pointer;
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
}
button:hover { background: var(--accent-hover); }
button.secondary { background: #eef0f4; color: var(--text); }
button.secondary:hover { background: #e2e4ea; }
button.danger { background: var(--danger); }
button.danger:hover { background: #b83430; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.muted { color: var(--muted); font-size: 12.5px; }
.right { text-align: right; }
.actions-cell { white-space: nowrap; }
.actions-cell button { margin-left: 6px; padding: 5px 10px; font-size: 12.5px; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1f2430;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

.item-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.item-row .grow { flex: 3; }
.item-row .small { flex: 1; }
.item-row button { padding: 8px 10px; }

.total-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.total-line.grand { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }
