/* ── GCE Frontend v3 ─────────────────────────────────────────── */
:root {
  --gce-primary:   #2563eb;
  --gce-primary-d: #1d4ed8;
  --gce-success:   #16a34a;
  --gce-danger:    #dc2626;
  --gce-warning:   #d97706;
  --gce-orange:    #ea580c;
  --gce-bg:        #f1f5f9;
  --gce-card:      #ffffff;
  --gce-border:    #e2e8f0;
  --gce-text:      #1e293b;
  --gce-muted:     #64748b;
  --gce-radius:    12px;
  --gce-shadow:    0 4px 24px rgba(0,0,0,.08);
  --gce-sidebar-w: 260px;
}

*,*::before,*::after { box-sizing: border-box; }
body { margin: 0; }

/* ── App layout (sidebar + main) ─────────────────────────────── */
.gce-app-layout {
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gce-text);
  background: var(--gce-bg);
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.gce-sidebar {
  width: var(--gce-sidebar-w);
  background: #1e293b;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.gce-sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 18px;
  border-bottom: 1px solid #334155;
}
.gce-sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gce-primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gce-sidebar-name    { font-weight: 700; font-size: .93rem; color: #f1f5f9; }
.gce-sidebar-contact { font-size: .75rem; color: #94a3b8; margin-top: 2px; word-break: break-all; }

.gce-sidebar-wallet {
  padding: 14px 20px;
  border-bottom: 1px solid #334155;
  background: #0f172a;
}
.gce-sidebar-wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  padding: 4px 0;
  color: #94a3b8;
}
.gce-sidebar-wallet-row strong { color: #4ade80; font-size: .9rem; }
.gce-sidebar-wallet-row.pending strong { color: #fbbf24; }

.gce-sidebar-nav {
  flex: 1;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
}
.gce-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: #94a3b8;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.gce-sidebar-link:hover { background: #334155; color: #f1f5f9; }
.gce-sidebar-link.active {
  background: var(--gce-primary);
  color: #fff;
  font-weight: 700;
}
.gce-sidebar-link .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.gce-sidebar-logout { margin-top: auto; color: #f87171; }
.gce-sidebar-logout:hover { background: #7f1d1d22; color: #fca5a5; }

/* ── Main content area ───────────────────────────────────────── */
.gce-main {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  min-width: 0;
}

/* ── Login page (standalone, no sidebar) ─────────────────────── */
.gce-wrap { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--gce-text); max-width: 1000px; margin: 0 auto; padding: 24px 16px; }
.gce-login-wrap .gce-card { max-width: 480px; margin: 60px auto; }
.gce-card { background: var(--gce-card); border-radius: var(--gce-radius); box-shadow: var(--gce-shadow); padding: 40px; }
.gce-logo { font-size: 48px; text-align: center; margin-bottom: 8px; }
.gce-card h2 { text-align: center; margin: 0 0 6px; font-size: 1.6rem; }
.gce-sub { text-align: center; color: var(--gce-muted); margin-bottom: 28px; }

/* Page card (submit, bank, kyc in sidebar layout) */
.gce-page-card {
  background: var(--gce-card);
  border-radius: var(--gce-radius);
  box-shadow: var(--gce-shadow);
  padding: 32px 36px;
  max-width: 600px;
}
.gce-page-card h2 { margin: 0 0 6px; font-size: 1.4rem; }

/* ── Tabs ────────────────────────────────────────────────────── */
.gce-tabs { display: flex; border-bottom: 2px solid var(--gce-border); margin-bottom: 24px; gap: 4px; }
.gce-tab { flex: 1; background: none; border: none; padding: 12px; font-size: .93rem; cursor: pointer; color: var(--gce-muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 500; }
.gce-tab.active { color: var(--gce-primary); border-bottom-color: var(--gce-primary); font-weight: 700; }
.gce-tab-content { display: none; }
.gce-tab-content.active { display: block; }

/* ── Form fields ─────────────────────────────────────────────── */
.gce-field { margin-bottom: 18px; }
.gce-field label { display: block; font-size: .85rem; font-weight: 600; color: var(--gce-text); margin-bottom: 6px; }
.gce-field input, .gce-field select, .gce-field textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--gce-border); border-radius: 8px;
  font-size: .95rem; background: #fff; color: var(--gce-text);
  transition: border .18s, box-shadow .18s;
}
.gce-field input:focus, .gce-field select:focus { outline: none; border-color: var(--gce-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.gce-field input[type=file] { padding: 7px 10px; }
.gce-input-row { display: flex; }
.gce-prefix { background: var(--gce-bg); border: 1.5px solid var(--gce-border); border-right: none; padding: 10px 12px; border-radius: 8px 0 0 8px; font-size: .95rem; color: var(--gce-muted); white-space: nowrap; }
.gce-input-row input { border-radius: 0 8px 8px 0; }
.gce-hint { font-size: .78rem; color: var(--gce-muted); margin-top: 4px; display: block; }
.req { color: var(--gce-danger); }

/* ── Buttons ─────────────────────────────────────────────────── */
.gce-btn {
  display: inline-block; padding: 11px 24px;
  background: var(--gce-primary); color: #fff;
  border: none; border-radius: 8px;
  font-size: .93rem; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .18s, transform .1s;
}
.gce-btn:hover  { background: var(--gce-primary-d); color: #fff; }
.gce-btn:active { transform: scale(.98); }
.gce-btn-full   { width: 100%; text-align: center; margin-top: 8px; }
.gce-btn-outline { background: transparent; border: 2px solid var(--gce-primary); color: var(--gce-primary); }
.gce-btn-outline:hover { background: var(--gce-primary); color: #fff; }
.gce-btn-sm  { padding: 7px 16px; font-size: .83rem; }
.gce-btn-muted { background: var(--gce-muted); }
.gce-btn-muted:hover { background: #475569; }
.gce-btn[disabled] { opacity: .55; cursor: not-allowed; }
.gce-btn-link { background: none; border: none; color: var(--gce-primary); font-size: .85rem; cursor: pointer; padding: 0; text-decoration: underline; font-weight: 600; }

/* ── Alerts ──────────────────────────────────────────────────── */
.gce-alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 14px; font-size: .88rem; }
.gce-alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--gce-warning); }
.gce-alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--gce-primary); }
.gce-alert-danger  { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--gce-danger); }
.gce-alert a { color: inherit; font-weight: 700; }

/* ── Messages ────────────────────────────────────────────────── */
.gce-msg { margin-top: 14px; padding: 11px 14px; border-radius: 8px; font-size: .9rem; display: none; }
.gce-msg.success { background: #dcfce7; color: #166534; border-left: 3px solid var(--gce-success); }
.gce-msg.error   { background: #fee2e2; color: #991b1b; border-left: 3px solid var(--gce-danger);  }
.gce-msg.info    { background: #dbeafe; color: #1e40af; border-left: 3px solid var(--gce-primary); }
.gce-hidden { display: none !important; }

/* ── Wallet grid ─────────────────────────────────────────────── */
.gce-wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.gce-wallet-card {
  background: var(--gce-card);
  border-radius: var(--gce-radius);
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  gap: 16px;
  border-left: 4px solid transparent;
}
.gce-wallet-balance { border-color: var(--gce-success); }
.gce-wallet-pending { border-color: var(--gce-warning); }
.gce-wallet-total   { border-color: var(--gce-primary); }
.gce-wallet-icon    { font-size: 2rem; }
.gce-wallet-amount  { font-size: 1.5rem; font-weight: 800; color: var(--gce-text); }
.gce-wallet-label   { font-size: .73rem; color: var(--gce-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; }

/* ── Sections ────────────────────────────────────────────────── */
.gce-section { margin-bottom: 28px; }
.gce-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.gce-section-title { font-size: 1rem; font-weight: 700; margin: 0; color: var(--gce-text); }

/* ── Tables ──────────────────────────────────────────────────── */
.gce-table-wrap { overflow-x: auto; background: var(--gce-card); border-radius: var(--gce-radius); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.gce-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.gce-table th {
  background: #f8fafc; padding: 11px 14px; text-align: left;
  font-weight: 700; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--gce-muted);
  border-bottom: 2px solid var(--gce-border); white-space: nowrap;
}
.gce-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.gce-table tr:last-child td { border-bottom: none; }
.gce-table tr:hover td { background: #f8fafc; }
.gce-admin-note { font-size: .75rem; color: var(--gce-warning); display: block; max-width: 180px; margin-top: 4px; }

/* ── Badges ──────────────────────────────────────────────────── */
.gce-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.status-pending      { background: #fef3c7; color: #92400e; }
.status-review, .status-under_review { background: #dbeafe; color: #1e40af; }
.status-approved     { background: #d1fae5; color: #065f46; }
.status-rejected     { background: #fee2e2; color: #991b1b; }
.status-paid         { background: #ccfbf1; color: #134e4a; }

.gce-txn-badge { font-size: .78rem; font-weight: 600; }

/* ── Color helpers ───────────────────────────────────────────── */
.red    { color: var(--gce-danger)  !important; }
.green  { color: var(--gce-success) !important; }
.orange { color: var(--gce-orange)  !important; }

/* ── Empty state ─────────────────────────────────────────────── */
.gce-empty { text-align: center; padding: 60px 20px; background: var(--gce-card); border-radius: var(--gce-radius); }
.gce-empty-icon { font-size: 52px; margin-bottom: 12px; }
.gce-empty p { color: var(--gce-muted); margin-bottom: 20px; }

/* ── Submit page ─────────────────────────────────────────────── */
.gce-info-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: .88rem; color: #1e40af; }
.gce-payout-preview { background: var(--gce-bg); border: 1px solid var(--gce-border); border-radius: 10px; padding: 18px; margin: 18px 0; }
.gce-payout-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; }
.gce-payout-row.payout-total { border-top: 2px solid var(--gce-border); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }

/* ── Radio group ─────────────────────────────────────────────── */
.gce-radio-group { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.gce-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; background: var(--gce-bg); border: 2px solid var(--gce-border); padding: 10px 20px; border-radius: 8px; font-weight: 600; transition: border .18s, background .18s; }
.gce-radio input[type=radio] { accent-color: var(--gce-primary); }
.gce-radio:has(input:checked) { border-color: var(--gce-primary); background: #eff6ff; color: var(--gce-primary); }

/* ── KYC ─────────────────────────────────────────────────────── */
.gce-kyc-status { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 10px; margin-bottom: 22px; }
.gce-kyc-status.approved { background: #d1fae5; }
.gce-kyc-status.pending  { background: #dbeafe; }
.gce-kyc-status.rejected { background: #fee2e2; }
.gce-kyc-status-icon { font-size: 2rem; }
.gce-kyc-submitted-info { background: var(--gce-bg); border-radius: 8px; padding: 14px; margin-bottom: 20px; font-size: .9rem; }
.gce-kyc-submitted-info p { margin: 4px 0; }
.gce-kyc-guidelines { background: #f8fafc; border: 1px solid var(--gce-border); border-radius: 8px; padding: 14px 18px; margin: 16px 0; font-size: .86rem; }
.gce-kyc-guidelines ul { margin: 8px 0 0 16px; line-height: 1.9; }

/* ── Modal ───────────────────────────────────────────────────── */
.gce-modal { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gce-modal.gce-hidden { display: none !important; }
.gce-modal-inner { background: var(--gce-card); border-radius: var(--gce-radius); padding: 32px; max-width: 640px; width: 100%; max-height: 88vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.gce-modal-close { position: absolute; top: 14px; right: 14px; background: var(--gce-bg); border: 1px solid var(--gce-border); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; color: var(--gce-muted); }
.gce-modal-close:hover { background: var(--gce-border); }
.gce-loading { text-align: center; padding: 40px; color: var(--gce-muted); }

/* Submission detail in modal */
.gce-sub-detail h3 { margin: 0 0 18px; font-size: 1.1rem; border-bottom: 2px solid var(--gce-border); padding-bottom: 10px; }
.gce-sub-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.gce-detail-item { background: var(--gce-bg); border-radius: 8px; padding: 12px 14px; }
.gce-detail-item .label { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--gce-muted); letter-spacing: .05em; }
.gce-detail-item .value { font-size: .97rem; font-weight: 700; margin-top: 4px; }
.gce-card-data-section { background: #f8fafc; border-radius: 8px; padding: 16px; margin-top: 12px; }
.gce-card-data-section h4 { margin: 0 0 12px; font-size: .78rem; color: var(--gce-muted); text-transform: uppercase; letter-spacing: .05em; }
.gce-card-data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.gce-card-data-table td { padding: 8px 10px; border-bottom: 1px solid var(--gce-border); }
.gce-card-data-table td:first-child { font-weight: 600; color: var(--gce-muted); width: 45%; }
.gce-card-data-table tr:last-child td { border-bottom: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .gce-app-layout { flex-direction: column; }
  .gce-sidebar {
    width: 100%; height: auto; position: relative;
    flex-direction: row; flex-wrap: wrap;
  }
  .gce-sidebar-user  { flex: 1; border-bottom: none; border-right: 1px solid #334155; padding: 14px 16px; }
  .gce-sidebar-wallet { padding: 10px 14px; flex: 1; }
  .gce-sidebar-nav { flex-direction: row; flex-wrap: wrap; padding: 6px 0; width: 100%; border-top: 1px solid #334155; }
  .gce-sidebar-link { padding: 10px 14px; font-size: .8rem; flex: 0 0 auto; }
  .gce-main { padding: 16px; }
  .gce-wallet-grid { grid-template-columns: 1fr; }
  .gce-sub-detail-grid { grid-template-columns: 1fr; }
  .gce-page-card { padding: 20px; }
  .gce-card { padding: 24px 18px; }
}
