/* ====================================================
   NOKOS OTP PANEL — Clean Redesign v2
   White / Black theme + dots
   Blue & Yellow buttons, thick stroke, soft shadow
   ==================================================== */

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

:root {
  --primary:       #2563eb;
  --primary-hover: #1d4ed8;
  --yellow:        #facc15;
  --yellow-hover:  #eab308;
  --success:       #16a34a;
  --danger:        #dc2626;
  --warning:       #f59e0b;
  --purple:        #7c3aed;
  --orange:        #ea580c;

  --bg:            #f4f6fb;
  --surface:       #ffffff;
  --surface-2:     #f1f5f9;
  --border:        #0f172a;
  --border-soft:   #cbd5e1;
  --text:          #0f172a;
  --text-sec:      #475569;
  --text-muted:    #94a3b8;

  --nav-h:         58px;
  --bottom-h:      64px;
  --radius:        14px;
  --radius-sm:     10px;
  --stroke:        2px solid #0f172a;
  --shadow:        3px 3px 0 #0f172a;
  --shadow-sm:     2px 2px 0 #0f172a;
}

[data-theme="dark"] {
  --bg:            #0b0b12;
  --surface:       #14141f;
  --surface-2:     #1c1c2a;
  --border:        #e2e8f0;
  --border-soft:   #334155;
  --text:          #f1f5f9;
  --text-sec:      #94a3b8;
  --text-muted:    #64748b;
  --shadow:        3px 3px 0 #e2e8f0;
  --shadow-sm:     2px 2px 0 #e2e8f0;
  --stroke:        2px solid #e2e8f0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  background-image: radial-gradient(circle, var(--text-muted) 1px, transparent 1px);
  background-size: 20px 20px;
  background-attachment: fixed;
  transition: background-color .2s, color .2s;
}

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

/* TOPBAR */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: var(--stroke);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; gap: 10px;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.topbar-icon {
  width: 34px; height: 34px;
  background: var(--primary); color: #fff;
  border: var(--stroke); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; box-shadow: var(--shadow-sm);
}
.topbar-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; border: var(--stroke); }
.topbar-name { font-weight: 700; font-size: 14px; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.nav-saldo {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--yellow); color: #0f172a;
  border: var(--stroke); border-radius: 20px;
  font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.user-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  border: var(--stroke); box-shadow: var(--shadow-sm);
}
.badge-admin { background: var(--yellow); color: #0f172a; }
.badge-user  { background: var(--primary); color: #fff; }

.btn-logout {
  background: var(--surface); border: var(--stroke);
  color: var(--text); padding: 6px 9px;
  border-radius: var(--radius-sm); cursor: pointer;
  box-shadow: var(--shadow-sm); transition: all .12s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

.theme-toggle {
  width: 34px; height: 34px;
  background: var(--surface); border: var(--stroke);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: all .12s; color: var(--text); font-size: 14px;
}
.theme-toggle:hover { background: var(--surface-2); }

/* BOTTOM NAV */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--bottom-h);
  background: var(--surface);
  border-top: var(--stroke);
  box-shadow: 0 -2px 0 var(--border);
  display: flex; align-items: stretch; justify-content: flex-start;
  padding: 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bottomnav::-webkit-scrollbar { display: none; }

.bn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; flex: 0 0 auto; min-width: 58px;
  color: var(--text-sec); font-size: 10px; font-weight: 500;
  text-decoration: none; padding: 6px 6px; margin: 6px 2px;
  border-radius: 10px; transition: background .12s, color .12s;
  white-space: nowrap;
}
.bn-item i { font-size: 16px; line-height: 1; }
.bn-item:hover { color: var(--primary); text-decoration: none; background: var(--surface-2); }
.bn-item.active {
  color: #fff; background: var(--primary);
  border: var(--stroke); box-shadow: var(--shadow-sm); font-weight: 700;
}

/* MAIN */
.main-content {
  padding: calc(var(--nav-h) + 20px) 16px calc(var(--bottom-h) + 24px);
  max-width: 1100px; margin: 0 auto;
}
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.page-subtitle { color: var(--text-sec); font-size: 13px; margin-top: 2px; }

/* ALERTS */
.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 13px; font-weight: 500;
  border: var(--stroke); box-shadow: var(--shadow-sm);
}
.alert-success { background: #dcfce7; color: #14532d; }
.alert-error   { background: #fee2e2; color: #7f1d1d; }
.alert-info    { background: #dbeafe; color: #1e3a8a; }
[data-theme="dark"] .alert-success { background: #14532d; color: #dcfce7; }
[data-theme="dark"] .alert-error   { background: #7f1d1d; color: #fee2e2; }
[data-theme="dark"] .alert-info    { background: #1e3a8a; color: #dbeafe; }

/* CARDS */
.card {
  background: var(--surface);
  border: var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: var(--stroke);
  background: var(--surface-2); gap: 10px; flex-wrap: wrap;
}
.card-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card-body { padding: 16px; }

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-bottom: 20px;
}
@media (min-width: 700px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  background: var(--surface);
  border: var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
}
.stat-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; border: var(--stroke); flex-shrink: 0;
}
.icon-blue   { background: #dbeafe; color: #1d4ed8; }
.icon-green  { background: #dcfce7; color: #15803d; }
.icon-purple { background: #ede9fe; color: #6d28d9; }
.icon-orange { background: #ffedd5; color: #c2410c; }
.icon-yellow { background: #fef9c3; color: #a16207; }
[data-theme="dark"] .icon-blue   { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .icon-green  { background: #14532d; color: #86efac; }
[data-theme="dark"] .icon-purple { background: #4c1d95; color: #c4b5fd; }
[data-theme="dark"] .icon-orange { background: #7c2d12; color: #fdba74; }
[data-theme="dark"] .icon-yellow { background: #713f12; color: #fde047; }
.stat-label { font-size: 11.5px; color: var(--text-sec); font-weight: 500; }
.stat-value { font-size: 17px; font-weight: 800; color: var(--text); margin-top: 1px; }

/* BUTTONS — neat */
.btn,
button.btn,
a.btn,
.btn-primary,
.btn-yellow,
.btn-success,
.btn-danger,
.btn-outline,
.btn-sm,
.btn-full,
.btn-lg,
.btn-block,
.btn-back,
.btn-cancel-deposit,
.btn-pay-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: var(--stroke);
  box-shadow: var(--shadow-sm);
  transition: background .12s, box-shadow .12s, transform .1s;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: middle;
}
.btn:hover, button.btn:hover, a.btn:hover,
.btn-primary:hover, .btn-yellow:hover, .btn-success:hover,
.btn-danger:hover, .btn-outline:hover, .btn-sm:hover, .btn-back:hover {
  text-decoration: none;
  box-shadow: none;
  transform: translate(1px, 1px);
}
.btn-primary { background: var(--primary); color: #fff !important; }
.btn-primary:hover { background: var(--primary-hover); color: #fff !important; }
.btn-yellow { background: var(--yellow); color: #0f172a !important; }
.btn-yellow:hover { background: var(--yellow-hover); color: #0f172a !important; }
.btn-success { background: var(--success); color: #fff !important; }
.btn-danger  { background: var(--danger); color: #fff !important; }
.btn-danger:hover { background: #b91c1c; color: #fff !important; }
.btn-outline, .btn-sm.btn-outline { background: var(--surface); color: var(--text) !important; }
.btn-outline:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn-full, .btn-block { width: 100%; }
.btn-back { background: var(--surface); color: var(--text) !important; margin-bottom: 12px; }
.btn-pay-pending { background: var(--primary); color: #fff !important; padding: 6px 10px; font-size: 12px; }

/* FORMS */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.form-control, .form-input,
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], select, textarea {
  width: 100%; padding: 11px 13px;
  background: var(--surface);
  border: var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px; font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .12s;
  appearance: none; -webkit-appearance: none;
}
.form-control:focus, .form-input:focus, input:focus, select:focus, textarea:focus {
  outline: none; box-shadow: var(--shadow);
}
textarea { resize: vertical; min-height: 90px; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper .form-input, .input-wrapper input { padding-right: 42px; }
.toggle-pw {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px 6px; font-size: 14px;
  box-shadow: none; display: flex; align-items: center; justify-content: center;
}
.toggle-pw:hover { color: var(--text); transform: translateY(-50%); box-shadow: none; }

/* TABLES */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table, .data-table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; color: var(--text-sec); background: var(--surface-2);
}
td { font-size: 13px; }
tr:hover td { background: var(--surface-2); }
.empty-row { text-align: center; color: var(--text-muted); padding: 28px !important; }
.code-sm { font-family: monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.code-otp { font-family: monospace; font-size: 13px; font-weight: 700; color: var(--primary); }
.phone-cell { font-family: monospace; font-size: 12.5px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }

/* DASHBOARD */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) {
  .dashboard-grid { grid-template-columns: 1.6fr 1fr; }
}
.card-wide { grid-column: 1 / -1; }
@media (min-width: 900px) { .card-wide { grid-column: auto; } }
.link-more { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; }

.top-services { padding: 8px 0; }
.service-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-soft);
}
.service-row:last-child { border-bottom: none; }
.service-rank {
  width: 24px; height: 24px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; border: 1.5px solid var(--border);
  background: var(--surface-2); flex-shrink: 0;
}
.rank-1 { background: var(--yellow); color: #0f172a; }
.rank-2 { background: #e2e8f0; color: #0f172a; }
.rank-3 { background: #fdba74; color: #0f172a; }
.service-logo-box {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; border: var(--stroke); flex-shrink: 0;
}
.service-info { flex: 1; min-width: 0; }
.service-name { font-weight: 600; font-size: 13px; display: block; margin-bottom: 4px; }
.service-bar-wrap {
  height: 6px; background: var(--surface-2); border-radius: 4px;
  overflow: hidden; border: 1px solid var(--border-soft);
}
.service-bar { height: 100%; background: var(--primary); border-radius: 3px; min-width: 4px; }
.service-count { font-weight: 800; font-size: 14px; color: var(--text); min-width: 28px; text-align: right; }
.empty-text { text-align: center; color: var(--text-muted); padding: 24px; font-size: 13px; }

.bot-status-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--surface);
  border: var(--stroke); border-radius: 20px; box-shadow: var(--shadow-sm);
}
.bot-status-dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--border); flex-shrink: 0; }
.dot-green { background: #22c55e; }
.dot-red   { background: #ef4444; }
.bot-status-label { font-size: 12.5px; font-weight: 600; }

/* AUTH */
.auth-page, .auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.auth-header { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 56px; height: 56px;
  background: var(--primary); color: #fff;
  border: var(--stroke); border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.auth-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; }
.auth-title { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.auth-subtitle, .auth-sub { text-align: center; color: var(--text-sec); font-size: 13px; margin-bottom: 0; }
.auth-form { margin-top: 4px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-sec); }
.auth-footer a { font-weight: 600; }

/* CHAT */
.chat-container {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--nav-h) - var(--bottom-h) - 90px);
  min-height: 400px;
  background: var(--surface); border: var(--stroke);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble {
  max-width: 82%; padding: 9px 13px;
  border-radius: 12px; border: var(--stroke); box-shadow: var(--shadow-sm);
}
.chat-bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.other { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.admin { align-self: flex-start; background: var(--yellow); color: #0f172a; border-bottom-left-radius: 4px; }
.chat-meta { font-size: 11px; font-weight: 700; margin-bottom: 2px; opacity: .9; }
.chat-time { font-size: 10px; opacity: .7; margin-top: 3px; text-align: right; }
.chat-input-area {
  display: flex; gap: 8px; padding: 12px;
  border-top: var(--stroke); background: var(--surface-2); align-items: center;
}
.chat-input-area input {
  flex: 1; padding: 10px 12px; border: var(--stroke); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-size: 14px;
}
.chat-input-area input:focus { outline: none; box-shadow: var(--shadow); }

/* PROFILE / DOCS */
.apikey-box {
  background: var(--surface-2); border: var(--stroke); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-sm); word-break: break-all;
}
.apikey-value { flex: 1; font-family: 'Courier New', monospace; font-size: 12.5px; font-weight: 600; color: var(--text); }
.apikey-actions { display: flex; gap: 6px; flex-shrink: 0; }
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .profile-grid { grid-template-columns: 1fr 1fr; } }

.docs-section { margin-bottom: 24px; }
.docs-section h3 {
  font-size: 15px; font-weight: 800; margin-bottom: 8px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.docs-code {
  background: var(--surface-2); border: var(--stroke); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: 'Courier New', monospace; font-size: 12px;
  overflow-x: auto; box-shadow: var(--shadow-sm); white-space: pre-wrap; line-height: 1.55;
}
.docs-endpoint {
  display: inline-block; padding: 2px 8px; background: var(--primary); color: #fff;
  border: var(--stroke); border-radius: 6px; font-size: 11.5px; font-weight: 700;
  margin-right: 6px; box-shadow: var(--shadow-sm);
}
.docs-method-get { background: #16a34a; }
.docs-method-post { background: #2563eb; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 700; border: 1.5px solid var(--border);
}
.badge-success { background: #dcfce7; color: #14532d; }
.badge-warning { background: #fef9c3; color: #713f12; }
.badge-danger  { background: #fee2e2; color: #7f1d1d; }
.badge-info    { background: #dbeafe; color: #1e3a8a; }
[data-theme="dark"] .badge-success { background: #14532d; color: #dcfce7; }
[data-theme="dark"] .badge-warning { background: #713f12; color: #fef9c3; }
[data-theme="dark"] .badge-danger  { background: #7f1d1d; color: #fee2e2; }
[data-theme="dark"] .badge-info    { background: #1e3a8a; color: #dbeafe; }

.empty-state { text-align: center; padding: 36px 16px; color: var(--text-sec); }
.empty-state i { font-size: 36px; margin-bottom: 10px; opacity: .35; display: block; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }

@media (max-width: 600px) {
  .main-content { padding-left: 12px; padding-right: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 15px; }
  .stat-icon { width: 36px; height: 36px; font-size: 15px; }
  .page-title { font-size: 18px; }
  .bn-item { min-width: 54px; font-size: 9.5px; }
  .bn-item i { font-size: 15px; }
  .topbar-name { display: none; }
  .nav-saldo { font-size: 11px; padding: 3px 8px; }
  .auth-card { padding: 24px 18px; }
}
