:root {
  --primary: #0f766e;
  --primary-dark: #0b4f49;
  --secondary: #f97316;
  --accent: #14b8a6;
  --ink: #0f172a;
  --soft-ink: #475569;
  --muted: #94a3b8;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --line: rgba(148, 163, 184, 0.22);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Poppins", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(
      circle at top left,
      rgba(20, 184, 166, 0.28),
      transparent 32%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(249, 115, 22, 0.18),
      transparent 30%
    ),
    linear-gradient(180deg, #f8fafc 0%, #eef6f8 100%);
}

a {
  text-decoration: none;
}

.guest-body::before,
.guest-body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: auto;
  border-radius: 50%;
  filter: blur(10px);
}

.guest-body::before {
  width: 320px;
  height: 320px;
  top: -80px;
  right: -60px;
  background: rgba(15, 118, 110, 0.18);
}

.guest-body::after {
  width: 280px;
  height: 280px;
  bottom: -60px;
  left: -60px;
  background: rgba(249, 115, 22, 0.14);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.6rem;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 28px 0;
}

.auth-card {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.5rem;
  align-items: stretch;
}

.auth-hero,
.glass-card,
.section-card,
.section-card-profil,
.metric-card,
.highlight-card,
.highlight-card-profil {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.auth-hero {
  border-radius: var(--radius-xl);
  padding: 2.4rem;
  background:
    linear-gradient(160deg, rgba(15, 118, 110, 0.94), rgba(11, 79, 73, 0.95)),
    linear-gradient(160deg, rgba(20, 184, 166, 0.16), transparent);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 48px;
  transform: rotate(20deg);
  right: -70px;
  bottom: -90px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.15;
  margin-bottom: 1rem;
  font-weight: 800;
}

.auth-hero p {
  color: rgba(255, 255, 255, 0.82);
}

.feature-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.75rem;
}

.feature-item,
.demo-box {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 1rem 1.1rem;
}

.feature-item strong,
.demo-box h2 {
  font-size: 1rem;
  display: block;
  margin-bottom: 0.25rem;
}

.glass-card {
  border-radius: var(--radius-xl);
  padding: 2rem;
}

.auth-form .form-label {
  font-weight: 600;
  color: var(--ink);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  border-radius: 14px;
}

.form-control,
.form-select {
  border: 1px solid rgba(148, 163, 184, 0.28);
  min-height: 48px;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(20, 184, 166, 0.12);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #12988f);
  border: none;
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #0d5d56, #0f766e);
}

.input-group .btn {
  border-radius: 0 14px 14px 0;
}

.dashboard-body {
  height: 100vh;
  overflow: hidden;
}

.app-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(20, 184, 166, 0.16), transparent 40%),
    linear-gradient(180deg, #082f2c 0%, #0b4f49 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 1030;
  overflow-y: auto;
}

.brand-panel {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #0f766e;
  font-size: 1.5rem;
}

.brand-icon img {
  width: 65px;
  height: 65px;
}

.brand-panel h2,
.sidebar-profile h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-panel p,
.sidebar-profile span {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  gap: 0.55rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.78);
  transition: 0.2s ease;
}

.sidebar-nav a i {
  font-size: 1rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.app-main {
  padding: 1.5rem;
  overflow-y: auto;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.4rem;
}

.page-title {
  font-size: clamp(1.5rem, 2.6vw, 2.3rem);
  margin-bottom: 0.25rem;
  font-weight: 800;
}

.page-subtitle {
  color: var(--soft-ink);
  max-width: 650px;
}

.topbar-chip {
  min-width: 180px;
  text-align: right;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.06);
}

.downloadPdf {
  display: flex;
  min-width: 180px;
  text-align: right;
  justify-content: space-between;
  border-radius: 18px;
}

.chip-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.app-content {
  display: grid;
  gap: 1.25rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-grid-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.metric-card,
.section-card,
.section-card-profil,
.highlight-card,
.highlight-card-profil {
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card a {
  margin-top: 20px;
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 24px;
  right: -32px;
  bottom: -36px;
  background: rgba(15, 118, 110, 0.08);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  background: rgba(15, 118, 110, 0.1);
  color: var(--primary);
}

.metric-card h3 {
  font-size: 2rem;
  margin: 0;
  font-weight: 800;
}

.metric-card p {
  margin: 0;
  color: var(--soft-ink);
}

.section-card h3,
.section-card-profil h3,
.highlight-card h3,
.highlight-card-profil h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.section-card p.section-lead,
.section-card-profil p.section-lead,
.highlight-card p.section-lead,
.highlight-card-profil p.section-lead {
  color: var(--soft-ink);
  margin-bottom: 1.2rem;
}

.table thead th {
  color: var(--soft-ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-width: 1px;
}

.table tbody td {
  vertical-align: middle;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--soft-ink);
}

.profile-progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.profile-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.content-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
.content-split-beranda-admin {
  display: grid;
  gap: 1rem;
}

.list-group-item {
  border-color: rgba(148, 163, 184, 0.15);
}

.info-pair {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.24);
}

.info-pair:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-pair span {
  color: var(--soft-ink);
}

.sidebar-backdrop {
  display: none;
}

.badge-soft {
  padding: 0.48rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

.search-form .form-control {
  min-height: 46px;
}

.hero-stat {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.hero-stat .demo-box {
  text-align: center;
}

.hero-stat strong {
  font-size: 1.5rem;
}

.mobile-menu-btn {
  display: none;
}

.rounded-circle {
  border: 2px solid #fff;
}

.highlight-card-profil img {
  transition: 0.3s;
}

.highlight-card-profil img:hover {
  transform: scale(1.05);
}

@media (max-width: 1199.98px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-split,
  .content-split-beranda-admin,
  .auth-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991.98px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;

    width: min(82vw, 300px);
    height: 100vh;

    overflow-y: auto;

    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 1020;
  }

  .sidebar-backdrop.is-visible {
    display: block;
  }

  .app-main {
    padding: 1rem;
  }

  .app-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-chip {
    text-align: left;
    min-width: auto;
  }

  .mobile-menu-btn {
    display: flex;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1050;

    width: 44px;
    height: 44px;

    align-items: center;
    justify-content: center;

    border-radius: 12px;
  }

  .mobile-menu-btn.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
/* ==================================
   GLOBAL MOBILE STYLES
   (max-width: 767.98px)
================================== */

@media (max-width: 767.98px) {
  /* ---------- LAYOUT & GRID ---------- */
  .hero-stat,
  .content-split .content-split-beranda-admin {
    grid-template-columns: 1fr;
  }

  /* ---------- CARD & KONTAINER ---------- */
  .glass-card,
  .auth-hero,
  .section-card,
  .section-card-profil,
  .metric-card,
  .highlight-card,
  .highlight-card-profil {
    padding: 1rem;
    border-radius: 18px;
  }

  .auth-shell {
    padding: 16px 0;
  }

  /* ---------- TYPOGRAPHY ---------- */
  .page-title {
    font-size: 1.4rem;
  }

  .page-subtitle {
    font-size: 0.9rem;
  }

  .section-card h3 .section-card-profil h3 {
    font-size: 1.2rem;
  }

  .section-lead {
    font-size: 0.9rem;
  }

  /* ---------- TABEL MENJADI CARD (UNIVERSAL) ---------- */
  .table-wrap {
    overflow: visible;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tr {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  }

  .table td {
    border: none;
    padding: 0.45rem 0;
    text-align: left !important;
  }

  .table td::before {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--soft-ink);
    margin-bottom: 0.2rem;
  }

  /* Default mapping kolom (bisa disesuaikan per halaman) */
  .table td:nth-child(1)::before {
    content: "No";
  }
  .table td:nth-child(2)::before {
    content: "Tanggal";
  }
  .table td:nth-child(3)::before {
    content: "Jam";
  }
  .table td:nth-child(4)::before {
    content: "Status";
  }
  .table td:nth-child(5)::before {
    content: "Keterangan";
  }
  .table td:nth-child(6)::before {
    content: "Aksi";
  }

  /* Tombol aksi dalam tabel */
  .table td:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .table td:last-child .btn,
  .table td:last-child form {
    flex: 1;
    min-width: 100px;
  }

  .table td:last-child form .btn {
    width: 100%;
  }

  /* ---------- FORM ---------- */
  .form-control,
  .form-select {
    font-size: 16px; /* mencegah zoom otomatis iPhone */
    min-height: 48px;
  }

  textarea.form-control {
    min-height: 120px;
  }

  .input-group .btn {
    min-width: 52px;
  }

  .row.g-3 > div {
    margin-bottom: 0.5rem;
  }

  .col-md-6,
  .col-12 {
    width: 100%;
  }

  /* ---------- INFO PAIR ---------- */
  .info-pair {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* ---------- TOMBOL & FLEX ---------- */
  .section-card .d-flex,
  .section-card-profil .d-flex,
  .highlight-card .d-flex,
  .highlight-card-profil .d-flex,
  .d-flex.flex-wrap.gap-2 {
    flex-direction: column;
  }

  .section-card .d-flex .btn,
  .section-card-profil .d-flex .btn,
  /* .highlight-card .btn, */
  .highlight-card-profil .btn,
  /* .btn-primary, */
  .search-form button {
    width: 100%;
  }

  .action-buttons .btn {
    width: 100%;
  }

  /* ---------- BADGE & LAINNYA ---------- */
  .badge {
    display: inline-block;
    margin-top: 0.25rem;
  }

  /* ---------- PROFIL ---------- */
  .profile-progress {
    margin-bottom: 1rem;
  }

  .highlight-card h3 .highlight-card-profil h3 {
    font-size: 1.25rem;
    word-break: break-word;
  }

  /* ---------- SISWA TERBARU (ADMIN) ---------- */
  .list-group-item .d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.25rem;
  }

  /* ---------- PENYESUAIAN URUTAN CARD (PROFILE) ---------- */
  .highlight-card {
    order: 2;
  }
  .section-card {
    order: 1;
  }
  .highlight-card-profil {
    order: 1;
  }
  .section-card-profil {
    order: 2;
  }
}

.attendance-mobile,
.activity-mobile,
.dashboard-attendance-mobile,
.dashboard-activity-mobile,
.admin-activity-mobile,
.admin-attendance-mobile,
.student-mobile-list {
  display: none;
}

/* Tampilkan di mobile */
@media (max-width: 767.98px) {
  .attendance-desktop,
  .activity-desktop,
  .dashboard-attendance-desktop,
  .dashboard-activity-desktop,
  .admin-activity-desktop,
  .admin-attendance-desktop,
  .table-wrap:not(.force-table) {
    display: none;
  }

  .attendance-mobile,
  .activity-mobile,
  .dashboard-attendance-mobile,
  .dashboard-activity-mobile,
  .admin-activity-mobile,
  .admin-attendance-mobile,
  .student-mobile-list {
    display: block;
  }

  /* Khusus halaman siswa: sembunyikan tabel, tampilkan card */
  .student-mobile-list {
    display: block;
  }
}

/* ==================================
   STYLE UNTUK MOBILE CARD (UNIVERSAL)
================================== */

.attendance-card,
.activity-card,
.dashboard-card,
.admin-card,
.student-mobile-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

/* Header & body card */
.attendance-card-header,
.activity-card-header,
.dashboard-card-header,
.admin-card-header,
.student-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.activity-card-header {
  margin-bottom: 1rem;
}

.student-mobile-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.attendance-card-body,
.activity-card-body,
.dashboard-card-body,
.admin-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Item dalam card */
.attendance-item,
.activity-item,
.dashboard-item,
.admin-item,
.student-mobile-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.student-mobile-item {
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}

.attendance-item span,
.activity-item span,
.dashboard-item span,
.admin-item span {
  color: var(--soft-ink);
  font-size: 0.9rem;
}

.student-mobile-item strong {
  color: var(--primary);
  font-size: 0.85rem;
}

.student-mobile-item span {
  color: var(--soft-ink);
  word-break: break-word;
}

.attendance-item strong,
.activity-item strong,
.admin-item strong {
  text-align: right;
  font-weight: 600;
}

/* Deskripsi & review (activity) */
.activity-description {
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  font-size: 0.9rem;
  line-height: 1.6;
}

.activity-review {
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  padding-top: 0.75rem;
}

.activity-review strong {
  display: block;
  margin-bottom: 0.35rem;
}

.activity-review p {
  margin: 0;
  color: var(--soft-ink);
}

/* Catatan (dashboard) */
.dashboard-note {
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--soft-ink);
  line-height: 1.5;
}

/* Footer card & aksi */
.attendance-card-footer,
.activity-card-footer,
.student-mobile-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.attendance-card-footer .btn,
.attendance-card-footer form,
.activity-card-footer .btn,
.activity-card-footer form,
.student-mobile-actions .btn,
.student-mobile-actions form,
.student-mobile-actions form button {
  flex: 1;
  width: 100%;
}

/* Mobile: kolom aksi jadi vertikal */
@media (max-width: 767.98px) {
  .attendance-card-footer,
  .activity-card-footer,
  .student-mobile-actions {
    flex-direction: column;
  }
}

/* ==================================
   RESPONSIVE DETAIL SISWA (HALAMAN DETAIL)
================================== */

@media (max-width: 767.98px) {
  .metric-grid-detail .metric-card {
    padding: 1rem;
  }

  .metric-grid-detail .metric-card h3 {
    font-size: 1.5rem;
  }

  /* Tabel riwayat (detail siswa) menjadi card */
  .detail-siswa-kegiatan td:nth-child(1)::before {
    content: "No";
  }

  .detail-siswa-kegiatan td:nth-child(2)::before {
    content: "Tanggal";
  }

  .detail-siswa-kegiatan td:nth-child(3)::before {
    content: "Kegiatan";
  }

  .detail-siswa-kegiatan td:nth-child(4)::before {
    content: "Status";
  }

  .detail-siswa-kegiatan td:nth-child(5)::before {
    content: "Catatan Guru";
  }

  .detail-siswa-kegiatan td:nth-child(6)::before {
    content: "Aksi";
  }

  table.guru-table td:nth-child(1)::before {
    content: "No";
  }

  table.guru-table td:nth-child(2)::before {
    content: "Nama";
  }

  table.guru-table td:nth-child(3)::before {
    content: "NIP";
  }

  table.guru-table td:nth-child(4)::before {
    content: "Kelas";
  }

  table.guru-table td:nth-child(5)::before {
    content: "Jurusan";
  }

  table.guru-table td:nth-child(6)::before {
    content: "Tempat PKL";
  }

  .table-wrap .btn {
    width: 100%;
    margin-top: 0.5rem;
  }

  .table-wrap strong {
    display: block;
    margin-bottom: 0.3rem;
  }

  .table-wrap .small {
    word-break: break-word;
  }
}

/* ==================================
  EKSTRA UNTUK LAYAR SANGAT KECIL (max-width: 576px)
================================== */

@media (max-width: 576px) {
  .section-card .section-card-profil {
    padding: 0.9rem;
    border-radius: 12px;
  }

  .form-label {
    font-size: 0.9rem;
  }

  .form-control,
  .form-select,
  .btn {
    font-size: 0.9rem;
  }
}
