:root {
  --bg: #f3efe7;
  --bg-strong: #e9e2d6;
  --ink: #101828;
  --muted: #6b7280;
  --line: #e2d8ca;
  --panel: #ffffff;
  --accent: #e76f51;
  --accent-2: #2a9d8f;
  --accent-3: #264653;
  --shadow: 0 20px 50px rgba(16, 24, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Space Grotesk", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(231, 111, 81, 0.25), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(42, 157, 143, 0.22), transparent 55%),
    radial-gradient(circle at 50% 90%, rgba(38, 70, 83, 0.12), transparent 60%),
    linear-gradient(120deg, #f8f4ee 0%, #efe7db 35%, #f5efe6 100%);
  z-index: -1;
}

.hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.login-card {
  width: min(420px, 92vw);
  background: var(--panel);
  padding: 32px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.login-head h1 {
  margin: 8px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
}

.login-head p {
  margin: 0 0 24px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.15);
  color: var(--accent-3);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app {
  display: flex;
  min-height: 100vh;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--line);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-3);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 0.08em;
}

.brand h2 {
  margin: 0;
  font-size: 18px;
  font-family: "Space Grotesk", sans-serif;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  border: none;
  background: transparent;
  padding: 12px 14px;
  border-radius: 12px;
  text-align: left;
  font-weight: 600;
  color: var(--accent-3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(42, 157, 143, 0.12);
}

.nav-link.active {
  background: rgba(231, 111, 81, 0.15);
  color: var(--accent);
}

.user-box {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-name {
  font-weight: 700;
}

.user-role {
  color: var(--muted);
  font-size: 12px;
}

.main {
  flex: 1;
  padding: 32px 36px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.status-pill {
  background: rgba(38, 70, 83, 0.12);
  color: var(--accent-3);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

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

.stat-card {
  background: var(--panel);
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 20px rgba(38, 70, 83, 0.08);
}

.stat-title {
  font-size: 13px;
  color: var(--muted);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 8px;
}

.stat-subvalue {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.stat-subvalue span {
  font-weight: 600;
  color: var(--accent-3);
}

.grid.two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(38, 70, 83, 0.08);
}

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

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-note {
  color: var(--muted);
  font-size: 12px;
}

.form {
  display: grid;
  gap: 12px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--accent-3);
}

.form input,
.form select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

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

.form .helper {
  font-size: 12px;
  color: var(--muted);
}

.fx-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: rgba(42, 157, 143, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.fx-summary strong {
  color: var(--accent-3);
  font-size: 14px;
}

.btn {
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(231, 111, 81, 0.25);
}

.btn.primary:hover {
  transform: translateY(-1px);
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
}

.btn.ghost {
  background: transparent;
  color: var(--accent-3);
  border: 1px solid var(--line);
}

.form-error {
  color: #b42318;
  font-size: 13px;
}

.table {
  width: 100%;
  overflow-x: auto;
}

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

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table input[type="number"],
.table input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
  width: 120px;
}

.table tr:hover {
  background: rgba(42, 157, 143, 0.08);
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.pending {
  background: rgba(231, 111, 81, 0.15);
  color: var(--accent);
}

.badge.paid {
  background: rgba(42, 157, 143, 0.18);
  color: var(--accent-3);
}

.badge.review {
  background: rgba(42, 157, 143, 0.12);
  color: var(--accent-2);
}

.badge.approved {
  background: rgba(42, 157, 143, 0.18);
  color: var(--accent-2);
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  width: min(520px, 92vw);
  box-shadow: var(--shadow);
  z-index: 2;
}

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

.modal-head h3 {
  margin: 0;
}

.modal-body {
  font-size: 14px;
}

.modal-body p {
  margin: 6px 0;
}

.modal-body img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 10px;
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeUp 0.5s ease forwards;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }
.delay-4 { animation-delay: 0.25s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-link {
    font-size: 12px;
  }

  .main {
    padding: 24px;
  }

  .user-box {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 16px;
  }
}
