/* =====================================================================
   UIS StaffSite — halaman publik
   Palet warna mengikuti template panel (ModernAdmin):
   aksen biru #1a66c4, navy #051831, latar #f0f4f9, font Roboto.
   ===================================================================== */
:root {
  --navy: #051831;          /* navy template (sidebar) */
  --navy-2: #1a66c4;        /* warna aksen utama template */
  --accent: #1a66c4;
  --accent-dark: #14529e;
  --accent-soft: #e6effa;
  --gold: #f59e0b;          /* warning template */
  --gold-light: #e6effa;
  --ink: #1e293b;
  --heading: #0f172a;
  --muted: #64748b;
  --paper: #f0f4f9;
  --line: #e2e8f0;
  --green: #15803d;
  --green-soft: #dcfce7;
  --danger: #ef4444;
  --white: #ffffff;
  --surface: #ffffff;       /* latar kartu/panel */
  --surface-2: #f8fafc;
  --input-bg: #ffffff;
  color-scheme: light;
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

h1, h2, h3, h4, .brand {
  font-family: "Roboto", system-ui, sans-serif;
  color: var(--heading);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.navbar-sticky { position: sticky; top: 0; z-index: 100; }

.brand-logo { height: 34px; width: auto; vertical-align: middle; border-radius: 6px; }

.navbar .brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.navbar .brand:hover { text-decoration: none; }
.navbar .brand small { font-weight: 400; font-size: 0.85rem; color: var(--muted); }

.navlinks { display: flex; align-items: center; gap: 20px; font-size: 0.93rem; flex-wrap: wrap; }
.navlinks a { color: var(--ink); }
.navlinks a:hover { color: var(--accent); text-decoration: none; }
.navlinks a.btn-primary, .navlinks a.btn-primary:hover { color: #fff; }
.navlinks a.active { color: var(--accent); font-weight: 500; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 1.1rem; cursor: pointer; color: var(--ink); }

.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn-gold { background: var(--gold); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-danger { background: var(--danger); color: white; }

.hero {
  background: linear-gradient(135deg, #051831 0%, #0b2a52 55%, #1a66c4 100%);
  color: white;
  padding: 56px 32px 64px;
  text-align: center;
}

.hero h1 { font-size: 1.9rem; margin: 0 0 22px; font-weight: 600; color: #fff; }
.hero .accent { color: #93c5fd; }

.search-bar {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.search-bar input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 6px;
  border: none;
  font-size: 0.95rem;
}

.search-bar button {
  background: var(--surface);
  border: none;
  padding: 0 22px;
  border-radius: 6px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.container { max-width: 1180px; margin: 0 auto; padding: 40px 32px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  margin: 0 0 18px;
  color: var(--heading);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.feed-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
}

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}

.feed-card .judul { font-weight: 600; margin: 4px 0; color: var(--ink); }
.feed-card .meta { font-size: 0.82rem; color: var(--muted); }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-approved { background: var(--green-soft); color: var(--green); }

.bidang-block { margin-bottom: 40px; }
.bidang-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.bidang-head h3 { margin: 0; font-size: 1.05rem; }
.bidang-head .count { color: var(--muted); font-size: 0.9rem; font-weight: 400;}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.staff-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.staff-card .photo {
  height: 130px;
  background: linear-gradient(135deg, #0b2a52, #1a66c4);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 2rem; font-weight: 700;
}

.staff-card .info { padding: 12px; }
.staff-card .nama { font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }
.staff-card .prodi { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

.filter-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.filter-grid label { font-size: 0.82rem; font-weight: 600; color: var(--heading); display:block; margin-bottom: 6px; }
.filter-grid input, .search-bar-plain input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.9rem;
}

.search-bar-plain { display: flex; gap: 10px; margin-top: 14px; }
.search-bar-plain input { flex: 1; }

.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  align-items: start;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}

.profile-card .photo-lg {
  width: 130px; height: 130px; border-radius: 50%;
  background: linear-gradient(135deg, #0b2a52, #1a66c4); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 700;
  margin: 0 auto 16px;
}

.profile-card h2 { font-size: 1.15rem; margin: 6px 0; }
.profile-card .prodi-line { color: var(--navy-2); font-weight: 600; margin-top: 6px; font-size: 0.92rem; }
.profile-card .struktural { color: var(--muted); font-size: 0.88rem; }

.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

.link-row { text-align: left; font-size: 0.88rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px;}

.section-label { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: #94a3b8; margin: 18px 0 8px; font-weight: 700;}

.tag-pill {
  display: inline-block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.8rem;
  margin: 3px 4px 3px 0;
}

.card-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs a {
  padding: 14px 20px;
  font-size: 0.92rem;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.tab-body { padding: 20px; }

.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.item-card .top-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;}
.item-card h4 { margin: 6px 0; font-size: 1rem; }
.item-card .meta { font-size: 0.82rem; color: var(--muted); }
.item-card .actions { margin-top: 10px; display: flex; gap: 8px; }

.pengajaran-row, .pendidikan-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 0.88rem; text-align: left;
}

.list-page { padding: 40px 32px; max-width: 900px; margin: 0 auto; }

.form-row { text-align: left; margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.92rem; font-family: inherit;
}

.alert { padding: 10px 14px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 14px; }
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: var(--green-soft); color: var(--green); }
.alert-info { background: var(--accent-soft); color: var(--accent); }

table.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden;}
table.admin-table th, table.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.9rem;}
table.admin-table th { background: var(--surface-2); color: var(--heading); }

.demo-note {
  background: #e8eefc;
  border: 1px solid #c7d5f5;
  color: var(--navy-2);
  padding: 10px 16px;
  font-size: 0.82rem;
  text-align: center;
}

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 24px; }
.pagination a, .pagination span {
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; font-size: 0.88rem;
}
.pagination .current { background: var(--accent); color: white; border-color: var(--accent); }

.wordcloud span { display: inline-block; margin: 4px 8px; }


/* Kartu & panel: sudut dan bayangan halus seperti template */
.feed-card, .staff-card, .filter-box, .profile-card, .card-panel, .item-card { box-shadow: var(--shadow-sm); }
.staff-card { transition: transform .15s ease, box-shadow .15s ease; }
.staff-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgb(5 24 49 / 0.08); }
.item-card { background: var(--surface); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus,
.filter-grid input:focus, .search-bar-plain input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(26 102 196 / 0.2); }

/* Footer publik */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.75); margin-top: 48px; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 28px 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 0.88rem; }
.site-footer a { color: #fff; }
.site-footer strong { color: #fff; }

/* ---------- Responsif (tablet & HP) ---------- */
@media (max-width: 1100px) {
  .staff-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .staff-grid { grid-template-columns: repeat(3, 1fr); }
  .two-col, .profile-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .nav-toggle { display: inline-block; }
  .navbar { flex-wrap: wrap; padding: 12px 18px; }
  .navlinks { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 12px; padding: 8px 0 4px; }
  .navlinks.open { display: flex; }
  .container, .list-page { padding: 24px 18px; }
  .tabs { overflow-x: auto; }
  .tabs a { white-space: nowrap; padding: 12px 14px; }
}
@media (max-width: 560px) {
  .staff-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: 1fr !important; }
  .hero { padding: 40px 18px 48px; }
  .hero h1 { font-size: 1.45rem; }
  .search-bar { flex-direction: column; }
  .search-bar button { padding: 12px; }
}

/* Foto dosen di kartu staf */
.staff-card .photo.has-foto { background: #e2e8f0; padding: 0; }
.staff-card .photo.has-foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.staff-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .staff-grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .staff-grid-4 { grid-template-columns: repeat(2, 1fr); } }

/* Label status validasi (hanya terlihat pemilik & admin) */
.validasi-note { margin-top: 8px; padding: 6px 10px; border-radius: 6px; font-size: 0.8rem; background: #fef3c7; color: #92400e; }
.validasi-note.ditolak { background: #fee2e2; color: #b91c1c; }
.badge-verified { background: var(--green-soft); color: var(--green); }

/* =====================================================================
   Mode gelap (sama dengan panel: atribut data-theme="dark" di <html>,
   pilihan disimpan di browser dengan kunci "theme")
   ===================================================================== */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #cbd5e1;
  --heading: #f1f5f9;
  --muted: #94a3b8;
  --paper: #0b1526;
  --surface: #13213a;
  --surface-2: #182a47;
  --input-bg: #0f1c32;
  --line: #24385a;
  --accent: #4a90e2;
  --accent-dark: #3b7fd0;
  --accent-soft: #1b3358;
  --gold-light: #1b3358;
  --green: #4ade80;
  --green-soft: #12351f;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
}
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .navbar { background: #0f1c32; border-bottom-color: var(--line); }
html[data-theme="dark"] .brand { color: var(--heading); }
html[data-theme="dark"] .hero { background: linear-gradient(135deg, #020b18 0%, #071d3a 55%, #12437f 100%); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea {
  background: var(--input-bg); color: var(--ink); border-color: var(--line);
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #64748b; }
html[data-theme="dark"] .staff-card:hover { box-shadow: 0 6px 16px rgb(0 0 0 / 0.45); }
html[data-theme="dark"] .staff-card .photo.has-foto { background: var(--surface-2); }
html[data-theme="dark"] .badge-pending, html[data-theme="dark"] .validasi-note { background: #3b2a0a; color: #fcd34d; }
html[data-theme="dark"] .alert-error, html[data-theme="dark"] .validasi-note.ditolak { background: #3b1414; color: #fca5a5; }
html[data-theme="dark"] .site-footer { background: #020b18; }
html[data-theme="dark"] .btn-outline { color: var(--accent); border-color: var(--accent); background: transparent; }
html[data-theme="dark"] a { color: var(--accent); }
html[data-theme="dark"] .navlinks a { color: var(--ink); }
html[data-theme="dark"] .navlinks a.active, html[data-theme="dark"] .navlinks a:hover { color: var(--accent); }
html[data-theme="dark"] .navlinks a.btn-primary, html[data-theme="dark"] .btn-primary { color: #fff; }
html[data-theme="dark"] .brand-logo { filter: none; }

.theme-toggle {
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1; padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .ikon-terang { display: none; }
html[data-theme="dark"] .theme-toggle .ikon-terang { display: inline; }
html[data-theme="dark"] .theme-toggle .ikon-gelap { display: none; }

/* ---------- Perbaikan tampilan HP: konten panjang tidak boleh melebarkan halaman ---------- */
.profile-grid > *, .two-col > *, .staff-grid > *, .feed-grid > * { min-width: 0; }
@media (max-width: 900px) { .two-col, .profile-grid { grid-template-columns: minmax(0, 1fr); } }
.profile-card, .item-card, .feed-card, .staff-card, .card-panel, .filter-box { overflow-wrap: anywhere; word-break: break-word; }
.profile-card a, .item-card a, .feed-card a { overflow-wrap: anywhere; }
.item-card table, .card-panel table, .profile-main table { display: block; max-width: 100%; overflow-x: auto; }
img, video, iframe { max-width: 100%; height: auto; }
.staff-card .photo img, .profile-card .photo-lg img { height: 100%; }
html, body { overflow-x: hidden; }
