* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, #ffffff 0%, #f6f9ff 40%, #eef4ff 100%);
  color: #1f2937;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  color: #344054;
  padding: 18px 12px;
}

.brand {
  font-size: 16px;
  font-weight: 700;
  color: #1d2939;
  margin-bottom: 18px;
  padding: 0 8px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu-item {
  width: 100%;
  text-align: left;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #475467;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.8);
  color: #1d2939;
  border-color: rgba(255, 255, 255, 0.9);
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.92);
  color: #175cd3;
  border-color: rgba(23, 92, 211, 0.18);
  box-shadow: 0 6px 20px rgba(23, 92, 211, 0.14);
}

.content {
  padding: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

h1,
h2 {
  margin: 0 0 8px;
}

.desc {
  margin: 0 0 12px;
  color: #667085;
  font-size: 14px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(208, 213, 221, 0.8);
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.72);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

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

.actions-inline button {
  width: auto;
  cursor: pointer;
}

button {
  background: linear-gradient(135deg, #2e90fa, #2563eb);
  color: #fff;
  border: none;
}

button.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: #344054;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.list-header h1 {
  margin-bottom: 4px;
}

.list-header .desc {
  margin-bottom: 0;
}

.seat-message {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-block;
}

.seat-message-success {
  color: #027a48;
  background: rgba(6, 174, 91, 0.12);
  border-color: rgba(6, 174, 91, 0.24);
}

.seat-message-error {
  color: #b42318;
  background: rgba(253, 228, 228, 0.75);
  border-color: rgba(180, 35, 24, 0.24);
}

.filter-select {
  width: auto;
  cursor: pointer;
}

.actions-inline {
  align-items: center;
  flex-wrap: wrap;
}

.questionnaire-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: fit-content;
  gap: 8px;
  margin: 12px 0;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(208, 213, 221, 0.7);
  background: rgba(255, 255, 255, 0.6);
}

.q-tab {
  width: auto !important;
  min-width: 120px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(208, 213, 221, 0.85);
  background: rgba(255, 255, 255, 0.82) !important;
  color: #475467;
  cursor: pointer;
}

.q-tab.active {
  background: linear-gradient(135deg, #2e90fa, #2563eb) !important;
  color: #ffffff;
  border-color: rgba(23, 92, 211, 0.35);
  box-shadow: 0 4px 14px rgba(23, 92, 211, 0.2);
}

.q-tab:not(.active) {
  color: #175cd3;
  box-shadow: none;
}

.questionnaire-panel {
  display: none;
}

.questionnaire-panel.active {
  display: block;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.account-table-wrap {
  margin-bottom: 16px;
}

.account-table {
  min-width: 760px;
}

.small-action-btn {
  width: auto;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.edit-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(46, 144, 250, 0.35);
  background: rgba(46, 144, 250, 0.12);
  color: #175cd3;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.delete-icon-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(217, 45, 32, 0.35);
  background: rgba(217, 45, 32, 0.12);
  color: #b42318;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.danger-action-btn {
  background: linear-gradient(135deg, #f97066, #d92d20);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 20;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  width: min(560px, 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  padding: 16px;
}

.modal-card-wide {
  width: min(720px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.questionnaire-detail-body {
  overflow-y: auto;
  padding-right: 4px;
}

.detail-section {
  margin-bottom: 14px;
}

.detail-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  color: #1d4ed8;
  border-left: 3px solid #1d4ed8;
  padding-left: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.detail-label {
  color: #64748b;
  font-size: 13px;
}

.detail-value {
  color: #0f172a;
  font-size: 14px;
  word-break: break-word;
  white-space: pre-wrap;
}

.detail-input {
  width: 100%;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(208, 213, 221, 0.85);
  padding: 8px 10px;
  font-size: 14px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.92);
  box-sizing: border-box;
}

.detail-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close-btn {
  width: auto;
}

.modal-form {
  display: grid;
  gap: 10px;
}

.modal-card-wide .modal-form {
  flex: 1;
  min-height: 0;
}

.modal-card-wide .questionnaire-detail-body {
  flex: 1;
  min-height: 0;
  max-height: calc(85vh - 170px);
  overflow-y: auto;
}

#questionnaire-edit-modal .modal-card-wide {
  height: min(85vh, 900px);
}

#questionnaire-edit-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

#questionnaire-edit-body {
  min-height: 0;
  overflow-y: auto;
}

.modal-form .field {
  margin: 0;
}

.modal-actions {
  justify-content: flex-end;
}

.seat-config-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 10px;
}

.seat-config-form .field {
  margin: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

.status-chip.paid {
  color: #027a48;
  background: rgba(6, 174, 91, 0.12);
}

.status-chip.pending {
  color: #b54708;
  background: rgba(247, 144, 9, 0.14);
}

.contract-select {
  width: auto;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(208, 213, 221, 0.8);
  background: rgba(255, 255, 255, 0.86);
  color: #344054;
  cursor: pointer;
}

.contract-select:disabled {
  opacity: 0.7;
  cursor: default;
}

.contract-issued-lock {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(6, 174, 91, 0.12);
  color: #027a48;
  font-size: 12px;
  font-weight: 600;
}

.muted-text {
  color: #98a2b3;
  font-size: 13px;
}

.proof-link {
  color: #175cd3;
  text-decoration: none;
  font-size: 13px;
}

.proof-link:hover {
  text-decoration: underline;
}

.records-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.records-table th,
.records-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(208, 213, 221, 0.55);
  text-align: left;
  white-space: nowrap;
}

.records-table th[hidden],
.records-table td[hidden] {
  display: none;
}

.batch-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.records-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.86);
  color: #344054;
  font-weight: 700;
}

.records-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.36);
}

.records-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.72);
}

.empty-cell {
  text-align: center !important;
  color: #667085;
}

@media (max-width: 720px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 12px;
  }

  .menu {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .modal-actions {
    justify-content: stretch;
  }
}
