/* =========================================================
   CashLink — Design tokens
   Palette: deep emerald (uang/pertumbuhan) + amber (aksen)
   ========================================================= */
:root{
  --primary: #0F6E5C;
  --primary-dark: #0A4D40;
  --primary-light: #E4F2EE;
  --accent: #F2A93B;
  --accent-dark: #D98F1F;
  --bg: #F5F7F6;
  --surface: #FFFFFF;
  --text: #1B2420;
  --text-muted: #6B7B76;
  --border: #E4E9E7;
  --success: #2E9E5B;
  --danger: #D64545;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 10px rgba(15, 30, 26, 0.06);
  --shadow-elevated: 0 8px 24px rgba(15, 30, 26, 0.14);
  --shadow-fab: 0 6px 16px rgba(15, 110, 92, 0.35);
  --nav-height: 68px;
  --topbar-height: 64px;
  --app-max-width: 480px;
}

*{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: pan-x pan-y;
}

html, body{
  margin: 0;
  padding: 0;
  background: #DDE6E2;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

body{
  touch-action: pan-x pan-y;
}

a{ text-decoration: none; color: inherit; }
button{ font-family: inherit; }
ul{ list-style: none; margin: 0; padding: 0; }

/* Phone-like app shell, centered on wider screens */
.app-shell{
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

/* ---------------- Top App Bar ---------------- */
.topbar{
  height: var(--topbar-height);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .title{
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .title .material-symbols-rounded{ font-size: 22px; }
.topbar .icon-btn{
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.14);
  border: none; color: #fff; cursor: pointer;
}
.topbar .icon-btn:active{ background: rgba(255,255,255,0.28); }
.topbar-sub{
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
}

/* ---------------- Content area ---------------- */
.content{
  padding: 18px 16px calc(var(--nav-height) + 20px);
}

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

.balance-card{
  background: linear-gradient(135deg, var(--primary) 0%, #12856F 60%, var(--accent) 160%);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  color: #fff;
  box-shadow: var(--shadow-elevated);
  position: relative;
  overflow: hidden;
}
.balance-card::after{
  content: "";
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  top: -60px; right: -40px;
}
.balance-card .label{
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
}
.balance-card .amount{
  font-family: 'Sora', sans-serif;
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0 14px;
}
.balance-row{
  display: flex;
  gap: 14px;
}
.balance-chip{
  background: rgba(255,255,255,0.16);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  flex: 1;
}
.balance-chip .v{ font-size: 15px; font-weight: 700; display:block; margin-top: 2px; font-family:'Sora',sans-serif;}

/* ---------------- Section heading ---------------- */
.section-title{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}
.section-title h2{
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.section-title a{
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 600;
}

/* ---------------- Quick actions grid (ala grid ikon Android) ---------------- */
.quick-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}
.quick-item{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.quick-item .icon-wrap{
  width: 52px; height: 52px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
  transition: transform .12s ease;
}
.quick-item:active .icon-wrap{ transform: scale(0.92); }
.quick-item .icon-wrap .material-symbols-rounded{ font-size: 24px; color:#fff; }
.quick-item span.lbl{
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}

/* ---------------- Transaction list items ---------------- */
.trx-item{
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
}
.trx-item .trx-icon{
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.trx-item .trx-icon .material-symbols-rounded{ color:#fff; font-size: 20px; }
.trx-item .trx-info{ flex: 1; min-width: 0; }
.trx-item .trx-info .kat{ font-weight: 700; font-size: 13.5px; }
.trx-item .trx-info .ket{
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trx-item .trx-right{ text-align: right; flex-shrink: 0; }
.trx-item .trx-right .nominal{ font-weight: 700; font-size: 13.5px; }
.trx-item .trx-right .laba{ font-size: 11px; color: var(--success); font-weight: 600; }
.trx-item .trx-right .waktu{ font-size: 10.5px; color: var(--text-muted); margin-top: 2px;}

.empty-state{
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .material-symbols-rounded{ font-size: 46px; opacity: 0.5; }
.empty-state p{ font-size: 13px; margin-top: 6px; }

/* ---------------- Forms ---------------- */
.form-group{ margin-bottom: 14px; }
.form-row{
  display: flex;
  gap: 10px;
}
.form-row .form-group{ flex: 1; min-width: 0; }
.form-group label{
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.form-control{
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 16px; /* >=16px mencegah auto-zoom saat fokus di iOS Safari */
  color: var(--text);
  font-family: inherit;
  line-height: 1.3;
}
input[type="date"].form-control,
input[type="time"].form-control{
  font-size: 14.5px; /* input date/time native tidak memicu auto-zoom iOS walau <16px */
  padding: 10px 10px;
}
select.form-control{ -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7B76' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-control:focus{
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
textarea.form-control{ resize: vertical; min-height: 70px; }

.kategori-picker{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.kategori-picker input{ display: none; }
.kategori-picker label{
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  text-align: center;
  color: var(--text-muted);
}
.kategori-picker input:checked + label{
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.kategori-picker .ic{
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.kategori-picker .ic .material-symbols-rounded{ font-size: 18px; color: #fff; }

/* ---------------- Buttons ---------------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary{ background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(15,110,92,0.3); }
.btn-primary:active{ background: var(--primary-dark); }
.btn-outline{ background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-danger{ background: var(--danger); color: #fff; }
.btn-ghost{ background: var(--border); color: var(--text); }

/* ---------------- Bottom Navigation ---------------- */
.bottom-nav{
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 60;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}
.nav-item{
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  flex: 1;
  padding: 6px 0;
}
.nav-item .material-symbols-rounded{ font-size: 22px; }
.nav-item.active{ color: var(--primary); }
.nav-item.active .material-symbols-rounded{ font-variation-settings: 'FILL' 1; }

.fab{
  position: fixed;
  bottom: calc(var(--nav-height) - 26px);
  left: 50%;
  transform: translateX(-50%);
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(15, 30, 26, 0.28), 0 3px 8px rgba(0,0,0,0.18);
  border: 4px solid var(--bg);
  cursor: pointer;
  z-index: 65;
}
.fab .material-symbols-rounded{ font-size: 27px; }
.fab:active{ transform: translateX(-50%) scale(0.94); }

/* ---------------- Auth (login) ---------------- */
.auth-shell{
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 42%, var(--bg) 42%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px 20px;
  position: relative;
  overflow: hidden;
}
.auth-shell::before{
  content: "";
  position: absolute;
  top: -80px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.auth-shell::after{
  content: "";
  position: absolute;
  top: 40px; left: -70px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.auth-logo{
  text-align: center;
  color: #fff;
  margin-bottom: 26px;
  position: relative;
  z-index: 1;
}
.auth-logo .mark{
  width: 60px; height: 60px;
  border-radius: 18px;
  background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.auth-logo .mark .material-symbols-rounded{ font-size: 30px; }
.auth-logo h1{
  font-family:'Sora',sans-serif; font-size: 21px; margin: 0;
  line-height: 1.25; padding: 0 8px;
}
.auth-logo p{
  font-size: 12px; opacity: .82; margin: 6px 0 0;
  padding: 0 12px; line-height: 1.4;
}
.auth-card{
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  box-shadow: var(--shadow-elevated);
  position: relative;
  z-index: 1;
}
.auth-card h2{ font-family:'Sora',sans-serif; font-size: 17px; margin: 0 0 4px; }
.auth-card .sub{ font-size: 12.5px; color: var(--text-muted); margin-bottom: 20px; }

.auth-footer{
  text-align: center;
  margin-top: 26px;
  position: relative;
  z-index: 1;
}
.auth-footer-brand{
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 12px;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.auth-footer-brand .material-symbols-rounded{ font-size: 15px; color: var(--accent-dark); }
.auth-footer-copyright{
  font-size: 10.5px;
  color: var(--text-muted);
}

.alert{
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 14px;
}
.alert-danger{ background: #FBE7E7; color: var(--danger); }
.alert-success{ background: #E4F5EA; color: var(--success); }

/* ---------------- Filter chips (Laporan) ---------------- */
.filter-bar{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.filter-bar::-webkit-scrollbar{ display: none; }
.chip{
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.chip.active{ background: var(--primary); border-color: var(--primary); color: #fff; }

.summary-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.summary-box{
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.summary-box .lbl{ font-size: 11px; color: var(--text-muted); font-weight: 600; }
.summary-box .val{ font-family:'Sora',sans-serif; font-size: 17px; font-weight: 700; margin-top: 4px; }

.table-simple{ width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table-simple th{
  text-align: left; padding: 9px 8px; color: var(--text-muted);
  border-bottom: 1.5px solid var(--border); font-size: 11px;
}
.table-simple td{ padding: 9px 8px; border-bottom: 1px solid var(--border); }

.profile-card{
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.avatar{
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 20px;
}
.menu-list .menu-item{
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  font-size: 13.5px;
  font-weight: 600;
}
.menu-list .menu-item .material-symbols-rounded{ color: var(--primary); }
.menu-list .menu-item.danger .material-symbols-rounded{ color: var(--danger); }
.menu-list .menu-item.danger{ color: var(--danger); }

.badge{
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
}

/* ---------------- Dynamic category detail fields ---------------- */
.field-section{ display: none; }
.field-section.active{ display: block; }
.field-section .card{ margin-bottom: 14px; }
.field-section .card .sec-lbl{
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px;
}
.field-section .card{ padding: 14px; margin-bottom: 12px; }

.preset-scroll{
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 14px;
}
.preset-scroll::-webkit-scrollbar{ display: none; }
.preset-chip{
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  border: 1.5px solid transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  text-align: left;
  min-width: 92px;
}
.preset-chip .p-nominal{ display: block; font-size: 12.5px; }
.preset-chip .p-laba{ display: block; font-size: 10.5px; color: var(--success); font-weight: 600; margin-top: 2px; }
.preset-chip.selected{ border-color: var(--primary); background: #D7EEE8; }

/* ---------------- Toggle switch (aktif/nonaktif) ---------------- */
.switch{
  position: relative;
  display: inline-block;
  width: 42px; height: 24px;
  flex-shrink: 0;
}
.switch input{ opacity: 0; width: 0; height: 0; }
.switch .slider{
  position: absolute; cursor: pointer; inset: 0;
  background: #CBD5D1; border-radius: 24px; transition: .15s;
}
.switch .slider::before{
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s;
}
.switch input:checked + .slider{ background: var(--success); }
.switch input:checked + .slider::before{ transform: translateX(18px); }

.role-badge{
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
}
.role-badge.admin{ background: #FDECD2; color: var(--accent-dark); }
.role-badge.karyawan{ background: var(--primary-light); color: var(--primary-dark); }

/* ---------------- Notifikasi sukses di tengah layar ---------------- */
.toast-center-overlay{
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 30, 26, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  padding: 24px;
}
.toast-center-overlay.show{ opacity: 1; pointer-events: auto; }
.toast-center-card{
  background: var(--surface);
  border-radius: 20px;
  padding: 26px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-elevated);
  max-width: 260px;
  transform: scale(.85);
  transition: transform .2s ease;
}
.toast-center-overlay.show .toast-center-card{ transform: scale(1); }
.toast-center-card .icon-circle{
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--success);
  display: flex; align-items: center; justify-content: center;
}
.toast-center-card .icon-circle .material-symbols-rounded{ color: #fff; font-size: 28px; }
.toast-center-card .msg{
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.4;
}