/* Khidmah Roster — layout and components (spec 06). */

/* Page container. */
.page { max-width: 960px; margin: 0 auto; padding: 16px; }
.header-row { display: flex; justify-content: flex-end; max-width: 960px; margin: 0 auto; padding: 12px 16px 0; }
.tabs { display: flex; gap: 8px; margin: 18px 0 16px; }
.tabs [role="tab"] {
  min-height: 44px; padding: 8px 22px;
  border: none; border-bottom: 3px solid transparent; border-radius: 999px 999px 6px 6px;
  background-color: transparent; color: var(--emerald-900);
  font: inherit; font-weight: 600; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.tabs [role="tab"]:hover { background-color: var(--emerald-100); }
.tabs [role="tab"][aria-selected="true"] { background-color: var(--emerald-700); color: #ffffff; border-bottom-color: var(--gold-500); }
.tabs [role="tab"]:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

/* Panels. */
section[role="tabpanel"] { min-height: 200px; }
section[role="tabpanel"]:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.placeholder { margin: 0; padding: 48px 0; text-align: center; color: var(--ink-soft); }

/* Card base (day cards, calendar cells). */
.card {
  margin-bottom: 16px; border: 1px solid var(--gold-500); border-radius: var(--radius);
  background-color: var(--sand); box-shadow: var(--shadow); overflow: hidden;
}
.card-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 10px 16px; background-color: var(--emerald-900); color: #ffffff; }
.card-body { padding: 16px; }

/* Day card (Tab 1): star + title + badge, Hijri line below. */
.day-head { flex-direction: column; align-items: stretch; gap: 2px; padding: 12px 16px; }
.day-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.star { color: var(--gold-300); }
.day-title { margin: 0; font-size: 1.25rem; color: #ffffff; }
.hijri { margin: 0; font-size: .85rem; color: var(--gold-300); }

/* Roles table: Job | Student. No vertical lines, striped rows. */
.roles { width: 100%; border-collapse: collapse; }
.roles th, .roles td { padding: 10px 8px; text-align: left; vertical-align: top; }
.roles thead th { border-bottom: 2px solid var(--gold-500); color: var(--ink-soft); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.roles tbody tr:nth-child(even) { background-color: var(--emerald-100); }
.roles td.job { width: 55%; }
.job-icon { margin-right: 8px; }
.job-name { font-weight: 600; }
.job-desc { display: block; margin-top: 2px; color: var(--ink-soft); }
.student-name { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.3; }
.no-one { color: var(--ink-soft); font-style: italic; }

/* Swap / manual chips, below the student name. */
.chip { display: block; width: fit-content; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.chip-swap { border: 1px solid var(--emerald-700); background-color: var(--emerald-100); color: var(--emerald-700); }
.chip-manual { background-color: var(--emerald-100); color: var(--emerald-900); }

/* Teacher actions (T13): small labels, full 44px tap target. */
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.act {
  min-height: 44px; padding: 6px 14px; font-size: .8rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--emerald-700); border-radius: 999px;
  background-color: var(--sand); color: var(--emerald-900);
  transition: background-color 150ms ease;
}
.act:hover { background-color: var(--emerald-100); }
.act:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 1px; }
.card-actions .act { background-color: var(--emerald-900); color: #ffffff; border-color: var(--emerald-900); }
.card-actions .act:hover { background-color: var(--emerald-700); }

/* Muted in-card messages (cancelled day, empty roster). */
.day-msg { margin: 4px 0; color: var(--ink-soft); }
.day-msg-strong { color: var(--ink); font-weight: 600; }
/* Cancelled day: midnight header. */
.day-card.cancelled .card-header { background-color: var(--midnight); }
/* "Tomorrow: Sunday, November 8" line under the Saturday card. */
.tomorrow { margin: 0 0 16px; padding: 0 6px; color: var(--ink-soft); }
.tomorrow a { color: var(--emerald-700); font-weight: 600; }
/* Error card with Retry, and skeleton rows while loading. */
.error-box { text-align: center; }
.error-box .btn { margin-top: 8px; }
.skel-row { display: flex; gap: 12px; padding: 9px 0; }

/* Action dialogs (T13): form fields, inline error, actions. */
.act-dialog { width: min(420px, 92vw); }
.act-form { display: flex; flex-direction: column; gap: 10px; }
.act-form select, .act-form input[type="text"] {
  min-height: 44px; padding: 6px 10px; border: 1px solid var(--emerald-700);
  border-radius: 8px; background-color: #ffffff; color: var(--ink); font: inherit;
}
.act-form select:focus-visible, .act-form input[type="text"]:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 1px; }
.act-form label { font-weight: 600; }
.act-form .dialog-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; padding: 4px 0 0; }

/* Responsive. */
@media (max-width: 700px) {
  .page { padding: 12px; }
  .header-row { padding: 8px 12px 0; }
  .header-plate { padding: 20px 16px 16px; }
  .bismillah { font-size: 1.4rem; }
  .title { font-size: 1.7rem; }
  .tabs { margin-top: 14px; }
  .card-body { padding: 12px; }
  .roles td { padding: 10px 6px; }
  .roles td.job { width: auto; }
  #drawer { width: 100vw; }
}
