/* =============================
   Global
============================= */

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #0f172a;
}

.light { background: #f4f6f8; }
.dark { background: #0f172a; color: #e5e7eb; }

.container {
  padding: 24px;
}

/* =============================
   Top Bar
============================= */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 44px;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
}

.brand-sub {
  font-size: 13px;
  opacity: 0.7;
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* =============================
   Buttons
============================= */

button {
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 12px;
  border: none;
}

.primary {
  background: #1d4ed8;
  color: white;
}

.ghost {
  background: transparent;
  border: 1px solid #cbd5e1;
}

.iconbtn {
  background: transparent;
  border: none;
}

/* =============================
   Tabs
============================= */

.tabs {
  display: flex;
  background: #e5e7eb;
  padding: 4px;
}

.tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
}

.tab.active {
  background: white;
  font-weight: 600;
}

/* =============================
   Panels
============================= */

.panel {
  display: none;
}

.panel.active {
  display: block;
}

/* =============================
   Schedule Cards
============================= */

.schedule-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e5e7eb;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-weight: 600;
}

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

.entry {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}

.inline-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.small {
  font-size: 12px;
}

.subtle {
  opacity: 0.7;
}

/* =============================
   Timeline
============================= */

.timeline-row-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-track {
  position: relative;
  height: 54px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.timeline-block {
  position: absolute;
  top: 4px;
  bottom: 4px;
  padding: 6px;
  border-radius: 8px;
  font-size: 12px;
}

/* =============================
   Roster
============================= */

.roster-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.roster-table th,
.roster-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px;
}

/* =============================
   Modal
============================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  width: min(520px,90%);
}

.modal-head {
  display: flex;
  justify-content: space-between;
}

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

/* =============================
   Toast
============================= */

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
}

.toast.hidden {
  display: none;
}
.role-badge {
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e5e7eb;
  color: #374151;
}

.role-admin {
  background: #1d4ed8;
  color: white;
}

.role-editor {
  background: #16a34a;
  color: white;
}

.role-viewer {
  background: #9ca3af;
  color: white;
}
body.light {
  --bg: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --subtle: #6b7280;
}

body.dark {
  --bg: #0b1220;
  --panel: #111827;
  --text: #e5e7eb;
  --subtle: #9ca3af;
}

body {
  background: var(--bg);
  color: var(--text);
}

.schedule-card,
.panel,
.modal-card {
  background: var(--panel);
}
