:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-muted: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --primary: #1D4ED8;
  --primary-hover: #1E40AF;
  --primary-soft: #EFF6FF;
  --primary-border: #BFDBFE;

  --success: #059669;
  --success-soft: #ECFDF5;
  --success-border: #A7F3D0;

  --warning: #D97706;
  --warning-soft: #FFFBEB;
  --warning-border: #FDE68A;

  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --danger-border: #FECACA;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
}

.container-narrow {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Boot Loader */
.boot-loader {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Header / Navbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 170px;
}

.user-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 13px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.22);
}

.btn-success:hover:not(:disabled) {
  background: #047857;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover:not(:disabled) {
  background: #B91C1C;
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  background: var(--surface-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.card-sm {
  padding: 16px;
  border-radius: var(--radius-md);
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-primary { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-success { background: var(--success-soft); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-muted { background: var(--surface-muted); color: var(--text-secondary); border: 1px solid var(--border); }

/* Landing Hero */
.hero {
  padding: 48px 0 36px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 38px;
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 14px;
}

.hero h1 span {
  color: var(--primary);
}

.hero-lead {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.trust-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.trust-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.trust-item span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Form Controls */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.seg-btn {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.seg-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.summary-box {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.summary-row.total {
  border-top: 1px dashed var(--border-strong);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
}

/* Sections */
.section {
  padding: 28px 0;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-head p {
  font-size: 14px;
  color: var(--text-secondary);
}

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

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.step-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
}

.step-card p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Tariff Table */
.tariff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.table-clean {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table-clean th, .table-clean td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table-clean th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-muted);
}

.table-clean td:last-child, .table-clean th:last-child {
  text-align: right;
}

/* Auth View */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
}

.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Dashboard */
.dash-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 26px 0 18px;
}

.dash-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}

.quick-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.quick-card.primary-card {
  background: linear-gradient(135deg, #1D4ED8 0%, #1E3A8A 100%);
  color: #FFFFFF;
  border-color: transparent;
}

.quick-card.primary-card .card-desc {
  color: rgba(255, 255, 255, 0.85);
}

.room-list {
  display: grid;
  gap: 12px;
}

.room-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.room-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.room-row-main {
  min-width: 0;
}

.room-row-title {
  font-weight: 800;
  font-size: 15px;
  color: var(--text);
  margin: 4px 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-row-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.room-row-right {
  text-align: right;
  flex-shrink: 0;
}

/* Room Workspace */
.room-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  padding: 20px 0 40px;
  align-items: start;
}

/* Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-muted);
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.step-node.done .step-dot {
  background: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
}

.step-node.done {
  color: var(--success);
}

.step-node.active .step-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.step-node.active {
  color: var(--primary);
}

.step-node.frozen .step-dot {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.step-node.frozen {
  color: var(--danger);
}

/* Status Banner */
.status-banner {
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-banner.info { background: var(--primary-soft); border-color: var(--primary-border); }
.status-banner.success { background: var(--success-soft); border-color: var(--success-border); }
.status-banner.warning { background: var(--warning-soft); border-color: var(--warning-border); }
.status-banner.danger { background: var(--danger-soft); border-color: var(--danger-border); }

.countdown-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

/* QRIS Panel */
.qris-box {
  background: #FFFFFF;
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.qris-img {
  width: 230px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px;
  background: #FFFFFF;
  margin: 12px auto;
  display: block;
}

/* Chat Panel */
.chat-card {
  display: flex;
  flex-direction: column;
  height: 580px;
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 82px;
}

.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F8FAFC;
}

.msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.msg.system {
  max-width: 100%;
  align-self: center;
  background: #EFF6FF;
  border: 1px solid #DBEAFE;
  color: #1E3A8A;
  font-size: 12.5px;
  text-align: center;
  border-radius: 10px;
}

.msg.me {
  align-self: flex-end;
  background: var(--primary);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.msg.other {
  align-self: flex-start;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-meta {
  font-size: 11px;
  opacity: 0.78;
  margin-bottom: 3px;
  font-weight: 700;
}

.msg-img {
  max-width: 210px;
  max-height: 210px;
  border-radius: 10px;
  margin-top: 6px;
  cursor: pointer;
  display: block;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.chat-composer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-composer input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
}

.proof-thumb {
  width: 100%;
  max-width: 260px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  margin-top: 8px;
  display: block;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
}

.upload-preview img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.toast-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
}

.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 12px 0;
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

/* Responsive Mobile Android */
@media (max-width: 860px) {
  .hero-grid, .tariff-grid, .room-layout, .dash-quick {
    grid-template-columns: 1fr;
  }
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
  .chat-card {
    position: static;
    height: 460px;
  }
}

@media (max-width: 560px) {
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: 27px; }
  .trust-strip, .steps-grid, .grid-2 {
    grid-template-columns: 1fr;
  }
  .topbar-inner { height: 58px; gap: 8px; }
  .brand { gap: 8px; flex: 1; }
  .brand-logo { width: 32px; height: 32px; }
  .brand-title { font-size: 14.5px; }
  .brand-sub { display: none; }
  .nav-hide-mobile { display: none !important; }
  .topbar-actions { gap: 6px; }
  .user-pill { max-width: 106px; padding: 5px 9px; font-size: 12px; }
  .card { padding: 16px; }
  .stepper { padding: 10px 6px; gap: 4px; }
  .step-node { font-size: 10.5px; }
  .toast-root { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}
