:root {
  --bg: #fff9f1;
  --ink: #122039;
  --muted: #5a6784;
  --surface: #ffffff;
  --accent: #ef5b2b;
  --accent-soft: #ffd7c7;
  --success: #0f8b5f;
  --pending: #b84925;
  --border: #e8e2dc;
  --shadow: 0 10px 28px rgba(20, 20, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Manrope, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, #ffdccc 0 13%, transparent 13%),
    radial-gradient(circle at 100% 16%, #ffe8bf 0 9%, transparent 9%),
    var(--bg);
}

.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0.9rem 2rem;
}

.hero {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  margin-top: 0.2rem;
  font-size: 1.65rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.08rem;
}

h3 {
  font-size: 0.96rem;
}

.subtitle,
.muted {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.85rem;
  margin-top: 0.8rem;
}

.tab-bar {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tab-btn {
  margin: 0;
  border: 1px solid #dcd5cd;
  background: #fffbf7;
  color: #3a4460;
  border-radius: 999px;
  padding: 0.55rem 0.7rem;
  font-weight: 700;
}

.tab-btn.active {
  background: linear-gradient(110deg, #dd4e22 0, #ef7432 100%);
  color: #fff;
  border-color: transparent;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.card {
  border-radius: 14px;
  padding: 0.75rem;
  background: linear-gradient(130deg, #fff 20%, #fff5ef 100%);
  border: 1px solid var(--border);
}

.card .label {
  color: var(--muted);
  font-size: 0.8rem;
}

.card .value {
  font-size: 1.4rem;
  font-family: "Space Grotesk", sans-serif;
  margin-top: 0.2rem;
}

.field-label {
  display: block;
  margin-top: 0.7rem;
  margin-bottom: 0.26rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.filters-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.check-row input {
  width: auto;
}

.status-message {
  min-height: 1.2rem;
}

input,
select,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d8dce7;
  font: inherit;
  padding: 0.62rem;
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
}

.btn {
  margin-top: 0.75rem;
  border: 0;
  color: #fff;
  background: linear-gradient(110deg, #dd4e22 0, #ef7432 100%);
  font-weight: 700;
}

.btn-secondary {
  background: linear-gradient(110deg, #2554aa 0, #1674c6 100%);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.list-head {
  margin-top: 1rem;
}

.stack {
  display: grid;
  gap: 0.5rem;
}

.row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem;
  background: #fffefc;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.row p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.badge {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
}

.badge.paid {
  color: #0a704d;
  background: #d6f9ea;
}

.badge.pending {
  color: #8f2d11;
  background: #ffe0d5;
}

.delete-log-btn {
  width: auto;
  border: 1px solid #f0b8a6;
  background: #fff4ef;
  color: #952d11;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
}

.role-badge {
  margin-top: 0.6rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #3d4d70;
}

.form-stack {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 25, 40, 0.42);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 460px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.no-border {
  margin-top: 0.2rem;
  padding-top: 0;
  border-top: 0;
}

#logoutBtn {
  width: auto;
  margin-top: 0.5rem;
}

.toast-container {
  position: fixed;
  right: 0.9rem;
  bottom: 0.9rem;
  z-index: 60;
  display: grid;
  gap: 0.5rem;
  width: min(92vw, 360px);
}

.toast {
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: #0f1f34;
  background: #fff;
  padding: 0.62rem 0.72rem;
  font-size: 0.86rem;
  line-height: 1.35;
  animation: toast-in 0.18s ease-out;
}

.toast-success {
  border-color: #8fd6bb;
  background: #f2fcf7;
}

.toast-error {
  border-color: #f2b9aa;
  background: #fff3f0;
}

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

.hidden {
  display: none;
}

@media (min-width: 760px) {
  .app-shell {
    padding: 1.6rem 1.2rem 2.6rem;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .tab-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  h1 {
    font-size: 2rem;
  }
}
