/* EDUVIA Portal Cashflow — Modern Soft-Elegant UI, Dashboard Widgets & Cashbook v20261124 */

/* Smooth view reveal */
.cashflow-app .view-section:not(.hidden) {
  animation: cfViewReveal 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cfViewReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Crisp SVG icon rendering across sidebar, mobile dock, and widgets */
.cashflow-app .portal-nav svg.nav-icon,
.cashflow-app .mobile-bottomnav svg,
.cf-ic {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  flex-shrink: 0;
}
.cashflow-app .portal-nav button {
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}
.cashflow-app .portal-nav button svg.nav-icon {
  width: 19px;
  height: 19px;
  opacity: 0.88;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.cashflow-app .portal-nav button:hover svg.nav-icon,
.cashflow-app .portal-nav button.active svg.nav-icon {
  opacity: 1;
  transform: scale(1.06);
}
.cashflow-app .mobile-bottomnav button svg {
  width: 20px;
  height: 20px;
}
.cf-ic {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
}
.cf-ic--sm {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}
.cf-ic--lg {
  width: 22px;
  height: 22px;
}

/* Tabular numerals for crisp Rupiah alignment */
.cf-num {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

/* =========================================================================
   DASHBOARD COMMAND DECK (Soft Pearl-Sage Theme — Zero Harsh Blue Boxes)
   ========================================================================= */
.cf-dash {
  display: grid;
  gap: 18px;
}

/* Soft Welcome & Quick Actions Banner */
.cf-welcome {
  position: relative;
  overflow: hidden;
  background: linear-gradient(148deg, #ffffff 0%, #f8fbfd 56%, #f1f8f5 100%) !important;
  border: 1px solid #e1ebf3 !important;
  border-radius: 22px;
  padding: 22px 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.045), 0 1px 2px rgba(15, 23, 42, 0.03);
  display: grid;
  gap: 16px;
}
.cf-welcome::before {
  content: "";
  position: absolute;
  top: -75px;
  right: -55px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 104, 71, 0.09) 0%, rgba(7, 142, 232, 0.05) 55%, transparent 74%);
  pointer-events: none;
}
.cf-welcome__top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.cf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #edf6f2;
  color: #116847;
  border: 1px solid #cce7db;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cf-welcome h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.cf-welcome p {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: #52637a;
  line-height: 1.5;
}
.cf-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #dce8f2;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}
.cf-health-pill__ring {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #edf6f2;
  color: #116847;
  font-size: 13px;
  font-weight: 800;
}
.cf-health-pill small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cf-health-pill b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

/* Quick Launch Action Widgets */
.cf-quick-widgets {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid #ebf1f7;
}
.cf-qbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 13px;
  border: 1.5px solid #dce6f0;
  background: #ffffff;
  color: #173654;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.cf-qbtn:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}
.cf-qbtn.is-in {
  background: #edf7f2;
  border-color: #bfe4d2;
  color: #116847;
}
.cf-qbtn.is-in:hover {
  background: #e1f3ea;
  border-color: #86d3b2;
}
.cf-qbtn.is-out {
  background: #fff5f6;
  border-color: #fecdd3;
  color: #be123c;
}
.cf-qbtn.is-out:hover {
  background: #ffe9ec;
  border-color: #fda4af;
}
.cf-qbtn.is-primary {
  background: #173f66;
  border-color: #173f66;
  color: #ffffff;
}
.cf-qbtn.is-primary:hover {
  background: #123252;
  border-color: #123252;
  color: #ffffff;
}

/* Executive KPI Grid */
.cf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.cf-kpi-grid.is-student {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.cf-kpi {
  position: relative;
  background: #ffffff !important;
  border: 1px solid #e2ebf3 !important;
  border-radius: 18px !important;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.035);
  display: grid;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.cf-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  border-color: #cbdceb !important;
}
.cf-kpi__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cf-kpi__label {
  font-size: 12.5px;
  font-weight: 700;
  color: #52637a;
}
.cf-kpi__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #eef5fc;
  color: #1d4e89;
  flex-shrink: 0;
}
.cf-kpi.is-emerald .cf-kpi__icon { background: #eaf7f0; color: #116847; }
.cf-kpi.is-amber .cf-kpi__icon { background: #fff7e6; color: #b45309; }
.cf-kpi.is-rose .cf-kpi__icon { background: #fff1f2; color: #be123c; }
.cf-kpi.is-sky .cf-kpi__icon { background: #eaf4ff; color: #0369a1; }
.cf-kpi.is-violet .cf-kpi__icon { background: #f4effe; color: #6d28d9; }
.cf-kpi.is-balance {
  background: linear-gradient(145deg, #ffffff 0%, #f3faf6 100%) !important;
  border-color: #cde8da !important;
}
.cf-kpi.is-balance.is-negative {
  background: linear-gradient(145deg, #ffffff 0%, #fff5f6 100%) !important;
  border-color: #fecdd3 !important;
}
.cf-kpi__val {
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
}
.cf-kpi.is-emerald .cf-kpi__val { color: #0f5a3e; }
.cf-kpi.is-rose .cf-kpi__val { color: #9f1239; }
.cf-kpi__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}
.cf-kpi__tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}
.cf-kpi.is-emerald .cf-kpi__tag { background: #dcfce7; color: #15803d; }
.cf-kpi.is-amber .cf-kpi__tag { background: #fef3c7; color: #b45309; }
.cf-kpi.is-rose .cf-kpi__tag { background: #fee2e2; color: #b91c1c; }

/* Statistics & Charts Bento Row */
.cf-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
}
.cf-widget-card {
  background: #ffffff;
  border: 1px solid #e2ebf3;
  border-radius: 20px;
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.035);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cf-widget-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cf-widget-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.cf-widget-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #64748b;
}

/* Donut Chart Widget */
.cf-donut-wrap {
  display: grid;
  grid-template-columns: 158px 1fr;
  gap: 18px;
  align-items: center;
}
.cf-donut-box {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto;
}
.cf-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.cf-donut-center strong {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.05;
}
.cf-donut-center small {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  margin-top: 2px;
}
.cf-breakdown {
  display: grid;
  gap: 10px;
}
.cf-brow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #f8fafc;
  border: 1px solid #ebf1f7;
}
.cf-brow__left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.cf-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cf-dot.is-paid { background: #16a34a; }
.cf-dot.is-unpaid { background: #f59e0b; }
.cf-dot.is-relief { background: #078ee8; }
.cf-brow__left span {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.cf-brow__left small {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  font-weight: 500;
}
.cf-brow__val {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  text-align: right;
  white-space: nowrap;
}

/* 6-Month Cashflow Bar Chart Widget */
.cf-chart-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}
.cf-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cf-legend-sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.cf-legend-sw.is-in { background: #15803d; }
.cf-legend-sw.is-out { background: #e11d48; }
.cf-bar-chart {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 174px;
  padding: 14px 8px 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fafdff 0%, #f5f9fc 100%);
  border: 1px solid #e9f0f7;
}
.cf-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}
.cf-bar-pair {
  width: 100%;
  height: 124px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
}
.cf-bar {
  width: 18px;
  max-width: 42%;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  transition: height 0.35s ease, filter 0.15s ease;
  position: relative;
}
.cf-bar:hover { filter: brightness(1.08); }
.cf-bar.is-in { background: linear-gradient(180deg, #22c55e 0%, #116847 100%); }
.cf-bar.is-out { background: linear-gradient(180deg, #fb7185 0%, #be123c 100%); }
.cf-bar-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
}

/* Dashboard Lower Bento: Bills with Filter Tabs + Cash Movement Feed */
.cf-bento-grid {
  display: grid;
  grid-template-columns: 1.38fr 0.92fr;
  gap: 16px;
  align-items: start;
}
.cf-tab-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cf-tab-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dce6f0;
  background: #f8fafc;
  color: #475569;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}
.cf-tab-pill:hover {
  border-color: #93c5fd;
  color: #143652;
}
.cf-tab-pill.active {
  background: #143652;
  border-color: #143652;
  color: #ffffff;
}

/* Cash Movement Feed Items */
.cf-tx-list {
  display: grid;
  gap: 10px;
}
.cf-tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f9fbfd;
  border: 1px solid #e7eff6;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.cf-tx-item:hover {
  background: #ffffff;
  border-color: #cfe0ef;
}
.cf-tx-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.cf-tx-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cf-tx-badge.is-in { background: #eaf7f0; color: #116847; }
.cf-tx-badge.is-out { background: #fff1f2; color: #be123c; }
.cf-tx-info { min-width: 0; }
.cf-tx-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-tx-info small {
  display: block;
  font-size: 11.5px;
  color: #64748b;
}
.cf-tx-amt {
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}
.cf-tx-amt.is-in { color: #116847; }
.cf-tx-amt.is-out { color: #be123c; }

/* =========================================================================
   PENCATATAN KEUANGAN (BUKU KAS MASUK & KELUAR)
   ========================================================================= */
.cf-cashbook {
  display: grid;
  gap: 18px;
}
.cf-cb-layout {
  display: grid;
  grid-template-columns: minmax(300px, 355px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.cf-cb-layout > * {
  min-width: 0;
}
.cf-cb-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) minmax(0, 0.85fr);
  gap: 10px;
  align-items: end;
}
.cf-cb-filters label {
  min-width: 0;
}
.cf-cb-filters input,
.cf-cb-filters select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 11px;
  border-radius: 10px;
  box-sizing: border-box;
}
.cf-cashbook .table-wrap table {
  min-width: 0 !important;
  width: 100% !important;
}
.cf-cashbook .table-wrap table th,
.cf-cashbook .table-wrap table td {
  padding: 11px 10px;
  vertical-align: middle;
}
.cf-cashbook .cf-cb-pill {
  white-space: nowrap;
}
.cf-cashbook .panel-actions {
  flex-wrap: nowrap;
  gap: 6px;
}
.cf-cb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border-radius: 9px !important;
}

/* Mobile bottom nav: support 5 buttons cleanly on one single row */
.cashflow-app .mobile-bottomnav:has(> button:nth-child(5)) {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}
.cashflow-app .mobile-bottomnav button {
  min-width: 0;
  padding-inline: 4px;
}
.cf-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border-radius: 14px;
  background: #f1f6fa;
  border: 1px solid #e1ebf3;
}
.cf-type-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cf-type-btn.is-in.active {
  background: #ffffff;
  border-color: #86efac;
  color: #116847;
  box-shadow: 0 4px 12px rgba(17, 104, 71, 0.12);
}
.cf-type-btn.is-out.active {
  background: #ffffff;
  border-color: #fda4af;
  color: #be123c;
  box-shadow: 0 4px 12px rgba(190, 18, 60, 0.12);
}
.cf-cb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.cf-cb-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
}
.cf-cb-pill.is-in { background: #dcfce7; color: #15803d; }
.cf-cb-pill.is-out { background: #fee2e2; color: #b91c1c; }
.cf-cb-pill.is-bill { background: #e0f2fe; color: #0369a1; }

.cf-amount-preview {
  font-size: 12.5px;
  font-weight: 700;
  color: #116847;
  margin-top: 4px;
}
.cf-amount-preview.is-out { color: #be123c; }

/* Responsive Breakpoints */
@media (max-width: 1180px) {
  .cf-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cf-stats-grid { grid-template-columns: 1fr; }
  .cf-bento-grid { grid-template-columns: 1fr; }
  .cf-cb-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .cf-welcome { padding: 18px 16px; border-radius: 18px; }
  .cf-kpi-grid,
  .cf-kpi-grid.is-student { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cf-kpi { padding: 14px; border-radius: 16px !important; }
  .cf-kpi__val { font-size: 17.5px; }
  .cf-widget-card { padding: 16px; border-radius: 18px; }
  .cf-donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .cf-breakdown { width: 100%; }
  .cf-cb-filters { grid-template-columns: 1fr; }
  .cf-quick-widgets { gap: 7px; }
  .cf-qbtn { padding: 8px 12px; font-size: 12.5px; }
}
@media (max-width: 440px) {
  .cf-kpi-grid,
  .cf-kpi-grid.is-student { grid-template-columns: 1fr; }
}
