/*!
 * EduManage - components.css
 * Reusable components: avatars, badges, timeline, customizer, menus, profile.
 */

/* ---------- Components ---------- */

.page-title {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -.02em;
  margin: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(var(--primary-rgb), .14);
  color: var(--primary);
  flex: none;
}

.badge-soft {
  font-weight: 600;
  padding: .35em .65em;
  border-radius: 99px;
  font-size: .72rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.badge-soft::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.b-success {
  background: rgba(22, 163, 74, .12);
  color: var(--success);
}

.b-warning {
  background: rgba(217, 119, 6, .14);
  color: var(--warning);
}

.b-danger {
  background: rgba(220, 38, 38, .12);
  color: var(--danger);
}

.b-info {
  background: rgba(8, 145, 178, .12);
  color: var(--info);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 1.1rem 1.5rem;
  font-size: .875rem;
  border-left: 1px solid var(--border-color);
  margin-left: .4rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: .3rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline small {
  display: block;
  color: var(--text-secondary);
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 1px var(--border-color);
  background: var(--sw);
  padding: 0;
}

.swatch[aria-pressed=true] {
  box-shadow: 0 0 0 2px var(--sw);
}

.opt {
  flex: 1;
  padding: .5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: .82rem;
  font-weight: 500;
}

.opt[aria-pressed=true] {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), .08);
  color: var(--primary);
}

.cust-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1.1rem 0 .45rem;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
}

.palette-item:hover {
  background: rgba(var(--primary-rgb), .1);
}

.menu-wide {
  width: 360px;
  max-width: calc(100vw - 1.5rem);
}

.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.menu-list {
  max-height: 340px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .7rem 2rem .7rem 1rem;
  white-space: normal;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}

.notif-item:last-child {
  border-bottom: 0;
}

.notif-ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary);
}

.notif-item .nt {
  font-size: .875rem;
  line-height: 1.35;
}

.notif-item small {
  color: var(--text-secondary);
}

.notif-item.unread {
  background: rgba(var(--primary-rgb), .05);
}

.notif-item.unread .nt {
  font-weight: 600;
}

.notif-item.unread::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 1.1rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.menu-foot {
  display: block;
  text-align: center;
  padding: .7rem;
  border-top: 1px solid var(--border-color);
  font-weight: 500;
  font-size: .875rem;
  text-decoration: none;
}

.profile-menu {
  width: 280px;
}

.profile-head {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: 1rem;
}

.min-w-0 {
  min-width: 0;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
}

.profile-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
}

.profile-menu .dropdown-item i {
  color: var(--text-secondary);
}

.profile-menu .dropdown-item.text-danger i {
  color: inherit;
}

.profile-menu .opt {
  padding: .35rem;
  font-size: .78rem;
}

.profile-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.avatar-xl {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  font-size: .875rem;
  color: var(--text-secondary);
}

.profile-meta strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
}

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  padding: .6rem var(--card-pad);
  background: rgba(var(--primary-rgb), .08);
  border-bottom: 1px solid var(--border-color);
}

.bulk-bar[hidden] {
  display: none;
}

.doc-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary);
  flex: none;
}

/* ---------- Attendance sheet ---------- */
.att-group .btn {
  padding: .25rem .6rem;
  font-size: .78rem;
}

.dept-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary);
}

/* ---------- Course cards, builder, calendar, report card, chat, auth, states ---------- */

.course-thumb {
  height: 110px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  background: rgba(var(--tt-rgb), .12);
  color: var(--tt);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.course-card {
  transition: box-shadow .15s;
}

.course-card:hover {
  box-shadow: var(--shadow-md);
}

.drag-handle {
  cursor: grab;
  color: var(--text-secondary);
}

.dragging {
  opacity: .45;
}

.lesson-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lesson-list>li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem;
  margin-bottom: .5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--card-bg);
}

.accordion {
  --bs-accordion-bg: transparent;
  --bs-accordion-border-color: var(--border-color);
  --bs-accordion-btn-bg: var(--card-bg);
  --bs-accordion-btn-color: var(--text-primary);
  --bs-accordion-active-bg: rgba(var(--primary-rgb), .08);
  --bs-accordion-active-color: var(--primary);
  --bs-accordion-color: var(--text-primary);
}

.accordion-button:focus {
  box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .18);
}

.list-group {
  --bs-list-group-bg: var(--card-bg);
  --bs-list-group-border-color: var(--border-color);
  --bs-list-group-color: var(--text-primary);
  --bs-list-group-action-hover-bg: var(--muted-bg);
  --bs-list-group-active-bg: rgba(var(--primary-rgb), .1);
  --bs-list-group-active-color: var(--text-primary);
  --bs-list-group-active-border-color: var(--border-color);
}

.cal-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
}

.cal-head {
  padding: .5rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--muted-bg);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.cal-day {
  min-height: 104px;
  padding: .35rem;
  font-size: .8rem;
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.cal-day.blank {
  background: var(--muted-bg);
  opacity: .5;
}

.cal-num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 600;
}

.cal-day.today .cal-num {
  background: var(--primary);
  color: #fff;
}

.cal-chip {
  display: block;
  margin-top: 3px;
  padding: 2px 6px;
  overflow: hidden;
  font-size: .7rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--tt);
  background: rgba(var(--tt-rgb), .12);
}

.report-card {
  max-width: 860px;
  margin-inline: auto;
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.report-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.skel {
  display: block;
  background: var(--muted-bg);
  border-radius: var(--radius-sm);
  animation: skel 1.4s ease-in-out infinite;
}

@keyframes skel {
  0%,100%{opacity: 1}50%{opacity:.45};
}

.chat-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 560px;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
  max-height: 420px;
  overflow-y: auto;
  padding: 1rem;
}

.chat-msg {
  max-width: 75%;
  padding: .55rem .85rem;
  font-size: .875rem;
  border-radius: var(--radius-lg);
  background: var(--muted-bg);
}

.chat-msg.me {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-wrap {
  width: 100%;
  max-width: 440px;
}

.otp {
  display: flex;
  gap: .5rem;
  justify-content: center;
}

.otp input {
  width: 48px;
  height: 56px;
  font-size: 1.4rem;
  text-align: center;
}

.state-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-inline: auto;
  font-size: 1.5rem;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), .12);
  color: var(--primary);
}

.perm-table th,
.perm-table td {
  text-align: center;
}

.perm-table th:first-child,
.perm-table td:first-child {
  text-align: left;
}

.tt-s6 {
  --tt: #db2777;
  --tt-rgb: 219, 39, 119;
}

.invoice-sheet {
  max-width: 820px;
  margin-inline: auto;
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
