body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #0b1020;
  color: #e5e7eb;
}

.topbar {
  background: #111827;
  color: #f9fafb;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #374151;
}

.topbar a {
  color: #93c5fd;
  margin-left: 12px;
  text-decoration: none;
}

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

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  justify-content: center;
}

.wide-card {
  grid-column: 1 / -1;
}

.card {
  background: #111827;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #374151;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

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

.form-grid input,
.form-grid select {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  background: #0f172a;
  color: #f9fafb;
}

.inline-form {
  display: inline-block;
  margin-left: 8px;
}

button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

button.danger {
  background: #dc2626;
}

.messages {
  list-style: none;
  padding: 0;
}

.messages li {
  margin-bottom: 8px;
  padding: 8px;
  border-radius: 5px;
}

.messages .success {
  background: #064e3b;
}

.messages .error {
  background: #7f1d1d;
}

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

ul {
  padding-left: 18px;
}

li {
  margin-bottom: 10px;
}

.account-data {
  list-style: none;
  padding-left: 0;
}

.account-data li {
  padding: 8px 0;
  border-bottom: 1px solid #374151;
}

.danger-zone {
  border-color: #7f1d1d;
}

.danger-zone h2 {
  color: #fca5a5;
}

.badge {
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid #60a5fa;
  color: #60a5fa;
  border-radius: 999px;
  margin-left: 6px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 5px;
}

.dot.free { background: #16a34a; }
.dot.full { background: #dc2626; }
.dot.blocked { background: #7c3aed; }
.dot.today-locked { background: #f59e0b; }

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

.calendar-day {
  border: 1px solid #4b5563;
  border-radius: 10px;
  background: #0f172a;
  color: #e5e7eb;
  text-align: left;
  padding: 10px;
}

.weekday {
  font-size: 12px;
  opacity: 0.8;
  display: block;
}

.calendar-day.free { border-color: #16a34a; }
.calendar-day.full { border-color: #dc2626; }
.calendar-day.blocked { border-color: #7c3aed; }
.calendar-day.today-locked { border-color: #f59e0b; }
.calendar-day.mixed { border-color: #60a5fa; }

.date-number {
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
}

.date-status {
  font-size: 12px;
  opacity: 0.9;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  z-index: 999;
  padding: 12px;
}

.modal-content {
  width: min(560px, 100%);
  position: relative;
}

.close-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  background: transparent;
  border: 1px solid #4b5563;
}

.button-link {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  padding: 8px 10px;
}

.table-wrap {
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  border: 1px solid #374151;
  padding: 8px;
  text-align: left;
}

.users-table thead {
  background: #1f2937;
}

.block-day-item {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #374151;
}

.calendar-accordion summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-accordion summary::-webkit-details-marker {
  display: none;
}

.calendar-accordion summary h2 {
  margin: 0;
}

.accordion-hint {
  font-size: 12px;
  opacity: 0.7;
}

.calendar-accordion:not([open]) .accordion-hint::before {
  content: "▸ ";
}

.calendar-accordion[open] .accordion-hint::before {
  content: "▾ ";
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

button.secondary {
  background: #374151;
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .container {
    padding: 0 10px;
  }

  .card {
    padding: 14px;
  }

  .inline-form {
    display: block;
    margin: 6px 0 0 0;
  }

  .legend {
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
  }

  .legend-item {
    width: 100%;
    line-height: 1.3;
  }

  .modal-actions {
    flex-direction: column;
  }
}
