:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e7ecf3;
  --muted: #8b9cb3;
  --accent: #3d8bfd;
  --accent-dim: #2563c7;
  --success: #34d399;
  --warn: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.site-header h1 a {
  color: var(--text);
  text-decoration: none;
}

.site-header h1 a:hover {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header nav a:hover {
  color: var(--accent);
}

.container {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

h2 {
  margin-top: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.flash.ok {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--success);
  color: #a7f3d0;
}

.flash.err {
  background: rgba(248, 113, 113, 0.12);
  border-color: #f87171;
  color: #fecaca;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.member-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.member-row:last-child {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge.done {
  background: rgba(52, 211, 153, 0.2);
  color: var(--success);
}

.badge.pending {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warn);
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
  border: 1px solid #f87171;
}

form.inline {
  display: inline;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.form-group {
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.bulk-grid-head,
.bulk-grid-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1fr) 120px;
  gap: 0.75rem;
  align-items: center;
}

.bulk-grid-head {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.bulk-grid-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.bulk-grid-row:last-of-type {
  border-bottom: none;
}

.bulk-member-name {
  font-weight: 500;
}

.scale-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

label.reason-label {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

textarea.reason-text {
  min-height: 52px;
  font-size: 0.95rem;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th,
table.data td {
  padding: 0.5rem 0.6rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

table.data th {
  color: var(--muted);
  font-weight: 500;
}

table.data tr:hover td {
  background: rgba(61, 139, 253, 0.06);
}

table.data td.reasons-cell {
  max-width: 280px;
  white-space: normal;
  font-size: 0.85rem;
  line-height: 1.45;
  vertical-align: top;
}

.empty {
  color: var(--muted);
  padding: 1rem 0;
}

.model-notice-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.model-notice-list {
  margin: 0 0 1rem;
  padding-right: 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.model-notice-list li {
  margin-bottom: 0.5rem;
}

.model-notice-list li strong {
  color: var(--text);
}

.model-notice-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.model-notice--slim {
  padding: 1rem 1.15rem;
}

.model-notice-p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.55;
}

.model-notice-p strong {
  color: var(--text);
}

p.model-notice-inline {
  margin: -0.35rem 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

p.model-notice-inline a {
  color: var(--accent);
  text-decoration: none;
}

p.model-notice-inline a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .bulk-grid-head {
    display: none;
  }

  .bulk-grid-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 0.75rem 0;
  }
}
