:root {
  --bg: #0b1414;
  --card: #0f1f1f;
  --text: #eef5f5;
  --muted: #b4c2c2;
  --border: rgba(255, 255, 255, 0.12);
  --primary: #ff8a2a;
  --danger: #ff5c7a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.45;
}

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

a:hover { text-decoration: underline; }

.link-button {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  font-weight: 700;
}

.link-button:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  background: color-mix(in srgb, var(--primary) 12%, rgba(255,255,255,0.06));
}

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

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

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

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

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 900px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

label {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input, select {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 220px;
  outline: none;
}

select option, select optgroup {
  background: var(--card);
  color: var(--text);
}

input:focus, select:focus {
  border-color: color-mix(in srgb, var(--primary) 75%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

button {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--primary) 70%, transparent);
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { filter: brightness(1.05); }

button:active { transform: translateY(1px); }

button.danger {
  border-color: rgba(255, 92, 122, 0.7);
  background: var(--danger);
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.04);
}

.table tr:hover td { background: rgba(255,255,255,0.03); }

.small-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.small-links a { color: var(--text); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal-panel {
  position: relative;
  width: min(920px, calc(100% - 24px));
  margin: 8vh auto 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

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

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

.modal-close {
  border-color: var(--border);
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.modal-body {
  margin-bottom: 10px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

h2 {
  margin: 16px 0 10px;
  font-size: 16px;
}

p { color: var(--muted); }

#calendar {
  margin-top: 12px;
}

.fc {
  --fc-border-color: rgba(255,255,255,0.12);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: rgba(255,255,255,0.05);
  --fc-today-bg-color: color-mix(in srgb, var(--primary) 16%, transparent);
  --fc-event-bg-color: color-mix(in srgb, var(--primary) 85%, transparent);
  --fc-event-border-color: color-mix(in srgb, var(--primary) 95%, transparent);
  --fc-event-text-color: #fff;
  --fc-button-bg-color: rgba(255,255,255,0.06);
  --fc-button-border-color: rgba(255,255,255,0.12);
  --fc-button-text-color: var(--text);
  --fc-button-hover-bg-color: rgba(255,255,255,0.10);
  --fc-button-hover-border-color: rgba(255,255,255,0.18);
  --fc-button-active-bg-color: color-mix(in srgb, var(--primary) 40%, transparent);
  --fc-button-active-border-color: color-mix(in srgb, var(--primary) 55%, transparent);
}

.fc .fc-timegrid-event .fc-event-main {
  padding: 2px 4px;
}

.fc .fc-timegrid-slot {
  height: 48px;
}

.fc .fc-timegrid-slot-label {
  font-size: 12px;
}

.fc .fc-timegrid-axis-cushion {
  font-size: 12px;
}

.ev {
  font-size: 12px;
  line-height: 1.2;
  word-break: break-word;
}

.ev-title {
  font-weight: 700;
}

.ev-meta {
  opacity: 0.95;
}

.fc .fc-timegrid-event .fc-event-title {
  white-space: normal;
}

.fc .group-booking {
  border-color: #6d28d9 !important;
}

.fc .room-booking {
  border-color: #4b5563 !important;
}

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

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
}

.legend-class { background: var(--primary); }
.legend-group { background: #7c3aed; }
.legend-reservation { background: #6b7280; }

.calendar-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.calendar-status.empty {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
}

.calendar-status.error {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.35);
  color: #ffb3c1;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 280px;
  max-height: 12rem;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.checklist-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 6px;
}

.checklist-item:hover {
  background: rgba(255,255,255,0.05);
}

.checklist-item input[type="checkbox"] {
  min-width: auto;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}

.checklist-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.modal-slot-time {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.admin-section h2 {
  margin-top: 0;
}

.admin-primary-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .admin-primary-links {
    grid-template-columns: 1fr 1fr;
  }
}

.admin-danger-zone {
  border-color: rgba(255, 92, 122, 0.45) !important;
  background: rgba(255, 92, 122, 0.06);
}

.orar-curent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.orar-curent-header h1 {
  margin: 0;
  font-size: 24px;
}

.orar-curent-clock {
  font-size: 32px;
  font-weight: bold;
  background: var(--card);
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.orar-curent-clock small {
  font-size: 16px;
  color: var(--muted);
  font-weight: normal;
}

.orar-curent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.orar-curent-room {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.orar-curent-room-header {
  padding: 16px 20px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.orar-curent-room-header small {
  font-size: 14px;
  opacity: 0.9;
  font-weight: normal;
}

.orar-curent-free { background: #1a5c1a; }
.orar-curent-booking { background: var(--danger); }
.orar-curent-class { background: var(--primary); }
.orar-curent-group { background: #7c3aed; }

.orar-curent-room-body {
  padding: 16px 20px;
  flex: 1;
}

.orar-curent-now {
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  color: #0b1414;
}

.orar-curent-now.orar-curent-booking { border-color: rgba(255, 92, 122, 0.5); }
.orar-curent-now.orar-curent-class { border-color: rgba(255, 138, 42, 0.5); }
.orar-curent-now.orar-curent-group { border-color: rgba(124, 58, 237, 0.5); }

.orar-curent-now strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.orar-curent-note {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  color: var(--danger);
  font-weight: bold;
  letter-spacing: 1px;
}

.orar-curent-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.orar-curent-item:last-child { border-bottom: none; }
.orar-curent-item.past { color: var(--muted); opacity: 0.6; }
.orar-curent-item.current {
  font-weight: 600;
  background: rgba(255, 138, 42, 0.1);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 138, 42, 0.2);
}

.orar-curent-time {
  min-width: 100px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.orar-curent-label {
  flex: 1;
  padding-left: 12px;
}

.orar-curent-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 8px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.orar-curent-tag.booking {
  background: rgba(255, 92, 122, 0.2);
  color: var(--danger);
  border: 1px solid rgba(255, 92, 122, 0.3);
}

.orar-curent-tag.class {
  background: rgba(255, 138, 42, 0.2);
  color: var(--primary);
  border: 1px solid rgba(255, 138, 42, 0.3);
}

.orar-curent-tag.group {
  background: rgba(124, 58, 237, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(124, 58, 237, 0.35);
}

.orar-curent-empty {
  color: var(--muted);
  padding: 8px 0;
  font-style: italic;
}

@media (max-width: 600px) {
  input, select {
    min-width: 0;
    width: 100%;
  }

  label {
    flex: 1 1 100%;
  }

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

  .modal-panel {
    width: calc(100% - 16px);
    margin-top: 4vh;
    max-height: 92vh;
    overflow-y: auto;
  }

  .checklist {
    min-width: 0;
    width: 100%;
  }
}
