:root {
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-light: #fff1e7;
  --background: #f7f8fa;
  --surface: #ffffff;
  --text: #172033;
  --muted: #778196;
  --border: #e9edf2;
  --green: #168653;
  --red: #dc4545;
  --shadow: 0 12px 35px rgba(20, 30, 50, .055);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.login-card {
  width: 100%;
  max-width: 410px;
  padding: 38px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  font-weight: 900;
  font-size: 25px;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-radius: 12px;
}

.eyebrow {
  color: var(--orange-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}

.login-card h1 {
  margin: 9px 0;
  font-size: 29px;
}

.muted, .section-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-card form {
  margin-top: 28px;
}

label {
  display: block;
  margin: 17px 0 8px;
  font-size: 12px;
  font-weight: 700;
}

input, select {
  width: 100%;
  min-height: 45px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .10);
}

.primary-btn, .secondary-btn {
  min-height: 43px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
}

.primary-btn {
  width: 100%;
  margin-top: 20px;
  color: white;
  background: var(--orange);
}

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

.primary-btn:disabled {
  opacity: .6;
  cursor: wait;
}

.primary-btn.compact {
  width: auto;
  margin: 0;
}

.secondary-btn {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.error-message {
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

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

.sidebar {
  width: 245px;
  flex-shrink: 0;
  min-height: 100vh;
  padding: 25px 17px;
  display: flex;
  flex-direction: column;
  background: white;
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 32px;
}

.sidebar-brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 1px;
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.3px;
}

.nav-label {
  padding: 0 10px 12px;
  color: #a0a8b7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  padding: 13px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #657086;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.nav-item:hover, .nav-item.active {
  color: var(--orange-dark);
  background: var(--orange-light);
}

.sidebar-bottom {
  margin-top: auto;
}

.admin-status {
  padding: 12px 7px;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}

.logout-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: white;
  color: #687287;
  text-align: left;
}

.main-content {
  width: 100%;
  min-width: 0;
  max-width: 1600px;
  margin: auto;
  padding: 30px 36px;
}

.topbar, .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 27px;
}

.topbar .eyebrow {
  margin-bottom: 6px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
}

.welcome-panel {
  min-height: 175px;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  border-radius: 17px;
  color: white;
  background: linear-gradient(115deg, #f97316, #ea580c);
}

.welcome-panel .eyebrow {
  color: #ffeadb;
}

.welcome-panel h2 {
  margin: 8px 0;
  font-size: 25px;
}

.welcome-panel p:last-child {
  color: #ffeadb;
  font-size: 12px;
}

.welcome-icon {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 28px;
  color: rgba(255,255,255,.85);
  font-size: 50px;
  font-weight: 900;
  transform: rotate(8deg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 23px 0 35px;
}

.stat-card, .table-card, .user-result {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  box-shadow: var(--shadow);
}

.stat-card span, .stat-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.stat-card strong {
  display: block;
  margin: 13px 0 7px;
  font-size: 28px;
}

.section-heading {
  margin: 28px 0 15px;
}

.section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.section-heading p {
  margin: 5px 0 0;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th, td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 11px;
}

th {
  background: #fafbfc;
  color: #8b94a5;
  font-size: 9px;
  letter-spacing: .7px;
  text-transform: uppercase;
}

td {
  color: #596477;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-cell {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 6px 9px;
  border-radius: 20px;
  background: #f0f2f5;
  color: #677185;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.pending {
  color: #a86a05;
  background: #fff5dc;
}

.badge.approved, .badge.paid, .badge.enabled {
  color: #168653;
  background: #e5f7ed;
}

.badge.processing {
  color: #245eb5;
  background: #e9f1ff;
}

.badge.rejected, .badge.disabled {
  color: #c13c3c;
  background: #ffebeb;
}

.filter-select {
  width: auto;
  min-width: 150px;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 650px;
  margin: 20px 0;
}

.search-form input {
  flex: 1;
}

.user-result {
  max-width: 650px;
  margin-top: 20px;
}

.user-result h3 {
  margin-top: 0;
}

.user-result p {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.user-balance {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 17px;
}

.user-balance div {
  padding: 15px;
  border-radius: 10px;
  background: #fafbfc;
}

.user-balance span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.user-balance strong {
  display: block;
  margin-top: 7px;
  font-size: 19px;
}

.app-message {
  margin-bottom: 18px;
  padding: 12px 15px;
  border-radius: 9px;
  background: #fff4e9;
  color: #a94c0b;
  font-size: 12px;
}

.app-message.error {
  background: #ffebeb;
  color: #b83232;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 40px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  color: #929aaa;
  font-size: 10px;
}

@media (max-width: 950px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    padding: 25px 20px;
  }
}

@media (max-width: 650px) {
  .app {
    display: block;
  }

  .sidebar {
    width: 100%;
    min-height: auto;
    padding: 13px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-brand {
    padding: 3px 5px 13px;
  }

  .nav-label, .sidebar-bottom {
    display: none;
  }

  nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
  }

  .nav-item {
    flex-shrink: 0;
    padding: 10px;
    font-size: 11px;
  }

  .main-content {
    padding: 22px 13px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .welcome-panel {
    min-height: 150px;
    padding: 20px;
  }

  .welcome-icon {
    width: 65px;
    height: 65px;
    font-size: 34px;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .search-form {
    flex-direction: column;
  }

  .primary-btn.compact {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }
}
