:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: #fbfbfd;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --sidebar: rgba(255, 255, 255, 0.88);
  --sidebar-muted: #8e8e93;
  --blue: #007aff;
  --blue-dark: #0066d6;
  --green: #248a3d;
  --amber: #b86e00;
  --red: #d70015;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.app-shell[hidden],
.modal-root[hidden] {
  display: none !important;
  pointer-events: none !important;
}

html,
body {
  min-height: 100%;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button.is-loading {
  position: relative;
  pointer-events: none;
}

button.is-loading::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 78% 12%, rgba(0, 122, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 54%, #f2f2f7 100%);
}

.login-panel {
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  overflow: hidden;
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  background: #1d1d1f;
  font-size: 13px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.login-panel h1 {
  margin: 18px 0 6px;
  font-size: 24px;
  line-height: 1.2;
}

.login-panel p {
  margin: 0 0 26px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.wide {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: var(--sidebar);
  color: var(--text);
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
  line-height: 1.2;
}

.sidebar-brand span {
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav-group {
  display: grid;
  gap: 4px;
  padding: 14px 10px;
}

.nav-title {
  margin: 14px 10px 6px;
  color: var(--muted);
  font-size: 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 6px;
  color: #3a3a3c;
  text-decoration: none;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.nav-link.active {
  background: #1d1d1f;
  color: #fff;
}

.workspace {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-rows: 64px 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  min-width: 160px;
  display: grid;
  gap: 3px;
}

.topbar-title strong {
  font-size: 17px;
}

.topbar-title span {
  color: var(--muted);
  font-size: 12px;
}

.club-switch {
  width: min(280px, 30vw);
  margin-left: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 500;
}

.club-switch select {
  min-width: 0;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view {
  min-width: 0;
  padding: 22px 24px 32px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h2 {
  margin: 0 0 7px;
  font-size: 22px;
  line-height: 1.25;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  min-height: 116px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.stat-card span {
  display: block;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 14px;
  font-size: 32px;
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 12px;
  color: #64748b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.panel-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-body {
  padding: 16px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.filter-form {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.filter-form label {
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.filter-form .button-row {
  display: flex;
  gap: 8px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: #f8fafc;
}

.status-strip span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  font-size: 12px;
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(160px, 1fr) minmax(260px, 2fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.switch-row {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.settings-grid label:not(.switch-row) {
  color: #f8fafc;
}

.switch-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-control {
  position: relative;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(31, 41, 55, 0.92), rgba(15, 23, 42, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.switch-control::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.32);
  transition: transform 0.18s ease, background 0.18s ease;
}

.switch-input:checked + .switch-control {
  border-color: rgba(94, 234, 212, 0.5);
  background: linear-gradient(135deg, #22d3ee, #86efac);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12), 0 12px 26px rgba(20, 184, 166, 0.25);
}

.switch-input:checked + .switch-control::before {
  transform: translateX(24px);
  background: linear-gradient(180deg, #ffffff, #ecfeff);
}

.switch-input:focus-visible + .switch-control {
  outline: 2px solid rgba(125, 211, 252, 0.9);
  outline-offset: 3px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

th,
td {
  height: 48px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: #fbfbfd;
  color: #6e6e73;
  font-weight: 700;
}

tbody tr:hover {
  background: #fbfbfd;
}

.table-footer {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  color: var(--muted);
}

.pagination {
  display: flex;
  gap: 6px;
}

.log-pagination {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-current {
  min-width: 116px;
  color: var(--text);
  font-weight: 700;
  text-align: center;
}

.page-jump-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.page-jump-form input {
  width: 74px;
  min-height: 34px;
  text-align: center;
}

.page-jump-form button {
  min-height: 34px;
  padding: 0 12px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 50%;
  background: rgba(0, 122, 255, 0.1);
  color: var(--blue);
  font-weight: 800;
  vertical-align: middle;
}

.avatar.image-avatar {
  display: inline-block;
  object-fit: cover;
  background: rgba(10, 20, 36, 0.08);
}

.room-image-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.room-image-field input[type="file"] {
  padding: 9px 10px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.room-image-preview {
  display: block;
  width: 100%;
  max-height: 190px;
  margin-top: 10px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.room-image-preview.empty {
  display: none;
}

.room-point-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.room-point-field {
  min-width: 0;
}

.point-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.point-upload-row input[type="file"] {
  min-width: 0;
}

.point-upload-status {
  color: #f5f5f7;
}

.point-map-editor {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #08090c;
  cursor: crosshair;
}

.point-map-editor.empty {
  cursor: default;
}

.point-map-editor.upload-pending {
  border-color: rgba(255, 149, 0, 0.5);
  cursor: default;
}

.point-map-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.point-map-editor > :not(.point-marker-layer) {
  pointer-events: none;
}

.point-map-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #0b0d12;
  background-size: 24px 24px;
}

.point-marker-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.point-editor-marker {
  position: absolute;
  left: var(--point-x, 0%);
  top: var(--point-y, 0%);
  transform: translate(-50%, -50%);
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff343b, #b80f18);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(255, 52, 59, 0.3), 0 0 0 4px rgba(255, 52, 59, 0.18);
  pointer-events: auto;
}

.point-marker-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.point-marker-count {
  margin-right: auto;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.task-item-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.task-item-chip img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.task-preview-block {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.task-item-selector {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.task-item-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.task-item-editor {
  display: grid;
  gap: 10px;
  max-height: 230px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
}

.task-item-edit-row {
  display: grid;
  grid-template-columns: 64px minmax(150px, 1fr) minmax(170px, 0.8fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.task-item-edit-preview {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f7f8;
  font-size: 12px;
  font-weight: 900;
}

.task-item-edit-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-item-edit-name,
.task-item-edit-file {
  min-width: 0;
  color: #f7f7f8;
  font-size: 12px;
}

.task-item-edit-file input[type="file"] {
  padding: 7px 8px;
}

.task-view-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-view-toggle {
  display: inline-grid;
  width: fit-content;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.task-view-toggle label {
  width: auto;
  margin: 0;
  padding: 8px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

#taskItemViewImage:checked ~ .task-view-toggle label[for="taskItemViewImage"],
#taskItemViewText:checked ~ .task-view-toggle label[for="taskItemViewText"] {
  background: linear-gradient(135deg, #ff343b, #b80f18);
  color: #fff;
}

.task-item-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  max-height: clamp(180px, calc(100vh - 470px), 330px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
  scrollbar-width: thin;
}

.task-item-library::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.task-item-library::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.task-item-library::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.task-item-choice {
  position: relative;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.task-item-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-choice-card {
  min-height: 128px;
  display: grid;
  grid-template-rows: 76px auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7f7f8;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.task-choice-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 74, 80, 0.64);
}

.task-item-choice input:checked + .task-choice-card,
.task-item-choice:focus-visible .task-choice-card {
  border-color: rgba(255, 74, 80, 0.95);
  background: rgba(255, 52, 59, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 74, 80, 0.44);
}

.task-choice-image {
  width: 76px;
  height: 76px;
  justify-self: center;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.task-choice-name {
  display: block;
  min-width: 0;
  color: #f7f7f8;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  overflow-wrap: anywhere;
}

#taskItemViewText:checked ~ .task-item-library {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

#taskItemViewText:checked ~ .task-item-library .task-choice-card {
  min-height: 42px;
  display: flex;
  justify-content: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.1);
}

#taskItemViewText:checked ~ .task-item-library .task-choice-image {
  display: none;
}

#taskItemViewText:checked ~ .task-item-library .task-choice-name {
  color: #ffd7d9;
  font-size: 13px;
}

#taskItemViewText:checked ~ .task-item-library .task-item-choice input:checked + .task-choice-card .task-choice-name {
  color: #ffffff;
}

.task-item-empty {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.task-group-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.task-group-option {
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.task-group-option input {
  width: auto;
  margin: 0;
}

.required-mark {
  color: var(--red);
  font-weight: 900;
}

.review-log {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.review-log > strong {
  display: block;
  margin-bottom: 10px;
}

.review-log-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.review-log-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.review-log-item b,
.review-log-item em,
.review-log-item p {
  display: block;
}

.review-log-item em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.review-log-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.row-title {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

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

.primary,
.secondary,
.ghost,
.danger,
.table-action {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
}

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

.primary:hover {
  background: var(--blue-dark);
}

.secondary {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.16);
  color: var(--blue);
}

.ghost {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line);
  color: #1d1d1f;
}

.danger {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.16);
  color: var(--red);
}

.table-action {
  min-height: 30px;
  padding: 5px 8px;
  background: transparent;
  border-color: transparent;
  color: var(--blue);
}

.table-action:hover {
  background: rgba(0, 122, 255, 0.08);
}

.table-action.danger-text {
  color: var(--red);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
}

.icon-button span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 2px 0;
  background: #1d1d1f;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.badge.blue {
  background: rgba(0, 122, 255, 0.1);
  color: var(--blue);
}

.badge.green {
  background: rgba(52, 199, 89, 0.12);
  color: var(--green);
}

.badge.amber {
  background: rgba(255, 149, 0, 0.12);
  color: var(--amber);
}

.badge.red {
  background: rgba(255, 59, 48, 0.12);
  color: var(--red);
}

.badge.gray {
  background: rgba(60, 60, 67, 0.08);
  color: #6e6e73;
}

.feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.feature-badge.enabled {
  background: rgba(52, 199, 89, 0.12);
  color: var(--green);
}

.feature-badge.disabled {
  background: rgba(255, 59, 48, 0.12);
  color: var(--red);
}

.feature-disabled-note {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 149, 0, 0.22);
  border-radius: 8px;
  background: rgba(255, 149, 0, 0.08);
  color: #7a4b00;
  font-weight: 700;
}

.empty-state,
.loading-state {
  padding: 42px 16px;
  color: var(--muted);
  text-align: center;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.room-list {
  display: grid;
  gap: 12px;
}

.room-list article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.room-list strong,
.room-list span {
  display: block;
}

.room-list span {
  margin-top: 4px;
  color: var(--muted);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.modal {
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.modal.modal-wide {
  width: min(1120px, calc(100vw - 40px));
}

.modal.modal-room {
  width: min(900px, calc(100vw - 40px));
}

.modal.modal-task-group {
  width: min(1040px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
}

.modal-head {
  flex: 0 0 auto;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  padding: 18px;
}

.modal.modal-task-group .modal-body {
  overflow: hidden;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-grid .full {
  grid-column: 1 / -1;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-weight: 700;
}

.feature-switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.feature-switch {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.feature-switch input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--blue);
}

.feature-switch span {
  font-weight: 800;
}

.feature-switch small {
  grid-column: 2;
  color: var(--muted);
  line-height: 1.45;
}

.modal-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fbfbfd;
}

.launch-modal-content .table-wrap {
  overflow-x: auto;
}

.launch-modal-content table {
  min-width: 900px;
}

.launch-modal-content th:nth-child(4),
.launch-modal-content td:nth-child(4) {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
  line-height: 1.5;
}

.launch-modal-content th:last-child,
.launch-modal-content td:last-child {
  width: 100px;
  text-align: right;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
}

.detail-row dt {
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
}

.toast {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 60;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #1d1d1f;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Tactical red/black theme driven by bg.jpg */
body {
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.68), rgba(8, 8, 10, 0.92)),
    url("/bg.jpg") center / cover fixed;
  color: #f7f7f8;
}

.login-screen {
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.46), rgba(8, 8, 10, 0.88)),
    url("/bg.jpg") center / cover;
}

.login-panel,
.topbar,
.sidebar,
.panel,
.stat-card,
.toolbar,
.modal,
.room-list article {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(13, 13, 17, 0.76);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.workspace {
  background: rgba(8, 8, 10, 0.54);
}

.login-panel h1,
.page-head h2,
.panel-head h3,
.topbar-title strong,
.sidebar-brand strong,
.stat-card strong,
.room-list strong,
.detail-row dd {
  color: #ffffff;
}

.login-panel p,
.topbar-title span,
.sidebar-brand span,
.muted,
.page-head p,
.stat-card span,
.stat-card small,
.room-list span,
.detail-row dt,
.table-footer,
.filter-form label {
  color: #d0d0d6;
}

label {
  color: #f1f1f3;
}

input,
select,
textarea {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(5, 5, 7, 0.62);
  color: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 74, 80, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 52, 59, 0.16);
}

.brand-mark,
.brand-mark.small,
.nav-link.active {
  background: linear-gradient(135deg, #ff343b, #b80f18);
  color: #ffffff;
}

.nav-title,
.nav-link {
  color: #d0d0d6;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.primary {
  background: linear-gradient(135deg, #ff343b, #b80f18);
  color: #ffffff;
}

.primary:hover {
  background: linear-gradient(135deg, #ff4c52, #d01822);
}

.secondary,
.ghost,
.icon-button {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.danger {
  border-color: rgba(255, 74, 80, 0.28);
  background: rgba(255, 52, 59, 0.12);
  color: #ff7a7f;
}

.table-action {
  color: #ff585d;
}

.table-action:hover {
  background: rgba(255, 52, 59, 0.1);
}

th {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

td,
th,
.panel-head,
.timeline li,
.modal-head,
.modal-actions {
  border-color: rgba(255, 255, 255, 0.1);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

td,
.field-label,
.task-group-option,
.task-group-option span,
.task-item-chip,
.task-choice-name {
  color: #ffffff;
}

.task-item-chip,
.task-group-picker {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
}

.task-group-option {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
}

.task-group-option input {
  accent-color: #ff343b;
}

.avatar,
.badge.blue {
  background: rgba(255, 59, 63, 0.14);
  color: #ff7074;
}

.badge.green {
  background: rgba(55, 214, 104, 0.14);
  color: #61e489;
}

.badge.amber {
  background: rgba(205, 155, 84, 0.18);
  color: #d7b06f;
}

.badge.red {
  background: rgba(255, 59, 63, 0.15);
  color: #ff7074;
}

.badge.gray {
  background: rgba(255, 255, 255, 0.1);
  color: #d0d0d6;
}

.feature-badge.enabled {
  background: rgba(55, 214, 104, 0.14);
  color: #61e489;
}

.feature-badge.disabled {
  background: rgba(255, 59, 63, 0.15);
  color: #ff7074;
}

.feature-disabled-note {
  border-color: rgba(255, 214, 102, 0.28);
  background: rgba(255, 214, 102, 0.1);
  color: #ffe28a;
}

.feature-switch {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.feature-switch input {
  accent-color: #ff343b;
}

.feature-switch small {
  color: #d0d0d6;
}

.modal-root {
  background: rgba(0, 0, 0, 0.48);
}

.modal-actions {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 1080px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .workspace {
    min-height: 100vh;
    grid-template-rows: auto 1fr;
  }

  .topbar {
    min-height: 64px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px;
    gap: 12px;
  }

  .icon-button {
    display: grid;
  }

  .topbar-title {
    min-width: 0;
    flex: 1;
  }

  .club-switch {
    width: 100%;
    grid-template-columns: 86px 1fr;
    order: 3;
  }

  .account {
    margin-left: auto;
  }

  .view {
    padding: 16px 12px 24px;
  }

  .page-head {
    display: grid;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
  }

  .filter-form {
    grid-template-columns: 1fr;
  }

  .filter-form .button-row {
    flex-wrap: wrap;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .feature-switch-grid {
    grid-template-columns: 1fr;
  }

  .detail-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
