:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #dfe6ef;
  --line-soft: #edf1f6;
  --text: #162033;
  --muted: #68758a;
  --blue: #1467d8;
  --blue-soft: #eaf3ff;
  --teal: #0f9488;
  --green: #148f43;
  --green-soft: #e8f7e9;
  --yellow: #b57900;
  --yellow-soft: #fff6d8;
  --red: #c83c47;
  --red-soft: #fde6e7;
  --shadow: 0 14px 35px rgba(22, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--blue);
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

form {
  margin: 0;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 10px rgba(22, 32, 51, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  font-size: 24px;
  font-weight: 750;
}

.brand-logo {
  height: 66px;
  width: auto;
}

.auth-logo {
  height: 100px;
  width: auto;
  margin-bottom: 24px;
}

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

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #43516a;
  background: transparent;
  font-weight: 700;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--blue-soft);
}

.account-menu {
  position: relative;
}

.account-menu summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, #0593a0, #126dcf);
  font-weight: 800;
}

.account-text {
  display: grid;
  min-width: 185px;
  gap: 2px;
}

.account-text strong {
  font-size: 14px;
}

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

.chevron {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-right: 2px solid #43516a;
  border-bottom: 2px solid #43516a;
  transition: transform 0.15s ease;
}

.account-menu[open] .chevron {
  transform: rotate(225deg);
}

.account-popover {
  position: absolute;
  top: 56px;
  right: 0;
  display: grid;
  min-width: 190px;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.account-popover a,
.ghost-button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.account-popover a:hover,
.ghost-button:hover {
  background: var(--blue-soft);
}

.sidebar {
  position: fixed;
  top: 72px;
  bottom: 0;
  left: 0;
  display: flex;
  width: 276px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav a,
.support-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 7px;
  color: #2f3b52;
  font-weight: 550;
}

.side-nav a.active,
.side-nav a:hover,
.support-link:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.support-link {
  border: 1px solid var(--line);
}

.nav-icon {
  display: inline-block;
  width: 19px;
  height: 19px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
}

.grid-icon {
  box-shadow: inset 7px 0 0 transparent;
}

.calendar-icon {
  border-radius: 3px;
}

.history-icon,
.check-icon,
.close-icon,
.help-icon {
  border-radius: 50%;
}

.content {
  min-height: 100vh;
  margin-left: 276px;
  padding: 90px 28px 34px;
}

.content > .panel {
  max-width: 1540px;
  margin-right: auto;
  margin-left: auto;
}

.panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.table-heading {
  justify-content: space-between;
}

.info-dot {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 50%;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
}

.select-card {
  display: grid;
  min-width: 280px;
  gap: 2px;
  padding: 8px 14px;
  border: 1px solid #cfd8e5;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  background: #ffffff;
}

.select-card-small {
  min-width: 150px;
  background: var(--blue-soft);
}

.select-card select {
  width: 100%;
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  outline: 0;
}

.release-countdown {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  background: #f8fafc;
}

.release-countdown div {
  display: grid;
  gap: 3px;
}

.release-countdown strong {
  color: #1e293b;
}

.release-countdown span {
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.week-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
}

.week-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.week-table th,
.week-table td {
  height: 31px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 0;
  text-align: center;
}

.week-table th {
  height: 40px;
  background: #fbfcfe;
  color: #253049;
  font-size: 14px;
  font-weight: 750;
}

.week-table th.weekend-col {
  background: #fff7e6;
}

.week-table .time-col {
  width: 132px;
}

.time-label {
  color: #455168;
  background: #fbfcfe;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.slot-cell {
  position: relative;
  padding: 2px;
  cursor: pointer;
  background: #ffffff;
  font-size: 0;
  line-height: 0;
  white-space: nowrap;
  transition: background 0.12s ease, box-shadow 0.12s ease, outline 0.12s ease;
}

.slot-cell.weekend-col {
  background: #fffaf0;
}

.slot-cell.weekend-col:hover {
  background: #fff4df;
}

.slot-cell:hover {
  background: #f8fbff;
  box-shadow: inset 0 0 0 2px rgba(20, 103, 216, 0.18);
}

.slot-cell.unavailable {
  cursor: pointer;
  background: #eef1f4;
  box-shadow: inset 0 0 0 1px #d8dee7;
}

.slot-cell.unavailable:hover {
  background: #eef1f4;
  box-shadow: inset 0 0 0 1px #d8dee7;
}

.court-slot {
  position: relative;
  display: inline-flex;
  width: 50%;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #334155;
  background: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: top;
}

.court-slot:hover {
  border-color: rgba(20, 103, 216, 0.32);
  background: #f8fbff;
}

.court-slot.bookable {
  color: #0f6b32;
  background: #e8f7e9;
}

.court-slot.unavailable {
  color: #7f1d1d;
  background: #fee2e2;
}

.court-slot.slot-status-not_bookable {
  color: #991b1b;
  background: repeating-linear-gradient(135deg, #fee2e2, #fee2e2 6px, #fecaca 6px, #fecaca 12px);
}

.court-slot.slot-status-booked_by_other {
  color: #065f46;
  background: repeating-linear-gradient(45deg, #d1fae5, #d1fae5 6px, #a7f3d0 6px, #a7f3d0 12px);
  cursor: not-allowed;
}

.court-slot.slot-status-full,
.court-slot.slot-status-locked {
  color: #7f1d1d;
  background: #fecaca;
}

.court-slot.slot-status-waitlist {
  color: #9a3412;
  background: #ffedd5;
}

.court-slot.slot-status-expired {
  color: #9f1239;
  background: #ffe4e6;
}

.court-label {
  pointer-events: none;
}

.court-slot.selected .court-label,
.court-slot.selected-tail .court-label {
  display: none;
}

.slot-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.slot-cell.saved {
  background: #e8f7e9;
  box-shadow: inset 0 0 0 2px rgba(20, 143, 67, 0.28);
}

.court-slot.saved,
.slot-cell.saved-court1 {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.court-slot.saved-court1 {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.slot-cell.saved-court1 .slot-dot {
  display: inline-block;
  background: #2563eb;
}

.court-slot.saved-court1 .slot-dot {
  display: inline-block;
  background: #2563eb;
}

.slot-cell.saved-court2 {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.court-slot.saved-court2 {
  background: #dbeafe;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.slot-cell.saved-court2 .slot-dot {
  display: inline-block;
  background: #2563eb;
}

.court-slot.saved-court2 .slot-dot {
  display: inline-block;
  background: #2563eb;
}

.slot-cell.saved-both {
  background: #e8f7e9;
  box-shadow: inset 0 0 0 2px rgba(20, 143, 67, 0.28);
}

.slot-cell.saved-both .slot-dot {
  display: inline-block;
  background: var(--green);
}

.slot-cell.saved .slot-dot {
  display: inline-block;
  background: var(--green);
}

.court-slot.saved .slot-dot {
  display: inline-block;
}

.slot-cell.saved-single::after,
.slot-cell.saved-series::after,
.court-slot.saved-single::after,
.court-slot.saved-series::after {
  position: absolute;
  top: 2px;
  right: 4px;
  display: grid;
  min-width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 4px;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.slot-cell.saved-single::after {
  content: "1";
  background: #475569;
}

.slot-cell.saved-series::after,
.court-slot.saved-series::after {
  content: "S";
  background: #0f9488;
}

.court-slot.saved-single::after {
  content: "1";
  background: #475569;
}

.slot-cell.selected,
.slot-cell.selected-tail,
.court-slot.selected,
.court-slot.selected-tail {
  position: relative;
  background: linear-gradient(135deg, #1e88ff, #105bd4) !important;
  box-shadow: inset 0 0 0 3px #0f6be8;
}

.slot-cell.selected .slot-dot,
.slot-cell.selected-tail .slot-dot,
.court-slot.selected .slot-dot,
.court-slot.selected-tail .slot-dot {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: #ffffff;
}

.slot-cell.selected .slot-dot,
.court-slot.selected .slot-dot {
  position: relative;
}

.slot-cell.selected .slot-dot::before,
.court-slot.selected .slot-dot::before {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 9px;
  height: 5px;
  content: "";
  transform: rotate(-45deg);
  border-bottom: 2px solid var(--blue);
  border-left: 2px solid var(--blue);
}

.resize-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  z-index: 5;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 5px;
  background: var(--blue);
  box-shadow: 0 2px 8px rgba(20, 103, 216, 0.35);
  cursor: ns-resize;
}

.resize-handle::before {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 7px;
  height: 7px;
  content: "";
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
}

.is-resizing-slot,
.is-resizing-slot * {
  cursor: ns-resize !important;
  user-select: none;
}

.selection-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  color: #27344d;
  background: #ffffff;
}

.selection-warning {
  color: #b45309;
  font-size: 12px;
  font-weight: 700;
}

.internal-booking-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  color: #334155;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.internal-booking-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.internal-booking-legend i {
  width: 13px;
  height: 13px;
  border-radius: 4px;
}

.court-slot.internal-booked {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.court-slot .mode-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 8px;
  font-weight: 700;
  color: white;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 3px;
  border-radius: 3px;
  pointer-events: none;
}

.booking-user-0 { color: #7c3aed !important; background-color: #ede9fe !important; }
.booking-user-1 { color: #0f766e !important; background-color: #ccfbf1 !important; }
.booking-user-2 { color: #b45309 !important; background-color: #fef3c7 !important; }
.booking-user-3 { color: #be123c !important; background-color: #ffe4e6 !important; }
.booking-user-4 { color: #0369a1 !important; background-color: #e0f2fe !important; }
.booking-user-5 { color: #15803d !important; background-color: #dcfce7 !important; }
.booking-user-6 { color: #c2410c !important; background-color: #ffedd5 !important; }
.booking-user-7 { color: #4338ca !important; background-color: #e0e7ff !important; }

.mode-toggle {
  display: inline-flex;
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.mode-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #2f3b52;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.mode-toggle input {
  width: 14px;
  height: 14px;
  padding: 0;
  accent-color: var(--blue);
}

.builder-footer {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.action-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: none;
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-btn.primary {
  background: var(--blue);
  color: white;
}

.action-btn.primary:hover:not(:disabled) {
  background: #2563eb;
}

.action-btn.secondary {
  background: #e2e8f0;
  color: #1e293b;
}

.action-btn.secondary:hover:not(:disabled) {
  background: #cbd5e1;
}

.action-btn.success {
  background: #dcfce7;
  border: 1px solid #22c55e;
  color: #16a34a;
}

.action-btn.success:hover:not(:disabled) {
  background: #22c55e;
  color: white;
}

.mode-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #2f3b52;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn:hover {
  background: #eef2f6;
}

.mode-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.summary-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--blue);
  border-radius: 4px;
}

.builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #2f3b52;
  font-weight: 500;
}

.checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.notification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 18px;
}

.notification-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2f3b52;
  font-weight: 650;
}

.notification-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

button,
.small-action,
.secondary-action {
  border: 0;
  border-radius: 7px;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 700;
}

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

.secondary-action,
.small-action {
  border: 1px solid #cfd8e5;
  color: var(--blue);
  background: #ffffff;
}

.danger {
  background: var(--red);
}

.icon-danger {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: var(--red);
  background: transparent;
}

.icon-danger:hover {
  background: var(--red-soft);
}

.trash-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

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

.action-buttons form {
  margin: 0;
}

.admin-form {
  align-items: end;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
}

.danger-zone strong {
  color: #991b1b;
}

.danger-zone p {
  margin: 4px 0 0;
  color: #5f6b7a;
  font-size: 13px;
}

.form-action {
  display: flex;
  align-items: end;
}

.sub-panel {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--line-soft);
  border-radius: 8px;
}

.sub-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
}

.warning-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--red-soft);
  border: 1px solid var(--red);
  border-radius: 6px;
  color: #991b1b;
}

.warning-banner strong {
  color: #991b1b;
}

.info-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
}

.mode-form {
  margin-top: 12px;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.mode-option:hover {
  border-color: var(--blue);
}

.mode-option input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.mode-option input[type="radio"]:checked + .mode-label {
  color: var(--blue);
}

.mode-form .form-action {
  margin-top: 16px;
}

.mode-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mode-label strong {
  font-size: 15px;
}

.mode-label small {
  color: var(--muted);
  font-size: 13px;
}

.test-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.test-buttons form {
  margin: 0;
}

.test-buttons button {
  padding: 8px 16px;
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.test-buttons button:hover {
  background: var(--blue);
  color: white;
}

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

.inline-confirm label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2f3b52;
  font-size: 12px;
  font-weight: 650;
}

.inline-confirm input[type="checkbox"] {
  width: 15px;
  height: 15px;
  padding: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: #2f3b52;
  background: #f5f7fa;
  font-size: 13px;
  font-weight: 750;
}

.compact-table {
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.mode-pill {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.mode-single {
  color: #334155;
  background: #e2e8f0;
}

.mode-series {
  color: #0f766e;
  background: #ccfbf1;
}

.status-active {
  color: #157a3a;
  background: #d9f5de;
}

.status-paused {
  color: #a36700;
  background: #ffedbd;
}

.status-line {
  color: var(--green);
  font-weight: 700;
}

.slot-details {
  margin-top: 14px;
}

.slot-details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

.data-table tr.booked td {
  background-color: #f0f0f0;
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

.error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
}

.live-mode-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 14px;
}

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

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #cfd8e5;
  border-radius: 7px;
  background: #ffffff;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-content {
  width: min(460px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 24px;
}

.auth-content .panel {
  margin: 0;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 72px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .account-text {
    display: none;
  }

  .sidebar {
    position: static;
    width: auto;
    padding-top: 88px;
  }

  .content {
    margin-left: 0;
    padding: 18px;
  }

  .builder-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

.bookings-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
}

.bookings-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  margin: 0 0 16px;
  color: var(--text);
}

.section-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--blue);
  mask-size: contain;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-position: center;
}

.history-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12,6 12,12 16,14'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12,6 12,12 16,14'/%3E%3C/svg%3E");
}

.calendar-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 12px;
}

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

.attempt-card,
.booking-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.attempt-card:hover,
.booking-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--blue);
}

.attempt-card.success {
  border-left: 4px solid var(--green);
}

.attempt-card.error {
  border-left: 4px solid var(--red);
}

.attempt-card.pending {
  border-left: 4px solid var(--yellow);
}

.attempt-summary {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.summary-success {
  color: var(--green);
  font-weight: 600;
}

.summary-error {
  color: var(--red);
  font-weight: 600;
}

.attempt-header,
.booking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.attempt-court {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.attempt-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.status-icon {
  font-size: 16px;
}

.success-icon { color: var(--green); }
.dry-icon { color: var(--blue); }
.error-icon { color: var(--red); }
.pending-icon { color: var(--yellow); }

.attempt-date,
.booking-date {
  font-size: 12px;
  color: var(--muted);
}

.attempt-details,
.booking-details {
  margin-bottom: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

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

.detail-value {
  font-weight: 500;
}

.attempt-results {
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  margin-top: 12px;
}

.result-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}

.result-court {
  font-weight: 600;
  color: var(--text);
}

.result-time {
  color: var(--muted);
}

.result-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--green-soft);
  color: var(--green);
}

.result-status:empty {
  display: none;
}

.result-artifacts {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.artifact-link {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.artifact-link:hover {
  background: var(--blue);
  color: white;
}

.attempt-error {
  margin-top: 12px;
  padding: 10px;
  background: var(--red-soft);
  border-radius: 6px;
  font-size: 12px;
  color: var(--red);
}

.booking-card.cancelled {
  opacity: 0.6;
}

.booking-court {
  font-size: 16px;
  font-weight: 600;
}

.booking-status {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.booking-status.active {
  background: var(--green-soft);
  color: var(--green);
}

.booking-status.cancelled {
  background: var(--red-soft);
  color: var(--red);
}

.booking-date {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.booking-time {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 8px;
}

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

.booking-dry-run {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
}

.booking-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

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

.action-form.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.action-form.stacked .inline-check {
  justify-content: flex-start;
}

.action-form.stacked button {
  width: 100%;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.inline-check input {
  width: 14px;
  height: 14px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small.danger {
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--red);
}

.btn-small.danger:hover {
  background: var(--red);
  color: white;
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn.primary {
  background: var(--blue);
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.btn.primary:hover {
  background: #2563eb;
}

.btn.info {
  background: #e0f2fe;
  color: #0284c7;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.btn.info:hover {
  background: #38bdf8;
  color: white;
}

.btn.success {
  background: #dcfce7;
  color: #16a34a;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.btn.success:hover {
  background: #22c55e;
  color: white;
}

.btn-small.success {
  background: #dcfce7;
  border: 1px solid #22c55e;
  color: #16a34a;
}

.btn-small.success:hover {
  background: #22c55e;
  color: white;
}

.btn-small.info {
  background: #e0f2fe;
  border: 1px solid #38bdf8;
  color: #0284c7;
}

.btn-small.info:hover {
  background: #38bdf8;
  color: white;
}

.btn-small.secondary {
  background: var(--line-soft);
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn-small.secondary:hover {
  background: var(--line);
  color: var(--text);
}

.btn-small.info {
  background: #e0f2fe;
  border: 1px solid #38bdf8;
  color: #0284c7;
}

.btn-small.info:hover {
  background: #38bdf8;
  color: white;
}

.success {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--green);
  font-size: 14px;
}

.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--line-soft);
  border-radius: 10px;
}

.info-text {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-section {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 20px;
  background: #fafbfc;
}

.form-section legend {
  font-weight: 700;
  color: var(--text);
  padding: 0 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.form-group .optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.email-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 804px);
  align-items: stretch;
  margin-left: auto;
}

.email-actions .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 39px;
  margin: 0;
  min-width: 0;
  padding: 10px 20px;
  text-align: center;
}

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

.notification-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #fafbfc;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.checkbox-item:hover {
  background: var(--line-soft);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--blue);
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-label strong {
  font-size: 14px;
  color: var(--text);
}

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

.password-form .form-grid {
  max-width: 500px;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

@media (max-width: 640px) {
  .email-actions,
  .password-form .form-grid {
    grid-template-columns: 1fr;
  }

}

.mode-options {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}

.mode-option {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fafbfc;
  border: 2px solid var(--line-soft);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-option:hover {
  border-color: var(--blue);
}

.mode-option.active {
  border-color: var(--blue);
  background: #eff6ff;
}

.mode-option input {
  margin-top: 4px;
}

.mode-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-label strong {
  font-size: 15px;
  color: var(--text);
}

.mode-label small {
  font-size: 13px;
  color: var(--muted);
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  margin-bottom: 20px;
}

.danger-zone-content strong {
  display: block;
  color: #dc2626;
  margin-bottom: 4px;
}

.danger-zone-content p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--line-soft);
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-active {
  color: var(--green);
  font-weight: 600;
}

.status-inactive {
  color: var(--red);
  font-weight: 600;
}

.admin-form {
  margin-top: 16px;
}
