/* styles.css - 泰国公司财务管理系统视觉样式 */
:root {
  --primary: #137E3D; /* Kasikornbank Green */
  --primary-hover: #0E5C2C;
  --primary-light: #E8F5E9;
  --primary-glow: rgba(19, 126, 61, 0.15);

  --secondary: #0F172A;
  --bg-main: #F8FAFC;
  --bg-sidebar: #064E3B; /* Deep Emerald */
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  --text-main: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --indigo: #6366F1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 11px;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.sidebar-entity-badge {
  background: rgba(0, 0, 0, 0.2);
  margin: 12px 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.badge-row:last-child {
  margin-bottom: 0;
}

.badge-label {
  opacity: 0.7;
}

.badge-val {
  font-weight: 600;
  color: #A7F3D0;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.nav-item.active {
  background: #10B981;
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.nav-item i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exchange-rate-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #A7F3D0;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 4px;
}

.exchange-rate-pill i {
  width: 14px;
  height: 14px;
}

.btn-export-pkg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #059669;
  color: #FFFFFF;
  border: none;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
}

.btn-export-pkg:hover {
  background: #047857;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Topbar */
.topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 240px;
  flex-shrink: 0;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
  line-height: 1.25;
}

.page-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
  max-width: 480px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quick-status-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 4px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  min-width: 80px;
  height: 38px;
  box-sizing: border-box;
}

.quick-status-item.bank-balance-pill {
  background: #F0FDF4;
  border-color: #BBF7D0;
}

.quick-status-item .status-lbl {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 2px;
}

.quick-status-item .status-num {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'JetBrains Mono', Consolas, monospace;
  line-height: 1.1;
}

.quick-status-item.highlight .status-num {
  color: var(--warning);
}

/* Content Container */
.tab-content-container {
  padding: 28px 32px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon i {
  width: 26px;
  height: 26px;
  color: #FFFFFF;
}

.bg-emerald { background: linear-gradient(135deg, #10B981, #059669); }
.bg-blue { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.bg-amber { background: linear-gradient(135deg, #F59E0B, #D97706); }
.bg-purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); }

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
  margin: 3px 0;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-light);
}

/* Dashboard Grids */
.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.chart-card, .table-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.tag-pill {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--border-light);
  color: var(--text-muted);
  font-weight: 500;
}

.tag-pill.tag-success {
  background: #D1FAE5;
  color: #065F46;
}

.card-body {
  padding: 20px;
}

/* Monthly Bars */
.monthly-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-month {
  width: 75px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

.bar-track {
  flex: 1;
  height: 22px;
  background: #F1F5F9;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #059669);
  border-radius: 6px;
  transition: width 0.6s ease;
}

.bar-val {
  width: 110px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}

/* Category Breakdown List */
.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
}

.cat-item-name {
  font-size: 13px;
  font-weight: 600;
}

.cat-item-th {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.cat-item-amt {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--secondary);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #F8FAFC;
}

.voucher-pill {
  font-family: monospace;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.voucher-pill:hover {
  text-decoration: underline;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  color: #FFFFFF;
}

.amount-gross {
  color: var(--text-muted);
  font-size: 12px;
}

.amount-net {
  font-weight: 700;
  color: var(--secondary);
  font-size: 13.5px;
}

.wht-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #FEF3C7;
  color: #92400E;
}

.btn-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  background: #EFF6FF;
  color: #1D4ED8;
  border-radius: 4px;
  text-decoration: none;
  border: 1px solid #DBEAFE;
}

.btn-file-chip:hover {
  background: #DBEAFE;
}

/* Filter Bar - Modern Responsive 2-Tier Financial Toolbar (Baoyu Design) */
.filter-bar {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.filter-row-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

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

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  height: 36px;
}

.search-input-wrap i,
.search-input-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-light);
  pointer-events: none;
  z-index: 2;
}

.search-input-wrap input {
  width: 100%;
  height: 36px;
  line-height: 36px;
  padding: 0 54px 0 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #FFFFFF;
  outline: none;
  box-sizing: border-box;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.search-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.filter-row-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.filter-row-secondary .select-type {
  width: 135px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 6px;
  font-size: 12px;
}

.filter-row-secondary .select-month {
  width: 120px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 6px;
  font-size: 12px;
}

.filter-row-secondary .filter-group-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.filter-row-secondary .select-cat {
  width: 145px;
  height: 34px;
  border-radius: 6px;
  font-size: 12px;
}

.filter-row-secondary .btn-cat-manage {
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
}

.filter-row-secondary .select-attach {
  width: 155px;
  height: 34px;
  border-radius: 6px;
  font-size: 12px;
}

.filter-row-secondary .select-review {
  width: 155px;
  height: 34px;
  border-radius: 6px;
  font-size: 12px;
}

.filter-row-secondary .btn-col-vis {
  height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
}

#btnResetFilters {
  height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

#btnNewTransaction2 {
  height: 36px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
  white-space: nowrap;
  font-size: 12.5px;
}

.filter-sec-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-sec-right .btn {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
}

.select-input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #FFFFFF;
  color: var(--text-main);
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.select-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.filter-actions {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #F1F5F9;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  height: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

.btn-xs i,
.btn-xs svg {
  width: 12px;
  height: 12px;
}

/* Bank Tab */
.bank-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
}

.bank-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.bank-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kbank-logo-badge {
  background: #137E3D;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 18px;
  padding: 8px 14px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}

.bank-balance-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .bank-balance-summary {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pill-group {
  display: inline-flex;
  background: #E2E8F0;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.pill-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: #475569;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:hover {
  color: #0F172A;
}

.pill-btn.active {
  background: #FFFFFF;
  color: #0F766E;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-upload-slip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  background: #FEF3C7;
  color: #B45309;
  border: 1px dashed #F59E0B;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-upload-slip:hover {
  background: #FDE68A;
  color: #92400E;
  border-color: #D97706;
}

.btn-slip-view {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-slip-view:hover {
  background: #D1FAE5;
  color: #047857;
}

.btn-slip-reupload {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  font-size: 11px;
  border-radius: 4px;
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
  cursor: pointer;
}

.btn-slip-reupload:hover {
  background: #E2E8F0;
  color: #334155;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #2563EB !important;
  background: #EFF6FF !important;
}

.tag-pill.tag-info {
  background: #E0F2FE;
  color: #0369A1;
}

.bal-box {
  background: #F8FAFC;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.bal-box.highlight {
  background: #ECFDF5;
  border-color: #A7F3D0;
}

.bal-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}

.bal-val {
  font-size: 22px;
  font-weight: 700;
}

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* WHT & Summary Grids */
.wht-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.summary-card {
  background: #FFFFFF;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.summary-card.highlight {
  border-color: var(--warning);
  background: #FFFBEB;
}

.summary-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--secondary);
}

.summary-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 12px 0;
}

.summary-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--secondary);
}

.sub-text {
  font-size: 11px;
  color: var(--text-light);
  display: block;
  margin-top: 4px;
}

/* Banner */
.vat-info-banner {
  display: flex;
  gap: 16px;
  align-items: center;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  color: #065F46;
}

.vat-info-banner i {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #059669;
}

/* Attachments */
.attachments-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.att-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.att-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #EFF6FF;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.att-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  word-break: break-all;
  margin-bottom: 6px;
}

.att-meta {
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 14px;
}

.att-actions {
  display: flex;
  gap: 8px;
}

/* Company Profile */
.company-profile-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.profile-logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.profile-title-area {
  flex: 1;
}

.profile-title-area h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--secondary);
}

.profile-title-area h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-top: 2px;
}

.profile-title-area p {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-seal {
  width: 90px;
  height: 90px;
  object-fit: contain;
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.detail-item {
  background: #F8FAFC;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-label {
  font-size: 11.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.detail-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
}

.certificates-list-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cert-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.cert-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  gap: 12px;
}

.cert-card i {
  color: var(--primary);
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.cert-info h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.cert-info p {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.cert-link {
  font-size: 11.5px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.cert-link:hover {
  text-decoration: underline;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal-overlay.active,
.modal-overlay.show {
  display: flex !important;
}

.modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.voucher-modal-box {
  max-width: 800px;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--secondary);
}

.input-control {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.input-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Printable Voucher */
.printable-voucher {
  background: #FFFFFF;
  color: #000000;
  font-family: -apple-system, "Sarabun", sans-serif;
}

.voucher-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000000;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.voucher-company h2 {
  font-size: 18px;
  font-weight: 800;
}

.voucher-company h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
}

.voucher-company p {
  font-size: 11px;
  color: #555555;
  margin-top: 2px;
}

.voucher-title-wrap {
  text-align: right;
}

.voucher-title-wrap h1 {
  font-size: 20px;
  font-weight: 800;
  color: #137E3D;
}

.voucher-title-wrap .v-no {
  font-size: 14px;
  font-weight: 700;
  font-family: monospace;
}

.voucher-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.voucher-info-table td {
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #DDDDDD;
}

.voucher-info-table .lbl {
  background: #F5F5F5;
  font-weight: 600;
  width: 18%;
}

.voucher-lines-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.voucher-lines-table th, .voucher-lines-table td {
  border: 1px solid #000000;
  padding: 8px 10px;
  font-size: 12px;
}

.voucher-lines-table th {
  background: #F0F0F0;
  text-align: center;
}

.voucher-sign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
  text-align: center;
}

.sign-box {
  border-top: 1px solid #000000;
  padding-top: 8px;
  font-size: 12px;
}

.sign-box p {
  color: #555555;
  font-size: 11px;
}

.seal-stamp-img {
  width: 80px;
  opacity: 0.85;
  display: block;
  margin: 0 auto 6px auto;
}

.voucher-pill.voucher-income {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

.tag-income {
  background: #D1FAE5;
  color: #065F46;
  font-weight: 700;
}

.tag-expense {
  background: #FFE4E6;
  color: #9F1239;
  font-weight: 700;
}

.text-income {
  color: #059669;
}

.text-expense {
  color: #E11D48;
}

/* 实时筛选财务汇总条 */
.filter-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.summary-pill {
  font-size: 13px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.summary-pill .lbl {
  color: #64748B;
  font-size: 12px;
}

.summary-pill strong {
  font-weight: 700;
  font-family: inherit;
}

/* 缺单警示与附件胶囊 */
.tag-missing-slip {
  background: #FEF3C7;
  color: #B45309;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px dashed #F59E0B;
}

.tag-has-slip {
  background: #E0F2FE;
  color: #0369A1;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-doc-note {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #F1F5F9;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #CBD5E1;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 财务公司交接卡片 */
.handover-hero-card {
  background: linear-gradient(135deg, #0F766E 0%, #137E3D 100%);
  color: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15);
}

.handover-hero-card .hero-tag {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-bottom: 8px;
}

.handover-hero-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.handover-hero-card p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 650px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.month-selector-wrap label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  display: block;
  margin-bottom: 4px;
}

.select-lg {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: #FFFFFF;
  color: #0F172A;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
}

.handover-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.check-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.check-card h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #0F172A;
}

.check-card p {
  font-size: 12px;
  color: #64748B;
  line-height: 1.4;
  flex: 1;
}

.check-status {
  margin-top: 6px;
}

/* 多媒体单据预览器 (Lightbox Modal) */
.preview-modal-box {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
}

/* 多单据快速切换标签栏 (Tab bar) */
.preview-doc-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #0F172A;
  border-bottom: 1px solid #1E293B;
  overflow-x: auto;
  white-space: nowrap;
}

.preview-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.preview-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.preview-tab.active {
  background: #059669;
  color: #FFFFFF;
  border-color: #10B981;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

.preview-tab i,
.preview-tab svg {
  width: 14px;
  height: 14px;
}

.preview-modal-body {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  max-height: calc(90vh - 120px);
  overflow: auto;
  background: #0F172A;
}

.preview-img-full {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.preview-pdf-frame {
  width: 100%;
  height: 70vh;
  border: none;
  background: #FFFFFF;
  border-radius: 6px;
}

/* 本地附件上传交互 */
.file-upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  padding: 10px 14px;
  border-radius: 8px;
}

.upload-status-text {
  font-size: 12px;
  color: #64748B;
  word-break: break-all;
}

.upload-status-text.success {
  color: #059669;
  font-weight: 600;
}

.action-btns-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.highlight-nav {
  position: relative;
}
.highlight-nav::after {
  content: 'NEW';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #F59E0B;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
}

/* Jev AI 样式支持 */
.tag-pill.tag-warning {
  background: #FEF3C7;
  color: #B45309;
}

.tag-pill.tag-danger {
  background: #FEE2E2;
  color: #DC2626;
}

.highlight-ai-nav {
  position: relative;
  border-left: 3px solid #10B981 !important;
}

.highlight-ai-nav i {
  color: #10B981;
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

.ai-prob-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.ai-prob-track {
  flex: 1;
  background: #E2E8F0;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.ai-prob-fill {
  background: #10B981;
  height: 100%;
  border-radius: 3px;
}

/* 网站安全锁屏屏障 (Password Gate: 888888) */
.auth-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-lock-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-lock-card {
  background: #FFFFFF;
  width: 90%;
  max-width: 400px;
  border-radius: 18px;
  padding: 36px 30px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
  text-align: center;
  border: 1px solid #E2E8F0;
  animation: cardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-lock-card.shake {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

.auth-lock-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #E6F4EA;
  color: #0F766E;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}

.auth-lock-brand img.auth-logo {
  height: 48px;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-lock-brand h2 {
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.auth-lock-brand p {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 22px;
}

.auth-lock-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap i {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 15px;
  font-weight: 600;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  outline: none;
  transition: all 0.2s;
  background: #F8FAFC;
  letter-spacing: 2px;
}

.auth-input-wrap input:focus {
  border-color: #0F766E;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.auth-error-msg {
  font-size: 12.5px;
  color: #DC2626;
  font-weight: 600;
  margin-top: -6px;
  margin-bottom: 2px;
  text-align: left;
  padding-left: 4px;
}

.auth-btn-submit {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 10px;
  background: #0F766E;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.auth-btn-submit:hover {
  background: #0D655E;
}

.auth-lock-footer {
  margin-top: 22px;
  font-size: 11px;
  color: #94A3B8;
}

/* 语言切换组件样式 (Language Switcher) */
.lang-switch-wrap {
  display: flex;
  align-items: center;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lang-btn:hover {
  color: #0F172A;
}

.lang-btn.active {
  background: #0F766E;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.25);
}

/* 侧边栏锁定按钮 */
.btn-lock-sys {
  margin-top: 8px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  background: transparent;
  border: 1px dashed #CBD5E1;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-lock-sys:hover {
  background: #FEE2E2;
  border-color: #F87171;
  color: #DC2626;
}

@media print {
  body * {
    visibility: hidden;
  }
  .printable-voucher, .printable-voucher * {
    visibility: visible;
  }
  .printable-voucher {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
  }
  .no-print {
    display: none !important;
  }
}

/* ========================================================
   HIGH-DENSITY FINANCIAL GENERAL LEDGER TABLE (V2 ARCHITECTURE)
   ======================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  -webkit-overflow-scrolling: touch;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
}

#transactionsTable {
  width: 100%;
  min-width: 2020px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

#transactionsTable th,
#transactionsTable td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  transition: background 0.15s ease;
}

#transactionsTable th {
  background: #F8FAFC;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

#transactionsTable tr:hover td {
  background: #F1F5F9;
}

/* Sticky Left Column: 凭证编号 */
#transactionsTable .col-voucher {
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  position: sticky;
  left: 0;
  z-index: 3;
  background: #FFFFFF;
  box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.06);
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-weight: 600;
  white-space: nowrap;
}

#transactionsTable th.col-voucher {
  z-index: 5;
  background: #F8FAFC;
}

#transactionsTable tr:hover .col-voucher {
  background: #F1F5F9;
}

/* Sticky Right Column: 操作 */
#transactionsTable .col-actions {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  position: sticky;
  right: 0;
  z-index: 10;
  background: #FFFFFF !important;
  box-shadow: -4px 0 10px rgba(15, 23, 42, 0.06);
  border-left: 1px solid #E2E8F0;
  text-align: right;
  white-space: nowrap;
  padding: 6px 8px;
  box-sizing: border-box;
  overflow: hidden;
}

#transactionsTable th.col-actions {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  z-index: 15;
  background: #F8FAFC !important;
  border-left: 1px solid #E2E8F0;
  text-align: center;
}

#transactionsTable tr:hover .col-actions {
  background: #F1F5F9 !important;
}

.tx-actions-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
}

.btn-tx-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 24px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: var(--secondary);
  flex-shrink: 0;
  box-sizing: border-box;
}

.btn-tx-action:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

.btn-tx-action i,
.btn-tx-action svg {
  width: 12px;
  height: 12px;
}

.btn-tx-action.btn-voucher {
  color: #1E293B;
  border-color: #CBD5E1;
}

.btn-tx-action.btn-ai {
  color: #0F766E;
  background: #F0FDFA;
  border-color: #99F6E4;
}
.btn-tx-action.btn-ai:hover {
  background: #CCFBF1;
  border-color: #5EEAD4;
}

.btn-tx-action.btn-edit {
  color: #FFFFFF;
  background: var(--primary);
  border-color: var(--primary);
}
.btn-tx-action.btn-edit:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-tx-action.btn-del {
  color: #94A3B8;
  padding: 0 5px;
  border-color: transparent;
  background: transparent;
}
.btn-tx-action.btn-del:hover {
  color: #EF4444;
  background: #FEE2E2;
  border-color: #FECACA;
}

/* Specific Columns Widths */
#transactionsTable .col-date {
  width: 105px;
  min-width: 105px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', Consolas, monospace;
  color: var(--text-muted);
}

#transactionsTable .col-type {
  width: 85px;
  min-width: 85px;
  text-align: center;
  white-space: nowrap;
}

#transactionsTable .col-payee {
  width: 250px;
  min-width: 250px;
  max-width: 280px;
}

#transactionsTable .col-category {
  width: 175px;
  min-width: 175px;
  white-space: nowrap;
}

#transactionsTable .col-gross {
  width: 135px;
  min-width: 135px;
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

#transactionsTable .col-wht {
  width: 125px;
  min-width: 125px;
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: #D97706;
  font-weight: 500;
  white-space: nowrap;
}

#transactionsTable .col-net {
  width: 145px;
  min-width: 145px;
  text-align: right;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

#transactionsTable .col-purpose {
  width: 260px;
  min-width: 260px;
  max-width: 320px;
  line-height: 1.4;
  word-break: break-word;
}

#transactionsTable .col-attachments {
  width: 250px;
  min-width: 250px;
}

#transactionsTable .col-jev {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  text-align: center;
  white-space: nowrap;
  padding: 6px 6px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Badges & Pills */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.type-badge.income {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.type-badge.expense {
  background: #FFF1F2;
  color: #9F1239;
  border: 1px solid #FECDD3;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #E2E8F0;
}

.entity-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
  font-size: 11px;
}

.entity-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
  font-weight: 500;
}

.entity-tag.kol {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
}

.entity-tag.project {
  background: #FAF5FF;
  color: #6B21A8;
  border-color: #E9D5FF;
}

/* Attachments Cell Badges */
.attach-cell-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attach-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.attach-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.attach-pill.invoice {
  background: #EEF2FF;
  color: #4338CA;
  border: 1px solid #C7D2FE;
}
.attach-pill.invoice:hover {
  background: #E0E7FF;
}

.attach-pill.slip {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.attach-pill.slip:hover {
  background: #D1FAE5;
}

.attach-pill.wht {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.attach-pill.wht:hover {
  background: #FDE68A;
}

.attach-pill.missing {
  background: #FFF1F2;
  color: #BE123C;
  border: 1px dashed #FDA4AF;
  font-size: 10.5px;
}

.attach-pill.contract {
  background: #F3E8FF;
  color: #7E22CE;
  border: 1px solid #DDD6FE;
}
.attach-pill.contract:hover {
  background: #E9D5FF;
}

.attach-pill.idcard {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}
.attach-pill.idcard:hover {
  background: #BAE6FD;
}

.attach-pill.bookbank {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}
.attach-pill.bookbank:hover {
  background: #FDE68A;
}

.attach-pill.receipt {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}
.attach-pill.receipt:hover {
  background: #DCFCE7;
}

.attach-pill.cert {
  background: #CCFBF1;
  color: #0F766E;
  border: 1px solid #99F6E4;
}
.attach-pill.cert:hover {
  background: #99F6E4;
}

.attach-pill.doc {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}
.attach-pill.doc:hover {
  background: #E2E8F0;
}

.attach-pill.more {
  background: #F8FAFC;
  color: #0F172A;
  border: 1px solid #CBD5E1;
  font-weight: 600;
}
.attach-pill.more:hover {
  background: #E2E8F0;
}

/* JEV Status Badges */
.jev-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  height: 22px;
  box-sizing: border-box;
}

.jev-badge i,
.jev-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.jev-badge.passed {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.jev-badge.flagged {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.jev-badge.pending {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #CBD5E1;
}

.jev-badge.returned {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FFEDD5;
}

.jev-badge.rejected {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

/* ========================================================
   SLIDE-OVER TRANSACTION DRAWER (#txDrawer)
   ======================================================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tx-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 680px;
  max-width: 95vw;
  background: #FFFFFF;
  z-index: 201;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 28px -4px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active .tx-drawer {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
}

.drawer-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.drawer-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Column Visibility Dropdown */
.col-visibility-wrap {
  position: relative;
  display: inline-block;
}

.col-visibility-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  width: 220px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  z-index: 50;
  display: none;
}

.col-visibility-menu.active {
  display: block;
}

.col-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.col-check-item:hover {
  background: #F1F5F9;
  border-radius: 4px;
}

/* Category Management Modal Styling */
.category-modal-box {
  width: 90%;
  max-width: 840px;
}

.category-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .category-layout {
    grid-template-columns: 1fr;
  }
}

.cat-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #FFFFFF;
  transition: all 0.15s ease;
}

.cat-item-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Drawer Attachment Cards */
.drawer-attach-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 600px) {
  .drawer-attach-grid {
    grid-template-columns: 1fr;
  }
}

.drawer-attach-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #F8FAFC;
}

.drawer-attach-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.drawer-attach-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* Audit Trail Timeline */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.audit-item {
  position: relative;
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

.audit-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.audit-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.audit-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================================
   BAOYU-DESIGN VISUAL OPTIMIZATIONS & USABILITY TOKENS
   ======================================================== */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Sarabun", "PingFang SC", sans-serif !important;
  background-color: #F8FAFC;
  color: #0F172A;
  letter-spacing: -0.01em;
}

code, kbd, .monospace, #transactionsTable .col-voucher, #transactionsTable .col-gross, #transactionsTable .col-wht, #transactionsTable .col-net, .status-num, #topbarBankBalance {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace !important;
}

/* Quick Filter Chips */
.quick-filter-chips {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.chip-filter:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}

.chip-filter.active {
  background: #0F766E !important;
  color: #FFFFFF !important;
  border-color: #0F766E !important;
  box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

.chip-filter.alert {
  color: #BE123C;
  background: #FFF1F2;
  border-color: #FECDD3;
}
.chip-filter.alert:hover {
  background: #FFE4E6;
}
.chip-filter.alert.active {
  background: #E11D48 !important;
  color: #FFFFFF !important;
  border-color: #E11D48 !important;
}

.chip-filter.warning {
  color: #B45309;
  background: #FEF3C7;
  border-color: #FDE68A;
}
.chip-filter.warning:hover {
  background: #FDE68A;
}
.chip-filter.warning.active {
  background: #D97706 !important;
  color: #FFFFFF !important;
  border-color: #D97706 !important;
}

.chip-filter.success {
  color: #047857;
  background: #ECFDF5;
  border-color: #A7F3D0;
}
.chip-filter.success:hover {
  background: #D1FAE5;
}
.chip-filter.success.active {
  background: #059669 !important;
  color: #FFFFFF !important;
  border-color: #059669 !important;
}

/* Search Box Enhancements */
.search-kbd-hint {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
  font-weight: 600;
}

.btn-clear-search {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  color: #94A3B8;
  cursor: pointer;
  padding: 2px 6px;
}
.btn-clear-search:hover {
  color: #0F172A;
}

/* Bank Balance Pill in Topbar */
.bank-balance-pill {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 6px 14px;
  border-radius: 8px;
}
.bank-balance-pill .status-lbl {
  color: #047857;
  font-weight: 600;
  font-size: 11px;
}
.bank-balance-pill .status-num {
  color: #065F46 !important;
  font-weight: 700;
  font-size: 14px;
}

/* Real-time Calculation Ribbon in Drawer */
.calc-equation-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 10px 16px;
  margin-top: 10px;
  font-size: 12.5px;
}

.calc-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-item .c-lbl {
  font-size: 11px;
  color: #64748B;
}

.calc-item strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: #0F172A;
}

.calc-item.highlight strong {
  color: #059669;
  font-size: 15px;
  font-weight: 700;
}

.calc-op {
  font-size: 18px;
  font-weight: 700;
  color: #94A3B8;
  user-select: none;
}

/* Card & Table Micro-Elevation */
.table-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  margin-bottom: 36px;
}

#transactionsTable tr:hover td {
  background: #F8FAFC;
}

#transactionsTable .col-voucher {
  box-shadow: 4px 0 8px -2px rgba(15, 23, 42, 0.05) !important;
}

#transactionsTable .col-actions {
  box-shadow: -4px 0 8px -2px rgba(15, 23, 42, 0.05) !important;
}

/* Table Footer & Pagination */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.table-stats-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', Consolas, monospace;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-page:hover:not(:disabled) {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: var(--primary);
}

.btn-page.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #FFFFFF !important;
  box-shadow: 0 1px 3px rgba(19, 126, 61, 0.25);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #F8FAFC;
  border-color: #E2E8F0;
}

.btn-page i,
.btn-page svg {
  width: 14px;
  height: 14px;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 13px;
  user-select: none;
}

.wht-col-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  transition: all 0.15s ease;
}
.wht-col-pill i, .wht-col-pill svg {
  width: 11px;
  height: 11px;
}
.wht-col-pill.passed {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}
.wht-col-pill.passed:hover {
  background: #D1FAE5;
  color: #047857;
}
.wht-col-pill.missing {
  background: #FEF3C7;
  color: #92400E;
  border: 1px dashed #F59E0B;
}
.wht-col-pill.missing:hover {
  background: #FDE68A;
  color: #78350F;
}
.wht-col-pill.voided {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
}
.wht-col-pill.voided:hover {
  background: #FEE2E2;
  color: #991B1B;
}

