/* =============================================
   BANK ADMIN PANEL — DARK THEME DESIGN SYSTEM
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-2: #1a1a28;
  --bg-input: #1e1e2e;
  --border: #2a2a3a;
  --border-light: #333348;
  --red: #F44336;
  --red-dark: #D32F2F;
  --red-glow: rgba(244,67,54,0.15);
  --green: #4CAF50;
  --yellow: #FFC107;
  --blue: #42A5F5;
  --white: #FFFFFF;
  --text: #E8E8F0;
  --text-2: #9898AC;
  --text-3: #6868780;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --glass: rgba(255,255,255,0.03);
  --transition: 0.2s ease;
}

html, body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand img { height: 32px; }

.sidebar-brand span {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.nav-item:hover {
  background: var(--glass);
  color: var(--text);
}

.nav-item.active {
  background: var(--red-glow);
  color: var(--red);
  font-weight: 600;
}

.nav-item .icon { font-size: 18px; width: 24px; text-align: center; }

.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.sidebar-user-name { font-size: 13px; font-weight: 600; }
.sidebar-user-role { font-size: 11px; color: var(--text-2); }

.main {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  min-height: 100vh;
}

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-2);
}

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--red);
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover::before { opacity: 1; }
.stat-card:hover { border-color: var(--border-light); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-icon.red { background: var(--red-glow); }
.stat-icon.green { background: rgba(76,175,80,0.15); }
.stat-icon.yellow { background: rgba(255,193,7,0.15); }
.stat-icon.blue { background: rgba(66,165,245,0.15); }

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-2);
}

/* ── Data Table ── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.table-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.table-search {
  width: 240px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}

.table-search:focus { border-color: var(--red); }
.table-search::placeholder { color: var(--text-3); }

.table-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--red-glow);
  border-color: var(--red);
  color: var(--red);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-2);
}

tbody td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--glass);
}

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

/* ── Status Badges ── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-status.pending {
  background: rgba(255,193,7,0.12);
  color: var(--yellow);
}

.badge-status.approved {
  background: rgba(76,175,80,0.12);
  color: var(--green);
}

.badge-status.rejected {
  background: rgba(244,67,54,0.12);
  color: var(--red);
}

.badge-status.active {
  background: rgba(76,175,80,0.12);
  color: var(--green);
}

.badge-status.blocked {
  background: rgba(244,67,54,0.12);
  color: var(--red);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Action Buttons ── */
.btn-action {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-action.approve {
  background: rgba(76,175,80,0.12);
  color: var(--green);
}

.btn-action.approve:hover {
  background: var(--green);
  color: var(--white);
}

.btn-action.reject {
  background: rgba(244,67,54,0.12);
  color: var(--red);
}

.btn-action.reject:hover {
  background: var(--red);
  color: var(--white);
}

.btn-action.view {
  background: rgba(66,165,245,0.12);
  color: var(--blue);
}

.btn-action.view:hover {
  background: var(--blue);
  color: var(--white);
}

.btn-action.block {
  background: rgba(255,193,7,0.12);
  color: var(--yellow);
}

.action-group {
  display: flex;
  gap: 6px;
}

/* ── Login Page ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img { height: 40px; margin: 0 auto; }

.login-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 8px;
}

.login-sub {
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 28px;
}

.form-group-admin {
  margin-bottom: 16px;
}

.form-label-admin {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input-admin {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input-admin:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.btn-admin {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--red);
  color: var(--white);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-admin:hover { background: var(--red-dark); }
.btn-admin:active { transform: scale(0.98); }
.btn-admin:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show { display: flex; }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--white); }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--bg-input);
  color: var(--text-2);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ── KYC Image Preview ── */
.kyc-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}

.kyc-img-card {
  background: var(--bg-card-2);
  border-radius: var(--r);
  overflow: hidden;
}

.kyc-img-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.kyc-img-label {
  text-align: center;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

/* ── Detail Grid ── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  padding: 12px;
  background: var(--bg-card-2);
  border-radius: var(--r);
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  word-break: break-all;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state .title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* ── Spinner ── */
.spin-admin {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    margin-left: 0;
    padding: 20px 16px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .table-header {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  .table-search { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .kyc-images { grid-template-columns: 1fr; }

  .mobile-toggle {
    display: flex !important;
  }
}

.mobile-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 150;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

.sidebar-overlay.show { display: block; }

/* ── Utilities ── */
.hide { display: none !important; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
