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

body { font-family: 'Segoe UI', sans-serif; background: #0f1117; color: #e2e8f0; height: 100vh; }

.hidden { display: none !important; }

/* LOGIN */
.login-screen { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #0f1117 0%, #1a1f2e 100%); }
.login-card { background: #1e2330; border: 1px solid #2d3448; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; }
.login-card h1 { font-size: 28px; font-weight: 700; color: #6366f1; margin-bottom: 6px; }
.login-card .subtitle { color: #64748b; margin-bottom: 28px; }

/* LAYOUT */
.main-screen { display: flex; height: 100vh; }

/* SIDEBAR */
.sidebar { width: 240px; background: #1e2330; border-right: 1px solid #2d3448; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid #2d3448; }
.logo { font-size: 18px; font-weight: 700; color: #6366f1; }
nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item { display: block; padding: 10px 20px; color: #94a3b8; text-decoration: none; font-size: 14px; border-radius: 8px; margin: 2px 8px; transition: all .2s; }
.nav-item:hover, .nav-item.active { background: #2d3448; color: #e2e8f0; }
.nav-item.active { color: #6366f1; }
.sidebar-footer { padding: 16px; border-top: 1px solid #2d3448; display: flex; align-items: center; justify-content: space-between; }
#user-info { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }

/* CONTENT */
.content { flex: 1; overflow-y: auto; background: #0f1117; }
.page { padding: 32px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.page-header h2 { font-size: 22px; font-weight: 600; }

/* CARDS */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: #1e2330; border: 1px solid #2d3448; border-radius: 12px; padding: 20px; }
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: #6366f1; }
.stat-card .stat-label { font-size: 13px; color: #64748b; margin-top: 4px; }

/* TABLE */
.table-wrap { background: #1e2330; border: 1px solid #2d3448; border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: #252b3b; }
th { padding: 12px 16px; text-align: left; color: #64748b; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 12px 16px; border-top: 1px solid #2d3448; vertical-align: middle; }
tr:hover td { background: #252b3b; }

/* BADGES */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-green { background: #14532d; color: #4ade80; }
.badge-red { background: #450a0a; color: #f87171; }
.badge-blue { background: #1e3a5f; color: #60a5fa; }
.badge-yellow { background: #422006; color: #fbbf24; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: #94a3b8; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; background: #252b3b; border: 1px solid #2d3448; border-radius: 8px;
  padding: 10px 12px; color: #e2e8f0; font-size: 14px; outline: none; transition: border .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #6366f1; }
.form-group textarea { resize: vertical; min-height: 80px; font-family: monospace; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* BUTTONS */
.btn { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: all .2s; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-ghost { background: transparent; color: #94a3b8; border: 1px solid #2d3448; }
.btn-ghost:hover { background: #2d3448; color: #e2e8f0; }
.btn-danger { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; padding: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; color: #64748b; font-size: 16px; }
.btn-icon:hover { background: #2d3448; color: #e2e8f0; }

/* ALERT */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-error { background: #450a0a; color: #f87171; border: 1px solid #7f1d1d; }
.alert-success { background: #14532d; color: #4ade80; border: 1px solid #166534; }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.modal-box { position: relative; background: #1e2330; border: 1px solid #2d3448; border-radius: 16px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; z-index: 1; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid #2d3448; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.btn-close { background: none; border: none; color: #64748b; cursor: pointer; font-size: 18px; }
.modal-body { padding: 24px; }

/* TOAST */
.toast { position: fixed; bottom: 24px; right: 24px; background: #1e2330; border: 1px solid #2d3448; border-radius: 10px; padding: 12px 20px; font-size: 14px; z-index: 200; animation: slideIn .3s ease; }
.toast.success { border-color: #166534; color: #4ade80; }
.toast.error { border-color: #7f1d1d; color: #f87171; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* PAGINATION */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 16px; justify-content: flex-end; font-size: 13px; color: #64748b; }
.pagination button { background: #1e2330; border: 1px solid #2d3448; color: #94a3b8; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.pagination button:hover:not(:disabled) { background: #2d3448; }
.pagination button:disabled { opacity: .4; cursor: default; }

/* GATEWAY RESULT */
.gateway-result { background: #0f1117; border: 1px solid #2d3448; border-radius: 8px; padding: 16px; font-family: monospace; font-size: 13px; overflow-x: auto; white-space: pre; max-height: 400px; overflow-y: auto; }

/* COPY BUTTON */
.token-cell { display: flex; align-items: center; gap: 6px; font-family: monospace; font-size: 12px; }
