:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-alt: #efe7dc;
  --text: #111111;
  --muted: #111111;
  --brand-blue: #2b3990;
  --brand-green: #00a651;
  --brand-blue-soft: #e8eeff;
  --brand-green-soft: #e7f8ef;
  --accent: #2b3990;
  --accent-dark: #1f2a72;
  --border: #d7cab8;
  --danger: #b00020;
  --success: #00a651;
  --warning-bg: #fff3d8;
  --success-bg: #e6f7ef;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f1ea;
  color: var(--text);
}

body.nav-drawer-open {
  overflow: hidden;
}

header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-nav {
  width: min(90vw, 1600px);
  max-width: none;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.75rem, 1vw, 1.4rem);
}

.nav-desktop {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(0.75rem, 1vw, 1.2rem);
}

.nav-desktop .links,
.nav-desktop .actions,
.nav-drawer .links,
.nav-drawer .actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-logo {
  width: clamp(2.9rem, 5vw, 3.5rem);
  height: auto;
  flex-shrink: 0;
}

.brand-label {
  min-width: 0;
}

.brand strong {
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--brand-blue);
  line-height: 1.1;
}

.nav-desktop .links {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: stretch;
  gap: 0.45rem;
  padding: 0.35rem;
  border: 1px solid rgba(43, 57, 144, 0.08);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(239, 231, 220, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 12px 28px rgba(82, 60, 36, 0.08);
}

.nav-desktop .links a {
  position: relative;
  display: inline-flex;
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  justify-content: center;
  padding: 0.72rem clamp(0.55rem, 0.85vw, 1rem);
  border-radius: 999px;
  font-size: clamp(0.76rem, 0.65rem + 0.28vw, 0.96rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.nav-desktop .actions {
  flex: 0 1 auto;
  width: fit-content;
  max-width: min(100%, clamp(13rem, 28vw, 22rem));
  min-width: 0;
  margin-left: auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.35rem;
  border: 1px solid rgba(43, 57, 144, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.nav-desktop .actions .muted,
.nav-drawer .actions .muted {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(100%, clamp(9rem, 21vw, 17rem));
  gap: 0.55rem;
  padding: 0.55rem 0.95rem 0.55rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(232, 238, 255, 0.86), rgba(231, 248, 239, 0.76));
  color: rgba(17, 17, 17, 0.8);
  font-weight: 600;
}

.nav-user-chip__text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(0.75rem, 0.68rem + 0.2vw, 0.92rem);
  line-height: 1.2;
}

.nav-user-chip::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-green), #57bf87);
  box-shadow: 0 0 0 5px rgba(0, 166, 81, 0.12);
  flex-shrink: 0;
}

.nav-drawer .actions .muted {
  display: flex;
  width: 100%;
  justify-content: center;
  text-align: center;
}

.nav-drawer .nav-user-chip {
  justify-content: center;
}

.nav-drawer .nav-user-chip__text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.nav-drawer {
  display: none;
}

.nav-backdrop,
.nav-menu__header,
.menu-close {
  display: none;
}

.nav-drawer-title {
  color: var(--brand-blue);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.card,
.panel,
form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(82, 60, 36, 0.08);
}

.panel,
form,
.table-wrap,
.card {
  padding: 1rem;
}

.card,
.panel,
form,
.table-wrap {
  min-width: 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.summary {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover,
.card-link:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 18px 36px rgba(82, 60, 36, 0.14);
  transform: translateY(-2px);
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.summary .card strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 0.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #fffdf9;
}

input[type="date"],
input[type="month"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

textarea {
  min-height: 140px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 0.7rem 1rem;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.button.secondary,
button.secondary {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border: 1px solid rgba(43, 57, 144, 0.14);
}

.button.success,
button.success {
  background: linear-gradient(135deg, #0f8b53, #1db86a);
  color: #ffffff;
  border: 1px solid rgba(10, 106, 62, 0.18);
}

.button[aria-disabled="true"] {
  pointer-events: none;
  cursor: default;
}

.button.danger,
button.danger {
  background: var(--danger);
}

.menu-toggle {
  display: none;
  padding: 0.7rem;
  min-width: 2.9rem;
  border: 1px solid rgba(43, 57, 144, 0.22);
  border-radius: 14px;
  background: rgba(43, 57, 144, 0.08);
  color: var(--brand-blue);
  box-shadow: none;
  flex-direction: column;
  gap: 0.28rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.menu-toggle__bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

a {
  color: var(--accent-dark);
}

.nav-desktop .links a,
.nav-drawer .links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-desktop .links a:hover,
.nav-desktop .links a:focus-visible {
  color: var(--brand-blue);
  background: rgba(43, 57, 144, 0.08);
  box-shadow: inset 0 0 0 1px rgba(43, 57, 144, 0.08);
  transform: translateY(-1px);
}

.nav-desktop .links a[aria-current="page"] {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue), #425cc2);
  box-shadow: 0 12px 22px rgba(43, 57, 144, 0.22);
}

.nav-desktop .links a[aria-current="page"]:hover,
.nav-desktop .links a[aria-current="page"]:focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #3142a1, #4d69d8);
  box-shadow: 0 14px 24px rgba(43, 57, 144, 0.24);
}

.nav-drawer .links a:hover,
.nav-drawer .links a:focus-visible {
  color: var(--brand-blue);
}

.nav-drawer .links a[aria-current="page"] {
  color: var(--brand-blue);
  border-color: rgba(43, 57, 144, 0.22);
  background: rgba(232, 238, 255, 0.92);
}

.nav-desktop .links a:focus-visible,
.nav-drawer .links a:focus-visible,
.nav-desktop .actions button:focus-visible,
.nav-drawer .actions button:focus-visible {
  outline: 3px solid rgba(43, 57, 144, 0.18);
  outline-offset: 2px;
}

.nav-desktop .actions form {
  flex: 0 0 auto;
}

.nav-desktop .actions button.secondary {
  white-space: nowrap;
  background: rgba(43, 57, 144, 0.08);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-desktop .actions button.secondary:hover,
.nav-desktop .actions button.secondary:focus-visible {
  background: var(--brand-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

audio {
  width: 100%;
  max-width: 100%;
}

code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

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

.visually-hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

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

.table-wrap th {
  color: var(--muted);
  font-size: 0.92rem;
}

.attendance-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: capitalize;
}

.attendance-status-pill--accepted {
  background: rgba(0, 166, 81, 0.12);
  border-color: rgba(0, 166, 81, 0.18);
  color: #0c7441;
}

.attendance-status-pill--rejected {
  background: rgba(176, 0, 32, 0.08);
  border-color: rgba(176, 0, 32, 0.18);
  color: #8f1634;
}

.attendance-status-preview-trigger {
  cursor: zoom-in;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.attendance-status-preview-trigger:hover,
.attendance-status-preview-trigger:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(43, 57, 144, 0.12);
}

.attendance-image-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 120;
  width: min(250px, calc(100vw - 2rem));
  padding: 0.55rem;
  border: 1px solid rgba(43, 57, 144, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(43, 36, 28, 0.22);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.attendance-image-preview.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.attendance-image-preview__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #f7f2ea;
}

.attendance-image-modal-open {
  overflow: hidden;
}

.attendance-image-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.attendance-image-modal.is-visible {
  display: flex;
}

.attendance-image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 20, 16, 0.72);
}

.attendance-image-modal__dialog {
  position: relative;
  width: min(90vw, 1200px);
  max-height: 90vh;
  padding: 1rem;
  border: 1px solid rgba(43, 57, 144, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 24px 56px rgba(24, 20, 16, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.attendance-image-modal__close {
  align-self: flex-end;
}

.attendance-image-modal__image {
  width: 100%;
  max-height: calc(90vh - 5rem);
  object-fit: contain;
  border-radius: 16px;
  background: #f7f2ea;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.split {
  justify-content: space-between;
  align-items: flex-start;
}

.split > * {
  min-width: 0;
}

.filter-form {
  align-items: flex-end;
}

.filter-field {
  flex: 1 1 220px;
  min-width: 220px;
}

.media-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem;
  background: #fffdf8;
}

.media-item img,
.media-item video {
  max-width: 100%;
  border-radius: 12px;
}

.camera-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 14rem;
  object-fit: contain;
  background: #101821;
}

.attendance-media-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  align-items: start;
}

.attendance-camera-card,
.attendance-preview-card {
  width: min(100%, 22rem);
  justify-self: center;
}

.attendance-preview-image {
  width: 100%;
  max-height: 14rem;
  object-fit: contain;
  background: #f7f2ea;
}

@media (min-width: 761px) {
  .attendance-media-layout {
    align-items: stretch;
  }

  .attendance-camera-card,
  .attendance-preview-card {
    height: 100%;
  }

  .camera-preview,
  .attendance-preview-image {
    height: 14rem;
  }
}

.hero {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.4fr 1fr;
}

.notice {
  border-left: 4px solid var(--accent);
  padding-left: 0.9rem;
}

.login-shell {
  max-width: 420px;
  margin: 4rem auto;
}

.subnav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.subnav a {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  background: var(--surface-alt);
}

.subnav a.active {
  background: var(--accent);
  color: #fff;
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.alert.success {
  background: var(--success-bg);
  border-color: #b9dfc2;
}

.alert.error {
  background: var(--warning-bg);
  border-color: #ebcc87;
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row input {
  width: auto;
}

.danger-zone {
  border-color: #efc4cb;
  background: #fff6f7;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9rem;
}

.nav-desktop .actions form,
.nav-drawer .actions form,
.inline-form {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.table-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.table-actions .button,
.table-actions button {
  padding: 0.5rem 0.85rem;
}

@media (max-width: 900px) {
  header {
    position: static;
  }

  .site-nav {
    padding: 0.9rem 1rem;
  }

  .nav-desktop {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .menu-toggle.is-open .menu-toggle__bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-toggle.is-open .menu-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open .menu-toggle__bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-drawer {
    display: block;
    position: fixed;
    inset: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 60;
  }

  .nav-drawer.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  .nav-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(43, 36, 28, 0.7);
  }

  .nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(84vw, 320px);
    padding: 1rem;
    background: var(--surface);
    border-left: 1px solid rgba(43, 57, 144, 0.12);
    box-shadow: -20px 0 44px rgba(43, 36, 28, 0.18);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.24s ease;
  }

  .nav-drawer.is-open .nav-panel {
    transform: translateX(0);
  }

  .nav-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .menu-close {
    display: inline-flex;
    width: auto;
    box-shadow: none;
  }

  .nav-drawer .links,
  .nav-drawer .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .nav-drawer .links a {
    display: block;
    width: 100%;
    white-space: normal;
    text-align: left;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(43, 57, 144, 0.14);
    border-radius: 14px;
    background: rgba(232, 238, 255, 0.55);
    text-decoration: none;
  }

  .nav-drawer .actions form,
  .nav-drawer .actions button {
    width: 100%;
  }

  main {
    padding: 1rem 1rem 2rem;
  }
}

@media (max-width: 760px) {
  .brand {
    gap: 0.65rem;
  }

  .brand-logo {
    width: 2.7rem;
  }

  .hero,
  .grid.two,
  .grid.summary,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .split,
  .inline {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-form {
    align-items: stretch;
  }

  .filter-field {
    min-width: 0;
    width: 100%;
  }

  .inline form,
  .split form,
  .inline .button,
  .inline button,
  .split .button,
  .split button,
  .table-actions .button,
  .table-actions button,
  .table-actions form {
    width: 100%;
  }

  .inline .pill,
  .split .pill {
    align-self: flex-start;
  }

  .subnav a {
    flex: 1 1 140px;
    text-align: center;
  }

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

  .login-shell {
    margin: 2rem auto;
  }
}



