.exp-wrap{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.exp-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
}

.exp-topbar h3{
  margin:0 0 4px;
}

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

.exp-btn{
  border:0;
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
}

.exp-btn-primary{
  background:#111827;
  color:#fff;
}

.exp-btn-secondary{
  background:#f3f4f6;
  color:#111827;
}

.exp-btn-danger{
  background:#fee2e2;
  color:#991b1b;
}

.exp-btn-success{
  background:#dcfce7;
  color:#166534;
}

.exp-filters{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.exp-filter{
  border:1px solid #e5e7eb;
  background:#fff;
  border-radius:999px;
  padding:8px 12px;
  cursor:pointer;
}

.exp-filter.active{
  background:#111827;
  color:#fff;
}

.exp-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}

.exp-kpi{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
}

.exp-kpi span{
  display:block;
  color:#6b7280;
  font-size:12px;
}

.exp-kpi strong{
  display:block;
  margin-top:4px;
  font-size:20px;
}

.exp-table-wrap{
  overflow:auto;
  border:1px solid #e5e7eb;
  border-radius:14px;
  background:#fff;
}

.exp-table{
  width:100%;
  border-collapse:collapse;
}

.exp-table th,
.exp-table td{
  padding:12px;
  border-bottom:1px solid #f1f5f9;
  text-align:left;
  white-space:nowrap;
}

.exp-table th{
  font-size:12px;
  color:#64748b;
}

.exp-status{
  display:inline-flex;
  align-items:center;
  padding:5px 9px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  background:#f3f4f6;
}

.exp-status-draft{background:#f3f4f6;}
.exp-status-submitted{background:#fef3c7;color:#92400e;}
.exp-status-approved{background:#dcfce7;color:#166534;}
.exp-status-rejected{background:#fee2e2;color:#991b1b;}
.exp-status-paid{background:#dbeafe;color:#1d4ed8;}

.exp-empty{
  padding:32px;
  text-align:center;
  color:#6b7280;
}

.exp-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(15,23,42,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.exp-modal{
  width:min(760px,100%);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border-radius:16px;
  padding:20px;
}

.exp-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

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

.exp-form-grid label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  font-weight:600;
}

.exp-form-grid input,
.exp-form-grid select,
.exp-form-grid textarea{
  width:100%;
  box-sizing:border-box;
  border:1px solid #d1d5db;
  border-radius:10px;
  padding:10px 12px;
}

.exp-full{
  grid-column:1/-1;
}

.exp-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:18px;
  flex-wrap:wrap;
}

.exp-error{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  background:#fee2e2;
  color:#991b1b;
}

@media(max-width:800px){
  .exp-kpis{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .exp-form-grid{
    grid-template-columns:1fr;
  }

  .exp-full{
    grid-column:auto;
  }
}

/* Fix expense button colors */
#expenses .exp-btn{
  color:#111827 !important;
  background:#f3f4f6 !important;
}

#expenses .exp-btn-primary{
  background:#111827 !important;
  color:#ffffff !important;
}

#expenses .exp-btn-secondary{
  background:#e5e7eb !important;
  color:#111827 !important;
}

#expenses .exp-btn-success{
  background:#dcfce7 !important;
  color:#166534 !important;
}

#expenses .exp-btn-danger{
  background:#fee2e2 !important;
  color:#991b1b !important;
}

#expenses .exp-filter{
  background:#ffffff !important;
  color:#111827 !important;
}

#expenses .exp-filter.active{
  background:#111827 !important;
  color:#ffffff !important;
}

/* Expenses live sidebar badge */
#expenseBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width:20px;
  height:20px;

  padding:0 6px;
  margin-left:8px;

  border-radius:999px;

  background:#dc2626 !important;
  color:#ffffff !important;

  font-size:11px;
  font-weight:700;
  line-height:1;

  box-sizing:border-box;
}

#expenseBadge.hidden{
  display:none !important;
}

/* Expense history */
.exp-history{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid #e5e7eb;
}

.exp-history h4{
  margin:0 0 14px;
}

.exp-history-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.exp-history-item{
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  background:#f9fafb;
}

.exp-history-head{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}

.exp-history-head span{
  color:#6b7280;
  font-size:12px;
}

.exp-history-user{
  margin-top:4px;
  font-size:12px;
  color:#64748b;
}

.exp-history-desc{
  margin-top:8px;
}

.exp-history-change{
  margin-top:8px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  font-size:12px;
  color:#475569;
}
