:root {
  --navy: #262b91;
  --navy-2: #171b68;
  --green: #37a35a;
  --green-dark: #1d7e40;
  --violet: #c953f2;
  --ink: #20223d;
  --muted: #6f7188;
  --line: #e6e8f0;
  --paper: #ffffff;
  --canvas: #f6f8fc;
  --soft-navy: #eef0ff;
  --soft-green: #eaf7ee;
  --soft-violet: #fbf0ff;
  --warning: #b66d00;
  --soft-warning: #fff5df;
  --danger: #b8354d;
  --soft-danger: #fff0f3;
  --shadow: 0 18px 46px rgba(29, 35, 98, .11);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.site-bg { min-height: 100vh; position: relative; overflow-x: clip; }
.site-bg::before, .site-bg::after {
  content: ""; position: fixed; border-radius: 999px; pointer-events: none; z-index: -1;
  filter: blur(2px);
}
.site-bg::before { width: 520px; height: 520px; top: -230px; right: -180px; background: radial-gradient(circle, rgba(201,83,242,.18), rgba(201,83,242,0) 68%); }
.site-bg::after { width: 620px; height: 620px; bottom: -300px; left: -230px; background: radial-gradient(circle, rgba(55,163,90,.13), rgba(55,163,90,0) 68%); }

.topbar {
  min-height: 76px; padding: 12px clamp(20px, 5vw, 76px); display: flex; align-items: center;
  justify-content: space-between; gap: 20px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(18px);
}
.brand-lockup { display: flex; align-items: center; gap: 18px; min-width: 0; }
.logo-kota { width: 128px; height: 50px; object-fit: contain; object-position: left center; }
.logo-pepro { width: 95px; height: 42px; object-fit: contain; object-position: center; }
.brand-divider { height: 34px; width: 1px; background: #d9dce7; }
.brand-context { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.btn, .text-btn {
  border: 0; border-radius: 12px; min-height: 42px; padding: 0 17px; font-size: 14px; font-weight: 750;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; transition: .2s ease;
}
.btn:hover, .text-btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--navy); box-shadow: 0 8px 18px rgba(38,43,145,.2); }
.btn-primary:hover { background: var(--navy-2); }
.btn-secondary { color: var(--navy); background: var(--soft-navy); }
.btn-secondary:hover { background: #e2e5ff; }
.btn-outline { color: var(--navy); background: white; border: 1.5px solid #cfd3ef; }
.btn-outline:hover { border-color: var(--navy); }
.btn-success { color: white; background: var(--green); box-shadow: 0 8px 18px rgba(55,163,90,.18); }
.btn-success:hover { background: var(--green-dark); }
.btn-small { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: 10px; }
.text-btn { background: transparent; color: var(--navy); padding: 0; min-height: 28px; }

.access-main { max-width: 1160px; padding: clamp(40px, 7vw, 90px) 24px; margin: 0 auto; }
.access-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(30px, 6vw, 80px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--green-dark); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.access-copy h1 { font-size: clamp(38px, 5vw, 62px); letter-spacing: -.055em; line-height: 1.05; margin: 18px 0; color: var(--navy-2); max-width: 680px; }
.access-copy h1 em { font-style: normal; color: var(--green); }
.access-copy p { max-width: 600px; color: var(--muted); font-size: 17px; margin: 0; }
.venue-chip { margin-top: 32px; display: flex; gap: 14px; align-items: center; max-width: 455px; padding: 15px 16px; background: rgba(255,255,255,.85); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 25px rgba(29,35,98,.05); }
.venue-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; color: var(--green); border-radius: 14px; background: var(--soft-green); }
.venue-chip strong, .venue-chip span { display: block; }
.venue-chip strong { font-size: 14px; }
.venue-chip span { color: var(--muted); font-size: 12px; margin-top: 2px; }

.login-card { border-radius: 24px; padding: clamp(24px, 4vw, 38px); background: rgba(255,255,255,.97); box-shadow: var(--shadow); border: 1px solid rgba(223,226,239,.9); position: relative; }
.login-card::after { content: ""; position: absolute; inset: 0 0 auto; height: 5px; border-radius: 24px 24px 0 0; background: linear-gradient(90deg, var(--navy), var(--violet), var(--green)); }
.login-card h2 { margin: 8px 0 4px; font-size: 25px; letter-spacing: -.03em; color: var(--navy-2); }
.login-card > p { color: var(--muted); margin: 0 0 25px; font-size: 14px; }
.form-stack { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { color: #43455f; font-size: 12px; font-weight: 750; }
.required { color: #c13858; }
.field input, .field select, .field textarea, .search-input {
  width: 100%; color: var(--ink); background: white; border: 1.5px solid #dde0eb; border-radius: 11px; min-height: 45px; padding: 0 13px; outline: none; transition: .18s;
}
.field textarea { padding: 12px 13px; min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(38,43,145,.08); }
.login-card .btn { width: 100%; margin-top: 5px; }
.help-row { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; padding-top: 17px; margin-top: 19px; border-top: 1px solid var(--line); }
.help-row svg { flex: 0 0 16px; color: var(--green); margin-top: 1px; }
.admin-shortcut { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.admin-shortcut a { color: var(--navy); font-weight: 750; }

.app-body { background: #f7f8fc; min-height: 100vh; }
.app-header { padding: 14px clamp(18px, 4vw, 52px); min-height: 70px; }
.app-header .logo-kota { width: 110px; height: 42px; }
.app-header .logo-pepro { width: 76px; height: 35px; }
.account-chip { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #50526d; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: linear-gradient(135deg, var(--navy), var(--violet)); font-size: 13px; font-weight: 800; }

.portal-shell { max-width: 1320px; margin: 0 auto; padding: 35px clamp(18px, 4vw, 52px) 70px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; }
.side-summary { position: sticky; top: 95px; align-self: start; }
.summary-card { background: var(--navy); color: white; border-radius: var(--radius); padding: 24px; overflow: hidden; position: relative; box-shadow: 0 13px 31px rgba(38,43,145,.22); }
.summary-card::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(201,83,242,.22); right: -85px; top: -85px; }
.summary-card .label { position: relative; color: #cfd2ff; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.summary-card h3 { position: relative; margin: 9px 0 4px; font-size: 19px; letter-spacing: -.03em; line-height: 1.18; }
.summary-card p { position: relative; margin: 0; font-size: 12px; color: #dcdfff; }
.mini-status { position: relative; margin-top: 22px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.17); display: flex; align-items: center; justify-content: space-between; }
.mini-status strong { font-size: 22px; letter-spacing: -.04em; display: block; }
.mini-status span { color: #dcdfff; font-size: 11px; }
.mini-status div span { display: block; margin-top: 2px; }
.side-nav { margin-top: 16px; padding: 8px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.side-link { border: 0; width: 100%; text-align: left; padding: 10px 11px; border-radius: 10px; color: var(--muted); background: transparent; font-weight: 700; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.side-link.active { color: var(--navy); background: var(--soft-navy); }

.portal-main { min-width: 0; }
.page-heading { display: flex; gap: 20px; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.page-heading h1 { margin: 2px 0 5px; color: var(--navy-2); font-size: clamp(27px, 3vw, 36px); letter-spacing: -.045em; line-height: 1.1; }
.page-heading p { margin: 0; font-size: 14px; color: var(--muted); }
.status-pill { display: inline-flex; gap: 6px; align-items: center; border-radius: 999px; padding: 6px 10px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.status-pill.waiting { color: var(--warning); background: var(--soft-warning); }
.status-pill.complete { color: var(--green-dark); background: var(--soft-green); }
.status-pill.review { color: var(--navy); background: var(--soft-navy); }
.status-pill.revision { color: var(--danger); background: var(--soft-danger); }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 15px 16px; margin-bottom: 22px; border: 1px solid #cdd4fd; background: #f2f4ff; border-radius: 14px; color: #444b91; font-size: 13px; }
.notice svg { flex: 0 0 18px; margin-top: 1px; }
.notice strong { display: block; margin-bottom: 2px; }
.section-card { padding: 24px; background: white; border-radius: var(--radius); border: 1px solid var(--line); margin-bottom: 19px; box-shadow: 0 5px 18px rgba(31,36,85,.025); }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.section-title h2 { font-size: 16px; letter-spacing: -.02em; margin: 0; color: #30324c; }
.section-title p { color: var(--muted); margin: 3px 0 0; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.docs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.upload-card { position: relative; padding: 16px; min-height: 173px; border: 1.5px dashed #cbd0dd; border-radius: 15px; background: #fcfcfe; transition: .2s; }
.upload-card:hover { border-color: var(--navy); background: #f8f9ff; }
.upload-card.is-uploaded { border-style: solid; border-color: #b9e2c6; background: #fbfffc; }
.upload-head { display: flex; align-items: flex-start; gap: 11px; }
.upload-icon { width: 35px; height: 35px; border-radius: 10px; display: grid; place-items: center; color: var(--navy); background: var(--soft-navy); flex: 0 0 35px; }
.upload-card.is-uploaded .upload-icon { color: var(--green-dark); background: var(--soft-green); }
.upload-title { min-width: 0; flex: 1; }
.upload-title strong { display: block; color: #32344e; font-size: 13px; line-height: 1.28; }
.upload-title span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; line-height: 1.4; }
.file-state { margin: 14px 0 10px; color: #999bad; font-size: 11px; overflow-wrap: anywhere; min-height: 17px; }
.file-state.has-file { color: var(--green-dark); font-weight: 700; }
.upload-card input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.upload-hint { color: #999bad; font-size: 10px; }
.upload-label { min-height: 32px; padding: 0 10px; cursor: pointer; border-radius: 9px; display: inline-flex; align-items: center; color: var(--navy); background: var(--soft-navy); font-weight: 800; font-size: 11px; }
.is-uploaded .upload-label { color: var(--green-dark); background: var(--soft-green); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.save-message { color: var(--muted); font-size: 12px; margin-right: auto; }

.admin-shell { max-width: 1450px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 52px) 65px; }
.admin-top { display: flex; align-items: end; gap: 22px; justify-content: space-between; margin-bottom: 25px; }
.admin-top h1 { margin: 3px 0 5px; color: var(--navy-2); font-size: 31px; letter-spacing: -.04em; }
.admin-top p { color: var(--muted); margin: 0; font-size: 13px; }
.date-chip { padding: 9px 12px; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 23px; }
.stat-card { padding: 18px; background: white; border-radius: 16px; border: 1px solid var(--line); }
.stat-card .stat-label { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.stat-card .stat-number { color: var(--navy-2); font-size: 29px; font-weight: 800; letter-spacing: -.05em; margin: 5px 0 3px; }
.stat-card .stat-note { color: var(--green-dark); font-size: 11px; font-weight: 700; }
.admin-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(330px,.75fr); gap: 19px; align-items: start; }
.table-card, .review-panel { padding: 20px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.table-head h2, .review-panel h2 { margin: 0; color: #33354d; font-size: 16px; letter-spacing: -.02em; }
.table-head .search-wrap { position: relative; max-width: 214px; width: 100%; }
.search-input { min-height: 37px; padding-left: 34px; font-size: 12px; }
.search-mark { position: absolute; left: 11px; top: 8px; color: #9799ab; }
.tenants-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tenants-table th { color: #8a8d9e; padding: 0 9px 10px; text-align: left; font-weight: 800; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.tenants-table td { padding: 14px 9px; color: #4c4f67; border-bottom: 1px solid #eff0f5; }
.tenants-table tr { cursor: pointer; transition: .15s; }
.tenants-table tr:hover, .tenants-table tr.selected { background: #f7f8ff; }
.company-name { color: #33354f; font-weight: 800; display: block; }
.company-pic { color: var(--muted); display: block; margin-top: 2px; font-size: 11px; }
.schedule-cell { min-width: 122px; color: #53566d; font-size: 11px; line-height: 1.35; }
.schedule-cell strong { display: block; color: #45485d; font-size: 11px; }
.doc-count { color: var(--navy); font-weight: 800; }
.table-action { padding: 4px 7px; color: var(--navy); border: 0; background: transparent; font-weight: 800; }
.review-panel { position: sticky; top: 92px; }
.panel-subtitle { color: var(--muted); font-size: 12px; margin: 4px 0 15px; }
.panel-status { padding: 12px; background: var(--soft-navy); border-radius: 12px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-status strong { color: var(--navy); font-size: 12px; }
.doc-review-list { display: grid; gap: 8px; max-height: 348px; overflow: auto; padding-right: 2px; }
.doc-review { padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.doc-review-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.doc-review strong { font-size: 11px; color: #45475f; line-height: 1.3; }
.doc-review small { display: block; color: var(--muted); margin-top: 3px; font-size: 10px; overflow-wrap: anywhere; }
.doc-review button { color: var(--navy); background: transparent; border: 0; padding: 0; font-size: 10px; font-weight: 800; }
.note-label { display: block; color: #56596e; font-size: 11px; font-weight: 800; margin: 16px 0 6px; }
.note-box { min-height: 72px !important; font-size: 12px; }
.review-actions { display: flex; gap: 9px; margin-top: 12px; }
.review-actions .btn { flex: 1; }
.empty-panel { color: var(--muted); font-size: 13px; padding: 36px 0; text-align: center; }
.schedule-box { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 16px; }
.schedule-box > div { padding: 10px; border-radius: 10px; background: #f8f9fc; border: 1px solid #eceef4; }
.schedule-box span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.schedule-box strong { display: block; color: #454760; margin-top: 3px; font-size: 11px; line-height: 1.35; }

.modal-backdrop { position: fixed; z-index: 80; inset: 0; padding: 22px; display: grid; place-items: center; background: rgba(18,21,68,.47); opacity: 0; visibility: hidden; transition: .2s ease; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { position: relative; width: min(710px, 100%); max-height: min(90vh, 800px); overflow: auto; padding: 26px; background: white; border-radius: 22px; box-shadow: 0 28px 80px rgba(15,18,69,.3); transform: translateY(12px) scale(.98); transition: .2s ease; }
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.modal-head h2 { color: var(--navy-2); font-size: 21px; line-height: 1.15; letter-spacing: -.03em; margin: 4px 0 4px; }
.modal-head p { color: var(--muted); font-size: 12px; margin: 0; }
.close-modal { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 0; border-radius: 9px; color: #686b7e; background: #f2f3f8; font-size: 18px; }
.modal-section { padding: 16px 0; border-top: 1px solid var(--line); }
.modal-section h3 { color: #40425b; margin: 0 0 13px; font-size: 13px; }
.modal-section .form-grid { gap: 13px; }
.account-result { margin-top: 16px; padding: 15px; border: 1px solid #bde2c8; border-radius: 13px; background: #f3fcf6; }
.account-result strong { display: block; color: var(--green-dark); font-size: 13px; }
.credentials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.credentials > div { padding: 9px; border-radius: 9px; background: white; border: 1px solid #dcefe1; }
.credentials span, .credentials code { display: block; }
.credentials span { color: var(--muted); font-size: 10px; font-weight: 700; }
.credentials code { color: #2d3a38; font-size: 12px; font-weight: 800; margin-top: 3px; overflow-wrap: anywhere; }
.account-result p { color: #597064; font-size: 11px; margin: 0; }

.toast { position: fixed; right: 22px; bottom: 22px; max-width: 345px; z-index: 99; color: #fff; background: #24265f; padding: 13px 16px; border-radius: 13px; box-shadow: 0 18px 38px rgba(21,25,95,.25); font-size: 13px; font-weight: 650; opacity: 0; transform: translateY(18px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.foot-note { max-width: 1320px; margin: 0 auto; padding: 0 clamp(18px,4vw,52px) 32px; color: #8a8d9e; font-size: 11px; }

@media (max-width: 1000px) {
  .access-grid { grid-template-columns: 1fr; max-width: 650px; margin: auto; }
  .access-copy { text-align: center; }
  .access-copy p, .venue-chip { margin-left: auto; margin-right: auto; text-align: left; }
  .portal-shell { grid-template-columns: 1fr; }
  .side-summary { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .side-nav { margin: 0; }
  .admin-grid { grid-template-columns: 1fr; }
  .review-panel { position: static; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 18px; }
  .brand-context, .brand-divider, .account-chip > span { display: none; }
  .logo-kota { width: 100px; }
  .logo-pepro { width: 67px; }
  .top-actions { flex-wrap: wrap; }
  .access-main { padding: 44px 20px 55px; }
  .access-copy h1 { font-size: 39px; }
  .portal-shell, .admin-shell { padding-top: 24px; }
  .page-heading, .admin-top { align-items: flex-start; flex-direction: column; gap: 10px; }
  .side-summary { grid-template-columns: 1fr; }
  .form-grid, .docs-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .section-card { padding: 18px; }
  .form-actions { justify-content: stretch; }
  .form-actions .btn { flex: 1; }
  .save-message { width: 100%; }
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .table-card { padding: 16px 12px; overflow-x: visible; }
  /* Tabel berubah jadi kartu berlabel di layar kecil */
  .tenants-table { min-width: 0; }
  .tenants-table thead { display: none; }
  .tenants-table tr { display: block; margin: 0 0 12px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .tenants-table td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid #f2f3f8; }
  .tenants-table tr td:last-child { border-bottom: 0; }
  .tenants-table td::before { content: attr(data-label); flex: none; max-width: 38%; color: #8a8d9e; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .tenants-table td.no-label::before, .tenants-table td:not([data-label])::before { content: none; }
  .tenants-table .cell-val { display: block; min-width: 0; text-align: right; }
  .tenants-table td.row-actions { justify-content: flex-end; }
  .table-head { align-items: flex-start; flex-direction: column; }
  .table-head .search-wrap { max-width: none; }
  .modal { padding: 20px; }
  .credentials, .schedule-box { grid-template-columns: 1fr; }
}

/* ===== Tambahan v2: status notice, demo hint, error, disabled ===== */
.notice.success { border-color: #b9e6c9; background: #effaf2; color: #1e6b3a; }
.notice.danger { border-color: #f3c2c2; background: #fdf1f1; color: #9b2c2c; }
.demo-hint {
  margin-top: 14px; padding: 11px 13px; border-radius: 12px;
  border: 1px dashed #c3c9ef; background: #f7f8ff;
  font-size: 12px; color: #50526d; line-height: 1.6;
}
.demo-hint strong { display: block; color: var(--navy, #24265f); margin-bottom: 2px; }
.demo-hint code, .credentials code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #eceffd; padding: 1px 6px; border-radius: 6px; font-size: 11.5px;
}
.form-error { color: #b3261e; font-size: 12.5px; font-weight: 700; margin: 0 0 10px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.account-chip .text-btn { margin-left: 4px; }

/* ===== Tambahan v3: flow kontrak, template pesan, finance ===== */
.message-box, .contract-box {
  width: 100%; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.65; padding: 14px; border-radius: 12px;
  border: 1px solid #d5d9f2; background: #fafbff; color: #2b2e55; resize: vertical;
}
.contract-box { min-height: 220px; }
.modal-wide { max-width: 860px; width: min(92vw, 860px); }
.panel-hint { font-size: 12.5px; color: #6a6d8f; line-height: 1.6; margin: 12px 0 4px; }
.docs-subhead { font-size: 13px; font-weight: 800; color: #3d4070; margin: 18px 0 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.upload-label.as-btn { border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; }
.upload-label.as-btn svg { width: 14px; height: 14px; }
.demo-hint span { display: block; }

/* Pastikan atribut hidden selalu menang atas display komponen */
[hidden] { display: none !important; }

/* Footer modal selalu terlihat saat konten panjang discroll */
.modal .form-actions {
  position: sticky; bottom: 0; background: #fff;
  padding-top: 12px; padding-bottom: 2px; margin-top: 14px;
  border-top: 1px solid #e6e8f6; z-index: 2;
}

/* v5: edit dokumen di modal kontrak + baris file di panel review */
.doc-edit-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.doc-edit-state { font-size: 12px; color: #6b6f8d; }
.doc-file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.doc-file-row small { margin-top: 0; }
.doc-file-row .view-file { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; cursor: pointer; }
.doc-file-row .view-file svg { width: 12px; height: 12px; }

/* v6: kalender penggunaan venue */
.calendar-card { margin-top: 18px; }
.cal-nav { display: flex; gap: 6px; }
.cal-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin: 2px 0 12px; flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.cal-dot.loadin { background: #d97706; }
.cal-dot.event { background: var(--navy); }
.cal-dot.loadout { background: #dc2626; }
.cal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .cal-grid { grid-template-columns: 1fr; } }
.cal-month h3 { font-size: 13px; margin: 0 0 8px; color: #45475f; text-transform: capitalize; }
.cal-week, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-week span { font-size: 10px; text-align: center; color: var(--muted); font-weight: 700; }
.cal-day { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; padding: 3px 5px; display: flex; flex-direction: column; justify-content: space-between; background: #fff; }
.cal-day.empty { border: 0; background: transparent; }
.cal-day b { font-weight: 600; color: #45475f; }
.cal-day.today { outline: 2px solid var(--navy); outline-offset: -2px; }
.cal-day.booked { background: #f4f6ff; cursor: pointer; }
.cal-dots { display: flex; gap: 3px; min-height: 9px; flex-wrap: wrap; }
.cal-tooltip { position: fixed; z-index: 999; background: #10142b; color: #fff; border-radius: 10px; padding: 8px 12px; max-width: 270px; box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; }
.cal-tip-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.cal-tip-row + .cal-tip-row { border-top: 1px solid rgba(255,255,255,.15); }
.cal-tip-row strong { display: block; font-size: 12px; }
.cal-tip-row span { display: block; font-size: 11px; opacity: .8; }
.cal-tip-row .cal-dot { margin-top: 4px; }

/* v7: kalender per-venue 1 bulan + hapus pengajuan */
.cal-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cal-venue-tabs { display: inline-flex; background: #eef0f7; border-radius: 10px; padding: 3px; gap: 2px; }
.cal-venue-tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; font-family: inherit; }
.cal-venue-tab.active { background: #fff; color: var(--navy); box-shadow: 0 2px 6px rgba(16,20,43,.1); }
.cal-nav { display: inline-flex; align-items: center; gap: 6px; }
.cal-nav select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; font-weight: 600; color: #45475f; background: #fff; font-family: inherit; text-transform: capitalize; }
.cal-grid.single { grid-template-columns: 1fr; max-width: 760px; }
.cal-grid.single .cal-day { aspect-ratio: auto; min-height: 58px; }
.table-action.danger { color: #dc2626; margin-left: 10px; }

/* v8: blokir tanggal, konfirmasi hapus, harga otomatis, perbaikan ikon tombol */
.btn svg { width: 14px; height: 14px; flex: none; }
.review-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.btn-danger { color: #fff; background: #dc2626; box-shadow: 0 8px 18px rgba(220,38,38,.2); }
.modal-narrow { max-width: 460px; }
.price-hint { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; line-height: 1.5; }
.cal-dot.block { background: #6b7280; }
.block-list { display: grid; gap: 8px; }
.block-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.block-row strong { font-size: 12px; display: block; }
.block-row small { font-size: 11px; color: var(--muted); }

/* tombol aksi tidak melar penuh bila sendirian (mis. tombol ZIP) */
.review-actions .btn { flex: 0 1 auto; }
.review-actions:has(.btn:nth-child(2)) .btn { flex: 1; }

/* v10: tenant success state + field notes + PPN hint */
.field-note { font-size: 10px; font-weight: 600; color: var(--muted); background: #eef1f8; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: middle; text-transform: none; letter-spacing: 0; }
.price-hint.tax { color: #8a6d1d; background: #fdf6e3; border: 1px solid #f0e2b6; border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.data-success { text-align: center; padding: 28px 18px 8px; }
.data-success-icon { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; background: #e8f7ee; border: 2px solid #bfe6cd; display: flex; align-items: center; justify-content: center; color: #15803d; }
.data-success-icon svg { width: 38px; height: 38px; }
.data-success h3 { margin: 0 0 8px; font-size: 18px; color: var(--navy); }
.data-success p { margin: 0 auto 16px; max-width: 460px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.data-success-summary { max-width: 460px; margin: 0 auto; text-align: left; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.data-success-summary .sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 12.5px; }
.data-success-summary .sum-row + .sum-row { border-top: 1px solid var(--line); }
.data-success-summary .sum-row span { color: var(--muted); flex: none; }
.data-success-summary .sum-row strong { text-align: right; }

/* v11: konfirmasi kirim data penyewa */
.data-confirm-summary { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 14px; max-height: 320px; overflow-y: auto; }
.data-confirm-summary .sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; font-size: 12.5px; }
.data-confirm-summary .sum-row + .sum-row { border-top: 1px solid var(--line); }
.data-confirm-summary .sum-row span { color: var(--muted); flex: none; }
.data-confirm-summary .sum-row strong { text-align: right; }
.data-confirm-check { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink); margin-bottom: 14px; cursor: pointer; }
.data-confirm-check input { margin-top: 2px; accent-color: var(--navy); }

/* v12: halaman super admin */
.inline-form { border-top: 1px solid var(--line); margin-top: 8px; padding: 18px 20px 20px; }
.inline-form .docs-subhead { margin: 0 0 12px; }
.inline-form .form-actions { margin-top: 14px; }
.table-action:disabled { opacity: .4; cursor: not-allowed; }

/* v15: pratinjau dokumen + hardening interaksi */
.modal-preview { width: min(920px, 100%); max-width: 100%; }
.doc-preview-body { min-height: 240px; max-height: 68vh; overflow: auto; display: flex; align-items: center; justify-content: center; background: #f4f6fb; border: 1px solid var(--line); border-radius: 12px; }
.doc-preview-img { max-width: 100%; max-height: 66vh; object-fit: contain; display: block; }
.doc-preview-frame { width: 100%; height: 66vh; border: 0; display: block; background: #fff; }
.doc-preview-fallback { text-align: center; padding: 40px 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.doc-preview-fallback p { margin: 0 0 6px; }
.doc-preview-fallback .hint { font-size: 12px; color: var(--muted); opacity: .85; }
.doc-preview-loading { padding: 48px 24px; color: var(--muted); font-size: 13px; }
.doc-file-actions { display: inline-flex; gap: 6px; flex: none; }

/* scrollbar ramping & rapi untuk daftar dokumen (menghilangkan "block tipis" di dekat tombol ZIP) */
.doc-review-list { scrollbar-width: thin; scrollbar-color: #c3cbdd transparent; }
.doc-review-list::-webkit-scrollbar { width: 6px; height: 6px; }
.doc-review-list::-webkit-scrollbar-track { background: transparent; }
.doc-review-list::-webkit-scrollbar-thumb { background: #c3cbdd; border-radius: 999px; }
.doc-review-list::-webkit-scrollbar-thumb:hover { background: #9aa6c2; }
.doc-preview-body { scrollbar-width: thin; scrollbar-color: #c3cbdd transparent; }
.doc-preview-body::-webkit-scrollbar { width: 6px; height: 6px; }
.doc-preview-body::-webkit-scrollbar-track { background: transparent; }
.doc-preview-body::-webkit-scrollbar-thumb { background: #c3cbdd; border-radius: 999px; }

/* hardening: hilangkan tap-highlight & seleksi tak sengaja pada elemen aksi */
.btn, .text-btn, .table-action, .view-file, .upload-label, .close-modal, .cal-venue-tabs button {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.view-file:focus-visible, .table-action:focus-visible, .btn:focus-visible, .text-btn:focus-visible {
  outline: 2px solid #2f5fd0;
  outline-offset: 2px;
}
.btn:focus:not(:focus-visible), .text-btn:focus:not(:focus-visible),
.table-action:focus:not(:focus-visible), .view-file:focus:not(:focus-visible) { outline: none; }
