/* ============ Token ============ */
:root {
  --blue-900: #0B2559;
  --blue-800: #12337A;
  --blue-700: #1A46C4;
  --blue-600: #2556E0;
  --blue-200: #C9D8FB;
  --blue-100: #E3ECFF;
  --blue-50:  #F3F7FF;
  --white:    #FFFFFF;
  --ink:      #13203F;
  --muted:    #56617F;
  --line:     #D6E0F5;
  --danger:   #C2302B;
  --danger-bg:#FDECEB;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(11, 37, 89, .06), 0 8px 24px -12px rgba(11, 37, 89, .18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--blue-50);
  font-size: 16px; line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--blue-600); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ Topbar ============ */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; color: var(--blue-900); text-decoration: none; }
.brand__mark { display: grid; grid-template-columns: repeat(2, 11px); gap: 3px; }
.brand__mark i { width: 11px; height: 11px; border-radius: 3px; background: var(--blue-200); }
.brand__mark i:nth-child(2), .brand__mark i:nth-child(3) { background: var(--blue-700); }
.nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a.is-active { color: var(--blue-700); }
.nav form { margin: 0; }
.userchip { display: flex; align-items: center; gap: .5rem; background: none; border: 1px solid var(--line); border-radius: 999px; padding: .25rem .8rem .25rem .25rem; font: inherit; font-size: .875rem; color: var(--muted); cursor: pointer; }
.userchip:hover { border-color: var(--blue-600); color: var(--blue-700); }
.userchip img, .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--blue-100); }

/* ============ Buttons & form ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 700; font-size: .95rem;
  padding: .65rem 1.15rem; border-radius: var(--r-sm); border: 1.5px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn--primary { background: var(--blue-700); color: var(--white); }
.btn--primary:hover { background: var(--blue-800); }
.btn--ghost { background: var(--white); color: var(--blue-700); border-color: var(--blue-200); }
.btn--ghost:hover { border-color: var(--blue-700); }
.btn--danger { background: var(--white); color: var(--danger); border-color: #F0C3C1; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { padding: .4rem .75rem; font-size: .85rem; }
.btn--block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; font-size: .875rem; color: var(--blue-700); cursor: pointer; }
.linkbtn--danger { color: var(--danger); }

label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .35rem; }
.hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
input[type=text], input[type=number], input[type=tel], input[type=search], input[type=email], select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: .6rem .75rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 1.1rem; }
.field .error { color: var(--danger); font-size: .82rem; margin-top: .3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; font-size: .92rem; margin: 0;
  padding: .55rem .7rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white); cursor: pointer; }
.check:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); }
.check input { accent-color: var(--blue-700); width: 17px; height: 17px; margin: 0; }

.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; }
.choice label { margin: 0; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--white); cursor: pointer; font-weight: 500; }
.choice label strong { display: block; font-size: 1rem; }
.choice label span { font-size: .82rem; color: var(--muted); }
.choice label:has(input:checked) { border-color: var(--blue-700); box-shadow: inset 0 0 0 1px var(--blue-700); background: var(--blue-50); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label:has(input:focus-visible) { outline: 3px solid var(--blue-600); outline-offset: 2px; }

/* ============ Panel / layout ============ */
.page { padding: 2rem 0 4rem; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pagehead h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.pagehead .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-block; font-weight: 600; font-size: .9rem; text-decoration: none; margin-bottom: .6rem; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.5rem; margin-bottom: 1.25rem; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel__head h2 { margin: 0; }
.formpanel { max-width: 760px; }
.formsec + .formsec { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1.5rem; }
.formsec > h2 { font-size: 1.1rem; }
.formfoot { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1.5rem; }

.flash { padding: .85rem 1rem; border-radius: var(--r-sm); margin-top: 1.25rem; font-weight: 500; font-size: .95rem; }
.flash--ok { background: var(--blue-100); color: var(--blue-900); border-left: 4px solid var(--blue-700); }
.flash--err { background: var(--danger-bg); color: #7A1D1A; border-left: 4px solid var(--danger); }
.flash ul { margin: .3rem 0 0; padding-left: 1.2rem; }

.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--blue-100); color: var(--blue-800); }
.badge--solid { background: var(--blue-700); color: var(--white); }
.badge--off { background: #ECEFF5; color: var(--muted); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem 1.25rem; }
.stat b { display: block; font-size: 1.8rem; font-weight: 800; color: var(--blue-900); line-height: 1.1; }
.stat span { font-size: .88rem; color: var(--muted); }
.stat--vacant { background: var(--blue-700); border-color: var(--blue-700); }
.stat--vacant b, .stat--vacant span { color: var(--white); }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: .6rem .75rem; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.inline { display: flex; gap: .4rem; align-items: center; margin: 0; }
.inline input { min-width: 160px; padding: .45rem .6rem; }
.rowactions { display: flex; gap: .8rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.rowactions form { margin: 0; }

.tabs { display: flex; gap: .3rem; background: var(--blue-50); border: 1px solid var(--line); padding: .25rem; border-radius: var(--r-sm); }
.tabs a { text-decoration: none; font-weight: 600; font-size: .88rem; color: var(--muted); padding: .35rem .8rem; border-radius: 4px; }
.tabs a.is-active { background: var(--white); color: var(--blue-700); box-shadow: 0 1px 2px rgba(11,37,89,.1); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h3 { color: var(--ink); }

/* ============ Papan kamar (elemen khas) ============ */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: .5rem; }
.tile { aspect-ratio: 1 / .82; border-radius: var(--r-sm); display: flex; flex-direction: column; justify-content: space-between; padding: .5rem .55rem; font-size: .72rem; }
.tile b { font-size: 1.15rem; font-weight: 800; line-height: 1; }
.tile--vacant { background: var(--blue-700); color: var(--white); }
.tile--full { background: repeating-linear-gradient(135deg, #EEF2FA 0 6px, #E4EAF6 6px 12px); color: #8993AE; border: 1px solid var(--line); }
.legend { display: flex; gap: 1.1rem; font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legend .v { background: var(--blue-700); }
.legend .f { background: repeating-linear-gradient(135deg, #EEF2FA 0 3px, #D9E0EF 3px 6px); border: 1px solid var(--line); }

.strip { display: flex; flex-wrap: wrap; gap: 3px; margin-top: .75rem; }
.strip i { width: 12px; height: 12px; border-radius: 2px; background: var(--blue-700); }
.strip i.full { background: #DDE4F2; }
.strip__cap { font-size: .84rem; color: var(--muted); margin: .4rem 0 0; }
.strip__cap b { color: var(--blue-700); }

/* ============ Hero (beranda) ============ */
.hero { background: var(--blue-900); color: var(--white); padding: 3.5rem 0 5.5rem; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2.5rem; align-items: center; }
.hero h1 { max-width: 14ch; }
.hero__sub { color: #BFD0F5; font-size: 1.05rem; max-width: 46ch; }
.hero__sub b { color: var(--white); }
.hero__board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; transform: rotate(-4deg); }
.hero__board i { aspect-ratio: 1; border-radius: 6px; background: var(--blue-800); }
.hero__board i.on { background: var(--blue-600); box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset; }
.hero__board i.lit { background: var(--white); }
@media (prefers-reduced-motion: no-preference) {
  .hero__board i.lit { animation: blink 3.2s ease-in-out infinite; }
  .hero__board i.lit:nth-child(odd) { animation-delay: 1.6s; }
}
@keyframes blink { 50% { background: var(--blue-600); } }
@media (max-width: 820px) { .hero__grid { grid-template-columns: 1fr; } .hero__board { display: none; } }

.search { background: var(--white); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 1rem; margin-top: -3.5rem; position: relative;
  display: grid; grid-template-columns: 2fr 1.2fr 1fr auto auto; gap: .6rem; align-items: center; }
.search .check { border: 0; padding: .55rem .4rem; background: none; }
@media (max-width: 900px) { .search { grid-template-columns: 1fr 1fr; } .search input[name=q] { grid-column: 1 / -1; } }

/* ============ Kartu kos ============ */
.list { padding: 2.25rem 0 4rem; }
.list__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.kcard { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.kcard:hover { border-color: var(--blue-600); }
.kcard:hover h3 { color: var(--blue-700); }
.kcard__img { aspect-ratio: 16 / 10; background: var(--blue-100); position: relative; }
.kcard__img img { width: 100%; height: 100%; object-fit: cover; }
.kcard__img .badge { position: absolute; left: .75rem; top: .75rem; background: var(--white); }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--blue-700); font-size: .85rem; font-weight: 600; }
.kcard__body { padding: 1rem 1.1rem 1.2rem; flex: 1; }
.kcard__body h3 { margin-bottom: .15rem; font-size: 1.1rem; }
.price { margin: .6rem 0 0; font-size: .92rem; color: var(--muted); }
.price b { color: var(--ink); font-size: 1.05rem; }

.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; font-size: .92rem; }

/* ============ Detail kos ============ */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .5rem; height: clamp(240px, 42vw, 420px); border-radius: var(--r-lg); overflow: hidden; margin-top: 1.5rem; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery img:first-child { grid-row: 1 / 3; }
.gallery--1 { grid-template-columns: 1fr; }
.gallery--2 { grid-template-columns: 1fr 1fr; }
.gallery--2 img:first-child, .gallery--1 img:first-child { grid-row: 1 / 3; }
.gallery--empty { background: var(--blue-100); display: grid; place-items: center; color: var(--blue-700); font-weight: 600; grid-template-columns: 1fr; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery img:first-child { grid-column: 1 / -1; grid-row: auto; } .gallery img:nth-child(n+4) { display: none; } }

.detail { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; padding: 2rem 0 4rem; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: 1fr; } }
.detail__title { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }
.section { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }

.amen { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .5rem 1rem; list-style: none; padding: 0; margin: 0; }
.amen li { display: flex; align-items: center; gap: .5rem; font-size: .95rem; }
.amen li::before { content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%; background: var(--blue-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231A46C4'%3E%3Cpath d='M8.2 13.6 4.6 10l1.2-1.2 2.4 2.4 6-6 1.2 1.2z'/%3E%3C/svg%3E") center / 14px no-repeat; }
.amen li.no { color: var(--muted); text-decoration: line-through; }
.amen li.no::before { background: #ECEFF5; }

.keyfacts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.25rem; }
.keyfact { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: .8rem 1rem; background: var(--white); }
.keyfact b { display: block; }
.keyfact span { font-size: .85rem; color: var(--muted); }
.keyfact.yes { border-color: var(--blue-600); background: var(--blue-50); }

.rtype { display: grid; grid-template-columns: 180px 1fr auto; gap: 1.1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem; margin-bottom: .8rem; }
.rtype__img { aspect-ratio: 4/3; border-radius: var(--r-sm); overflow: hidden; background: var(--blue-100); }
.rtype__img img { width: 100%; height: 100%; object-fit: cover; }
.rtype__thumbs { display: flex; gap: 4px; margin-top: 4px; }
.rtype__thumbs img { width: 40px; height: 32px; object-fit: cover; border-radius: 3px; }
.rtype__meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .6rem; }
.rtype__price { text-align: right; }
.rtype__price b { font-size: 1.2rem; display: block; }
@media (max-width: 640px) { .rtype { grid-template-columns: 1fr; } .rtype__price { text-align: left; } }

.aside { position: sticky; top: 84px; }
.contact { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.25rem; }
.contact .from { font-size: .88rem; color: var(--muted); }
.contact .from b { font-size: 1.5rem; color: var(--ink); display: block; }
.contact hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.map { width: 100%; aspect-ratio: 16/10; border: 0; border-radius: var(--r-md); background: var(--blue-100); }

.photogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.photogrid figure { margin: 0; position: relative; aspect-ratio: 4/3; border-radius: var(--r-sm); overflow: hidden; background: var(--blue-100); }
.photogrid img { width: 100%; height: 100%; object-fit: cover; }
.photogrid form { position: absolute; right: 6px; top: 6px; margin: 0; }
.photogrid button { background: rgba(255,255,255,.92); border: 0; border-radius: 4px; font: inherit; font-size: .75rem; font-weight: 700; color: var(--danger); padding: .2rem .45rem; cursor: pointer; }

.upload { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.upload input[type=file] { font: inherit; font-size: .9rem; }

.addroom { background: var(--blue-50); border: 1px dashed var(--blue-200); border-radius: var(--r-md); padding: 1rem; margin-bottom: 1.25rem; }
.addroom__row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.addroom__row .field { margin: 0; flex: 1 1 120px; }

/* ============ Login ============ */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 2rem 1rem; }
.authcard { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2.25rem; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow); }
.authcard .brand__mark { margin: 0 auto 1.25rem; grid-template-columns: repeat(3, 18px); gap: 5px; }
.authcard .brand__mark i { width: 18px; height: 18px; border-radius: 4px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: .7rem; width: 100%; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); font-weight: 700; text-decoration: none; margin-top: 1.25rem; }
.gbtn:hover { border-color: var(--blue-600); background: var(--blue-50); }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--line); background: var(--white); padding: 1.5rem 0; font-size: .88rem; color: var(--muted); }
.photogrid figure > button { position: absolute; right: 6px; top: 6px; }
.adminnav { display: flex; gap: .3rem; margin-bottom: 1.25rem; }
