/* ============================================================
   Style — Ma'had Al-Islam Nurul Hidayah
   ============================================================ */

:root {
  --hijau:        #15803d;
  --hijau-tua:    #14532d;
  --hijau-muda:   #dcfce7;
  --teks:         #1f2937;
  --teks-lembut:  #4b5563;
  --bg:           #f8fafc;
  --putih:        #ffffff;
  --border:       #e5e7eb;
  --merah:        #dc2626;
  --kuning:       #d97706;
  --biru:         #2563eb;
  --radius:       12px;
  --shadow:       0 2px 12px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--teks);
  background: var(--bg);
  overflow-x: hidden; /* Cegah layar bergeser ke kanan */
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--hijau); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--hijau-tua); line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header publik ---------- */
.site-header {
  background: var(--putih);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--hijau-tua);
  font-weight: 700;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 40px;
  border-radius: 8px;
  background: transparent;
}

.brand-text { font-size: 15px; line-height: 1.2; max-width: 200px; }

.nav-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  background: var(--putih);
  border-radius: 10px;
  font-size: 20px;
  cursor: pointer;
  color: var(--hijau-tua);
}

.site-nav {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--putih);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px 16px;
  gap: 2px;
  box-shadow: var(--shadow);
}

body.nav-open .site-nav { display: flex; }

.site-nav a {
  padding: 12px 10px;
  border-radius: 8px;
  color: var(--teks);
  font-weight: 500;
}
.site-nav a:hover { background: var(--hijau-muda); text-decoration: none; }
.site-nav a.active { color: var(--hijau); font-weight: 700; }

.btn-nav, .btn-nav-outline, .btn-nav-login {
  display: inline-block;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 6px;
}
.btn-nav { background: var(--hijau); color: #fff; }
.btn-nav:hover { background: var(--hijau-tua); text-decoration: none; color: #fff; }
.btn-nav-outline { border: 1px solid var(--border); color: var(--teks); }
.btn-nav-outline:hover { background: #f3f4f6; text-decoration: none; }

.btn-nav-login { background-color: #f59e0b; color: #1f2937; font-weight: 700; }
.btn-nav-login:hover { background-color: #d97706; text-decoration: none; color: #1f2937; }

/* ---------- Main & Hero ---------- */
.site-main { padding: 24px 0 48px; min-height: 60vh; }

.hero {
  background: linear-gradient(135deg, var(--hijau-tua), var(--hijau));
  color: #fff;
  border-radius: 16px; 
  padding: 40px 24px;
  margin-bottom: 32px;
  box-shadow: 0 10px 25px rgba(20, 83, 45, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero h1 { color: #fff; margin-bottom: 12px; font-size: 1.8rem; line-height: 1.3; }
.hero p { color: #e6f4ea; margin-bottom: 24px; font-size: 1rem; opacity: 0.9; max-width: 600px;}

.hero .btn-primary {
  background: #ffffff;
  color: var(--hijau-tua);
  border-radius: 50px;
  padding: 14px 40px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  width: auto;
}

.hero .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
  background: #f8fafc;
}

/* ---------- Tombol Umum ---------- */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
  min-height: 48px;
}
.btn-primary { background: var(--hijau); color: #fff; }
.btn-primary:hover { background: var(--hijau-tua); text-decoration: none; color: #fff; }
.btn-secondary { background: #e5e7eb; color: var(--teks); }
.btn-secondary:hover { background: #d1d5db; text-decoration: none; }
.btn-danger { background: var(--merah); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; color: #fff; }
.btn-sm { padding: 8px 12px; font-size: 14px; min-height: 40px; border-radius: 8px; }

/* Tombol Login Utama */
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px 20px; font-size: 16px; font-weight: 700;
  color: #1f2937; background-color: #f59e0b; border: none;
  border-radius: 10px; cursor: pointer; min-height: 48px; transition: background-color 0.2s;
}
.btn-login:hover { background-color: #d97706; }

/* ---------- Kartu & Section ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

.card {
  background: var(--putih);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s;
  overflow-wrap: break-word; word-wrap: break-word;
}
.card:hover { transform: translateY(-2px); }
.card h3 { margin-top: 0; font-size: 1.25rem; margin-bottom: 12px; color: #15803d; border-bottom: 2px solid #dcfce7; padding-bottom: 8px; display: inline-block;}
.card p:last-child { margin-bottom: 0; }

.card-pengumuman .tanggal {
  display: inline-block; font-size: 13px; color: var(--teks-lembut);
  background: #f3f4f6; padding: 2px 10px; border-radius: 999px; margin-bottom: 10px;
}

.section { margin-bottom: 40px; }
.section-title { font-size: 1.4rem; margin-bottom: 20px; position: relative; }
.section-title::after {
  content: ''; display: block; width: 40px; height: 3px;
  background: #f59e0b; margin-top: 6px; border-radius: 2px;
}

/* ---------- Form ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.form-control, select, textarea {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: inherit;
  color: var(--teks); background: var(--putih); border: 1px solid #cbd5e1;
  border-radius: 10px; min-height: 48px;
}
.form-control:focus, select:focus, textarea:focus { outline: 3px solid #bbf7d0; border-color: var(--hijau); }
textarea { min-height: 100px; resize: vertical; }
.form-actions { margin-top: 20px; }
.form-actions .btn-primary { width: 100%; }

/* ---------- Alert ---------- */
.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 15px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #dbeafe; color: #1e3a8a; }

/* ---------- Tabel ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; background: var(--putih); font-size: 15px; }
table.data th, table.data td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: #f9fafb; font-weight: 700; color: var(--hijau-tua); font-size: 14px; }
table.data tr:hover td { background: #f9fafb; }

/* ---------- Badge status ---------- */
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge-hadir, .badge-sudah, .badge-diterima, .badge-aktif { background: #dcfce7; color: #166534; }
.badge-sakit { background: #fef3c7; color: #92400e; }
.badge-izin, .badge-lulus  { background: #dbeafe; color: #1e3a8a; }
.badge-alpa, .badge-belum, .badge-ditolak { background: #fee2e2; color: #991b1b; }
.badge-baru, .badge-keluar  { background: #f3f4f6; color: #374151; }

/* ---------- Login ---------- */
.login-wrap {
  max-width: 400px; margin: 40px auto; background: var(--putih);
  padding: 28px 24px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border);
}
.login-wrap h1 { text-align: center; margin-bottom: 4px; }
.login-wrap .sub { text-align: center; color: var(--teks-lembut); margin-bottom: 24px; font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--hijau-tua); color: #d1fae5; margin-top: 40px; font-size: 15px; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 28px 16px; }
.site-footer strong { color: #fff; font-size: 18px; margin: 0; }
.site-footer p { margin: 4px 0; color: #bbf7d0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 14px 0; font-size: 14px; text-align: center; color: #a7f3d0; }

.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.footer-logo { width: 44px; height: 44px; object-fit: contain; background: #ffffff; border-radius: 8px; padding: 4px; }

/* ---------- Utilities & Kustom Profil ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.muted { color: var(--teks-lembut); font-size: 14px; }

.kelompok-jabatan { margin-top: 32px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; }
.kelompok-jabatan h3 { margin: 0; font-size: 18px; color: #15803d; white-space: nowrap; }
.garis-pemisah { flex: 1; height: 2px; background-color: #dcfce7; border-radius: 2px; }

.kartu-nama {
  background: #ffffff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px;
  text-align: center; font-weight: 600; color: #1f2937; box-shadow: 0 1px 4px rgba(0,0,0,.03); transition: transform 0.2s, box-shadow 0.2s;
}
.kartu-nama:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: #86efac; }

/* ============================================================
   Responsif (Tablet & Desktop)
   ============================================================ */
@media (min-width: 640px) {
  h1 { font-size: 2rem; }
  .form-actions .btn-primary { width: auto; min-width: 200px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-inner { grid-template-columns: 2fr 1fr; }
}

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex; flex-direction: row; position: static; background: transparent;
    border: 0; box-shadow: none; padding: 0; align-items: center; gap: 4px;
  }
  .site-nav a { padding: 10px 12px; }
  .btn-nav, .btn-nav-outline { margin-top: 0; margin-left: 8px; }
  .btn-nav-login { margin-top: 0; margin-left: 8px; background-color: #f59e0b !important; color: #1f2937 !important; }
  .btn-nav-login:hover { background-color: #d97706 !important; }
  .brand-text { font-size: 16px; max-width: none; }
  .login-wrap { margin: 64px auto; padding: 36px 32px; }
  .brand-logo-img { width: 48px; height: 48px; flex: 0 0 48px; }
}