:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --info: #0369a1;
  --info-bg: #e0f2fe;
}
* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overscroll-behavior-y: contain;
}
body { display: flex; justify-content: center; }
button, a, select, input { touch-action: manipulation; }
.app-frame {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: #f8fafc;
  box-shadow: 0 0 30px rgba(15, 23, 42, 0.08);
  position: relative;
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
.hidden { display: none !important; }
.topbar {
  background: var(--primary);
  color: #fff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo-badge {
  width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.15rem;
}
.topbar h1 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.sub-badge { font-size: 0.71rem; opacity: 0.88; }
.install-pill {
  background: #f59e0b; color: #fff; border: none; border-radius: 99px;
  padding: 6px 11px; font-size: 0.74rem; font-weight: 700; cursor: pointer;
}
.icon-btn {
  background: rgba(255,255,255,0.15); border: none; color: #fff; width: 34px; height: 34px;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-card .icon-btn { background: #f1f5f9; color: var(--text); }
.offline-bar {
  background: #1e293b; color: #f8fafc; text-align: center;
  font-size: 0.76rem; padding: 6px 12px;
}
.screen { padding: 16px; }
.auth-hero { text-align: center; padding: 18px 0 14px; }
.shield-pill {
  display: inline-block; background: #ccfbf1; color: var(--primary-dark);
  font-size: 0.75rem; font-weight: 600; padding: 4px 10px; border-radius: 99px;
}
.auth-hero h2 { margin: 10px 0 6px; font-size: 1.4rem; }
.auth-hero p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
.pass-wrap { position: relative; display: flex; align-items: center; }
.pass-wrap input { padding-right: 42px; }
.eye-btn {
  position: absolute; right: 8px; background: transparent; border: none;
  font-size: 1rem; cursor: pointer; padding: 6px 8px;
}
code { background: #e2e8f0; padding: 2px 5px; border-radius: 4px; font-size: 0.78rem; }
.exec-banner {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.22);
}
.exec-tag {
  display: inline-block; background: rgba(255,255,255,0.18);
  padding: 3px 8px; border-radius: 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px;
}
.month-pill-input {
  background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px; padding: 6px 8px; font-size: 0.8rem; width: auto;
}
.exec-progress-wrap { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.exec-progress-track { flex: 1; height: 7px; background: rgba(255,255,255,0.22); border-radius: 99px; overflow: hidden; }
.exec-progress-fill { height: 100%; background: #34d399; transition: width 0.3s; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  line-height: 1.6;
}
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 0.79rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 16px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn {
  border: none; border-radius: 10px; padding: 12px 14px; font-weight: 600;
  font-size: 0.92rem; cursor: pointer; transition: 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1px solid var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 8px 11px; font-size: 0.79rem; }
.btn-block { width: 100%; }
.hint-text { font-size: 0.81rem; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }
.alert-banner {
  background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px;
  font-size: 0.8rem; display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.alert-banner button {
  background: var(--warn); color: #fff; border: none; border-radius: 6px; padding: 5px 9px; font-size: 0.75rem; cursor: pointer;
}
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px;
}
.kpi-title { font-size: 0.74rem; color: var(--muted); display: block; }
.kpi-val { font-size: 1.12rem; font-weight: 800; margin-top: 4px; display: block; }
.kpi-success .kpi-val { color: var(--success); }
.kpi-danger .kpi-val { color: var(--danger); }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick-actions-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.section-heading { font-size: 0.96rem; margin: 14px 0 10px; font-weight: 700; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stack-list { display: flex; flex-direction: column; gap: 12px; }
.badge { padding: 3px 9px; border-radius: 99px; font-size: 0.71rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.badge-paid, .badge-resolved, .badge-closed { background: var(--success-bg); color: var(--success); }
.badge-partial, .badge-in_progress { background: var(--warn-bg); color: var(--warn); }
.badge-pending, .badge-open { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.detail-lines {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.84rem; line-height: 1.65; color: var(--text);
}
.detail-lines .lbl { font-weight: 600; color: var(--muted); display: inline-block; min-width: 118px; }
.remark-highlight {
  background: #f0fdfa; border-left: 3px solid var(--primary); padding: 8px 10px;
  border-radius: 6px; font-size: 0.83rem; margin-top: 8px; line-height: 1.55;
}
.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.search-input { margin-bottom: 12px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.bottom-nav {
  position: fixed; bottom: 0; width: 100%; max-width: 480px; background: #fff;
  border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 25;
}
.bottom-nav.nav-5 { grid-template-columns: repeat(5, 1fr); }
.nav-item {
  border: none; background: transparent; display: flex; flex-direction: column;
  align-items: center; gap: 2px; color: var(--muted); cursor: pointer; padding: 4px 2px;
}
.nav-item small { font-size: 0.7rem; }
.nav-item.active { color: var(--primary); font-weight: 700; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-card {
  background: #fff; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px)); max-height: 90vh; overflow-y: auto;
}
.bill-summary-box {
  background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 10px;
  padding: 10px; margin-bottom: 12px; font-size: 0.85rem;
}
.bill-grand-total { font-size: 1.05rem; color: var(--primary-dark); margin-top: 4px; }
.toast {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 99px;
  font-size: 0.82rem; z-index: 60; box-shadow: 0 4px 12px rgba(0,0,0,0.25); max-width: 90%; text-align: center;
}
