:root {
  font-family: Arial, sans-serif;
  color: #202238;
  background: #f4f5f9;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }

.topbar {
  background: #17172b;
  color: white;
  padding: 16px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  background: #e6b94a;
  color: #17172b;
  padding: 11px;
  border-radius: 9px;
}
.brand strong, .brand small { display: block; }
.brand small { color: #c5c5d5; margin-top: 4px; font-size: 12px; }

.container { max-width: 1200px; margin: 28px auto; padding: 0 18px; }
.panel {
  background: white;
  border: 1px solid #e5e6ef;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 18px #20223808;
}
.login { max-width: 430px; margin: 8vh auto; }
h1 { font-size: 29px; margin: 7px 0; }
h2 { font-size: 19px; margin: 0; }
p { color: #73758a; }
.eyebrow {
  color: #704cda;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.4px;
}
label { display: grid; gap: 7px; font-size: 12px; font-weight: bold; color: #55576c; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid #dfe1eb;
  border-radius: 8px;
  background: white;
  color: #202238;
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid #8060df55;
  border-color: #8060df;
}
button { cursor: pointer; font: inherit; }
.primary, .secondary {
  padding: 11px 15px;
  border: 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: bold;
}
.primary { background: #6844d8; color: white; }
.primary:hover { background: #5432bd; }
.secondary { background: #eeedf7; color: #3d315f; }
.login form { display: grid; gap: 15px; margin-top: 22px; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}
.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.summary .panel { margin-bottom: 18px; }
.summary small { display: block; color: #74768a; font-size: 12px; }
.summary strong { display: block; font-size: 23px; margin: 12px 0; overflow-wrap: anywhere; }
#overdueTotal { color: #b66b16; }
.expenseForm {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.wide { grid-column: span 2; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.message { font-size: 13px; color: #39814c; }
.message.error { color: #b52c40; }
.tableWrap { overflow-x: auto; margin-top: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 12px 9px; text-align: left; border-bottom: 1px solid #ececf2; }
th { color: #73758a; font-size: 11px; text-transform: uppercase; }
td { white-space: nowrap; }
td:nth-child(2) { white-space: normal; min-width: 150px; }
.status { padding: 5px 8px; border-radius: 20px; font-size: 11px; font-weight: bold; }
.status-pending { background: #fff1d8; color: #915d08; }
.status-paid { background: #def6e6; color: #237546; }
.status-cancelled { background: #eeeef2; color: #696a79; }
.small-button { border: 0; border-radius: 6px; padding: 7px; margin: 2px; background: #eeedf7; color: #3d315f; }
.small-button.danger { background: #fde8eb; color: #a62d3e; }
.userForm { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 18px; }
footer { text-align: center; color: #8b8da0; font-size: 12px; padding: 12px 0 28px; }

@media (max-width: 850px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .expenseForm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .userForm { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .container { margin: 16px auto; padding: 0 10px; }
  .topbar { padding: 13px; }
  .panel { padding: 14px; }
  .heading { align-items: flex-start; }
  h1 { font-size: 24px; }
  .summary strong { font-size: 19px; }
  .filters { gap: 9px; }
  .primary, .secondary { padding: 10px; }
}
