:root {
  --color-primary: #1E2A3A;
  --color-accent: #C8A04D;
  --color-bg: #F6F4EE;
  --color-surface: #FFFFFF;
  --color-text: #1B1B1B;
  --color-muted: #6B6B6B;
  --color-border: #E2DED3;
  --color-success: #2F7D5A;
  --color-warn: #C8A04D;
  --color-danger: #B23A48;

  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 30, 0.06);
  --shadow-md: 0 6px 24px rgba(20, 24, 30, 0.08);
}

* { box-sizing: border-box; }

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

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  background: var(--color-primary);
  color: #fff;
  border-bottom: 3px solid var(--color-accent);
}
.topbar a, .topbar .nav-user, .topbar .link-button { color: #fff; }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark {
  background: var(--color-accent);
  color: #1B1B1B;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.brand-name { font-size: 17px; }

.nav { display: flex; align-items: center; gap: 16px; }
.nav-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.3); }
.nav-user { color: rgba(255,255,255,0.85); font-size: 14px; }
.logout-form { display: inline; }
.link-button {
  background: none; border: none; padding: 0;
  font: inherit; cursor: pointer; color: inherit;
  text-decoration: underline;
}

main.container { padding-top: 32px; padding-bottom: 56px; min-height: 60vh; }

h1 { font-size: 28px; margin: 0 0 16px; }
h2 { font-size: 20px; margin: 24px 0 12px; }

.muted { color: var(--color-muted); font-size: 14px; }

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

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
}
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); }
.btn-sm { padding: 4px 10px; font-size: 13px; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="file"],
select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
}
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: 500; margin-bottom: 4px; }
.form-row .helptext { color: var(--color-muted); font-size: 13px; }
.errorlist { color: var(--color-danger); list-style: none; padding: 0; margin: 4px 0 0; font-size: 13px; }

.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.msg { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 6px; }
.msg-success { background: #E5F1EA; color: #1F5A3F; }
.msg-info { background: #E5EBF3; color: #1E2A3A; }
.msg-warning { background: #FBEFD3; color: #6E5106; }
.msg-error { background: #F4DDDF; color: #7A1F2A; }

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
table.data thead th {
  background: #F1ECDF;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
table.data tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: #DCEFE2; color: #1F5A3F; }
.badge-yellow { background: #FBEFD3; color: #6E5106; }
.badge-orange { background: #FBE0C5; color: #8A4A12; }
.badge-red { background: #F4DDDF; color: #7A1F2A; }
.badge-expired { background: #1B1B1B; color: #fff; }
.badge-muted { background: #ECE9DF; color: #6B6B6B; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.toolbar .form-row { margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 0;
  background: #fff;
}

body.client .topbar-client { background: #1E2A3A; }
body.client .brand-mark-client { background: var(--color-accent); }

.empty {
  text-align: center;
  padding: 32px;
  color: var(--color-muted);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Dev-only "log in as" bar. Rendered only when DEBUG=True (see base.html). */
.dev-switcher {
  background: repeating-linear-gradient(
    -45deg, #2A2118 0 12px, #1F1810 12px 24px
  );
  color: #F6F4EE;
  border-bottom: 1px solid #000;
  font-size: 13px;
}
.dev-switcher-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 24px;
  flex-wrap: wrap;
}
.dev-tag {
  background: var(--color-accent);
  color: #1B1B1B;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 11px;
}
.dev-switcher-form { display: flex; align-items: center; gap: 6px; flex: 1; }
.dev-label { color: #F6F4EE; }
.dev-switcher select {
  background: #1B1B1B;
  color: #F6F4EE;
  border: 1px solid #4A3F32;
  padding: 3px 8px;
  font-size: 13px;
  width: auto;
  min-width: 240px;
}
.dev-go {
  background: var(--color-accent);
  color: #1B1B1B;
  border: 0;
  padding: 3px 10px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: 600;
}
.dev-current { color: rgba(246, 244, 238, 0.7); margin-left: auto; }
