:root {
  --green-900: #0b3d24;
  --green-700: #0f5c34;
  --green-600: #12864a;
  --green-500: #17a259;
  --green-100: #e6f7ee;
  --ink: #14201b;
  --gray-600: #6b7a74;
  --gray-300: #dfe7e3;
  --bg: #f5f8f6;
  --card: #ffffff;
  --danger: #e14b4b;
  --warn: #e0a52c;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(11, 61, 36, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 84px;
  position: relative;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 8px;
}
.topbar .greeting { display: flex; align-items: center; gap: 10px; }
.topbar .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-100); display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--green-700); overflow: hidden;
}
.topbar h4 { margin: 0; font-size: 15px; }
.topbar .sub { font-size: 12px; color: var(--gray-600); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--card); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}

/* ---------- Auth pages ---------- */
.auth-wrap { padding: 30px 24px; }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header .icon-circle {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-100);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 12px;
  color: var(--green-700);
}
.auth-header h2 { margin: 0 0 4px; }
.auth-header p { margin: 0; color: var(--gray-600); font-size: 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--gray-300);
  font-size: 15px; background: var(--card); outline: none;
}
.field input:focus, .field select:focus { border-color: var(--green-500); }
.field-pw { position: relative; }
.field-pw button {
  position: absolute; right: 12px; top: 12px; background: none; border: none; cursor: pointer; color: var(--gray-600);
}

.btn {
  display: block; width: 100%; text-align: center; padding: 14px; border-radius: 12px;
  border: none; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--green-600); color: #fff; }
.btn-primary:hover { background: var(--green-700); }
.btn-outline { background: #fff; color: var(--green-700); border: 1.5px solid var(--green-600); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block + .btn-block { margin-top: 10px; }

.auth-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--gray-600); }
.auth-foot a { color: var(--green-700); font-weight: 600; text-decoration: none; }

.alert { padding: 12px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #fdeceb; color: #a5271f; }
.alert-success { background: var(--green-100); color: var(--green-700); }

/* ---------- Home / balance card ---------- */
.balance-card {
  margin: 12px 20px; padding: 22px; border-radius: 20px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  color: #fff; box-shadow: var(--shadow);
}
.balance-card .label { font-size: 13px; opacity: 0.85; display:flex; align-items:center; justify-content:space-between; }
.balance-card .amount { font-size: 30px; font-weight: 800; margin-top: 6px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  padding: 16px 20px 4px;
}
.stat-card {
  background: var(--card); border-radius: 14px; padding: 10px 8px; text-align: center;
  box-shadow: var(--shadow); font-size: 11px; color: var(--gray-600);
}
.stat-card .val { font-size: 13px; font-weight: 700; color: var(--ink); display: block; margin-top: 4px; }

.action-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
  padding: 16px 20px;
}
.action-item { text-align: center; text-decoration: none; color: var(--ink); font-size: 11px; }
.action-item .circle {
  width: 46px; height: 46px; border-radius: 14px; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff;
  display: flex; justify-content: space-around; align-items: center;
  padding: 10px 6px 14px; box-shadow: 0 -4px 18px rgba(0,0,0,0.06); border-radius: 20px 20px 0 0;
}
.bottom-nav a { text-decoration: none; color: var(--gray-600); font-size: 10px; text-align: center; }
.bottom-nav a.active { color: var(--green-700); font-weight: 700; }
.bottom-nav .nav-icon { display:block; margin: 0 auto 3px; }
.bottom-nav .fab {
  width: 48px; height: 48px; border-radius: 50%; background: var(--green-600); color: #fff;
  display: flex; align-items: center; justify-content: center; margin-top: -22px; box-shadow: var(--shadow);
}

/* ---------- Generic page ---------- */
.page-header {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px;
}
.page-header a.back { color: var(--ink); text-decoration: none; font-size: 20px; }
.page-header h3 { margin: 0; }

.card {
  background: var(--card); border-radius: 16px; padding: 18px; margin: 10px 20px; box-shadow: var(--shadow);
}
.card-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gray-300); }
.card-row:last-child { border-bottom: none; }

.method-option {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px;
  border: 1.5px solid var(--gray-300); margin-bottom: 12px; cursor: pointer;
}
.method-option.selected { border-color: var(--green-500); background: var(--green-100); }
.method-option .icon { width: 40px; height: 40px; border-radius: 10px; display:flex; align-items:center; justify-content:center; }
.method-option .meta small { color: var(--gray-600); }

.amount-chips { display: flex; gap: 8px; margin: 10px 0 18px; flex-wrap: wrap; }
.amount-chips button {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--gray-300); background: #fff; cursor: pointer; font-size: 13px;
}

.tx-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--gray-300); }
.tx-item:last-child { border-bottom: none; }
.tx-icon { width: 40px; height: 40px; border-radius: 12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.tx-meta { flex: 1; }
.tx-meta .title { font-weight: 600; font-size: 14px; }
.tx-meta .date { font-size: 12px; color: var(--gray-600); }
.tx-amount { text-align: right; font-weight: 700; font-size: 14px; }
.tx-amount .status { display: block; font-size: 11px; font-weight: 500; }
.status-successful { color: var(--green-600); }
.status-pending { color: var(--warn); }
.status-failed, .status-rejected { color: var(--danger); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-pending { background: #fdf3e0; color: var(--warn); }
.badge-approved, .badge-successful { background: var(--green-100); color: var(--green-700); }
.badge-rejected, .badge-failed { background: #fdeceb; color: var(--danger); }

/* ---------- Popup / modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11, 32, 21, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-box {
  background: #0f1e17; color: #fff; border-radius: 20px; padding: 26px 22px; max-width: 360px; width: 100%;
  text-align: center; position: relative;
}
.modal-box .close-x {
  position: absolute; right: 14px; top: 14px; background: none; border: none; color: #fff; font-size: 18px; cursor: pointer;
}
.modal-box .megaphone {
  width: 90px; height: 90px; border-radius: 50%; background: #16261e; margin: 6px auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.modal-box h3 { margin: 0 0 10px; }
.modal-box p { color: #cdd8d2; font-size: 13.5px; line-height: 1.5; margin-bottom: 20px; }
.modal-box .btn { margin-bottom: 10px; }

/* ---------- Settings list ---------- */
.settings-list a, .settings-list .row {
  display: flex; align-items: center; justify-content: space-between; padding: 15px 4px;
  border-bottom: 1px solid var(--gray-300); text-decoration: none; color: var(--ink); font-size: 14px;
}
.settings-list .left { display: flex; align-items: center; gap: 12px; }

/* ---------- Admin ---------- */
.admin-shell { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar { width: 230px; background: #0b1f16; color: #dfe9e3; padding: 20px 14px; flex-shrink: 0; transition: transform 0.3s ease; }
.admin-sidebar h2 { color: #fff; font-size: 18px; padding: 0 8px 18px; }
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 11px 10px; border-radius: 10px;
  color: #b9c7bf; text-decoration: none; font-size: 14px; margin-bottom: 2px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--green-700); color: #fff; }
.admin-main { flex: 1; padding: 26px 32px; max-width: 1100px; width: 100%; overflow-x: hidden; }
.admin-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-card { background: var(--card); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.admin-card .label { font-size: 12px; color: var(--gray-600); }
.admin-card .value { font-size: 22px; font-weight: 800; margin-top: 6px; }

/* Responsive Admin Media Queries */
@media (max-width: 768px) {
  .admin-mobile-header { display: flex !important; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 1000;
    transform: translateX(-100%); box-shadow: 4px 0 20px rgba(0,0,0,0.3); padding-top: 18px;
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-sidebar .admin-close-btn { display: block !important; }
  .admin-main { padding: 16px 14px; }
  .admin-top { flex-direction: column; align-items: stretch; }
  .admin-top h2 { font-size: 20px; }
  .admin-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  
  .card { overflow-x: auto; margin: 10px 0; }
  table { min-width: 600px; }
}

@media (max-width: 480px) {
  .admin-grid { grid-template-columns: 1fr; }
}

table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; }
table th, table td { text-align: left; padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid var(--gray-300); }
table th { background: #f0f4f2; color: var(--gray-600); font-weight: 700; }
.table-actions a, .table-actions button { margin-right: 6px; font-size: 12px; padding: 6px 12px; border-radius: 8px; border: none; cursor: pointer; text-decoration: none; display: inline-block; margin-bottom: 4px; }
.act-approve { background: var(--green-100); color: var(--green-700); }
.act-reject { background: #fdeceb; color: var(--danger); }

.tabs { display: flex; gap: 8px; margin: 10px 20px 4px; }
.tabs a {
  padding: 8px 16px; border-radius: 20px; font-size: 13px; text-decoration: none; color: var(--gray-600); background: #fff;
  border: 1px solid var(--gray-300);
}
.tabs a.active { background: var(--green-600); color: #fff; border-color: var(--green-600); }

.timer-box { display: flex; gap: 8px; }
.timer-box .unit { background: #0f2c1c; color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 13px; text-align: center; min-width: 42px; }
.timer-box .unit small { display: block; font-size: 9px; font-weight: 400; opacity: .7; }
