/* API Keys Page */

.apikeys-main {
  padding: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.apikeys-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.apikeys-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.apikeys-subtitle {
  font-size: 14px;
  color: #8a94a6;
  margin: 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #5cb8e6;
  color: #0a0e17;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-primary:hover { background: #4da8d6; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #5cb8e6;
  border: 1px solid rgba(92,184,230,0.3);
  transition: border-color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-outline:hover { border-color: #5cb8e6; }

/* Warning */
.api-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: 10px;
  margin-bottom: 24px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.6;
}

.api-warning svg { flex-shrink: 0; margin-top: 1px; }
.api-warning strong { color: #fbbf24; }

/* Card */
.api-card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.api-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.api-card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
}

.api-card-body {
  padding: 20px;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  padding: 0;
}

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

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #8a94a6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.key-label {
  font-weight: 600;
}

.key-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.masked-key {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: #0a0e17;
  padding: 4px 10px;
  border-radius: 4px;
  color: #8a94a6;
}

.copy-btn {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(92,184,230,0.12);
  color: #5cb8e6;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.copy-btn:hover { background: rgba(92,184,230,0.2); }

/* Permission tags */
.perm-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.perm-tag.read { background: rgba(92,184,230,0.15); color: #5cb8e6; }
.perm-tag.trade { background: rgba(34,197,94,0.15); color: #22c55e; }
.perm-tag.withdraw { background: rgba(251,191,36,0.15); color: #fbbf24; }

.ip-cell {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: #8a94a6;
}

.key-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.key-status.active { background: rgba(34,197,94,0.15); color: #22c55e; }
.key-status.revoked { background: rgba(239,68,68,0.15); color: #ef4444; }

/* Action buttons */
.action-cell {
  display: flex;
  gap: 6px;
}

.table-action-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.table-action-btn.outline {
  background: transparent;
  color: #5cb8e6;
  border: 1px solid rgba(92,184,230,0.3);
}

.table-action-btn.outline:hover { border-color: #5cb8e6; }

.table-action-btn.danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.3);
}

.table-action-btn.danger:hover {
  border-color: #ef4444;
  background: rgba(239,68,68,0.08);
}

/* Rate limits */
.rate-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.rate-item {
  background: #0a0e17;
  border-radius: 10px;
  padding: 18px;
}

.rate-label {
  font-size: 12px;
  font-weight: 600;
  color: #8a94a6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.rate-value {
  font-size: 18px;
  font-weight: 700;
  color: #5cb8e6;
  margin-bottom: 4px;
}

.rate-desc {
  font-size: 12px;
  color: #64748b;
}

/* Docs row */
.api-docs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.api-docs-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.api-docs-info svg { flex-shrink: 0; margin-top: 2px; }

.api-docs-title {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.api-docs-desc {
  font-size: 13px;
  color: #8a94a6;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #e2e8f0;
}

.modal-close {
  background: none;
  border: none;
  color: #8a94a6;
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.modal-close:hover { color: #e2e8f0; }

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* Form elements */
.form-group {
  margin-bottom: 16px;
}

.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #8a94a6;
  margin-bottom: 6px;
}

.form-optional {
  font-weight: 400;
  color: #64748b;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: #0a0e17;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 14px;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #5cb8e6;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.checkbox-item:hover {
  background: rgba(255,255,255,0.03);
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #5cb8e6;
  flex-shrink: 0;
}

.checkbox-label {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  margin-right: 6px;
}

.checkbox-desc {
  font-size: 12px;
  color: #64748b;
  display: block;
}

/* Responsive */
@media (max-width: 800px) {
  .apikeys-main { padding: 16px; }
  .rate-grid { grid-template-columns: 1fr; }
  .api-docs-row { flex-direction: column; align-items: flex-start; }
  .apikeys-header { flex-direction: column; }
}
