:root {
  --uis-green-dark: #1e5c2f;
  --uis-green: #2e7d32;
  --uis-green-light: #8bc34a;
  --uis-gold: #d4af37;
  --uis-gold-light: #f5e6a8;
  --bg-page: #f4f6f2;
  --white: #ffffff;
  --text-dark: #223122;
  --text-muted: #6b7a6b;
  --border-soft: #d7e0d3;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(30, 92, 47, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  background: linear-gradient(120deg, var(--uis-green-dark), var(--uis-green));
  color: var(--white);
  box-shadow: var(--shadow);
}

.app-header .logo-box {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header .logo-box img {
  height: 68px;
  display: block;
}

.app-header .title-box {
  flex: 1;
  text-align: center;
  padding: 18px;
}

.app-header .title-box h1 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.app-header .title-box p {
  margin: 4px 0 0;
  font-size: 0.95rem;
  font-weight: 400;
  opacity: 0.9;
}

/* ---------- Tabs Gedung ---------- */
.gedung-tabs {
  display: flex;
  flex-wrap: wrap;
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
}

.gedung-tab {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: 14px 10px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
  position: relative;
}

.gedung-tab:hover {
  color: var(--uis-green-dark);
  background: var(--uis-gold-light);
}

.gedung-tab.active {
  color: var(--uis-green-dark);
  border-bottom-color: var(--uis-gold);
  background: #fbf8ec;
}

/* ---------- Flyout Lantai ---------- */
.lantai-panel {
  background: var(--white);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  animation: fadeSlide 0.2s ease;
}

.lantai-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--uis-green-light);
  background: #f1f8ec;
  color: var(--uis-green-dark);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lantai-chip:hover {
  background: var(--uis-green-light);
  color: var(--white);
}

.lantai-chip.active {
  background: var(--uis-green-dark);
  border-color: var(--uis-green-dark);
  color: var(--white);
}

/* ---------- Search Bar Publik ---------- */
.search-bar-public {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 0 18px;
  position: relative;
}

.search-bar-public input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
}

.search-bar-public input:focus {
  outline: none;
  border-color: var(--uis-gold);
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 18px;
  right: 18px;
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(30,92,47,0.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.search-results.open { display: block; }

.search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f3ee;
  font-size: 0.88rem;
}

.search-result-item:hover { background: var(--uis-gold-light); }
.search-result-item .kode { font-weight: 700; color: var(--uis-green-dark); margin-right: 8px; }
.search-result-item .nama { color: var(--text-dark); }
.search-result-item .meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.search-no-result {
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ---------- Main Content ---------- */
.main-content {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 18px 40px;
  min-height: 400px;
}

.content-frame {
  background: var(--white);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 360px;
}

.placeholder-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 320px;
  color: var(--text-muted);
  font-size: 1rem;
  text-align: center;
  flex-direction: column;
  gap: 10px;
}

.placeholder-msg .big-icon {
  font-size: 2.2rem;
  opacity: 0.5;
}

/* ---------- Room Grid ---------- */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.room-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--white);
  position: relative;
}

.room-card:hover {
  border-color: var(--uis-gold);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
  transform: translateY(-2px);
}

.room-card .room-kode {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.room-card .room-nama {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--uis-green-dark);
  margin: 4px 0 8px;
}

.room-card .room-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 8px;
}

.badge-kelas { background: #e3f2e6; color: var(--uis-green-dark); }
.badge-kantor { background: #fff3d6; color: #8a6d00; }
.badge-lab { background: #e6eefc; color: #1c4c9c; }
.badge-rapat { background: #fbe6e6; color: #a13333; }

.badge-nonaktif {
  background: #f3d6d6;
  color: var(--danger);
}

/* ---------- Room Detail ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--uis-green-dark);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.back-link:hover { text-decoration: underline; }

.room-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.room-detail-header h2 {
  margin: 0 0 4px;
  color: var(--uis-green-dark);
  font-size: 1.4rem;
}

.room-detail-header .sub {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.info-item {
  background: #f7faf5;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 14px;
}

.info-item .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.info-item .value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-top: 2px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--uis-green-dark);
  margin: 26px 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--uis-gold-light);
}

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

.photo-box {
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fafbf9;
}

.photo-box img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #eef2ea;
  display: block;
}

.photo-box .no-photo {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-direction: column;
  gap: 6px;
}

.photo-box .caption {
  padding: 8px 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
}

/* Foto grup (Pengguna Ruangan) — ukuran lebih besar & proporsional, mengisi lebar penuh */
.photo-box.photo-wide {
  grid-column: 1 / -1;
}

.photo-box.photo-wide img {
  height: 380px;
  object-fit: contain;
  background: #eef2ea;
}

.photo-box.photo-wide .no-photo {
  height: 380px;
}

@media (max-width: 640px) {
  .photo-box.photo-wide img,
  .photo-box.photo-wide .no-photo {
    height: 260px;
  }
}

.sarana-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.sarana-item {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px;
  background: #fafbf9;
}

.sarana-item .thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: contain;
  background: var(--uis-gold-light);
  flex-shrink: 0;
}

.sarana-item .thumb-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  background: #eef2ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.sarana-item .info .nama { font-weight: 600; font-size: 0.92rem; }
.sarana-item .info .jumlah { font-size: 0.8rem; color: var(--text-muted); }

.orang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.orang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fffaf0;
  border: 1px solid var(--uis-gold-light);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.orang-item .avatar-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--uis-green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ---------- Hamburger Button (mobile only) ---------- */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-right: 6px;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  margin: 5px 0;
  transition: 0.2s ease;
}

/* ---------- Mobile Drawer (off-canvas) ---------- */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 20, 0.45);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drawer-overlay.open {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--white);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  background: var(--uis-green-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.drawer-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-header-brand img {
  height: 34px;
  background: var(--white);
  border-radius: 4px;
  padding: 2px;
}

.drawer-brand-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.drawer-brand-sub {
  font-size: 0.72rem;
  opacity: 0.85;
}

.drawer-close-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

/* Accordion Level 1 — Gedung */
.acc-gedung-item { border-bottom: 1px solid var(--border-soft); }

.acc-gedung-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.acc-gedung-head:hover { background: #f7faf5; }

.acc-gedung-head .chevron {
  transition: transform 0.2s ease;
  color: var(--uis-green-dark);
  font-size: 0.8rem;
}

.acc-gedung-item.open .acc-gedung-head .chevron { transform: rotate(180deg); }
.acc-gedung-item.open .acc-gedung-head { background: #eef6ea; color: var(--uis-green-dark); }

.acc-gedung-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: #fafcf8;
}

.acc-gedung-item.open .acc-gedung-body { max-height: 2000px; }

/* Accordion Level 2 — Lantai */
.acc-lantai-item { border-top: 1px solid var(--border-soft); }

.acc-lantai-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px 11px 30px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--uis-green-dark);
}

.acc-lantai-head .chevron { font-size: 0.72rem; color: var(--text-muted); transition: transform 0.2s ease; }
.acc-lantai-item.open .acc-lantai-head .chevron { transform: rotate(180deg); }

.acc-lantai-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.acc-lantai-item.open .acc-lantai-body { max-height: 1200px; }

/* Accordion Level 3 — Room list */
.acc-room-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 18px 9px 42px;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  border-top: 1px solid #f0f3ee;
}

.acc-room-link:hover { background: var(--uis-gold-light); }
.acc-room-link .room-name { font-weight: 600; }
.acc-room-link .room-kap { font-size: 0.72rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.app-footer {
  background: linear-gradient(120deg, var(--uis-green-light), var(--uis-gold-light));
  text-align: center;
  padding: 14px;
  color: var(--uis-green-dark);
  font-weight: 600;
  font-size: 0.85rem;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Breakpoint Mobile: <= 768px ---------- */
@media (max-width: 768px) {
  .app-header .logo-box { padding: 8px 12px; }
  .app-header .logo-box img { height: 44px; }
  .title-box h1 { font-size: 1.02rem; }
  .title-box p { font-size: 0.8rem; }

  .hamburger-btn { display: block; }

  /* Sembunyikan navigasi desktop, digantikan drawer */
  .gedung-tabs { display: none; }
  .lantai-panel { display: none !important; }

  .main-content { margin-top: 10px; padding: 0 12px 30px; }
  .content-frame { padding: 16px; }
}
