:root {
  --primary: #1150a3;
  --primary-dark: #0b3570;
  --secondary: #f0f4ff;
  --text: #1f2333;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.brand-label {
  font-weight: 600;
  margin: 0;
}

.role-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.role-chip {
  background: var(--secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.role-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

main {
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 25px 45px rgba(17, 80, 163, 0.08);
}

.hero-content {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.hero-content p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 auto;
  max-width: 520px;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero-actions .btn {
  width: 100%;
}

.btn {
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 0.65rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #eee;
}

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

.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn.full {
  width: 100%;
}

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

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(17, 80, 163, 0.12);
}

.calendar-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.06);
}

.filter-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn.filter-btn {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 0 0 0.25rem 0;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

.table-wrapper.small table {
  min-width: auto;
}

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

th,
td {
  text-align: left;
  padding: 0.9rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--secondary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

.table-wrapper tbody tr {
  transition: background 0.2s ease;
}

.table-wrapper tbody tr:hover {
  background: rgba(17, 80, 163, 0.04);
}

.admin-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.06);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.admin-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.admin-card form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-card .small {
  font-size: 0.85rem;
}

.admin-table {
  width: 100%;
  min-width: auto;
}

.admin-table th {
  text-transform: none;
  letter-spacing: normal;
}

.admin-table td {
  font-size: 0.95rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.btn.danger {
  background: #dc2626;
  color: #fff;
}

.btn.ghost-danger {
  background: transparent;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.danger-zone {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #fecaca;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fff5f5;
}

.danger-zone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

.small {
  font-size: 0.85rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-ghost.edit {
  color: var(--primary);
}

.btn-ghost.delete {
  color: #c2410c;
  border-color: #fecdd3;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 100;
}

.modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #fff;
  border-radius: 1rem;
  padding: 1.75rem;
  width: min(420px, 100%);
  position: relative;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

input,
select {
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 1rem;
}

.form-error {
  color: #b91c1c;
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 800px) {
  main {
    padding: 1.5rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .top-bar {
    flex-direction: column;
    gap: 0.75rem;
  }

  main {
    padding: 1.25rem;
  }

  .calendar-section {
    padding: 1.25rem 1rem;
  }

  .table-wrapper {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  table {
    min-width: 100%;
  }

  tbody tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.25rem 0.5rem;
    box-shadow: 0 15px 25px rgba(15, 23, 42, 0.08);
    background: #fff;
  }

  td {
    border: none;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem;
    font-size: 0.95rem;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
  }

  td:last-child {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-ghost {
    width: 100%;
    text-align: center;
  }

  .danger-zone {
    flex-direction: column;
    align-items: flex-start;
  }

  .danger-zone-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (min-width: 540px) {
  .hero-actions {
    flex-direction: row;
  }

  .hero-actions .btn {
    flex: 1 1 50%;
  }
}
