/* ==========================================================================
   PadhaiTrack - Dynamic Solution Demo Design System
   Structurally different from every prior demo: this is a dashboard APP
   mockup (sidebar nav, data tables, stat cards), not a marketing site.
   Emerald + violet - a fresh SaaS/product feel, distinct from every
   marketing-site palette used so far.
   ========================================================================== */

:root {
  --pt-emerald: #0a7a54;
  --pt-emerald-dark: #0a6b4a;
  --pt-emerald-darker: #063d2a;
  --pt-violet: #5b3fd9;
  --pt-sidebar-active: #b8f2dc;
  --pt-bg: #f6f8f7;
  --pt-white: #ffffff;
  --pt-charcoal: #1c2620;
  --pt-ink: #566259;
  --pt-border: #dce6e0;

  --pt-font-heading: 'Plus Jakarta Sans', sans-serif;
  --pt-font-body: 'DM Sans', sans-serif;

  --pt-space-2: 8px;
  --pt-space-3: 16px;
  --pt-space-4: 24px;
  --pt-space-5: 32px;
  --pt-space-6: 48px;

  --pt-radius: 10px;
}

.pt-body {
  margin: 0;
  font-family: var(--pt-font-body);
  color: var(--pt-ink);
  background: var(--pt-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.pt-body * {
  box-sizing: border-box;
}
.pt-body a {
  color: inherit;
  text-decoration: none;
}
.pt-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pt-body table {
  border-collapse: collapse;
  width: 100%;
}

.pt-h1,
.pt-h2,
.pt-h3 {
  font-family: var(--pt-font-heading);
  color: var(--pt-charcoal);
  line-height: 1.2;
  margin: 0 0 var(--pt-space-2);
  font-weight: 700;
}
.pt-h1 {
  font-size: 1.6rem;
}
.pt-h2 {
  font-size: 1.15rem;
}
.pt-h3 {
  font-size: 1rem;
}

/* ---- SmartWebMakers demo banner ---- */
.pt-demo-banner {
  background: #0b2545;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  padding: 10px var(--pt-space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--pt-space-3);
  flex-wrap: wrap;
  text-align: center;
}
.pt-demo-banner a {
  background: #f36136;
  color: #0b2545;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* ---- App shell: sidebar + main content ---- */
.pt-shell {
  display: flex;
  min-height: 100vh;
}
.pt-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--pt-emerald-darker);
  padding: var(--pt-space-4) var(--pt-space-3);
  display: flex;
  flex-direction: column;
}
.pt-sidebar-logo {
  font-family: var(--pt-font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pt-white);
  padding: var(--pt-space-2) var(--pt-space-2) var(--pt-space-4);
}
.pt-sidebar-logo span {
  color: var(--pt-sidebar-active);
}
.pt-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px var(--pt-space-3);
  border-radius: var(--pt-radius);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.pt-sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--pt-white);
}
.pt-sidebar-nav a.is-active {
  background: var(--pt-emerald-dark);
  color: var(--pt-sidebar-active);
}
.pt-sidebar-role-switch {
  margin-top: auto;
  padding-top: var(--pt-space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.pt-sidebar-role-switch p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 var(--pt-space-2) var(--pt-space-2);
}

.pt-main {
  flex: 1;
  min-width: 0;
}
.pt-topbar {
  background: var(--pt-white);
  border-bottom: 1px solid var(--pt-border);
  padding: var(--pt-space-3) var(--pt-space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--pt-space-3);
}
.pt-topbar-title {
  font-family: var(--pt-font-heading);
  font-weight: 700;
  color: var(--pt-charcoal);
}
.pt-sample-tag {
  background: #fff3e0;
  color: #8a5a00;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.pt-content {
  padding: var(--pt-space-5);
}

/* ---- Buttons ---- */
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  min-height: 42px;
  border-radius: var(--pt-radius);
  font-weight: 700;
  font-family: var(--pt-font-body);
  font-size: 0.88rem;
  border: 2px solid transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}
.pt-btn:focus-visible {
  outline: 2px solid var(--pt-violet);
  outline-offset: 2px;
}
.pt-btn-emerald {
  background: var(--pt-emerald);
  color: var(--pt-white);
}
.pt-btn-violet {
  background: var(--pt-violet);
  color: var(--pt-white);
}
.pt-btn-outline {
  background: transparent;
  color: var(--pt-emerald);
  border-color: var(--pt-emerald);
}

/* ---- Stat cards ---- */
.pt-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--pt-space-3);
  margin-bottom: var(--pt-space-5);
}
.pt-stat-card {
  background: var(--pt-white);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  padding: var(--pt-space-4);
}
.pt-stat-num {
  font-family: var(--pt-font-heading);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--pt-charcoal);
  display: block;
}
.pt-stat-label {
  font-size: 0.8rem;
  color: var(--pt-ink);
}

/* ---- Cards & tables ---- */
.pt-card {
  background: var(--pt-white);
  border: 1px solid var(--pt-border);
  border-radius: var(--pt-radius);
  padding: var(--pt-space-4);
  margin-bottom: var(--pt-space-4);
}
.pt-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pt-ink);
  padding: var(--pt-space-2) var(--pt-space-3);
  border-bottom: 2px solid var(--pt-border);
}
.pt-table td {
  padding: var(--pt-space-3);
  border-bottom: 1px solid var(--pt-border);
  font-size: 0.92rem;
}
.pt-table tr:last-child td {
  border-bottom: none;
}

.pt-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  font-family: var(--pt-font-body);
}
button.pt-badge {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
button.pt-badge:focus-visible {
  outline: 2px solid var(--pt-violet);
  outline-offset: 2px;
}
.pt-badge-paid {
  background: #e1f5ea;
  color: #0a6b4a;
}
.pt-badge-pending {
  background: #fff3e0;
  color: #8a5a00;
}
.pt-badge-overdue {
  background: #fde7e3;
  color: #b3401e;
}
.pt-badge-present {
  background: #e1f5ea;
  color: #0a6b4a;
}
.pt-badge-absent {
  background: #fde7e3;
  color: #b3401e;
}

.pt-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pt-emerald);
  color: var(--pt-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pt-font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: var(--pt-space-2);
  vertical-align: middle;
}

.pt-qr-box {
  width: 140px;
  height: 140px;
  background: repeating-conic-gradient(
      var(--pt-charcoal) 0% 25%,
      var(--pt-white) 0% 50%
    )
    50% / 12px 12px;
  border: 1px solid var(--pt-border);
  border-radius: 8px;
  margin: 0 auto var(--pt-space-3);
}

/* ---- Landing page (marketing intro, before the dashboard mockup) ---- */
.pt-landing-hero {
  background: var(--pt-emerald-darker);
  padding: 64px 0;
  text-align: center;
}
.pt-landing-hero .pt-h1 {
  color: var(--pt-white);
  font-size: clamp(1.9rem, 3.3vw + 1rem, 2.7rem);
}
.pt-landing-sub {
  color: rgba(255, 255, 255, 0.8);
  max-width: 52ch;
  margin: 0 auto var(--pt-space-4);
  font-size: 1.05rem;
}
.pt-landing-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pt-sidebar-active);
  margin-bottom: var(--pt-space-3);
}

/* ---- SmartWebMakers conversion elements ---- */
.swm-float-cta {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #f36136;
  color: #0b2545;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.28);
  z-index: 600;
}
.swm-float-cta:hover {
  background: #ef5b28;
}

/* ---- Bar chart (pure CSS, no JS library needed for a mockup) ---- */
.pt-chart {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 140px;
  padding-top: 12px;
}
.pt-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.pt-chart-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 6px 6px 0 0;
  background: var(--pt-emerald);
  transition: opacity 0.15s;
}
.pt-chart-bar.is-current {
  background: var(--pt-violet);
}
.pt-chart-label {
  font-size: 0.72rem;
  color: var(--pt-ink);
}
.pt-chart-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pt-charcoal);
}

/* ---- Attendance dot trend (visual history, not just a %) ---- */
.pt-dot-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.pt-dot {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}
.pt-dot.present {
  background: var(--pt-emerald);
}
.pt-dot.absent {
  background: #e8998a;
}

/* ---- Student profile header ---- */
.pt-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--pt-space-4);
  flex-wrap: wrap;
}
.pt-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pt-emerald);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pt-font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.pt-profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pt-clickable-name {
  color: var(--pt-charcoal);
  font-weight: 700;
  cursor: pointer;
}
.pt-clickable-name:hover {
  color: var(--pt-emerald);
  text-decoration: underline;
}

/* ---- Interactive attendance toggle (client-side only, nothing persists) ---- */
.pt-toggle-group {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--pt-border);
}
.pt-toggle-btn {
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--pt-white);
  color: var(--pt-ink);
  border: none;
  cursor: pointer;
  font-family: var(--pt-font-body);
}
.pt-toggle-btn.present-on {
  background: var(--pt-emerald);
  color: #fff;
}
.pt-toggle-btn.absent-on {
  background: #c0432c;
  color: #fff;
}

/* ---- Toast confirmation (client-side only) ---- */
.pt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--pt-charcoal);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--pt-font-body);
  font-weight: 700;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pt-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Login screen (visual mockup only - no real form submission) ---- */
.pt-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--pt-emerald-darker);
}
.pt-login-card {
  background: var(--pt-white);
  border-radius: var(--pt-radius);
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
}
.pt-login-logo {
  text-align: center;
  font-family: var(--pt-font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--pt-charcoal);
  margin-bottom: 4px;
}
.pt-login-logo span {
  color: var(--pt-emerald);
}
.pt-login-role {
  text-align: center;
  color: var(--pt-ink);
  font-size: 0.85rem;
  margin-bottom: 28px;
}
.pt-login-field {
  margin-bottom: 16px;
}
.pt-login-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--pt-charcoal);
  margin-bottom: 6px;
}
.pt-login-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 2px solid var(--pt-border);
  border-radius: var(--pt-radius);
  font-family: var(--pt-font-body);
  font-size: 0.95rem;
  color: var(--pt-charcoal);
}
.pt-login-field input:focus {
  outline: none;
  border-color: var(--pt-emerald);
}
.pt-otp-row {
  display: flex;
  gap: 8px;
}
.pt-otp-row input {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 10px 0;
}
.pt-login-btn {
  width: 100%;
  margin-top: 8px;
}
.pt-login-demo-note {
  margin-top: 20px;
  padding: 10px 12px;
  background: var(--pt-bg);
  border-radius: var(--pt-radius);
  font-size: 0.78rem;
  color: var(--pt-ink);
  text-align: center;
  font-style: italic;
}

/* ---- Toast (lightweight interactivity on decorative buttons - client-side only, no data sent anywhere) ---- */
.pt-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--pt-charcoal);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--pt-radius);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 1000;
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.pt-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
[data-demo-action] {
  cursor: pointer;
}
[data-toggle-attendance] {
  cursor: pointer;
  user-select: none;
}

/* ---- Student profile ---- */
.pt-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: var(--pt-space-4);
}
.pt-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pt-emerald);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pt-font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.pt-link {
  color: var(--pt-violet);
  font-weight: 700;
}
.pt-link:hover {
  text-decoration: underline;
}

.pt-child-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--pt-font-body);
  cursor: pointer;
}
.pt-child-pill:focus-visible {
  outline: 2px solid var(--pt-violet);
  outline-offset: 2px;
}

/* ---- Mobile ---- */
@media (max-width: 900px) {
  .pt-shell {
    flex-direction: column;
  }
  .pt-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: var(--pt-space-3);
  }
  .pt-sidebar-logo {
    padding: 0 var(--pt-space-3) 0 0;
  }
  .pt-sidebar-nav {
    display: flex;
    gap: 4px;
  }
  .pt-sidebar-nav a {
    white-space: nowrap;
  }
  .pt-sidebar-role-switch {
    display: none;
  }
  .pt-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .pt-content {
    padding: var(--pt-space-3);
  }
  .pt-stat-grid {
    grid-template-columns: 1fr;
  }
  .pt-btn {
    width: 100%;
  }
  .pt-chart {
    gap: 6px;
    height: 110px;
  }
  .pt-chart-bar {
    max-width: 26px;
  }
  .pt-chart-value {
    font-size: 0.62rem;
  }
  .pt-dot {
    width: 13px;
    height: 13px;
  }
  .swm-float-cta {
    right: 12px;
    bottom: 12px;
    padding: 10px 16px;
    font-size: 0.78rem;
  }
}
