/* ==========================================================================
   VENCANTO ACCOUNTING - DESIGN SYSTEM & STYLESHEET
   Encanto Botanical Casa Aesthetic (Light & Dark Theme)
   ========================================================================== */

:root {
  --pink: #E84A8A;
  --purple: #7B4FA3;
  --yellow: #F6C445;
  --jungle: #2D6A4F;
  --leaf: #3F8F5B;
  --terracotta: #E07A5F;

  --bg-body: #FBF9F4;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #F7F2EC;

  --border: #E8DEC8;

  --text-heading: #2D232E;
  --text-body: #5A4D5C;
  --text-muted: #8E7E90;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(123, 79, 163, 0.06);
  --shadow-md: 0 4px 20px rgba(123, 79, 163, 0.10);
  --shadow-lg: 0 12px 36px rgba(123, 79, 163, 0.16);

  --font-brand: 'Merienda', cursive, serif;
  --font-body: 'DM Sans', 'Nunito', sans-serif;
  --font-numeric: 'Nunito', sans-serif;

  --sidebar-w: 270px;
  --header-h: 70px;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-blur: blur(12px);
}

body.dark,
[data-theme="dark"] {
  --bg-body: #16131B;
  --bg-surface: #211D27;
  --bg-surface-2: #29232F;

  --border: #3A3040;

  --text-heading: #FFF4D8;
  --text-body: #E9DDE8;
  --text-muted: #BFAFC0;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 44px rgba(0, 0, 0, 0.6);

  --glass-bg: rgba(33, 29, 39, 0.88);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.55;
  font-size: 14.5px;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(123, 79, 163, 0.035) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(45, 106, 79, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(232, 74, 138, 0.02) 0%, transparent 50%);
  background-attachment: fixed;
}

h1, h2, h3, .brand-font {
  font-family: var(--font-brand);
  color: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--text-heading);
  font-weight: 700;
}

.num-font, .amount-val, .kpi-num, table td.text-right {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--pink);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-header {
  padding: 24px 20px 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1.5px solid var(--border);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--jungle), var(--leaf));
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.25);
  font-size: 20px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--text-heading);
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 800;
  padding: 14px 12px 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-full);
  color: var(--text-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid transparent;
  min-height: 44px;
}

.nav-item:hover {
  background: var(--bg-surface-2);
  color: var(--purple);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(123, 79, 163, 0.12), rgba(232, 74, 138, 0.08));
  color: var(--purple);
  border-color: rgba(123, 79, 163, 0.28);
  font-weight: 700;
}

body.dark .nav-item.active {
  background: linear-gradient(135deg, rgba(123, 79, 163, 0.28), rgba(232, 74, 138, 0.2));
  color: var(--yellow);
  border-color: rgba(246, 196, 69, 0.3);
}

.nav-item svg, .nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--pink);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--r-full);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1.5px solid var(--border);
  background: var(--bg-surface-2);
}

.company-badge-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.company-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Main Content Area */
.main-wrapper {
  flex: 1 1 auto;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  min-width: 0;
  width: calc(100% - var(--sidebar-w));
  max-width: calc(100vw - var(--sidebar-w));
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
.top-header {
  height: var(--header-h);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle-btn {
  display: none;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
  cursor: pointer;
  color: var(--text-heading);
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-heading);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.header-search input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123, 79, 163, 0.15);
}

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  min-width: 40px;
}

.btn-icon:hover {
  background: var(--bg-surface-2);
  transform: translateY(-2px);
  border-color: var(--purple);
  color: var(--purple);
}

/* Page Content View */
.view-container {
  padding: 28px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.65rem;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid transparent;
  min-height: 44px;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  min-height: 34px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  min-height: 48px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(123, 79, 163, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(123, 79, 163, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, var(--jungle), var(--leaf));
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(45, 106, 79, 0.25);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.35);
}

.btn-warning {
  background: var(--yellow);
  color: #2D232E;
  box-shadow: 0 4px 14px rgba(246, 196, 69, 0.3);
}

.btn-warning:hover {
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--terracotta);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(224, 122, 95, 0.25);
}

.btn-danger:hover {
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--bg-surface-2);
  transform: translateY(-2px);
}

.btn-magic {
  background: linear-gradient(135deg, #7B4FA3 0%, #E84A8A 50%, #F6C445 100%);
  color: #FFFFFF;
  background-size: 200% 200%;
  animation: magicShimmer 4s ease infinite;
  box-shadow: 0 4px 16px rgba(232, 74, 138, 0.3);
}

@keyframes magicShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.badge-success {
  background: rgba(45, 106, 79, 0.12);
  color: var(--jungle);
  border: 1px solid rgba(45, 106, 79, 0.25);
}

body.dark .badge-success {
  background: rgba(63, 143, 91, 0.25);
  color: #8CE8A9;
  border-color: rgba(63, 143, 91, 0.4);
}

.badge-warning {
  background: rgba(246, 196, 69, 0.18);
  color: #B88200;
  border: 1px solid rgba(246, 196, 69, 0.35);
}

body.dark .badge-warning {
  background: rgba(246, 196, 69, 0.25);
  color: #FFE17E;
}

.badge-danger {
  background: rgba(224, 122, 95, 0.15);
  color: var(--terracotta);
  border: 1px solid rgba(224, 122, 95, 0.3);
}

body.dark .badge-danger {
  background: rgba(224, 122, 95, 0.25);
  color: #FFA58E;
}

.badge-purple {
  background: rgba(123, 79, 163, 0.12);
  color: var(--purple);
  border: 1px solid rgba(123, 79, 163, 0.25);
}

body.dark .badge-purple {
  background: rgba(123, 79, 163, 0.28);
  color: #E2BCFF;
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(123, 79, 163, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.15rem;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Hero Card */
.hero-card {
  background: linear-gradient(135deg, rgba(123, 79, 163, 0.08), rgba(45, 106, 79, 0.08));
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 30px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "🌿";
  position: absolute;
  right: 20px;
  bottom: -15px;
  font-size: 120px;
  opacity: 0.12;
  pointer-events: none;
}

.hero-title {
  font-size: 1.8rem;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.dark .hero-title {
  background: linear-gradient(135deg, #FFF4D8, #F6C445);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-body);
  max-width: 600px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(123, 79, 163, 0.35);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.kpi-icon-purple { background: rgba(123, 79, 163, 0.12); color: var(--purple); }
.kpi-icon-pink { background: rgba(232, 74, 138, 0.12); color: var(--pink); }
.kpi-icon-jungle { background: rgba(45, 106, 79, 0.12); color: var(--jungle); }
.kpi-icon-yellow { background: rgba(246, 196, 69, 0.15); color: #C59005; }
.kpi-icon-terracotta { background: rgba(224, 122, 95, 0.15); color: var(--terracotta); }

.kpi-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-heading);
}

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Health Card */
.health-card {
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-bottom: 24px;
}

.health-card.balanced {
  border-color: rgba(45, 106, 79, 0.4);
  background: linear-gradient(135deg, rgba(45, 106, 79, 0.04), var(--bg-surface));
}

.health-card.unbalanced {
  border-color: rgba(224, 122, 95, 0.6);
  background: linear-gradient(135deg, rgba(224, 122, 95, 0.06), var(--bg-surface));
}

.equation-display {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--r-lg);
  margin: 16px 0;
  font-weight: 800;
  font-size: 1.15rem;
}

.equation-part {
  text-align: center;
}

.equation-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.equation-num {
  font-size: 1.25rem;
  color: var(--text-heading);
}

.equation-operator {
  font-size: 1.3rem;
  color: var(--purple);
}

/* ==========================================================================
   TABLES & PDA SPECIAL LAYOUT
   ========================================================================== */
.table-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.table-toolbar {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg-surface-2);
}

.table-toolbar-left, .table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--purple) var(--bg-surface-2);
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.table-scroll:active {
  cursor: grabbing;
}

.table-scroll::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--bg-surface-2);
  border-radius: var(--r-full);
}

.table-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: var(--r-full);
  border: 2px solid var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

#table-pda-matrix {
  min-width: 1500px !important;
  width: max-content !important;
  table-layout: fixed !important;
}

#table-pda-matrix th,
#table-pda-matrix td {
  min-width: 145px !important;
  width: 145px !important;
  max-width: 145px !important;
  white-space: nowrap;
  box-sizing: border-box;
}

#table-pda-matrix th {
  white-space: normal !important;
  line-height: 1.25;
  vertical-align: bottom;
  word-break: break-word;
  padding: 10px 8px;
}

.data-table th {
  background: var(--bg-surface-2);
  color: var(--text-heading);
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 1.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  font-size: 0.88rem;
  background: var(--bg-surface);
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover td {
  background: rgba(123, 79, 163, 0.04);
}

body.dark .data-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.data-table tfoot td {
  background: var(--bg-surface-2);
  font-weight: 800;
  color: var(--text-heading);
  border-top: 2px solid var(--border);
  border-bottom: none;
  padding: 14px;
}

/* Freeze Columns for PDA */
#table-pda-matrix .freeze-col-1,
.freeze-col-1 {
  position: sticky;
  left: 0;
  min-width: 95px;
  width: 95px;
  max-width: 95px;
  z-index: 10;
  background: var(--bg-surface) !important;
  box-sizing: border-box;
}

#table-pda-matrix .freeze-col-2,
.freeze-col-2 {
  position: sticky;
  left: 95px;
  min-width: 360px;
  width: 360px;
  max-width: 360px;
  z-index: 10;
  background: var(--bg-surface) !important;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
  white-space: normal !important;
  word-break: break-word !important;
  line-height: 1.4 !important;
  box-sizing: border-box;
}

#table-pda-matrix th.freeze-col-1,
#table-pda-matrix th.freeze-col-2,
th.freeze-col-1, 
th.freeze-col-2 {
  background: var(--bg-surface-2) !important;
  z-index: 12;
  white-space: normal !important;
  word-break: break-word !important;
  box-sizing: border-box;
}

/* Footer spanning 2 columns in PDA */
#table-pda-matrix tfoot td.freeze-col-1,
tfoot td.freeze-col-1 {
  width: 455px !important;
  min-width: 455px !important;
  max-width: 455px !important;
  z-index: 11;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
}

/* Prompt Chips Full Wrap (Ask Vencanto) */
.prompt-chip {
  white-space: normal !important;
  word-break: break-word !important;
  text-align: left !important;
  line-height: 1.35 !important;
  padding: 10px 14px !important;
  height: auto !important;
  min-height: 38px !important;
  width: 100% !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  font-size: 0.82rem !important;
  cursor: pointer;
  border-radius: var(--r-md) !important;
  transition: all 0.2s ease !important;
}

.prompt-chip:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(123, 79, 163, 0.12);
}

/* Unfreeze state when toggled */
#table-pda-matrix.no-freeze .freeze-col-1,
#table-pda-matrix.no-freeze .freeze-col-2,
#table-pda-matrix.no-freeze th.freeze-col-1,
#table-pda-matrix.no-freeze th.freeze-col-2,
#table-pda-matrix.no-freeze tfoot td.freeze-col-1 {
  position: static !important;
  box-shadow: none !important;
  width: auto !important;
  max-width: none !important;
}

.cell-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.table-scroll.is-dragging {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* PDA Impact Indicators */
.val-positive {
  color: var(--jungle);
  font-weight: 700;
}

body.dark .val-positive {
  color: #72E098;
}

.val-negative {
  color: var(--terracotta);
  font-weight: 700;
}

.val-zero {
  color: var(--text-muted);
  opacity: 0.4;
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-heading);
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-control:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123, 79, 163, 0.15);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

/* Journal Split Table Input */
.journal-split-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.journal-split-table td {
  padding: 4px;
  border: none;
  background: transparent;
  vertical-align: top;
}

/* Searchable Account Combobox */
.acc-combobox-wrapper {
  position: relative;
  width: 100%;
}

.acc-combobox-input {
  width: 100%;
  padding: 9px 28px 9px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-heading);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.acc-combobox-input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123, 79, 163, 0.15);
}

.acc-combobox-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.acc-combobox-wrapper.open .acc-combobox-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.acc-combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  max-height: 230px;
  overflow-y: auto;
  z-index: 120;
  display: none;
  scrollbar-width: thin;
}

.acc-combobox-dropdown.show {
  display: block;
}

.acc-combobox-item {
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}

.acc-combobox-item:hover,
.acc-combobox-item.highlighted {
  background: var(--bg-surface-2);
  color: var(--purple);
  padding-left: 16px;
}

.acc-combobox-item-code {
  font-weight: 800;
  color: var(--purple);
  margin-right: 6px;
}

.acc-combobox-item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: rgba(123, 79, 163, 0.1);
  color: var(--purple);
  white-space: nowrap;
}

.acc-combobox-empty {
  padding: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(22, 19, 27, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  margin: auto;
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
}

.modal-dialog-lg {
  max-width: 860px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-2);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.18rem;
  color: var(--text-heading);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  max-height: calc(92vh - 130px);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1.5px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-surface-2);
  flex-shrink: 0;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  color: var(--text-heading);
  font-size: 0.88rem;
  font-weight: 600;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-success { border-left: 5px solid var(--jungle); }
.toast-warning { border-left: 5px solid var(--yellow); }
.toast-danger { border-left: 5px solid var(--terracotta); }
.toast-info { border-left: 5px solid var(--purple); }

/* ==========================================================================
   ACADEMY & ASSISTANT STYLING
   ========================================================================== */
.academy-stats-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: rgba(246, 196, 69, 0.2);
  color: #C59005;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.xp-progress-wrap {
  flex: 1;
  min-width: 180px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--bg-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--pink));
  border-radius: var(--r-full);
  transition: width 0.4s ease;
}

/* Quiz Card */
.quiz-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  margin-bottom: 20px;
}

.quiz-scenario {
  background: var(--bg-surface-2);
  border-left: 4px solid var(--purple);
  padding: 16px 20px;
  border-radius: var(--r-md);
  font-size: 1rem;
  margin: 16px 0;
  color: var(--text-heading);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.quiz-option-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  text-align: left;
  font-size: 0.92rem;
  color: var(--text-heading);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--purple);
  background: var(--bg-surface-2);
  transform: translateX(4px);
}

.quiz-option-btn.correct {
  border-color: var(--jungle);
  background: rgba(45, 106, 79, 0.12);
  color: var(--jungle);
  font-weight: 700;
}

.quiz-option-btn.wrong {
  border-color: var(--terracotta);
  background: rgba(224, 122, 95, 0.12);
  color: var(--terracotta);
}

.quiz-feedback {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Ask Vencanto Chat Area */
.assistant-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .assistant-container {
    grid-template-columns: 1fr;
  }
}

.chat-bubble {
  padding: 16px 20px;
  border-radius: var(--r-xl);
  margin-bottom: 14px;
  max-width: 90%;
  line-height: 1.5;
}

.chat-user {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-bot {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  color: var(--text-heading);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: inline-block;
  animation: floatLeaf 3s ease-in-out infinite;
}

@keyframes floatLeaf {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(6deg); }
}

.empty-state-title {
  font-size: 1.3rem;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.empty-state-text {
  font-size: 0.92rem;
  max-width: 420px;
  margin: 0 auto 20px auto;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--purple);
}

.tab-btn.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

body.dark .tab-btn.active {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

/* Financial Statement Line Styles */
.report-section-header {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-heading);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.report-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.report-line.subtotal {
  font-weight: 700;
  border-top: 1px dashed var(--border);
  color: var(--text-heading);
}

.report-line.grand-total {
  font-weight: 800;
  font-size: 1.05rem;
  border-top: 2px solid var(--text-heading);
  border-bottom: 3px double var(--text-heading);
  color: var(--text-heading);
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-surface-2);
  border-radius: var(--r-sm);
}

/* Micro-animations */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Print Stylesheet */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .sidebar, .top-header, .header-actions, .btn, .tabs-nav, .toast-container, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .view-container {
    padding: 0 !important;
  }
  .card, .table-container {
    border: 1px solid #CCCCCC !important;
    box-shadow: none !important;
  }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-close-btn {
  display: none;
  margin-left: auto;
  color: var(--text-heading);
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(224, 122, 95, 0.15);
  color: var(--terracotta);
  border-color: var(--terracotta);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .app-container {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  .sidebar {
    transform: translateX(-100%);
    z-index: 50;
    width: 280px;
    max-width: 85vw;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }
  .menu-toggle-btn {
    display: inline-flex;
  }
  .view-container {
    padding: 20px 16px;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 0 12px;
    height: 60px;
  }
  .header-left {
    gap: 8px;
  }
  .header-search {
    display: none;
  }
  .header-right {
    gap: 6px;
  }
  .header-right .btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .header-right .btn span {
    display: none;
  }
  .view-container {
    padding: 16px 10px;
  }
  .assistant-container {
    grid-template-columns: 1fr !important;
  }
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .health-card {
    flex-direction: column;
    align-items: flex-start !important;
  }

  /* Modal on Mobile: Full responsiveness & touch scroll */
  .modal-overlay {
    padding: 8px 4px !important;
    align-items: flex-start !important;
  }

  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 95vh !important;
    border-radius: var(--r-lg) !important;
    margin: 6px auto !important;
  }

  .modal-header {
    padding: 12px 14px !important;
  }

  .modal-body {
    padding: 12px 10px !important;
    max-height: calc(95vh - 115px) !important;
  }

  .modal-footer {
    padding: 10px 12px !important;
    flex-wrap: wrap !important;
  }

  .modal-footer .btn {
    flex: 1 1 auto !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  #tx-entries-table {
    min-width: 480px !important;
    width: 100% !important;
  }

  /* PDA Mobile Optimization: Unfreeze columns 1 & 2 so they NEVER cover the phone screen */
  #table-pda-matrix .freeze-col-1,
  #table-pda-matrix .freeze-col-2,
  .freeze-col-1,
  .freeze-col-2 {
    position: static !important;
    left: auto !important;
    min-width: 130px !important;
    width: auto !important;
    max-width: none !important;
    box-shadow: none !important;
    z-index: 1 !important;
  }

  #table-pda-matrix tfoot td.freeze-col-1,
  tfoot td.freeze-col-1 {
    width: auto !important;
    min-width: 130px !important;
    max-width: none !important;
    box-shadow: none !important;
  }

  .table-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    max-width: 100vw !important;
    display: block !important;
  }

  #table-pda-matrix {
    min-width: 920px !important;
  }

  .balance-sheet-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* ==========================================================================
   ACCOUNTING CHEAT SHEET STYLING
   ========================================================================== */
.cheatsheet-banner {
  background: linear-gradient(135deg, rgba(123, 79, 163, 0.08), rgba(45, 106, 79, 0.08));
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.25s ease;
}

.cheatsheet-banner.active {
  display: block;
}

.cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.cheatsheet-item {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 0.85rem;
}

.cheatsheet-item.asset { border-left: 4px solid var(--jungle); }
.cheatsheet-item.liability { border-left: 4px solid var(--terracotta); }
.cheatsheet-item.equity { border-left: 4px solid var(--purple); }
.cheatsheet-item.revenue { border-left: 4px solid var(--yellow); }
.cheatsheet-item.expense { border-left: 4px solid var(--pink); }

/* ==========================================================================
   TRANSACTION-LEVEL PEDAGOGICAL FINANCIAL REPORTS STYLING
   ========================================================================== */
.report-acc-group {
  margin-bottom: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  overflow: hidden;
  transition: all 0.2s ease;
}

.report-acc-group:hover {
  border-color: rgba(123, 79, 163, 0.4);
}

.report-acc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-heading);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.report-acc-header:hover {
  background: rgba(123, 79, 163, 0.08);
}

.report-acc-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-acc-chevron {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
  display: inline-block;
}

.report-acc-group.collapsed .report-acc-chevron {
  transform: rotate(-90deg);
}

.report-entries-container {
  padding: 6px 14px 10px 14px;
  transition: max-height 0.3s ease;
}

.report-acc-group.collapsed .report-entries-container {
  display: none;
}

.report-entry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px 6px 24px;
  font-size: 0.85rem;
  color: var(--text-body);
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

.report-entry-row:hover {
  background: rgba(123, 79, 163, 0.04);
}

.report-entry-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-entry-badge {
  font-size: 0.72rem;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
}

.report-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px 8px 16px;
  font-size: 0.88rem;
  font-weight: 800;
  border-top: 1.5px solid var(--border);
  background: rgba(0, 0, 0, 0.015);
  margin-top: 4px;
}

.report-drilldown-card {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
}

/* --- MONTHLY TRANSACTION & REPORT SEPARATORS --- */
.month-section-card {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.month-header-banner {
  background: linear-gradient(135deg, rgba(123, 79, 163, 0.12), rgba(45, 106, 79, 0.1));
  border-left: 4.5px solid var(--purple);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.month-filter-badge-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-2);
  padding: 3px 10px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pda-month-separator-tr td {
  background: linear-gradient(90deg, rgba(123, 79, 163, 0.2), rgba(45, 106, 79, 0.15)) !important;
  padding: 11px 16px !important;
  font-weight: 800 !important;
  color: var(--purple) !important;
  text-align: left !important;
  border-top: 2px solid var(--purple) !important;
  border-bottom: 2px solid var(--purple) !important;
  letter-spacing: 0.03em;
}

.journal-month-header-tr td {
  background: linear-gradient(90deg, rgba(123, 79, 163, 0.16), rgba(45, 106, 79, 0.1)) !important;
  padding: 10px 16px !important;
  font-weight: 800 !important;
  color: var(--purple) !important;
  border-top: 2px solid var(--purple) !important;
  border-bottom: 1.5px solid var(--purple) !important;
}

.journal-month-subtotal-tr td {
  background: rgba(123, 79, 163, 0.06) !important;
  font-weight: 800 !important;
  border-bottom: 2px solid var(--border) !important;
  padding: 8px 12px !important;
}

/* ==========================================================================
   CATEGORY BADGES & PILLS (6 MAIN CATEGORIES: HARTA, UTANG, MODAL, PRIVE, PENDAPATAN, BEBAN)
   ========================================================================== */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.category-badge:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.badge-cat-harta {
  background: rgba(45, 106, 79, 0.12);
  color: var(--jungle);
  border-color: rgba(45, 106, 79, 0.35);
}

.badge-cat-utang {
  background: rgba(224, 122, 95, 0.12);
  color: var(--terracotta);
  border-color: rgba(224, 122, 95, 0.35);
}

.badge-cat-modal {
  background: rgba(123, 79, 163, 0.12);
  color: var(--purple);
  border-color: rgba(123, 79, 163, 0.35);
}

.badge-cat-prive {
  background: rgba(244, 162, 97, 0.15);
  color: #c05621;
  border-color: rgba(244, 162, 97, 0.45);
}

.badge-cat-pendapatan {
  background: rgba(42, 157, 143, 0.12);
  color: #1a7a6e;
  border-color: rgba(42, 157, 143, 0.4);
}

.badge-cat-beban {
  background: rgba(229, 62, 62, 0.1);
  color: #c53030;
  border-color: rgba(229, 62, 62, 0.35);
}

/* --- BUKU BESAR INTERACTIVE CONTROLS & INFO BOX --- */
.ledger-category-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ledger-cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  min-height: 38px;
}

.ledger-cat-tab:hover {
  transform: translateY(-2px);
  color: var(--text-heading);
  border-color: var(--purple);
  box-shadow: var(--shadow-sm);
}

.ledger-cat-tab.active {
  background: var(--purple);
  color: #ffffff;
  border-color: var(--purple);
  box-shadow: var(--shadow-md);
}

.ledger-info-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  background: var(--bg-surface-2);
  padding: 16px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.ledger-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ledger-info-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ledger-info-val {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-heading);
}

/* --- PDA GROUPED CELL PILLS --- */
.pda-pill-beban {
  display: inline-block;
  color: #c53030;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(229, 62, 62, 0.08);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin: 1px 0;
}

.pda-pill-pendapatan {
  display: inline-block;
  color: #1a7a6e;
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(42, 157, 143, 0.08);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin: 1px 0;
}

.pda-pill-utang {
  display: inline-block;
  color: var(--terracotta);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(224, 122, 95, 0.08);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin: 1px 0;
}

.pda-pill-modal {
  display: inline-block;
  color: var(--purple);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
  background: rgba(123, 79, 163, 0.08);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  margin: 1px 0;
}

.pda-pill-prive {
  color: #c05621 !important;
  background: rgba(244, 162, 97, 0.12) !important;
}

.btn-trace-tx {
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


