/* ==========================================================================
   JUCO Indonesia — admin dashboard
   ========================================================================== */

:root {
  --green: #3FA535;
  --green-700: #1C6B2A;
  --green-800: #12492A;
  --green-900: #0A2E1C;
  --lime: #A8DB5A;
  --lime-soft: #EAF7D6;
  --ink: #10231A;
  --muted: #64756A;
  --line: rgba(16, 52, 32, .12);
  --bg: #F3F6F2;
  --white: #fff;
  --radius: 16px;
  --font: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.02em; font-weight: 800; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 6px; }

.ico { width: 18px; height: 18px; flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 258px; flex: 0 0 258px; background: var(--green-900); color: rgba(255, 255, 255, .78);
  display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: var(--lime); }
.admin-brand strong { color: #fff; font-size: 1.4rem; letter-spacing: .04em; line-height: 1; }
.admin-brand small { display: block; font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .55); margin-top: 3px; }
.admin-brand svg { width: 42px; height: 30px; }
.admin-brand img { background: #fff; padding: 5px 9px; border-radius: 10px; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav-label { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .38); padding: 16px 12px 6px; }
.admin-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px;
  font-size: .9rem; font-weight: 600; color: rgba(255, 255, 255, .76); transition: background .18s, color .18s;
}
.admin-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-nav a.is-active { background: var(--green); color: #fff; box-shadow: 0 12px 24px -16px rgba(63, 165, 53, .9); }
.admin-nav .count {
  margin-left: auto; background: rgba(255, 255, 255, .16); color: #fff; font-size: .7rem;
  padding: 1px 7px; border-radius: 999px; font-weight: 700;
}
.admin-side-foot { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); }
.admin-user { display: flex; gap: 10px; align-items: center; padding: 0 8px 12px; }
.admin-user span {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 800; font-size: .85rem;
}
.admin-user strong { display: block; color: #fff; font-size: .85rem; }
.admin-user small { font-size: .72rem; color: rgba(255, 255, 255, .5); }
.admin-side-foot .logout {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  font-size: .84rem; font-weight: 600; color: rgba(255, 255, 255, .7);
}
.admin-side-foot .logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: 14px 26px;
}
.admin-top h1 { margin: 0; font-size: 1.15rem; }
.admin-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-menu-btn { display: none; background: rgba(16, 52, 32, .06); border: none; border-radius: 10px; width: 40px; height: 40px; color: var(--green-800); }
.admin-content { padding: 26px; max-width: 1280px; width: 100%; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 700; font-size: .86rem; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap; cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--green), var(--green-700)); color: #fff; box-shadow: 0 12px 22px -16px rgba(28, 107, 42, .9); }
.btn-outline { background: #fff; border-color: var(--line); color: var(--green-800); }
.btn-outline:hover { border-color: var(--green); color: var(--green-700); }
.btn-ghost { background: rgba(16, 52, 32, .05); color: var(--green-800); }
.btn-danger { background: #FDECE7; color: #A13B27; border-color: #F6D2C7; }
.btn-danger:hover { background: #FBDDD4; }
.btn-sm { padding: 7px 12px; font-size: .78rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------- cards & stats ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card .stat-icon {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--lime-soft); color: var(--green-700); margin-bottom: 14px;
}
.stat-card small { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat-card strong { display: block; font-size: 1.55rem; color: var(--green-900); letter-spacing: -.03em; line-height: 1.2; margin-top: 3px; }
.stat-card .delta { font-size: .76rem; color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 640px; }
table.data th {
  text-align: left; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px; border-bottom: 1px solid rgba(16, 52, 32, .07); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(63, 165, 53, .045); }
table.data .cell-title { font-weight: 700; }
table.data .cell-sub { color: var(--muted); font-size: .78rem; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: #eee; flex: 0 0 auto; }
.cell-media { display: flex; align-items: center; gap: 12px; min-width: 220px; }

/* ---------- badges ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.pill-green { background: #DCF3DA; color: #1C6B2A; }
.pill-amber { background: #FFF3D6; color: #8A5B00; }
.pill-red { background: #FBE3DE; color: #A13B27; }
.pill-blue { background: #E2EDFF; color: #24508A; }
.pill-gray { background: rgba(16, 52, 32, .07); color: var(--muted); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.field > span { font-weight: 700; color: #33443A; }
.field > span em { color: #C0392B; font-style: normal; }
.field > span small { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: .88rem; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(63, 165, 53, .14); }
.field-full { grid-column: 1 / -1; }
.field-hint { font-size: .74rem; color: var(--muted); margin: 0; }
.form-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
.form-section h3 { margin-bottom: 14px; font-size: .95rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }

.lang-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.lang-tabs button {
  border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px 14px;
  font-size: .8rem; font-weight: 700; color: var(--muted);
}
.lang-tabs button.is-active { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.lang-pane[hidden] { display: none; }

/* ---------- flash ---------- */
.flash { padding: 12px 16px; border-radius: 11px; font-size: .86rem; font-weight: 600; margin-bottom: 16px; border: 1px solid transparent; }
.flash-success { background: #E8F7E3; color: #1C6B2A; border-color: #C8E8C0; }
.flash-error { background: #FDECE7; color: #A13B27; border-color: #F6D2C7; }
.flash-info { background: #E8F1FF; color: #24508A; border-color: #CFE0FA; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 20% 0%, #12492A 0%, #071B10 60%); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 22px; padding: 34px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .6); }
.login-card .brand { display: flex; align-items: center; gap: 10px; color: var(--green); margin-bottom: 22px; }
.login-card .brand strong { color: var(--green); font-size: 1.5rem; letter-spacing: .05em; }
.login-card .brand small { display: block; color: var(--muted); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; }
.login-card h1 { font-size: 1.25rem; margin-bottom: 6px; }
.login-card p.sub { color: var(--muted); font-size: .86rem; margin-bottom: 20px; }
.login-hint { margin-top: 18px; font-size: .76rem; color: var(--muted); text-align: center; }

/* ---------- calendar admin ---------- */
.admin-cal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.admin-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.admin-cal-head strong { text-transform: capitalize; font-size: 1rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 6px; }
.cal-weekdays span { text-align: center; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.cal-cell {
  min-height: 62px; border-radius: 9px; border: 1px solid var(--line); padding: 5px;
  font-size: .78rem; font-weight: 700; background: #fff; position: relative;
}
.cal-cell.is-empty { background: transparent; border-color: transparent; }
.cal-cell.is-past { background: rgba(16, 52, 32, .02); color: rgba(16, 35, 26, .3); }
.cal-cell.is-booked { background: #DCF3DA; border-color: #B9E3B2; color: #1C6B2A; }
.cal-cell.is-blocked { background: repeating-linear-gradient(135deg, #FFF3D6, #FFF3D6 6px, #FDECCB 6px, #FDECCB 12px); border-color: #F0D79E; color: #8A5B00; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--green); }
.cal-cell small { display: block; font-size: .6rem; font-weight: 600; opacity: .8; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: .74rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; border: 1px solid rgba(16, 52, 32, .12); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.list-rows { display: grid; gap: 10px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; font-size: .85rem; }
.list-row form { margin: 0; }
.detail-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 15px; border-bottom: 1px solid var(--line); font-size: .86rem; background: #fff; }
.detail-list > div:last-child { border-bottom: none; }
.detail-list span { color: var(--muted); }
.detail-list strong { text-align: right; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .admin-side {
    position: fixed; inset: 0 auto 0 0; z-index: 80; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: 0 0 60px rgba(0, 0, 0, .4);
  }
  body.admin-nav-open .admin-side { transform: none; }
  .admin-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .admin-content { padding: 18px; }
  .admin-top { padding: 12px 18px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .cal-cell { min-height: 48px; font-size: .7rem; }
}
@media (max-width: 520px) {
  .stat-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .cal-cell { min-height: 40px; }
  .cal-cell small { display: none; }
}

/* ---------- Galeri foto item ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.photo-tile { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f3f5f2; aspect-ratio: 4 / 3; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-num {
  position: absolute; left: 6px; bottom: 6px; background: rgba(6, 32, 20, .78); color: #fff;
  font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}
.photo-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 8px;
  border: none; background: rgba(255, 255, 255, .92); color: #A13B27; font-size: 1rem; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.photo-del:hover { background: #FDECE7; }

/* ---------- Katalog rental admin ---------- */
.rental-group { margin-bottom: 18px; }
.rental-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; background: rgba(16, 52, 32, .04); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px;
}
.rental-group-head h3 { margin: 0; font-size: .95rem; }
.rental-group-head .muted { font-size: .76rem; }
.rental-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.rental-table th {
  text-align: left; font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.rental-table td { padding: 8px 10px; border-bottom: 1px solid rgba(16, 52, 32, .06); vertical-align: middle; }
.rental-table tr:last-child td { border-bottom: none; }
.rental-table input[type="number"], .rental-table input[type="text"] {
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .82rem; width: 100%;
}
.rental-table input[type="number"] { max-width: 130px; }
.rental-table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.rental-inactive { opacity: .55; }
.price-tag { font-weight: 700; color: var(--green-800); white-space: nowrap; }
.rental-add { border-top: 1px dashed var(--line-strong); padding-top: 12px; margin-top: 6px; }
.rental-scroll { max-height: 520px; overflow-y: auto; }

/* ---------- Panduan Xendit ---------- */
.xendit-guide { border-color: rgba(63, 165, 53, .35); background: linear-gradient(150deg, rgba(234, 247, 214, .5), #fff 42%); }
.xendit-steps { display: grid; gap: 14px; }
.xendit-steps li { display: flex; gap: 13px; align-items: flex-start; }
.xendit-steps li > span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: .8rem; font-weight: 800; flex: 0 0 auto;
}
.xendit-steps strong { display: block; font-size: .9rem; margin-bottom: 2px; }
.xendit-steps p { margin: 0; font-size: .82rem; color: var(--muted); }
.xendit-steps em { font-style: normal; font-weight: 700; color: var(--green-800); }
.xendit-warn, .xendit-ok { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; }
.xendit-warn { background: #FFF3D6; color: #8A5B00; }
.xendit-ok { background: #DCF3DA; color: #1C6B2A; }
.xendit-warn .ico, .xendit-ok .ico { width: 16px; height: 16px; }
